diff --git a/.crumb b/.crumb
index 239ac3e3..29c9d186 100644
--- a/.crumb
+++ b/.crumb
@@ -22,44 +22,44 @@
"children": [
{
"digest": "fc491bf9ab591bdc2065379f71a34d4a572d866f7225e74745dcaf73c773bac7",
- "last_commit": "5e0c797",
+ "last_commit": "7e5c1f8f",
"name": "crates",
"purpose": "Directory crates. Purpose not yet described by a human."
},
{
- "digest": "a59c8f9ed7fc2e2b7479b0f27b51563d256adfd2e2399cef59af0f055419c21e",
- "last_commit": "5e0c797",
+ "digest": "35d5555ff4f23d370106e874ec0d5f9aa4f7d87e37c9589d1dbbcd5bd533640d",
+ "last_commit": "432c9447",
"name": "docs",
"purpose": "Directory docs. Purpose not yet described by a human."
},
{
- "digest": "45c897a7055a0c25a1ee482e5dd8674f527bc91d12bae901c9e73ed3ada3d7d2",
- "last_commit": "5e0c797",
+ "digest": "773512413893fb607ea2e93c237b7ec15c3c55d8c656e8224a42b92b6bf0a6e5",
+ "last_commit": "a14aa34c",
"name": "native",
"purpose": "Directory native. Purpose not yet described by a human."
},
{
"digest": "57b4d8b99549c2e7921fb7d62b2dd99a1e6a4d9607d5c7604d83ab397effd1b9",
- "last_commit": "5e0c797",
+ "last_commit": "5e0c7970",
"name": "scripts",
"purpose": "Directory scripts. Purpose not yet described by a human."
},
{
"digest": "e891c078bec120c3fdb14e13b7dd25d69054f608c2ea632adf2fd2b6e45d8fa1",
- "last_commit": "29e884d",
+ "last_commit": "29e884d5",
"name": "tools",
"purpose": "First-party host artifact preparation tools"
}
],
- "children_root": "sha256:6b121afe0e7bc6ab5114ae4880e57aae282a8df324ba86582fc88ae21dedd7a5",
- "compiled_at": "2026-11-06T14:27:34Z",
+ "children_root": "sha256:a3a646af619fe37df90fe0a2f31bb24001a00dc3b3df2586c0b3ee62d63e5fb9",
+ "compiled_at": "2026-11-06T15:04:49Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:496b6e4c7536b56a766b0a7fd834a4e6609e37c053ebdac83776fa2f4e1fc3aa",
- "evidence_files": 392,
- "evidence_root": "sha256:21295040af737637275f8863f93700421b9552286e96e613ae8de21f7ad8d6c1",
- "files": 4150,
- "generated_at_commit": "6b4712e54f53ba3c2d0cd3c3f085802846f54fa6",
- "source_tree": "sha256:ae21d112bdcaf36f03a56f61a4357b8dde8b276504bfa4e76ed7987d6d6e2b34"
+ "digest": "sha256:c39e5b525ec642c343546c7150304feba2adb0dc4f6138b060d4f68106dce3b3",
+ "evidence_files": 1474,
+ "evidence_root": "sha256:c9bebaaf662519bc6f3e7d03368e629ad54c8af2005adc6984363ed5b004a6e9",
+ "files": 5355,
+ "generated_at_commit": "a14aa34c9249188cc771a2a565494b5ce61ad432",
+ "source_tree": "sha256:2992687a070375993f346cda9f9eb9577ab8e6f4dd588056e36858fa08e6b837"
},
"owner_lane": "",
"provenance": {
diff --git a/docs/.crumb b/docs/.crumb
index f420829b..9581644f 100644
--- a/docs/.crumb
+++ b/docs/.crumb
@@ -30,14 +30,14 @@
}
],
"children_root": "sha256:efb4a0449db172a441d8663f55ab48d6d81405e011961fd54213541c119b6852",
- "compiled_at": "2026-11-06T12:57:47Z",
+ "compiled_at": "2026-11-06T14:13:40Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:a59c8f9ed7fc2e2b7479b0f27b51563d256adfd2e2399cef59af0f055419c21e",
+ "digest": "sha256:35d5555ff4f23d370106e874ec0d5f9aa4f7d87e37c9589d1dbbcd5bd533640d",
"evidence_files": 3,
"evidence_root": "sha256:dc6e023412ded01aca886a94dc13859cb37ae664a28cff201db34893e3fab9ee",
- "files": 319,
- "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8",
- "source_tree": "sha256:7e5a28140bdcda9e128acb2a57f22e16478fba1b791d12fecc129c9a23a4d69a"
+ "files": 323,
+ "generated_at_commit": "432c9447df58c134b21be92447164f33f92e70b2",
+ "source_tree": "sha256:9f0c276b6ee819366889a290556874f77bc3875493eb828705c1b3878f4d7122"
},
"owner_lane": "",
"provenance": {
diff --git a/docs/superpowers/plans/2026-10-23-allen-omega-implementation.md b/docs/superpowers/plans/2026-10-23-allen-omega-implementation.md
new file mode 100644
index 00000000..5fe64ffa
--- /dev/null
+++ b/docs/superpowers/plans/2026-10-23-allen-omega-implementation.md
@@ -0,0 +1,16 @@
+# L694 implementation checkpoints
+
+1. Verify immutable compiler hash and compile/execute minimal probe. Freeze grammar
+ from pinned omc.om and founding OMEGESE language decisions.
+2. Runtime state with behavioral RED stubs, native GREEN, rejection/recovery and
+ stale-ID mutant. Commit/push executable checkpoint evidence.
+3. CODE and courier protocol, independently frozen exact fixtures, partial/reorder/
+ loss/duplicate/session/capacity cases. No transport claim.
+4. Import pinned native SHA core. Memory/note codecs and simulated two-copy fault
+ transactions. Compare independently produced golden bytes. Never equate SHA
+ with keyed authentication or rollback freshness.
+5. Code rows, scene/state and native buffer rendering receipts. Record limits of
+ full visual equivalence and device integration.
+6. Fresh source replay, behavioral mutants, strict repository gate, hashes and
+ committed evidence closure. Push exact branch and verify remote. WIP until
+ target gates; do not close L694.
diff --git a/docs/superpowers/plans/2026-10-23-allen-portable-build.md b/docs/superpowers/plans/2026-10-23-allen-portable-build.md
new file mode 100644
index 00000000..b623a987
--- /dev/null
+++ b/docs/superpowers/plans/2026-10-23-allen-portable-build.md
@@ -0,0 +1,21 @@
+# Allen portable seeded build
+
+This continues the existing Alpha delivery contract in `native/omega/allen/ALPHA.md`.
+It removes one acquisition blocker, not the unfinished hosted/iMac qualification.
+
+1. Reproduce the private compiler-path dependency with the real pinned compiler
+ copied to a fresh directory. Add build-orchestration checks for a changed
+ compiler, invalid source, existing output and dangling output links.
+2. Let `build-one.sh` select `OMEGA_COMPILER`, defaulting to the repository-local
+ `build/allen-toolchain/build/bootstrap/omc`. Retain the fixed compiler digest.
+ Publish an executable only after successful compilation and ELF inspection;
+ never replace an existing output, including a dangling link.
+3. Document source-only reconstruction of omega-bridge commit
+ `0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9`. Rebuild from its Git archive and
+ verify the existing compiler digest before executing the complete Allen gate
+ from a clean source export outside the developer checkout.
+4. Record actual results and remaining launch gates. Push the tested candidate
+ through the existing publication desk; do not label this a public alpha.
+
+No compiler implementation, product runtime, identity, memory or service changes.
+Shell remains external build/test orchestration; all compiled probes are Omega.
diff --git a/docs/superpowers/specs/2026-10-23-allen-omega-design.md b/docs/superpowers/specs/2026-10-23-allen-omega-design.md
new file mode 100644
index 00000000..27227490
--- /dev/null
+++ b/docs/superpowers/specs/2026-10-23-allen-omega-design.md
@@ -0,0 +1,45 @@
+# L694 Allen Omega contract freeze (WIP)
+
+Approved authority: /home/drakestapleton/handoffs/briefs/L694-allen-omega.md.
+Baseline da55660ea7337f2b6a42095fcd1fb6ddebe1cc7c. No master sequencing change.
+
+All new implementation and test programs are handwritten seeded Omega. Shell,
+Git, sed, cat, sha256sum, readelf and quiet-build are external development tools.
+No foreign runtime, generated C, compiler edits, service changes or deployment.
+
+## Contract and source map
+
+* svc/allen_intent.c: JOB/SAY/WAIT, code and code-more vs ordinary model chat.
+* x86/kmain_x86.c code_request/courier_step: one outstanding job, immediate code
+ acknowledgment, stale sequence rejection, 20s slow and 30s silence timeout.
+* svc/allen_code.c: 32768 bytes, 128-byte pieces, 256 slots, IEEE CRC32, 800
+ lines, escaped newline/backslash. Complete code alone becomes displayable.
+* x86/courier_udp{.h,_x86.c}: ALLEN-COURIER v=1, 16 lowercase hex session,
+ 1000-byte JOB pieces, 4096-byte job; ordered LINE delivery, duplicate GOT,
+ wrong-session refusal. Protocol core only; no socket attachment.
+* svc/allen_memory.c: AIENALM1, versions 2/3/4; payload 40 + 113*nfacts
+ + (v>=3 ? 24 : 0) + (v>=4 ? 12 : 0). Header64, generation64 at16,
+ SHA256(header[0:32] || payload), zero header24:32 and trailing unit bytes.
+ Facts32 maximum, notes512. AIENNOT1 note length1..127; index, start, gone.
+ Two-copy save writes older, flushes, reads back, then publishes generation.
+* svc/allen_scene.h, docs/ALLEN_CANVAS.md and ui/allen_ui.c: bounded scene,
+ calm sky/presence, no traditional desktop; code row wrapping and scrolling.
+
+## Boundary and intentional changes
+
+Fixed pools, explicit lengths, no pointer/heap/OS provider. Runtime caller supplies
+monotonic milliseconds and session; identity remains Allen unless restored.
+Overflow rejects whole operation rather than silently truncating user/model text.
+Request IDs never reused across reset. Duplicate conflicting pieces rejected;
+malformed numeric overflow rejected. No checksum claimed to authenticate a sender.
+Disk tests use fixed buffers and injected failures, never a physical disk. SHA
+integrity, keyed authorization, and freshness are independent; latter two are
+unimplemented here and are never inferred from a successful SHA check.
+
+## Required unclosed gates
+
+Full legacy semantic/UI equivalence, transcript persistence, qualified native
+provider integration, x86 EFI image, MMIO/interrupt/keyboard/framebuffer/disk/NIC,
+iMac QEMU chat/keyboard/bootdisk and signed physical trial. Seed compiler currently
+emits Linux AArch64 only. FR1/8/9/16 remain with L408; no C bridge may satisfy them.
+Hermes JSON/WebSocket/admission belongs to L690 and is not reimplemented here.
diff --git a/docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md b/docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md
new file mode 100644
index 00000000..7630e503
--- /dev/null
+++ b/docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md
@@ -0,0 +1,31 @@
+# L694 required provider handoff, WIP
+
+No new compiler request or owner. Existing FR1/8/9/16 stay with L408.
+L690's gateway implementation is untouched. No deployment is authorized here.
+
+Verified immutable compiler source at omega-bridge-native-development
+0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9, seed/omc/omc.om:
+vs_fd/vs_arr/vs_off/vs_end implement Linux read/write, main startup exits via93;
+elfhdr fixes ELF AArch64 and program headers. No x86/EFI codegen, MMIO,
+interrupt, disk, socket or clock API is present at this checkpoint. This is an
+inspection of the actual pinned compiler, not an inference from an old roadmap.
+The fresh source-native bootstrap reproduces hash191b776e. There are no compiler
+edits here and no foreign wrapper may substitute for the missing target.
+
+| Existing dependency | Actual L694 entry/state to bind | Smallest qualification receipt needed |
+| --- | --- | --- |
+| FR9 x86 EFI/native target | same handwritten runtime/probe and tests | Source-only compiler pin produces nonempty PE32+ AMD64 EFI image with inspected headers, native marker in isolated iMac QEMU; then same behavioral gates on that target. Current ELF is not EFI. |
+| FR8 privileged/device interfaces | Frame192x128, render/glow; start/heard/tick milliseconds | Native typed MMIO/port/IRQ/monotonic interface with bounds/refusals; keyboard event changes Prompt, frame buffer observes native pixels, monotonic timeout test. No C/asm wrapper to count as Omega product implementation. |
+| FR1 durable storage provider | Enc4096, Unit4096; Tx target/generation, txwrite/txflush/txread; nwrite/nflush/nread | Native block read/write/flush on isolated disposable simulated/QEMU disk,512B and4KB geometry, fault at each phase, restart chooses valid newest; old copy bytes unchanged. Hash integrity, keyed authorization and anti-rollback each report separately. |
+| FR16 bounded transport | In/Inlen, packet Outb/Outlen, qreceive/qtake | Immutable native socket/readiness/close API, isolated loopback recorded datagrams, partial writes/reads, EOF/error/timeout, malformed and session mismatch. No production endpoint. |
+| iMac execution | cohesive runtime plus qualified providers | Existing iMac QEMU boot/chat/keyboard/bootdisk gates with complete Omega execution closure; then parent-signed physical trial. All remain NOT_RUN. |
+
+Exact provider API names are not invented here: no qualified interface for these
+features is supplied by the pinned compiler. The owner must hand off its actual
+immutable signatures and executable receipts. L694's fixed-pool entry points
+above define the consumer side, not an alternate socket or driver implementation.
+
+Independent portable work remains in native/omega/allen/README.md. In particular,
+a component render is not full visual parity and state restoration is not actual
+durable transcript continuity. These are implementation gaps beyond platform
+blocking and must remain visible to the parent. L694 is not closed or READY.
diff --git a/evidence/allen-omega-L694/CLOSURE.md b/evidence/allen-omega-L694/CLOSURE.md
new file mode 100644
index 00000000..fe056a16
--- /dev/null
+++ b/evidence/allen-omega-L694/CLOSURE.md
@@ -0,0 +1,46 @@
+# Immutable-source acceptance closure, WIP
+
+Implementation source commit: a19ed49 (full ID in handoff).
+Reconstructed through `git archive a19ed49 native/omega/allen` plus committed
+wire/stdio fixtures into fresh target/allen-omega-L694/immutable-source.
+No inherited binary or receipt was treated as fresh acceptance.
+
+Executed command:
+
+```sh
+quiet-build target/allen-omega-L694/immutable-source/native/omega/allen/gate.sh \
+ /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1
+```
+
+Exit0. All13 test/render/fixture programs and the standalone Allen executable
+compile successfully to nonempty static Linux AArch64 ELF before execution.
+879 native behavioral checks,0 failed. Memory golden comparison0; stdio golden
+comparison0; actual native rendering exit0. Five compiled mutants fail the original
+gates with exits3/2/2/7/1. final/ contains exact per-check outputs and SHA256s of
+all executable and source inputs. source-closure.log verifies the archived inputs
+also match the current implementation. No code changed after source commit.
+
+Source-only compiler bootstrap at pinned bridge0fc7d866 succeeds, exit0,
+stage1==stage2 and supplied compiler hash==rebuilt hash191b776e. bootstrap.log and
+compiler.sha256 preserve the result. Shell/readelf/hash tools are external tools,
+not a product runtime or a compiler implementation fallback.
+
+Strict repository verification exit101: four unchanged Rust courier tests require
+loopback sockets prohibited by the sandbox. Formatting passed. Separate
+`cargo clippy --offline --all-targets -- -D warnings` exit0, zero warnings.
+Strict suite is FAIL, not waived, not an Omega gate.
+
+Publishing: original worktree Git metadata cannot be written under managed
+permissions. A bare publication metadata directory was initialized in the permitted
+handoff root from the baseline, using the existing worktree as its explicit
+--work-tree. No second worktree or worker was created. Implementation commit and
+closure commit are recorded there on feat/allen-omega-L694. Origin is the original
+`git@github.com:aien-dev/aienux.git`. Push exit128 because github.com does not
+resolve; push.log preserves it. Remote exact hash verification is unavailable.
+A prerequisite-based Git bundle permits parent publication without rewriting the
+implementation. No PR, merge, issue closure, service or deployment action occurred.
+
+Required target and remaining portable gates:
+[provider handoff](../../docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md),
+[module limits](../../native/omega/allen/README.md). Verdict WIP / TARGET NOT_RUN /
+REMOTE PUBLICATION BLOCKED. This is neither whole Allen replacement nor live.
diff --git a/evidence/allen-omega-L694/L722/L719-original-review.md b/evidence/allen-omega-L694/L722/L719-original-review.md
new file mode 100644
index 00000000..2e45d9b5
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/L719-original-review.md
@@ -0,0 +1,17 @@
+# L719 independent review — L694 native Allen milestone
+
+**Reviewed source:** `8049f5ddbfb3284498e54ed582768a399dcc99d5` (baseline `da55660ea7337f2b6a42095fcd1fb6ddebe1cc7c`). Exported the source/docs and committed evidence into private `~/handoffs/L719-review`; production/source/worktree and ledgers were not modified. Pinned compiler SHA-256 verified as `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`.
+
+## Finding
+
+**Medium — oversized stdio command lines are silently discarded instead of refused.** `native/omega/allen/main.om:135-140` sets `Lstate[1]` when the 8192-byte line buffer fills, but on newline `main.om:123-133` takes the `else` branch, clears the overflow flag and line length, and continues without reporting an error or terminating. This contradicts the stated whole-operation overflow refusal (`native/omega/allen/README.md:66-70`) at the actual standalone integration boundary.
+
+**Reproduction:** compiled the unmodified concatenated Omega core + `main.om` using the pinned compiler via `build-one.sh`; nonempty static AArch64 ELF check passed. Fed `ASK ` + 8189 `x` bytes (8193-byte line, one byte beyond the 8192-byte line buffer) + newline, then `ASK hi\n`. The process exited `0`, stderr was empty, and stdout was 473 bytes containing a `JOB 1 chat ...` packet ending with `the person said something in passing.\thi\n`. Thus the oversized first line was silently skipped and the next command was processed; the caller receives no refusal/error for the dropped command. Probe ELF SHA-256: `c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8`; stdout SHA-256: `52777ab25b070876095242a799846ece3098d472751e98e33c0eac18ffaa9477`; stderr SHA-256: `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`. Probe artifacts are under `~/handoffs/L719-review/probe-output/`.
+
+## Evidence checked / limits
+
+- `evidence/allen-omega-L694/CLOSURE.md` says the exact immutable replay compiled 13 Omega test/render/fixture programs plus standalone Allen, ran 879 checks, compared the 4096-byte memory golden, and exercised five compiled behavioral mutants. The committed per-test logs have the claimed line counts (runtime 28, CODE 23, courier 24, memory 79, edges 352, short 20, long 292); `final-replay.log` records the same mutant exits and `target=NOT_RUN; live=NOT_RUN`.
+- The gate does not test stdio overflow: `gate.sh:33-37` exercises only the canned `stdio-input.txt` and compares its two golden outputs. `main.om` is separately compiled and run in that path, but has no direct oversized-line case in the committed test sources.
+- Known missing iMac/provider/UI/scene parity and non-qualification are explicitly disclosed in the README/design/platform gates and are not reported as newly discovered defects. I did not rerun the parent-owned broad gate or alter any production files.
+
+**Disposition:** one concrete boundary defect reproduced; no conclusion of full Allen qualification. Target, live attachment, iMac/platform parity, and the broader strict suite remain outside this review's verified scope (the saved closure separately records four sandbox-denied socket tests in the strict Rust suite).
diff --git a/evidence/allen-omega-L694/L722/README.md b/evidence/allen-omega-L694/L722/README.md
new file mode 100644
index 00000000..14410c6b
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/README.md
@@ -0,0 +1,5 @@
+# L722 correction of L719 stdio overflow
+
+Original8049f5d executable received an Omega-generated8201-byte input:8193-byte ASK line, newline, valid ASK hi. Actual RED exit0 with473 stdout bytes proves silent loss and subsequent job execution. After correction the standalone input loop returns65 as soon as a byte exceeds capacity; subsequent commands are not dispatched. The public gate requires exit65 and both outputs empty. All879 existing native checks and5 compiled behavioral mutants still pass their original expectations, memory and stdio goldens unchanged. Review source and reproduction are retained, not replaced by a no-findings claim.
+
+Independent corrective review pending. Whole portability/full repository/iMac acceptance remains open.
diff --git a/evidence/allen-omega-L694/L722/binaries.sha256 b/evidence/allen-omega-L694/L722/binaries.sha256
new file mode 100644
index 00000000..b2fd7b35
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/binaries.sha256
@@ -0,0 +1,20 @@
+da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/readback-mutant
+798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/view
+be4ff5265e6e46962c9a35008bcf8a9127c7d9fbcc00db58f9a40c8a4008fb5d /home/drakestapleton/handoffs/allen-omega-L694/L722/green/allen
+ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef /home/drakestapleton/handoffs/allen-omega-L694/L722/green/reply
+f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec /home/drakestapleton/handoffs/allen-omega-L694/L722/green/hash-mutant
+0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/golden
+d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/session-mutant
+bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af /home/drakestapleton/handoffs/allen-omega-L694/L722/green/intent
+9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/fixture
+52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/runtime
+b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/code
+d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/edges
+87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d /home/drakestapleton/handoffs/allen-omega-L694/L722/green/render
+7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e /home/drakestapleton/handoffs/allen-omega-L694/L722/green/stale-mutant
+3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/courier
+44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c /home/drakestapleton/handoffs/allen-omega-L694/L722/green/scene
+fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d /home/drakestapleton/handoffs/allen-omega-L694/L722/green/paint
+0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f /home/drakestapleton/handoffs/allen-omega-L694/L722/green/crc-mutant
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/stdio-overflow-input
+1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd /home/drakestapleton/handoffs/allen-omega-L694/L722/green/memory
diff --git a/evidence/allen-omega-L694/L722/code.log b/evidence/allen-omega-L694/L722/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.in b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.in
new file mode 100644
index 00000000..a4f3dd77
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.in
@@ -0,0 +1,2 @@
+ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ASK hi
diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.om b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.om
new file mode 100644
index 00000000..9a0fc255
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.om
@@ -0,0 +1,29 @@
+note L723 independent exact-capacity command followed by valid positive control.
+global Bytes uchar 8192
+text Tail "\nASK hi\n"
+fn main to int
+for i ulong len Bytes
+put Bytes i 120
+end
+put Bytes 0 65
+put Bytes 1 83
+put Bytes 2 75
+put Bytes 3 32
+sent = ulong 0
+while lt sent len Bytes
+n = write 1 Bytes sent sub len Bytes sent
+if le n 0
+ret 2
+end
+sent = add sent ulong n
+end
+sent = ulong 0
+while lt sent len Tail
+n = write 1 Tail sent sub len Tail sent
+if le n 0
+ret 2
+end
+sent = add sent ulong n
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stderr b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stdout b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stdout
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/corrective-review/overflow.in b/evidence/allen-omega-L694/L722/corrective-review/overflow.in
new file mode 100644
index 00000000..6103faf0
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/overflow.in
@@ -0,0 +1,2 @@
+ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ASK hi
diff --git a/evidence/allen-omega-L694/L722/corrective-review/overflow.stderr b/evidence/allen-omega-L694/L722/corrective-review/overflow.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/corrective-review/overflow.stdout b/evidence/allen-omega-L694/L722/corrective-review/overflow.stdout
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.in b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.in
new file mode 100644
index 00000000..b21a8d65
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.in
@@ -0,0 +1 @@
+ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\ No newline at end of file
diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.om b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.om
new file mode 100644
index 00000000..7de23b0e
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.om
@@ -0,0 +1,20 @@
+note L723 independent over-capacity line terminated by EOF, no newline.
+global Bytes uchar 8193
+fn main to int
+for i ulong len Bytes
+put Bytes i 120
+end
+put Bytes 0 65
+put Bytes 1 83
+put Bytes 2 75
+put Bytes 3 32
+sent = ulong 0
+while lt sent len Bytes
+n = write 1 Bytes sent sub len Bytes sent
+if le n 0
+ret 2
+end
+sent = add sent ulong n
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stderr b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stdout b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stdout
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/corrective-review/parent-verification.json b/evidence/allen-omega-L694/L722/corrective-review/parent-verification.json
new file mode 100644
index 00000000..fe4bb353
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/parent-verification.json
@@ -0,0 +1,29 @@
+{
+ "source": "13d02ab4b7145579f6d3faa53442167bfcdcd7bc",
+ "source_closure_match": true,
+ "binary_sha256": "be4ff5265e6e46962c9a35008bcf8a9127c7d9fbcc00db58f9a40c8a4008fb5d",
+ "probes": {
+ "overflow": {
+ "exit": 65,
+ "stdout_bytes": 0,
+ "stderr_bytes": 0,
+ "input_bytes": 8201
+ },
+ "oversize-eof": {
+ "exit": 65,
+ "stdout_bytes": 0,
+ "stderr_bytes": 0,
+ "input_bytes": 8193
+ },
+ "exact-boundary": {
+ "exit": 65,
+ "stdout_bytes": 0,
+ "stderr_bytes": 0,
+ "input_bytes": 8200
+ },
+ "positive": {
+ "exit": 0,
+ "golden_cmp": 0
+ }
+ }
+}
diff --git a/evidence/allen-omega-L694/L722/corrective-review/positive.stderr b/evidence/allen-omega-L694/L722/corrective-review/positive.stderr
new file mode 100644
index 00000000..7d40356d
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/positive.stderr
@@ -0,0 +1,2 @@
+I need to code that. Let me send it off to the Spark.
+Code ready.
diff --git a/evidence/allen-omega-L694/L722/corrective-review/positive.stdout b/evidence/allen-omega-L694/L722/corrective-review/positive.stdout
new file mode 100644
index 00000000..db964ea1
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/positive.stdout
@@ -0,0 +1 @@
+JOB 1 code the person asked Allen for code. make me a calculator
diff --git a/evidence/allen-omega-L694/L722/corrective-review/report.md b/evidence/allen-omega-L694/L722/corrective-review/report.md
new file mode 100644
index 00000000..cddafe43
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/corrective-review/report.md
@@ -0,0 +1,19 @@
+# L723 independent corrective review — L722 stdio overflow
+
+**Result: no findings in the scoped correction.** Reviewed exact commit `13d02ab4b7145579f6d3faa53442167bfcdcd7bc` against parent `7f4cb7aa54164f71e2e26b0b834119af3e3839e5`. Checkout was clean and at the requested commit. The runtime change replaces the overflow-flag set with immediate status `65`; therefore neither newline handling nor any subsequent command can clear the condition and continue dispatching. The gate adds a generated 8193-byte command followed by `ASK hi`, requiring status 65 and empty stdout/stderr. No unrelated behavior or production files were changed in this review.
+
+## Independent rebuild and probes
+
+Rebuilt standalone `main.om` plus the exact pinned core at commit source with pinned `omc` SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. `build-one.sh` succeeded; ELF was static AArch64 EXEC. Rebuilt executable SHA-256: `be4ff5265e6e46962c9a35008bcf8a9127c7d9fbcc00db58f9a40c8a4008fb5d`.
+
+- **8193-byte line + newline + later valid command:** independently compiled the committed Omega input generator and ran it through the rebuilt executable. Input was 8201 bytes total; process returned `65`, stdout `0` bytes, stderr `0` bytes. The later `ASK hi` was not dispatched.
+- **8193-byte line ending at EOF (no newline):** independently authored/compiled an Omega generator. Input was 8193 bytes; process returned `65`, stdout/stderr each `0` bytes.
+- **8192-byte line boundary, followed by newline and valid command:** independently authored/compiled an Omega generator. Input was 8200 bytes and spans the runtime's 8192-byte read buffer boundary. Process returned `65`, stdout/stderr each `0` bytes. This establishes refusal at the exact-size line boundary case, but does not distinguish overflow detection from downstream refusal of the extremely long `ASK` payload; no stronger interpretation is claimed.
+- **Positive control:** ran the established valid stdio fixture through the rebuilt executable; returned `0` and stdout/stderr matched their committed goldens byte-for-byte (`cmp` passed).
+
+The first two overflow cases directly exercise the immediate-return branch, including a subsequent command in the newline case. Exact-source broad suite was not duplicated; parent brief records its existing 879-check/five-mutant run. No iMac, target, live-service, or full qualification claim is made.
+
+## Artifacts
+
+Review report: `~/handoffs/L723-review/report.md`.
+Independent sources, generated fixtures, rebuilt executable, and captured outputs: `~/handoffs/L723-review/rebuild/`. These are review artifacts only; no source-tree edits were made.
diff --git a/evidence/allen-omega-L694/L722/courier.log b/evidence/allen-omega-L694/L722/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L722/edges.log b/evidence/allen-omega-L694/L722/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L722/green.exit b/evidence/allen-omega-L694/L722/green.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/green.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L722/green.log b/evidence/allen-omega-L694/L722/green.log
new file mode 100644
index 00000000..d6630414
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/green.log
@@ -0,0 +1,21 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L722/input.txt b/evidence/allen-omega-L694/L722/input.txt
new file mode 100644
index 00000000..6103faf0
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/input.txt
@@ -0,0 +1,2 @@
+ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ASK hi
diff --git a/evidence/allen-omega-L694/L722/intent.log b/evidence/allen-omega-L694/L722/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L722/long.log b/evidence/allen-omega-L694/L722/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L722/memory.log b/evidence/allen-omega-L694/L722/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L722/paint.log b/evidence/allen-omega-L694/L722/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L722/red.exit b/evidence/allen-omega-L694/L722/red.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/red.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L722/red.stderr b/evidence/allen-omega-L694/L722/red.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/red.stdout b/evidence/allen-omega-L694/L722/red.stdout
new file mode 100644
index 00000000..a44ca483
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/red.stdout
@@ -0,0 +1 @@
+JOB 1 chat You are the far hands of Allen, a quiet presence living in AIENOS on the person's computer. You answer as Allen; the person sees only your words, as if Allen said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. the person said something in passing. Answer in one or two warm, plain sentences. hi
diff --git a/evidence/allen-omega-L694/L722/reply.log b/evidence/allen-omega-L694/L722/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L722/runtime.log b/evidence/allen-omega-L694/L722/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L722/scene.log b/evidence/allen-omega-L694/L722/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L722/short.log b/evidence/allen-omega-L694/L722/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L722/source.sha256 b/evidence/allen-omega-L694/L722/source.sha256
new file mode 100644
index 00000000..ef1fdc60
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/source.sha256
@@ -0,0 +1,35 @@
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+e056022d8dd4a3976d5d392e52bf6a5e2bf81334ee6b3a58c61cdf56778c4d41 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+46ba5562bcbbd808e6557f1f49e296e022c292ea0b718b1516312f10a9828cca native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L722/stdio-overflow.stderr b/evidence/allen-omega-L694/L722/stdio-overflow.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/stdio-overflow.stdout b/evidence/allen-omega-L694/L722/stdio-overflow.stdout
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L722/view.log b/evidence/allen-omega-L694/L722/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L722/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L725/README.md b/evidence/allen-omega-L694/L725/README.md
new file mode 100644
index 00000000..071985d9
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/README.md
@@ -0,0 +1,50 @@
+# L725: native Omega courier lifecycle
+
+Partial host-native milestone under L694. This is not socket, Ethernet, model,
+x86 EFI or physical iMac qualification. The provider must supply actual monotonic
+milliseconds, link state, datagram bytes and whole-datagram send results. All new
+product and executable test source is handwritten seeded Omega. Existing shell
+and host tools only build, inspect, run, compare and inventory the artifacts.
+
+## Executed evidence
+
+- `full.log` and `full.exit`: complete native gate returned 0. `counts.json`
+ inventories 1092 executed passing checks, including 213 scheduler checks and
+ the original 879 checks. Existing memory/stdio goldens and stdio overflow
+ refusal remain passing.
+- Seven compiled behavioral mutants were rejected: stale 3, CRC 2, hash 2,
+ readback 7, session 1, keepalive 40, ACK-stop 27. Compilation and nonempty static
+ AArch64 EXEC checks precede every run, including the mutants.
+- `source.sha256` binds all consumed native-tree files; parent compared each
+ listed hash against source immediately before committing. `binaries.sha256`
+ binds actual native artifacts under the named handoff output directory.
+- The final scheduler tests cover 4096-byte jobs across five datagrams with
+ byte-by-byte payload comparisons, failed-send retry, retry deadlines, HELLO/HI
+ readiness/expiry, ACK and LINE retry stop, duplicate GOT, queue backpressure,
+ cancellation, next-job reset, malformed/stale sessions and backward clocks.
+
+## RED and fixture corrections retained
+
+1. `red.om`/`red.exit`: initial test assembly omitted runtime.om, which code.om
+ references. Compiler error 3 is a fixture setup error, not behavioral RED.
+2. `red2.om`/`red2.log`/`red2.exit`: compiled Omega stub, 78 failures among 108
+ checks. The first real implementation then ran with six failures in packet
+ inspection (`green1.log`). Diagnosis: the existing test logger itself writes
+ to Outb, overwriting pending datagrams before test inspection.
+3. The test-only `test` wrapper now preserves Outb/Outlen/Err around logging.
+ `red3` reran the compilable stub: 76 of 108 checks fail, exit 76. The same
+ unchanged production implementation passes all 108 (`green2`). No assertion
+ or production refusal was removed to resolve the fixture defect.
+4. Expanded maximum-capacity/backpressure coverage passes 213 checks (`green3`),
+ then the combined native gate passes all 1092. The two new compiled mutants
+ prove the real timing and acknowledgement assertions detect behavioral faults.
+
+The original L719 finding and L722 RED/GREEN remain retained. The separate L723
+corrective review is archived under `../L722/corrective-review`, with exact-source
+closure and binary identity checked, its three boundary probes rerun by the
+parent, and positive control compared byte-for-byte. That review clears only the
+stdio correction; it does not review this new scheduler.
+
+Independent scheduler review remains pending. The broad legacy repository strict
+suite runs separately; its outcome is not inferred from this native gate. No
+READY/merge/deployment/full-platform claim is made here.
diff --git a/evidence/allen-omega-L694/L725/ackstop-mutant.log b/evidence/allen-omega-L694/L725/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L725/binaries.sha256 b/evidence/allen-omega-L694/L725/binaries.sha256
new file mode 100644
index 00000000..984a1e7e
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/binaries.sha256
@@ -0,0 +1,23 @@
+6a815fd66fdb6886af1a8dc857d6951268b43340bfd0f5dcf5ed7e677d384357 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/scheduler
+3036ba651bd6825a31db6f1d9ec60ad52b1f0c56a3fd525fda6c0b1da3f1ff7b /home/drakestapleton/handoffs/allen-omega-L694/L725/full/readback-mutant
+b106da82966dfc959663bf943dfd01a8f70cced034efba51e476ea78f0f0f5dc /home/drakestapleton/handoffs/allen-omega-L694/L725/full/view
+3f9aae22be9800849c7a05049b0e6b0b758a5b4e67ee1e133910a66e75100c27 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/allen
+2259fa1fb28693c519fbe85ee7c805c8e2b7ccc5f4b29a0fb28ef7809f14dc6a /home/drakestapleton/handoffs/allen-omega-L694/L725/full/reply
+e4d98c22d7c51637fd1d9d0da06eee2144fb70bbf7e435f786cc313d458887f5 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/ackstop-mutant
+7d3946f72b32b9a70780c79deaeea4f7f0fbb2587907106a3e4e655445f7b218 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/hash-mutant
+688b4eeb6c7846fb36fea2884d8296d4643dd11c74da6988793e785929ad89e4 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/golden
+762e48ed7daa7e2027d4e06717ff23bd11744094504e9c6ba538e2d68171d547 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/session-mutant
+2e6de4e1d216916e74bc08329cdabbd44681d483e1726463ceebe1d56bca1c63 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/intent
+b852b5d51bfcc096b2f35ea131709d28aeb26ebe1fa7626655d8abe9c67fa292 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/fixture
+cca90a4f538ae8150a479b5c4ea269008b7cee1fe73056e1da8e3bbcc70146da /home/drakestapleton/handoffs/allen-omega-L694/L725/full/runtime
+b4aef9ff0a2b5060802824247f5f56aa9fe37e0e52b4f86c2d93b867fef6a0cd /home/drakestapleton/handoffs/allen-omega-L694/L725/full/code
+4cc03fb5f9d9cc34d5d0a0dbfd68fc96d66e1e5cc0371217abbc4ec7dee9c295 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/edges
+c970301a150f75278d60c3599efdbbea9a17abf83d951cc289bd6062bb1e0cd8 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/render
+db8433262d65d28e0521a4b07bcfb98a866937d018738504581dc15894531014 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/stale-mutant
+929dcee90baf941017010d78ff9ca7c6e76d6c8ac71b2402b00c49c29e51144d /home/drakestapleton/handoffs/allen-omega-L694/L725/full/courier
+7de38ac1871bc16d3b83d1a89730d4e567d34145588295c3ec3b34a577fb4e51 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/scene
+2a9151fd8824c485536e364fd3509dc8acdaff7ff3d6a9cafac189a48b1a7362 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/paint
+bcb251faa2cd3f2c6fbc203f0fd9b59e2fd9b961254426699b7684c64c5ea4c9 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/crc-mutant
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/stdio-overflow-input
+2f0e5b78f242e27e87d2b07b150d12ccbf3ebf03e3be38d45aeb67e8aa1f486c /home/drakestapleton/handoffs/allen-omega-L694/L725/full/keepalive-mutant
+0865317bcebeb9dbf958344f716abcc0a3ed473ddb3cb482bbce056764d057a8 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/memory
diff --git a/evidence/allen-omega-L694/L725/code.log b/evidence/allen-omega-L694/L725/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L725/counts.json b/evidence/allen-omega-L694/L725/counts.json
new file mode 100644
index 00000000..d4f468dd
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/counts.json
@@ -0,0 +1,19 @@
+{
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "memory": 79,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292
+ },
+ "total": 1092,
+ "compiled_mutants_rejected": 7
+}
diff --git a/evidence/allen-omega-L694/L725/courier.log b/evidence/allen-omega-L694/L725/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L725/crc-mutant.log b/evidence/allen-omega-L694/L725/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L725/edges.log b/evidence/allen-omega-L694/L725/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L725/full.exit b/evidence/allen-omega-L694/L725/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L725/full.log b/evidence/allen-omega-L694/L725/full.log
new file mode 100644
index 00000000..e681192a
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/full.log
@@ -0,0 +1,24 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L725/green1.exit b/evidence/allen-omega-L694/L725/green1.exit
new file mode 100644
index 00000000..1e8b3149
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/green1.exit
@@ -0,0 +1 @@
+6
diff --git a/evidence/allen-omega-L694/L725/green1.log b/evidence/allen-omega-L694/L725/green1.log
new file mode 100644
index 00000000..be7f31cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/green1.log
@@ -0,0 +1,108 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 1
+37 1
+38 1
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 1
+47 1
+48 1
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
diff --git a/evidence/allen-omega-L694/L725/green2.exit b/evidence/allen-omega-L694/L725/green2.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/green2.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L725/green2.log b/evidence/allen-omega-L694/L725/green2.log
new file mode 100644
index 00000000..eae3b0e8
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/green2.log
@@ -0,0 +1,108 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
diff --git a/evidence/allen-omega-L694/L725/green3.exit b/evidence/allen-omega-L694/L725/green3.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/green3.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L725/green3.log b/evidence/allen-omega-L694/L725/green3.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/green3.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L725/hash-mutant.log b/evidence/allen-omega-L694/L725/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L725/independent-review/hello.expected b/evidence/allen-omega-L694/L725/independent-review/hello.expected
new file mode 100644
index 00000000..d6d7c0c9
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/hello.expected
@@ -0,0 +1 @@
+ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0
diff --git a/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.full.om b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.full.om
new file mode 100644
index 00000000..1b076d8d
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.full.om
@@ -0,0 +1,2764 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent serialized lifecycle boundary probes; all assertions run in Omega.
+global SavedOut uchar 8192
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn controlr kind ulong to void
+put Inlen 0 0
+b = packet kind get Q 1 0 0 0
+copyout
+end
+fn liner part ulong value ulong to void
+put Inlen 0 1
+put In 0 uchar value
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test qstart 77 100
+test qnext 100 true
+test qsent 100 true
+test not qnext 2099 true
+test qnext 2100 true
+test qsent 2100 true
+controlr 6
+test eq qincoming 2101 1
+test qready 2101
+note First failed JOB must be immediately retryable; ACK while no send is outstanding then suppresses retries.
+put Inlen 0 3
+put In 0 65
+put In 1 66
+put In 2 67
+test qsubmit 2102
+test qnext 2102 true
+test eq get T 10 1
+test qsent 2102 false
+test eq get T 10 0
+test qnext 2102 true
+test qsent 2102 true
+controlr 4
+test eq qincoming 2103 1
+test eq get T 6 1
+test not qnext 4101 true
+note Send one line, fail its GOT, then accept duplicate and retry GOT until success.
+liner 1 65
+test eq qincoming 4102 1
+test qnext 4102 true
+test eq get T 10 3
+test qsent 4102 false
+test eq get T 13 1
+liner 1 65
+test eq qincoming 4103 2
+test qnext 4103 true
+test qsent 4103 true
+test eq get T 13 0
+test qtake
+test eq get In 0 65
+test not qtake
+note Pending GOT is discarded by cancel; cancelled sequence cannot later emit old receipt.
+liner 2 66
+test eq qincoming 4104 1
+test qnext 4104 true
+test eq get T 10 3
+qcancel
+test eq get T 10 0
+test eq get T 13 0
+test not qsent 4104 true
+test not qnext 4104 true
+test eq get Q 4 0
+note New submission after cancel uses new sequence; stale old ACK is rejected.
+put Inlen 0 1
+put In 0 90
+test qsubmit 4105
+test eq get Q 1 2
+put Inlen 0 0
+b = packet 4 1 0 0 0
+copyout
+test eq qincoming 4106 0
+test eq get T 6 0
+test qnext 4106 true
+test eq get T 10 1
+test qsent 4106 true
+controlr 4
+test eq qincoming 4107 1
+note Existing ready state expires at the strict 30000ms edge, then HELLO uses 2s.
+test qready 32100
+test qnext 32100 true
+test qsent 32100 true
+test not qready 32101
+test not qnext 32101 true
+test qnext 34100 true
+test eq get T 10 5
+test qsent 34106 true
+note Once any LINE is accepted, a later backward-clock packet cannot move clock/state.
+liner 1 82
+test eq qincoming 34107 1
+old = get T 0
+liner 2 83
+test eq qincoming 34106 0
+test eq get T 0 old
+test eq get Q 2 1
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.log b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.log
new file mode 100644
index 00000000..9a5ae0eb
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.log
@@ -0,0 +1,58 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
diff --git a/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.om b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.om
new file mode 100644
index 00000000..37e29b0e
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.om
@@ -0,0 +1,118 @@
+note Independent serialized lifecycle boundary probes; all assertions run in Omega.
+global SavedOut uchar 8192
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn controlr kind ulong to void
+put Inlen 0 0
+b = packet kind get Q 1 0 0 0
+copyout
+end
+fn liner part ulong value ulong to void
+put Inlen 0 1
+put In 0 uchar value
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test qstart 77 100
+test qnext 100 true
+test qsent 100 true
+test not qnext 2099 true
+test qnext 2100 true
+test qsent 2100 true
+controlr 6
+test eq qincoming 2101 1
+test qready 2101
+note First failed JOB must be immediately retryable; ACK while no send is outstanding then suppresses retries.
+put Inlen 0 3
+put In 0 65
+put In 1 66
+put In 2 67
+test qsubmit 2102
+test qnext 2102 true
+test eq get T 10 1
+test qsent 2102 false
+test eq get T 10 0
+test qnext 2102 true
+test qsent 2102 true
+controlr 4
+test eq qincoming 2103 1
+test eq get T 6 1
+test not qnext 4101 true
+note Send one line, fail its GOT, then accept duplicate and retry GOT until success.
+liner 1 65
+test eq qincoming 4102 1
+test qnext 4102 true
+test eq get T 10 3
+test qsent 4102 false
+test eq get T 13 1
+liner 1 65
+test eq qincoming 4103 2
+test qnext 4103 true
+test qsent 4103 true
+test eq get T 13 0
+test qtake
+test eq get In 0 65
+test not qtake
+note Pending GOT is discarded by cancel; cancelled sequence cannot later emit old receipt.
+liner 2 66
+test eq qincoming 4104 1
+test qnext 4104 true
+test eq get T 10 3
+qcancel
+test eq get T 10 0
+test eq get T 13 0
+test not qsent 4104 true
+test not qnext 4104 true
+test eq get Q 4 0
+note New submission after cancel uses new sequence; stale old ACK is rejected.
+put Inlen 0 1
+put In 0 90
+test qsubmit 4105
+test eq get Q 1 2
+put Inlen 0 0
+b = packet 4 1 0 0 0
+copyout
+test eq qincoming 4106 0
+test eq get T 6 0
+test qnext 4106 true
+test eq get T 10 1
+test qsent 4106 true
+controlr 4
+test eq qincoming 4107 1
+note Existing ready state expires at the strict 30000ms edge, then HELLO uses 2s.
+test qready 32100
+test qnext 32100 true
+test qsent 32100 true
+test not qready 32101
+test not qnext 32101 true
+test qnext 34100 true
+test eq get T 10 5
+test qsent 34106 true
+note Once any LINE is accepted, a later backward-clock packet cannot move clock/state.
+liner 1 82
+test eq qincoming 34107 1
+old = get T 0
+liner 2 83
+test eq qincoming 34106 0
+test eq get T 0 old
+test eq get Q 2 1
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L725/independent-review/parent-verification.json b/evidence/allen-omega-L694/L725/independent-review/parent-verification.json
new file mode 100644
index 00000000..36dc9db2
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/parent-verification.json
@@ -0,0 +1,13 @@
+{
+ "source": "ae16b168e3c135a4770b4400f4cb9a18dcb289f4",
+ "exact_core_and_test_closure": true,
+ "checks": {
+ "scheduler": 213,
+ "lifecycle-review": 58
+ },
+ "parent_rebuild_byte_identical": true,
+ "parent_probe_exit": 0,
+ "wire_bytes": 73,
+ "wire_cmp": 0,
+ "scope": "host-only; transport and target unqualified"
+}
diff --git a/evidence/allen-omega-L694/L725/independent-review/report.md b/evidence/allen-omega-L694/L725/independent-review/report.md
new file mode 100644
index 00000000..20459335
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/report.md
@@ -0,0 +1,27 @@
+# L730 independent review — native Omega courier lifecycle
+
+## Scope and provenance
+
+- Reviewed exact candidate `ae16b168e3c135a4770b4400f4cb9a18dcb289f4` against parent `13d02ab4b7145579f6d3faa53442167bfcdcd7bc` in `~/workspace/aienos-allen-omega-L694`.
+- Exported candidate source to `~/handoffs/L730-review/source` and rebuilt from that immutable export; local git worktree was clean at review start.
+- Reviewed `native/omega/allen/scheduler.om`, its regression suite and API documentation, the reused Omega courier core, and legacy `native/kernel/x86/courier_udp.h` / `courier_udp_x86.c` wire behavior.
+- Compiler SHA-256: `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`.
+
+## Results
+
+**No findings** in the reviewed serialized lifecycle and tested boundary sequences.
+
+Executed from the exact export with the pinned `build-one.sh` path:
+
+1. Rebuilt and ran the narrow scheduler suite: compile exit 0, static AArch64 ELF64 EXEC with no `INTERP`/`NEEDED`, native exit 0, `213` assertions and `0` failures. Combined source SHA-256 `f92c69dd168d6f95984c9150af0544f11a9b265b4aa350e15dc3e3b7bf1de947`; executable SHA-256 `6a815fd66fdb6886af1a8dc857d6951268b43340bfd0f5dcf5ed7e677d384357`.
+2. Independently authored and ran `build/lifecycle-review.om` as Omega against the candidate scheduler. Compile exit 0, native exit 0, `58` assertions, `0` failures. Sequences covered failed JOB send/retry, ACK suppressing retries, failed GOT retained through duplicate/retry, `qcancel` discarding pending receipt, post-cancel sequence advancement and stale ACK refusal, strict HI expiry and 2s/10s HELLO timing, and backward-clock LINE refusal without state movement. Full-probe source SHA-256 `46096dd4e85af3c5338088a9b5842cc53286f1eca7a09baf2b5eefe7ed164074`; executable SHA-256 `0e0ecd1704cc4bb5b8187e1b2fd0899b353f1acf78f5ab39b92dc90cfb14aaff`.
+3. Built and executed a separate minimal Omega program producing the first HELLO, then compared the resulting bytes with the literal legacy header form using `cmp`: **PASS**, 73 bytes exact (`ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0\n`). Wire executable SHA-256 `7e34ddd7422c798c7abd1f1e551f793152539a5ff431d3c175168c43e2b5f08c`; raw emitted bytes SHA-256 `a33f0ab1a0cbf950f93fb4b85808f4b8af02271426c8f60583060a95bde4f801`.
+
+The existing courier parser binds packets to the current run and sequence; the lifecycle suite exercises retries, ordered line delivery/duplicate receipts, queue-full recovery, cancellation and refusal boundaries. No source or production files were modified. No live sockets, service/device calls, iMac or physical-target qualification were performed or inferred; this is host-only native execution, not transport/deployment qualification.
+
+## Review artifacts
+
+- Export: `~/handoffs/L730-review/source`
+- Narrow native suite executable/log/source: `~/handoffs/L730-review/build/scheduler`, `scheduler.log`, `scheduler.om`
+- Independent Omega probe source/full-source/executable/log: `~/handoffs/L730-review/build/lifecycle-review.om`, `lifecycle-review.full.om`, `lifecycle-review`, `lifecycle-review.log`
+- Wire probe source/executable/raw bytes/expected bytes: `~/handoffs/L730-review/build/wire.om`, `wire`, `wire.bin`, `hello.expected`
diff --git a/evidence/allen-omega-L694/L725/independent-review/scheduler.log b/evidence/allen-omega-L694/L725/independent-review/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L725/independent-review/wire.bin b/evidence/allen-omega-L694/L725/independent-review/wire.bin
new file mode 100644
index 00000000..d6d7c0c9
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/wire.bin
@@ -0,0 +1 @@
+ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0
diff --git a/evidence/allen-omega-L694/L725/independent-review/wire.full.om b/evidence/allen-omega-L694/L725/independent-review/wire.full.om
new file mode 100644
index 00000000..804a550a
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/wire.full.om
@@ -0,0 +1,2635 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+fn main to int
+a = qstart 77 100
+b = qnext 100 true
+w = write 1 Outb 0 get Outlen 0
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L725/independent-review/wire.om b/evidence/allen-omega-L694/L725/independent-review/wire.om
new file mode 100644
index 00000000..63d75935
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/independent-review/wire.om
@@ -0,0 +1,6 @@
+fn main to int
+a = qstart 77 100
+b = qnext 100 true
+w = write 1 Outb 0 get Outlen 0
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L725/intent.log b/evidence/allen-omega-L694/L725/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L725/keepalive-mutant.log b/evidence/allen-omega-L694/L725/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L725/long.log b/evidence/allen-omega-L694/L725/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L725/memory.log b/evidence/allen-omega-L694/L725/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L725/paint.log b/evidence/allen-omega-L694/L725/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L725/readback-mutant.log b/evidence/allen-omega-L694/L725/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L725/red.exit b/evidence/allen-omega-L694/L725/red.exit
new file mode 100644
index 00000000..00750edc
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red.exit
@@ -0,0 +1 @@
+3
diff --git a/evidence/allen-omega-L694/L725/red.om b/evidence/allen-omega-L694/L725/red.om
new file mode 100644
index 00000000..6d248235
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red.om
@@ -0,0 +1,834 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note L725 compilable behavioral stub, retained only in RED evidence.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+ret false
+end
+fn qready now ulong to bool
+ret false
+end
+fn qsubmit now ulong to bool
+ret false
+end
+fn qnext now ulong link bool to bool
+ret false
+end
+fn qsent now ulong ok bool to bool
+ret false
+end
+fn qincoming now ulong to ulong
+ret 0
+end
+fn qcancel to void
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Native courier lifecycle regression. Clock values are injected milliseconds.
+text Lineone "SAY 1 1/1 Model text."
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn tcopy to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn control kind ulong seq ulong to void
+put Inlen 0 0
+b = packet kind seq 0 0 0
+tcopy
+end
+fn linepkt part ulong to void
+put Inlen 0 len Lineone
+for i ulong len Lineone
+put In i get Lineone i
+end
+b = packet 2 get Q 1 part 0 0
+tcopy
+end
+fn jobinput to void
+put Inlen 0 1001
+for i ulong 1001
+put In i 120
+end
+put In 999 10
+put In 1000 121
+end
+fn main to int
+test qstart 42 100
+test not qready 100
+test not qnext 100 false
+test eq get T 3 0
+test qnext 100 true
+test eq get T 10 5
+test not qnext 100 true
+test qsent 100 false
+test eq get T 3 0
+test qnext 101 true
+test qsent 101 true
+test eq get T 3 1
+test not qnext 2100 true
+test qnext 2101 true
+test qsent 2101 true
+control 6 0
+test eq qincoming 2102 1
+test qready 2102
+test not qnext 12100 true
+test qnext 12101 true
+test eq get T 10 5
+test qsent 12101 true
+test qready 32101
+test not qready 32102
+test qnext 32102 true
+test qsent 32102 true
+test not qnext 32101 true
+test eq get T 0 32102
+jobinput
+test qsubmit 32103
+test eq get Q 1 1
+test eq get JobOut 999 32
+test eq get JobOut 1000 121
+test not qsubmit 32103
+test qnext 32103 true
+test eq get T 10 1
+test eq get T 11 1
+tcopy
+test pkparse
+test eq get N 6 1000
+test eq get In add get N 5 999 32
+test qsent 32103 false
+test eq get T 9 1
+test qnext 32104 true
+test eq get T 11 1
+test qsent 32104 true
+test qnext 32104 true
+test eq get T 11 2
+tcopy
+test pkparse
+test eq get N 6 1
+test eq get In get N 5 121
+test qsent 32104 true
+test eq get T 9 0
+control 6 0
+test eq qincoming 32105 1
+test qready 32105
+test not qnext 34103 true
+test qnext 34104 true
+test eq get T 10 1
+test eq get T 11 1
+test qsent 34104 true
+test qnext 34104 true
+test eq get T 11 2
+test qsent 34104 true
+control 4 2
+test eq qincoming 34105 0
+test eq get T 6 0
+control 4 1
+test eq qincoming 34105 1
+test eq get T 6 1
+test not qnext 36104 true
+linepkt 1
+test eq qincoming 36105 1
+test eq get Q 4 1
+test eq get T 13 1
+test qnext 36105 true
+test eq get T 10 3
+test qsent 36105 false
+test eq get T 13 1
+linepkt 1
+test eq qincoming 36106 2
+test eq get Q 4 1
+test qnext 36106 true
+test eq get T 10 3
+test qsent 36106 true
+test eq get T 13 0
+test qtake
+test eq get Inlen 0 len Lineone
+test not qtake
+linepkt 2
+test eq qincoming 36107 1
+linepkt 3
+test eq qincoming 36107 0
+test eq get Q 2 2
+test eq get Q 4 1
+test qnext 36108 true
+test qsent 36108 true
+linepkt 3
+test eq qincoming 36109 1
+test eq get Q 2 3
+qcancel
+test eq get T 5 0
+linepkt 4
+test eq qincoming 36110 0
+jobinput
+test qsubmit 36111
+test eq get Q 1 2
+test eq get Q 4 0
+control 6 0
+test eq qincoming 36112 1
+control 6 0
+put In 22 49
+test eq qincoming 36113 0
+test eq get T 2 36112
+control 4 2
+test eq qincoming 36110 0
+test eq get T 6 0
+qcancel
+put Q 1 4294967295
+jobinput
+test not qsubmit 36114
+test eq get Q 1 4294967295
+test not qstart 0 36114
+test eq get Q 0 42
+test qstart 43 0
+put Inlen 0 4097
+test not qsubmit 0
+test eq get Q 1 0
+put Inlen 0 0
+test not qsubmit 0
+test not qsent 0 true
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L725/red2.exit b/evidence/allen-omega-L694/L725/red2.exit
new file mode 100644
index 00000000..8e14edce
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red2.exit
@@ -0,0 +1 @@
+78
diff --git a/evidence/allen-omega-L694/L725/red2.log b/evidence/allen-omega-L694/L725/red2.log
new file mode 100644
index 00000000..852ff9e0
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red2.log
@@ -0,0 +1,108 @@
+1 1
+2 0
+3 0
+4 0
+5 1
+6 1
+7 0
+8 1
+9 0
+10 1
+11 1
+12 1
+13 0
+14 1
+15 1
+16 1
+17 1
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 1
+25 1
+26 0
+27 1
+28 1
+29 1
+30 1
+31 1
+32 0
+33 1
+34 1
+35 1
+36 1
+37 1
+38 1
+39 1
+40 1
+41 1
+42 1
+43 1
+44 1
+45 1
+46 1
+47 1
+48 1
+49 1
+50 0
+51 1
+52 1
+53 0
+54 1
+55 1
+56 1
+57 1
+58 1
+59 1
+60 1
+61 0
+62 0
+63 1
+64 1
+65 0
+66 1
+67 1
+68 1
+69 1
+70 1
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 1
+78 0
+79 1
+80 1
+81 0
+82 1
+83 0
+84 1
+85 1
+86 1
+87 1
+88 1
+89 1
+90 0
+91 0
+92 1
+93 1
+94 0
+95 1
+96 0
+97 1
+98 0
+99 0
+100 0
+101 0
+102 0
+103 1
+104 1
+105 0
+106 1
+107 0
+108 0
diff --git a/evidence/allen-omega-L694/L725/red2.om b/evidence/allen-omega-L694/L725/red2.om
new file mode 100644
index 00000000..ff7cf4b2
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red2.om
@@ -0,0 +1,979 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note L725 compilable behavioral stub, retained only in RED evidence.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+ret false
+end
+fn qready now ulong to bool
+ret false
+end
+fn qsubmit now ulong to bool
+ret false
+end
+fn qnext now ulong link bool to bool
+ret false
+end
+fn qsent now ulong ok bool to bool
+ret false
+end
+fn qincoming now ulong to ulong
+ret 0
+end
+fn qcancel to void
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Native courier lifecycle regression. Clock values are injected milliseconds.
+text Lineone "SAY 1 1/1 Model text."
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn tcopy to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn control kind ulong seq ulong to void
+put Inlen 0 0
+b = packet kind seq 0 0 0
+tcopy
+end
+fn linepkt part ulong to void
+put Inlen 0 len Lineone
+for i ulong len Lineone
+put In i get Lineone i
+end
+b = packet 2 get Q 1 part 0 0
+tcopy
+end
+fn jobinput to void
+put Inlen 0 1001
+for i ulong 1001
+put In i 120
+end
+put In 999 10
+put In 1000 121
+end
+fn main to int
+test qstart 42 100
+test not qready 100
+test not qnext 100 false
+test eq get T 3 0
+test qnext 100 true
+test eq get T 10 5
+test not qnext 100 true
+test qsent 100 false
+test eq get T 3 0
+test qnext 101 true
+test qsent 101 true
+test eq get T 3 1
+test not qnext 2100 true
+test qnext 2101 true
+test qsent 2101 true
+control 6 0
+test eq qincoming 2102 1
+test qready 2102
+test not qnext 12100 true
+test qnext 12101 true
+test eq get T 10 5
+test qsent 12101 true
+test qready 32101
+test not qready 32102
+test qnext 32102 true
+test qsent 32102 true
+test not qnext 32101 true
+test eq get T 0 32102
+jobinput
+test qsubmit 32103
+test eq get Q 1 1
+test eq get JobOut 999 32
+test eq get JobOut 1000 121
+test not qsubmit 32103
+test qnext 32103 true
+test eq get T 10 1
+test eq get T 11 1
+tcopy
+test pkparse
+test eq get N 6 1000
+test eq get In add get N 5 999 32
+test qsent 32103 false
+test eq get T 9 1
+test qnext 32104 true
+test eq get T 11 1
+test qsent 32104 true
+test qnext 32104 true
+test eq get T 11 2
+tcopy
+test pkparse
+test eq get N 6 1
+test eq get In get N 5 121
+test qsent 32104 true
+test eq get T 9 0
+control 6 0
+test eq qincoming 32105 1
+test qready 32105
+test not qnext 34103 true
+test qnext 34104 true
+test eq get T 10 1
+test eq get T 11 1
+test qsent 34104 true
+test qnext 34104 true
+test eq get T 11 2
+test qsent 34104 true
+control 4 2
+test eq qincoming 34105 0
+test eq get T 6 0
+control 4 1
+test eq qincoming 34105 1
+test eq get T 6 1
+test not qnext 36104 true
+linepkt 1
+test eq qincoming 36105 1
+test eq get Q 4 1
+test eq get T 13 1
+test qnext 36105 true
+test eq get T 10 3
+test qsent 36105 false
+test eq get T 13 1
+linepkt 1
+test eq qincoming 36106 2
+test eq get Q 4 1
+test qnext 36106 true
+test eq get T 10 3
+test qsent 36106 true
+test eq get T 13 0
+test qtake
+test eq get Inlen 0 len Lineone
+test not qtake
+linepkt 2
+test eq qincoming 36107 1
+linepkt 3
+test eq qincoming 36107 0
+test eq get Q 2 2
+test eq get Q 4 1
+test qnext 36108 true
+test qsent 36108 true
+linepkt 3
+test eq qincoming 36109 1
+test eq get Q 2 3
+qcancel
+test eq get T 5 0
+linepkt 4
+test eq qincoming 36110 0
+jobinput
+test qsubmit 36111
+test eq get Q 1 2
+test eq get Q 4 0
+control 6 0
+test eq qincoming 36112 1
+control 6 0
+put In 22 49
+test eq qincoming 36113 0
+test eq get T 2 36112
+control 4 2
+test eq qincoming 36110 0
+test eq get T 6 0
+qcancel
+put Q 1 4294967295
+jobinput
+test not qsubmit 36114
+test eq get Q 1 4294967295
+test not qstart 0 36114
+test eq get Q 0 42
+test qstart 43 0
+put Inlen 0 4097
+test not qsubmit 0
+test eq get Q 1 0
+put Inlen 0 0
+test not qsubmit 0
+test not qsent 0 true
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L725/red3.exit b/evidence/allen-omega-L694/L725/red3.exit
new file mode 100644
index 00000000..dd475631
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red3.exit
@@ -0,0 +1 @@
+76
diff --git a/evidence/allen-omega-L694/L725/red3.log b/evidence/allen-omega-L694/L725/red3.log
new file mode 100644
index 00000000..e47b4d39
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red3.log
@@ -0,0 +1,108 @@
+1 1
+2 0
+3 0
+4 0
+5 1
+6 1
+7 0
+8 1
+9 0
+10 1
+11 1
+12 1
+13 0
+14 1
+15 1
+16 1
+17 1
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 1
+25 1
+26 0
+27 1
+28 1
+29 1
+30 1
+31 1
+32 0
+33 1
+34 1
+35 1
+36 0
+37 1
+38 1
+39 1
+40 1
+41 1
+42 1
+43 1
+44 1
+45 1
+46 0
+47 1
+48 1
+49 1
+50 0
+51 1
+52 1
+53 0
+54 1
+55 1
+56 1
+57 1
+58 1
+59 1
+60 1
+61 0
+62 0
+63 1
+64 1
+65 0
+66 1
+67 1
+68 1
+69 1
+70 1
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 1
+78 0
+79 1
+80 1
+81 0
+82 1
+83 0
+84 1
+85 1
+86 1
+87 1
+88 1
+89 1
+90 0
+91 0
+92 1
+93 1
+94 0
+95 1
+96 0
+97 1
+98 0
+99 0
+100 0
+101 0
+102 0
+103 1
+104 1
+105 0
+106 1
+107 0
+108 0
diff --git a/evidence/allen-omega-L694/L725/red3.om b/evidence/allen-omega-L694/L725/red3.om
new file mode 100644
index 00000000..56ecba1f
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/red3.om
@@ -0,0 +1,991 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note L725 compilable behavioral stub, retained only in RED evidence.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+ret false
+end
+fn qready now ulong to bool
+ret false
+end
+fn qsubmit now ulong to bool
+ret false
+end
+fn qnext now ulong link bool to bool
+ret false
+end
+fn qsent now ulong ok bool to bool
+ret false
+end
+fn qincoming now ulong to ulong
+ret 0
+end
+fn qcancel to void
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Native courier lifecycle regression. Clock values are injected milliseconds.
+text Lineone "SAY 1 1/1 Model text."
+note check writes through Outb; preserve the actual pending datagram around logging.
+global SavedOut uchar 8192
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn tcopy to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn control kind ulong seq ulong to void
+put Inlen 0 0
+b = packet kind seq 0 0 0
+tcopy
+end
+fn linepkt part ulong to void
+put Inlen 0 len Lineone
+for i ulong len Lineone
+put In i get Lineone i
+end
+b = packet 2 get Q 1 part 0 0
+tcopy
+end
+fn jobinput to void
+put Inlen 0 1001
+for i ulong 1001
+put In i 120
+end
+put In 999 10
+put In 1000 121
+end
+fn main to int
+test qstart 42 100
+test not qready 100
+test not qnext 100 false
+test eq get T 3 0
+test qnext 100 true
+test eq get T 10 5
+test not qnext 100 true
+test qsent 100 false
+test eq get T 3 0
+test qnext 101 true
+test qsent 101 true
+test eq get T 3 1
+test not qnext 2100 true
+test qnext 2101 true
+test qsent 2101 true
+control 6 0
+test eq qincoming 2102 1
+test qready 2102
+test not qnext 12100 true
+test qnext 12101 true
+test eq get T 10 5
+test qsent 12101 true
+test qready 32101
+test not qready 32102
+test qnext 32102 true
+test qsent 32102 true
+test not qnext 32101 true
+test eq get T 0 32102
+jobinput
+test qsubmit 32103
+test eq get Q 1 1
+test eq get JobOut 999 32
+test eq get JobOut 1000 121
+test not qsubmit 32103
+test qnext 32103 true
+test eq get T 10 1
+test eq get T 11 1
+tcopy
+test pkparse
+test eq get N 6 1000
+test eq get In add get N 5 999 32
+test qsent 32103 false
+test eq get T 9 1
+test qnext 32104 true
+test eq get T 11 1
+test qsent 32104 true
+test qnext 32104 true
+test eq get T 11 2
+tcopy
+test pkparse
+test eq get N 6 1
+test eq get In get N 5 121
+test qsent 32104 true
+test eq get T 9 0
+control 6 0
+test eq qincoming 32105 1
+test qready 32105
+test not qnext 34103 true
+test qnext 34104 true
+test eq get T 10 1
+test eq get T 11 1
+test qsent 34104 true
+test qnext 34104 true
+test eq get T 11 2
+test qsent 34104 true
+control 4 2
+test eq qincoming 34105 0
+test eq get T 6 0
+control 4 1
+test eq qincoming 34105 1
+test eq get T 6 1
+test not qnext 36104 true
+linepkt 1
+test eq qincoming 36105 1
+test eq get Q 4 1
+test eq get T 13 1
+test qnext 36105 true
+test eq get T 10 3
+test qsent 36105 false
+test eq get T 13 1
+linepkt 1
+test eq qincoming 36106 2
+test eq get Q 4 1
+test qnext 36106 true
+test eq get T 10 3
+test qsent 36106 true
+test eq get T 13 0
+test qtake
+test eq get Inlen 0 len Lineone
+test not qtake
+linepkt 2
+test eq qincoming 36107 1
+linepkt 3
+test eq qincoming 36107 0
+test eq get Q 2 2
+test eq get Q 4 1
+test qnext 36108 true
+test qsent 36108 true
+linepkt 3
+test eq qincoming 36109 1
+test eq get Q 2 3
+qcancel
+test eq get T 5 0
+linepkt 4
+test eq qincoming 36110 0
+jobinput
+test qsubmit 36111
+test eq get Q 1 2
+test eq get Q 4 0
+control 6 0
+test eq qincoming 36112 1
+control 6 0
+put In 22 49
+test eq qincoming 36113 0
+test eq get T 2 36112
+control 4 2
+test eq qincoming 36110 0
+test eq get T 6 0
+qcancel
+put Q 1 4294967295
+jobinput
+test not qsubmit 36114
+test eq get Q 1 4294967295
+test not qstart 0 36114
+test eq get Q 0 42
+test qstart 43 0
+put Inlen 0 4097
+test not qsubmit 0
+test eq get Q 1 0
+put Inlen 0 0
+test not qsubmit 0
+test not qsent 0 true
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L725/reply.log b/evidence/allen-omega-L694/L725/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L725/runtime.log b/evidence/allen-omega-L694/L725/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L725/scene.log b/evidence/allen-omega-L694/L725/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L725/scheduler.log b/evidence/allen-omega-L694/L725/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L725/session-mutant.log b/evidence/allen-omega-L694/L725/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L725/short.log b/evidence/allen-omega-L694/L725/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L725/source.sha256 b/evidence/allen-omega-L694/L725/source.sha256
new file mode 100644
index 00000000..7147d854
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/source.sha256
@@ -0,0 +1,37 @@
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+7c2e516c56b555bbd7fefa8f24b0b87b6013b0545a43c98e7c01269cccbf76d3 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+e1a49f0f3fb01e92e8b474867d0fb68a3fc4da53c8fe5ad8411862c97f364843 native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L725/stale-mutant.log b/evidence/allen-omega-L694/L725/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L725/stdio-overflow.stderr b/evidence/allen-omega-L694/L725/stdio-overflow.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L725/stdio-overflow.stdout b/evidence/allen-omega-L694/L725/stdio-overflow.stdout
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L725/view.log b/evidence/allen-omega-L694/L725/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L725/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L734/README.md b/evidence/allen-omega-L694/L734/README.md
new file mode 100644
index 00000000..11126c92
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/README.md
@@ -0,0 +1,55 @@
+# L734: native application binding
+
+This increment joins runtime prompt admission, intent/JOB construction, courier
+scheduling, CODE assembly and SAY/WAIT consumption in handwritten seeded Omega.
+It is an executed provider-facing core, not actual network/device attachment.
+The existing development stdio main remains separate. No live service, machine,
+physical disk, compiler or kernel provider was changed.
+
+## Actual results
+
+`full.log`, `full.exit` and `counts.json`: 1253 native checks pass, including
+161 application checks. Nine separately compiled behavioral mutants are rejected:
+stale3, CRC2, hash2, readback7, session1, keepalive40, ACK-stop27, pending-wire1,
+application-CODE3. Each executable was built through the pinned compiler and
+checked for nonempty static AArch64 EXEC before execution. Memory and stdio
+goldens, and the overflow refusal regression, remain passing.
+
+`source.sha256` was checked against the current source bytes before this commit.
+`binaries.sha256` inventories actual compiled executables in the fresh handoff
+output directory. Build orchestration and log/hash collection use existing host
+tools; product and executable test/probe logic are Omega only.
+
+## RED/GREEN and construction failures
+
+- Initial `red.om` did not compile: text identifiers longer than the selected
+ compiler's eight-byte global-name limit returned error13. Tests were corrected
+ to the actual grammar. This was not counted as behavioral RED.
+- `red2` is a compilable stub: 131 executed assertions,103 failures, exit103.
+- Initial real implementation `green1.om` exceeded the selected compiler's
+ sixteen-slot expression budget (error12). Extracting the retry-admission helper
+ preserved behavior; `green2` executed133 checks with exit0. The two additional
+ executed assertions are conditional send-result checks skipped by the stub.
+- Pending-output regression: a code-completion LINE could cause saytake to write
+ AGAIN into Outb while a previously offered JOB was awaiting send-result
+ reporting. `pending-red` executed154 checks with one failure. The application
+ now preserves the complete outgoing bytes/length/error around reply handling;
+ `pending-green` executes154 checks, zero failures. The final compiled
+ pendingwire mutant independently reintroduces this defect and fails.
+- Stale-inner-CODE regression: an accepted current transport envelope containing
+ an old CODE ID could populate the old assembly buffer during a newer chat,
+ before heard rejected its logical ID. `stalecode-red` executes161 checks with
+ three state-mutation failures. The application now validates active code-kind
+ and assembly/conversation binding before calling codetake. The same cases pass
+ in the full suite, and the compiled appcode mutant fails those three checks.
+
+Tests exercise real serialized protocol bytes through the application calls:
+chat prompt->JOB->LINE->retained answer, immediate code acknowledgement,
+missing-code AGAIN after GOT, distinct conversation/wire IDs, stale inner reply
+refusal, complete CRC-checked code before display, cancellation/reset, failed send,
+WAIT, slow notice, silence timeout, backward clocks and invalid admission.
+
+Independent review pending. The earlier completed strict legacy repository suite
+is retained in ../parent-strict; it is not silently relabeled as qualification
+of this new native source. Native socket/clock/device integration, full portable
+parity, x86 EFI/QEMU and physical iMac execution remain open under L694.
diff --git a/evidence/allen-omega-L694/L734/ackstop-mutant.log b/evidence/allen-omega-L694/L734/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L734/appcode-mutant.log b/evidence/allen-omega-L694/L734/appcode-mutant.log
new file mode 100644
index 00000000..a7e8e5a9
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/appcode-mutant.log
@@ -0,0 +1,161 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
diff --git a/evidence/allen-omega-L694/L734/application.log b/evidence/allen-omega-L694/L734/application.log
new file mode 100644
index 00000000..57341bc5
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/application.log
@@ -0,0 +1,161 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
diff --git a/evidence/allen-omega-L694/L734/binaries.sha256 b/evidence/allen-omega-L694/L734/binaries.sha256
new file mode 100644
index 00000000..ac54dc46
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/binaries.sha256
@@ -0,0 +1,26 @@
+6d650ec56ff5ff9d069b042e6651962b68cd9ef674c33c4efe76345c4e97dbfe /home/drakestapleton/handoffs/allen-omega-L694/L734/full/scheduler
+fdae94ddf868f701e5b2b97187206f11dd4d2b53601edee6fab7e2d8c541b782 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/readback-mutant
+3bec6065cb044eb019e143bfa0e2eacbe58c92a11069a701f196591512de424d /home/drakestapleton/handoffs/allen-omega-L694/L734/full/view
+144fcf58ba2d37e28e31f70901ddee2816bc73e392837edc9d33a37cfdd8da39 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/allen
+56d7b62cc9ee2088bec592fcdcb08e1460727ee924f5f6dc57609b440ce4bfdb /home/drakestapleton/handoffs/allen-omega-L694/L734/full/reply
+1b084c60c51bb6bff0e86b6e33bdd7f8ae20c439358a59040b10557ef4480922 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/ackstop-mutant
+d35f99663a6b6c38cfe73466cd957406ce1a02e0fbcd7d4e6d517916adb2e892 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/hash-mutant
+7ab3d4b929b9783974fce2bba19d348f05825f21486b2392a4f53fac3f0f3545 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/golden
+7a77f860a281df4f67cf253eebbd73d4d2a74c9e4e00e1dd4e56af826aff54cb /home/drakestapleton/handoffs/allen-omega-L694/L734/full/session-mutant
+8eb6d85cb109b38f0b63ddd3728d97ae44846bf023dadd85c9a5ddfe5938bfaa /home/drakestapleton/handoffs/allen-omega-L694/L734/full/intent
+1e112b3a8a29fd8af52ae5e5dded6d9960a8aca5c5191c32ebb19ba0ac657e42 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/fixture
+a899184689994913953a995f6535fa154d7c7ac021033157dee9540d3895422b /home/drakestapleton/handoffs/allen-omega-L694/L734/full/runtime
+d0c7123c568256add05f01477def3aaa2f610817cc68a4c8dbed0e898bf33494 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/code
+99c557b76691198da03677762b605ea874be85ce8ab06650d3d77747ae2efba5 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/edges
+ac9fee41c760e6c47990f12b76052958c57c6142be09d26b349d9c9ac01fa669 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/appcode-mutant
+171d20f70aa37afc3e8d3a6d1a7350f6bdc3f2064473ff247c616733297e0dc7 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/render
+8208fb15282d590f8ac6a68805a7ecc1ef59976421f75cfd3045a0d9156b69b4 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/stale-mutant
+0b38ec713cfd0fcb7d2dbe82a571bd3666ecc840231b02cb703b74ea3b077ad5 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/courier
+f16baa5e99569377dc55617fd83c24cfdf414597ee86f2f8e33f9eb091b7e166 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/scene
+e9dc0394cdacc031f299f53c3ba91658a6d33476e9b75f7abf2605707bbf2312 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/pendingwire-mutant
+ca4def5b75b6c1b85e1f15630e447d86e42ef1a4f9532f023c9cbc20dcc0005b /home/drakestapleton/handoffs/allen-omega-L694/L734/full/paint
+aecb6d628b7dd4656b980f228304c0bc64ec53b7f8fc627dd9920802e162fec6 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/crc-mutant
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/stdio-overflow-input
+4b639c76d4301d413bf7c1e213bcc1c8d83c4588cacd4bec5a60fd282a9a6fac /home/drakestapleton/handoffs/allen-omega-L694/L734/full/keepalive-mutant
+b61eb63933ae35b49cb17722f9835ba2311055b2fbfe16acdf89f9c7436a7a92 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/memory
+987c3ac961f1dc5297ac8a48e71a6c3b203babb6e8ef6503b982b537a3efe469 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/application
diff --git a/evidence/allen-omega-L694/L734/code.log b/evidence/allen-omega-L694/L734/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L734/counts.json b/evidence/allen-omega-L694/L734/counts.json
new file mode 100644
index 00000000..26d8e50a
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/counts.json
@@ -0,0 +1,20 @@
+{
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 161,
+ "memory": 79,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292
+ },
+ "total": 1253,
+ "compiled_mutants_rejected": 9
+}
diff --git a/evidence/allen-omega-L694/L734/courier.log b/evidence/allen-omega-L694/L734/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L734/crc-mutant.log b/evidence/allen-omega-L694/L734/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L734/edges.log b/evidence/allen-omega-L694/L734/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L734/full.exit b/evidence/allen-omega-L694/L734/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L734/full.log b/evidence/allen-omega-L694/L734/full.log
new file mode 100644
index 00000000..6e989ecf
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/full.log
@@ -0,0 +1,27 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L734/green1.om b/evidence/allen-omega-L694/L734/green1.om
new file mode 100644
index 00000000..ec79f64b
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/green1.om
@@ -0,0 +1,3098 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+note First acknowledge the triggering LINE; only then submit AGAIN under a new
+note wire sequence. Its body keeps the original conversation ID.
+if and gt get A 1 0 and eq get T 10 0 eq get T 13 0
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+appcancel
+put A 2 3
+ret false
+end
+put A 1 0
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note End-to-end application core over real Omega protocol bytes; no socket simulation claim.
+text Smallask "hello"
+text Codeaskt "Please make me a calculator"
+text Finaltxt " 1/1 Model answer."
+text Codetxt " 1/1 9 3ce11e06 python print(1)\\n"
+text Prefixes "SAY WAIT CODE "
+text Againexp "AGAIN 2"
+global SavedOut uchar 8192
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt code bool to void
+if code
+put Inlen 0 len Codeaskt
+for i ulong len Codeaskt
+put In i get Codeaskt i
+end
+else
+put Inlen 0 len Smallask
+for i ulong len Smallask
+put In i get Smallask i
+end
+end
+end
+fn incoming part ulong seq ulong kind ulong to void
+outreset
+off = ulong 0
+size = ulong 4
+if eq kind 1
+off = ulong 4
+size = ulong 5
+end
+if eq kind 2
+off = ulong 9
+size = ulong 5
+end
+for i ulong size
+emitb get Prefixes add off i
+end
+emitn seq
+if eq kind 0
+for i ulong len Finaltxt
+emitb get Finaltxt i
+end
+end
+if eq kind 2
+for i ulong len Codetxt
+emitb get Codetxt i
+end
+end
+copyout
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test not appinit 0 100
+test appinit 42 100
+test not appinit 43 100
+test eq get Q 0 42
+prompt false
+test appask 100
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+test eq get R 1 1
+test eq get A 2 0
+prompt false
+test not appask 101
+test eq get R 9 1
+test apppoll 100 true
+test eq get T 10 5
+test appsent 100 true
+test apppoll 100 true
+test eq get T 10 1
+copyout
+test pkparse
+test eq get N 1 1
+test eq get In get N 5 74
+test appsent 100 true
+incoming 1 1 0
+test appreceive 101
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 8 13
+test eq get R 9 2
+test eq get Answer 0 77
+prompt true
+test not appask 102
+test eq get R 0 1
+test apppoll 102 true
+test eq get T 10 3
+test appsent 102 true
+note Code acknowledgement is visible immediately, but missing code requests AGAIN.
+prompt true
+test appask 103
+test eq get R 0 2
+test eq get Q 1 2
+test eq get R 2 2
+test eq get A 2 1
+test eq get R 8 len Ack
+test apppoll 103 true
+test appsent 103 false
+test apppoll 104 true
+test eq get T 10 1
+test appsent 104 true
+incoming 1 2 0
+test appreceive 105
+test eq get A 2 2
+test eq get A 1 len Againexp
+test eq get R 1 1
+test eq get R 13 1
+test apppoll 105 true
+test eq get T 10 3
+test eq get Q 1 2
+test appsent 105 true
+test apppoll 106 true
+test eq get T 10 1
+test eq get Q 1 3
+test eq get R 0 2
+copyout
+test pkparse
+test eq get N 6 len Againexp
+bad = ulong 0
+for i ulong len Againexp
+if ne get In add get N 5 i get Againexp i
+bad = add bad 1
+end
+end
+test eq bad 0
+test appsent 106 true
+incoming 1 2 0
+test appreceive 107
+test eq get A 2 3
+test eq get R 1 0
+test eq get A 1 0
+note Reset cancels pending delivery without reusing either counter.
+appreset
+test eq get R 0 2
+test eq get Q 1 3
+test eq get R 9 0
+prompt false
+test appask 108
+test eq get R 0 3
+test eq get Q 1 4
+test apppoll 108 true
+test appsent 108 true
+incoming 1 2 0
+test appreceive 109
+test eq get A 2 4
+test eq get R 1 1
+test eq get R 8 0
+test apppoll 109 true
+test appsent 109 true
+incoming 2 3 0
+test appreceive 110
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 9 2
+test apppoll 110 true
+test appsent 110 true
+note Cancellation drops an outstanding send and stale response safely.
+prompt false
+test appask 111
+test apppoll 111 true
+appcancel
+test eq get R 1 0
+test eq get T 5 0
+test not appsent 111 true
+incoming 1 4 0
+test not appreceive 112
+note Complete CODE bytes must arrive before a code response becomes visible.
+prompt true
+test appask 113
+test eq get R 0 5
+test eq get Q 1 6
+test apppoll 113 true
+test appsent 113 true
+incoming 1 5 2
+test appreceive 114
+test eq get A 2 0
+test eq codestat 2
+test eq get R 6 0
+test apppoll 114 true
+test appsent 114 true
+incoming 2 5 0
+test appreceive 115
+test eq get A 2 1
+test eq get R 6 1
+test eq get R 1 0
+test eq get Code 6 49
+test apppoll 115 true
+test appsent 115 true
+note WAIT updates silence deadline, no answer; slow and timeout cancel both layers.
+prompt false
+test appask 116
+test eq get R 0 6
+test apppoll 116 true
+test appsent 116 true
+incoming 1 6 1
+test appreceive 117
+test eq get A 2 0
+test eq get R 4 117
+test apppoll 117 true
+test appsent 117 true
+v = apppoll 20116 true
+test eq get A 2 5
+test eq get R 1 1
+if v
+test appsent 20116 true
+end
+v = apppoll 30116 true
+test eq get R 1 1
+if v
+test appsent 30116 true
+end
+v = apppoll 30117 true
+test eq get A 2 6
+test eq get R 1 0
+test eq get T 5 0
+test eq get A 1 0
+if v
+test appsent 30117 true
+end
+n = get R 9
+prompt false
+test not appask 30116
+test eq get R 9 n
+test not apppoll 30116 true
+note Invalid prompt never becomes a pending job or transcript line.
+put Inlen 0 160
+test not appask 30118
+test eq get R 9 n
+test eq get R 0 6
+test eq get Q 1 7
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/green2.exit b/evidence/allen-omega-L694/L734/green2.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/green2.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L734/green2.log b/evidence/allen-omega-L694/L734/green2.log
new file mode 100644
index 00000000..d5e8237e
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/green2.log
@@ -0,0 +1,133 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
diff --git a/evidence/allen-omega-L694/L734/hash-mutant.log b/evidence/allen-omega-L694/L734/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/build/app-baseline.log b/evidence/allen-omega-L694/L734/independent-review/build/app-baseline.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/build/app-baseline.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/build/probe-final-50/probe.log b/evidence/allen-omega-L694/L734/independent-review/build/probe-final-50/probe.log
new file mode 100644
index 00000000..107e4801
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/build/probe-final-50/probe.log
@@ -0,0 +1,50 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.log b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.om b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.om
new file mode 100644
index 00000000..a5ebf72b
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.om
@@ -0,0 +1,3226 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note End-to-end application core over real Omega protocol bytes; no socket simulation claim.
+text Smallask "hello"
+text Codeaskt "Please make me a calculator"
+text Finaltxt " 1/1 Model answer."
+text Codetxt " 1/1 9 3ce11e06 python print(1)\\n"
+text Prefixes "SAY WAIT CODE "
+text Againexp "AGAIN 2"
+global SavedOut uchar 8192
+global Heldwire uchar 8192
+global Heldlen ulong 2
+fn holdwire to void
+put Heldlen 0 get Outlen 0
+put Heldlen 1 get Err 0
+for i ulong get Outlen 0
+put Heldwire i get Outb i
+end
+end
+fn unhold to void
+for i ulong get Heldlen 0
+put Outb i get Heldwire i
+end
+put Outlen 0 get Heldlen 0
+put Err 0 get Heldlen 1
+end
+fn samewire to bool
+if ne get Outlen 0 get Heldlen 0
+ret false
+end
+for i ulong get Heldlen 0
+if ne get Outb i get Heldwire i
+ret false
+end
+end
+ret eq get Err 0 get Heldlen 1
+end
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt code bool to void
+if code
+put Inlen 0 len Codeaskt
+for i ulong len Codeaskt
+put In i get Codeaskt i
+end
+else
+put Inlen 0 len Smallask
+for i ulong len Smallask
+put In i get Smallask i
+end
+end
+end
+fn incoming part ulong seq ulong kind ulong to void
+outreset
+off = ulong 0
+size = ulong 4
+if eq kind 1
+off = ulong 4
+size = ulong 5
+end
+if eq kind 2
+off = ulong 9
+size = ulong 5
+end
+for i ulong size
+emitb get Prefixes add off i
+end
+emitn seq
+if eq kind 0
+for i ulong len Finaltxt
+emitb get Finaltxt i
+end
+end
+if eq kind 2
+for i ulong len Codetxt
+emitb get Codetxt i
+end
+end
+copyout
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test not appinit 0 100
+test appinit 42 100
+test not appinit 43 100
+test eq get Q 0 42
+prompt false
+test appask 100
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+test eq get R 1 1
+test eq get A 2 0
+prompt false
+test not appask 101
+test eq get R 9 1
+test apppoll 100 true
+test eq get T 10 5
+test appsent 100 true
+test apppoll 100 true
+test eq get T 10 1
+copyout
+test pkparse
+test eq get N 1 1
+test eq get In get N 5 74
+test appsent 100 true
+incoming 1 1 0
+test appreceive 101
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 8 13
+test eq get R 9 2
+test eq get Answer 0 77
+prompt true
+test not appask 102
+test eq get R 0 1
+test apppoll 102 true
+test eq get T 10 3
+test appsent 102 true
+note Code acknowledgement is visible immediately, but missing code requests AGAIN.
+prompt true
+test appask 103
+test eq get R 0 2
+test eq get Q 1 2
+test eq get R 2 2
+test eq get A 2 1
+test eq get R 8 len Ack
+test apppoll 103 true
+test appsent 103 false
+test apppoll 104 true
+test eq get T 10 1
+test appsent 104 true
+incoming 1 2 0
+test appreceive 105
+test eq get A 2 2
+test eq get A 1 len Againexp
+test eq get R 1 1
+test eq get R 13 1
+test apppoll 105 true
+test eq get T 10 3
+test eq get Q 1 2
+test appsent 105 true
+test apppoll 106 true
+test eq get T 10 1
+test eq get Q 1 3
+test eq get R 0 2
+copyout
+test pkparse
+test eq get N 6 len Againexp
+bad = ulong 0
+for i ulong len Againexp
+if ne get In add get N 5 i get Againexp i
+bad = add bad 1
+end
+end
+test eq bad 0
+test appsent 106 true
+incoming 1 2 0
+test appreceive 107
+test eq get A 2 3
+test eq get R 1 0
+test eq get A 1 0
+note Reset cancels pending delivery without reusing either counter.
+appreset
+test eq get R 0 2
+test eq get Q 1 3
+test eq get R 9 0
+prompt false
+test appask 108
+test eq get R 0 3
+test eq get Q 1 4
+test apppoll 108 true
+test appsent 108 true
+note Old CODE must not mutate the code buffer during a newer chat job.
+incoming 1 2 2
+test appreceive 109
+test eq get A 2 4
+test eq get C 1 0
+test eq get C 2 0
+test eq get Code 0 0
+test apppoll 109 true
+test appsent 109 true
+incoming 2 2 0
+test appreceive 109
+test eq get A 2 4
+test eq get R 1 1
+test eq get R 8 0
+test apppoll 109 true
+test appsent 109 true
+incoming 3 3 0
+test appreceive 110
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 9 2
+test apppoll 110 true
+test appsent 110 true
+note Cancellation drops an outstanding send and stale response safely.
+prompt false
+test appask 111
+test apppoll 111 true
+appcancel
+test eq get R 1 0
+test eq get T 5 0
+test not appsent 111 true
+incoming 1 4 0
+test not appreceive 112
+note Complete CODE bytes must arrive before a code response becomes visible.
+prompt true
+test appask 113
+test eq get R 0 5
+test eq get Q 1 6
+test apppoll 113 true
+test appsent 113 true
+incoming 1 5 2
+test appreceive 114
+test eq get A 2 0
+test eq codestat 2
+test eq get R 6 0
+test apppoll 114 true
+test appsent 114 true
+incoming 2 5 0
+test appreceive 115
+test eq get A 2 1
+test eq get R 6 1
+test eq get R 1 0
+test eq get Code 6 49
+test apppoll 115 true
+test appsent 115 true
+note WAIT updates silence deadline, no answer; slow and timeout cancel both layers.
+prompt false
+test appask 116
+test eq get R 0 6
+test apppoll 116 true
+test appsent 116 true
+incoming 1 6 1
+test appreceive 117
+test eq get A 2 0
+test eq get R 4 117
+test apppoll 117 true
+test appsent 117 true
+v = apppoll 20116 true
+test eq get A 2 5
+test eq get R 1 1
+if v
+test appsent 20116 true
+end
+v = apppoll 30116 true
+test eq get R 1 1
+if v
+test appsent 30116 true
+end
+v = apppoll 30117 true
+test eq get A 2 6
+test eq get R 1 0
+test eq get T 5 0
+test eq get A 1 0
+if v
+test appsent 30117 true
+end
+n = get R 9
+prompt false
+test not appask 30116
+test eq get R 9 n
+test not apppoll 30116 true
+note Invalid prompt never becomes a pending job or transcript line.
+put Inlen 0 160
+test not appask 30118
+test eq get R 9 n
+test eq get R 0 6
+test eq get Q 1 7
+note Receiving a code completion before send-result reporting cannot replace
+note the pending datagram with the newly generated AGAIN text.
+prompt true
+test appask 30118
+test apppoll 30118 true
+test eq get T 10 1
+holdwire
+incoming 1 7 0
+unhold
+test appreceive 30119
+test eq get A 2 2
+test samewire
+test eq get T 10 1
+test appsent 30119 true
+test apppoll 30120 true
+test eq get T 10 3
+test appsent 30120 true
+test apppoll 30121 true
+test eq get Q 1 9
+test eq get R 0 7
+test appsent 30121 true
+appcancel
+note Idle runtime still refuses a new prompt while a HELLO send is outstanding.
+test apppoll 32122 true
+test eq get T 10 5
+holdwire
+n = get R 9
+prompt false
+test not appask 32122
+test samewire
+test eq get R 9 n
+test appsent 32122 true
+note Late CODE may complete the original job before queued AGAIN is sent.
+prompt true
+test appask 32123
+test eq get R 0 8
+test eq get Q 1 10
+test apppoll 32123 true
+test appsent 32123 true
+incoming 1 8 0
+test appreceive 32124
+test gt get A 1 0
+test apppoll 32124 true
+test appsent 32124 true
+incoming 2 8 2
+test appreceive 32125
+test eq codestat 2
+test apppoll 32125 true
+test appsent 32125 true
+incoming 3 8 0
+test appreceive 32126
+test eq get A 2 1
+test eq get R 1 0
+test eq get A 1 0
+test apppoll 32126 true
+test appsent 32126 true
+test not apppoll 32127 true
+test eq get Q 1 10
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.log b/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.log
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.om b/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.om
new file mode 100644
index 00000000..08722b1b
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.om
@@ -0,0 +1,2961 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+fn probecheck ok bool id ulong to void
+if not ok
+put Fails 0 add get Fails 0 1
+end
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+line 1 1
+probecheck appreceive 1 7
+probecheck eq get R 1 0 8
+line 2 1
+probecheck appreceive 2 9
+probecheck eq get A 2 4 10
+probecheck eq get Q 4 2 11
+probecheck eq get T 13 2 12
+probecheck apppoll 2 true 13
+probecheck eq get T 10 3 14
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+probecheck pkparse 15
+probecheck eq get N 0 4 16
+probecheck eq get N 2 2 17
+probecheck appsent 2 true 18
+probecheck eq get T 13 0 19
+probecheck not apppoll 3 true 20
+note Retry of the first accepted line is classified duplicate and then acknowledged.
+line 1 1
+probecheck appreceive 4 21
+probecheck eq get T 13 1 22
+probecheck apppoll 4 true 23
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+probecheck pkparse 24
+probecheck eq get N 0 4 25
+probecheck eq get N 2 1 26
+probecheck appsent 4 true 27
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.log
new file mode 100644
index 00000000..107e4801
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.log
@@ -0,0 +1,50 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.om
new file mode 100644
index 00000000..8cd3b347
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.om
@@ -0,0 +1,3023 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+global Probeout uchar 8192
+global Pstate ulong 2
+fn probecheck ok bool id ulong to void
+put Pstate 0 get Outlen 0
+put Pstate 1 get Err 0
+for i ulong get Outlen 0
+put Probeout i get Outb i
+end
+check ok id
+for i ulong get Pstate 0
+put Outb i get Probeout i
+end
+put Outlen 0 get Pstate 0
+put Err 0 get Pstate 1
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn waitline lineid ulong to void
+outreset
+emitb 87
+emitb 65
+emitb 73
+emitb 84
+emitb 32
+emitb 49
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn readwire to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+waitline 1
+probecheck appreceive 1 7
+probecheck eq get R 1 1 8
+probecheck eq get T 13 1 9
+note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send.
+line 2 1
+probecheck not appreceive 2 10
+probecheck eq get Q 2 1 11
+probecheck eq get T 13 1 12
+probecheck apppoll 2 true 13
+readwire
+probecheck pkparse 14
+probecheck eq get N 0 3 15
+probecheck eq get N 2 1 16
+probecheck appsent 2 true 17
+probecheck eq get T 13 0 18
+line 2 1
+probecheck appreceive 3 19
+probecheck eq get A 2 1 20
+probecheck eq get R 1 0 21
+probecheck eq get T 13 2 22
+probecheck apppoll 3 true 23
+readwire
+probecheck pkparse 24
+probecheck eq get N 0 3 25
+probecheck eq get N 2 2 26
+probecheck appsent 3 true 27
+probecheck not apppoll 4 true 28
+note Replayed acknowledged LINE is treated as duplicate and gets its own GOT.
+waitline 1
+probecheck appreceive 4 29
+probecheck eq get T 13 1 30
+probecheck apppoll 4 true 31
+readwire
+probecheck pkparse 32
+probecheck eq get N 0 3 33
+probecheck eq get N 2 1 34
+probecheck appsent 4 true 35
+probecheck not apppoll 5 true 36
+note Cancellation discards the offered JOB but wire and conversation counters persist.
+prompt
+probecheck appask 5 37
+probecheck apppoll 5 true 38
+probecheck eq get T 10 1 39
+appcancel
+probecheck eq get T 5 0 40
+probecheck not appsent 5 true 41
+probecheck eq get Q 1 2 42
+probecheck eq get R 0 2 43
+prompt
+probecheck appask 6 44
+probecheck eq get Q 1 3 45
+probecheck eq get R 0 3 46
+appcancel
+old = get R 9
+put Q 1 4294967295
+prompt
+probecheck not appask 7 47
+probecheck eq get R 0 3 48
+probecheck eq get R 9 old 49
+probecheck eq get Q 1 4294967295 50
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.log
new file mode 100644
index 00000000..f25a2fd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.log
@@ -0,0 +1,36 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.om
new file mode 100644
index 00000000..05015ca5
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.om
@@ -0,0 +1,3001 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+global Probeout uchar 8192
+global Pstate ulong 2
+fn probecheck ok bool id ulong to void
+put Pstate 0 get Outlen 0
+put Pstate 1 get Err 0
+for i ulong get Outlen 0
+put Probeout i get Outb i
+end
+check ok id
+for i ulong get Pstate 0
+put Outb i get Probeout i
+end
+put Outlen 0 get Pstate 0
+put Err 0 get Pstate 1
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn waitline lineid ulong to void
+outreset
+emitb 87
+emitb 65
+emitb 73
+emitb 84
+emitb 32
+emitb 49
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn readwire to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+waitline 1
+probecheck appreceive 1 7
+probecheck eq get R 1 1 8
+probecheck eq get T 13 1 9
+note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send.
+line 2 1
+probecheck not appreceive 2 10
+probecheck eq get Q 2 1 11
+probecheck eq get T 13 1 12
+probecheck apppoll 2 true 13
+readwire
+probecheck pkparse 14
+probecheck eq get N 0 3 15
+probecheck eq get N 2 1 16
+probecheck appsent 2 true 17
+probecheck eq get T 13 0 18
+line 2 1
+probecheck appreceive 3 19
+probecheck eq get A 2 1 20
+probecheck eq get R 1 0 21
+probecheck eq get T 13 2 22
+probecheck apppoll 3 true 23
+readwire
+probecheck pkparse 24
+probecheck eq get N 0 3 25
+probecheck eq get N 2 2 26
+probecheck appsent 3 true 27
+probecheck not apppoll 4 true 28
+note Replayed acknowledged LINE is treated as duplicate and gets its own GOT.
+waitline 1
+probecheck appreceive 4 29
+probecheck eq get T 13 1 30
+probecheck apppoll 4 true 31
+readwire
+probecheck pkparse 32
+probecheck eq get N 0 3 33
+probecheck eq get N 2 1 34
+probecheck appsent 4 true 35
+probecheck not apppoll 5 true 36
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.log
new file mode 100644
index 00000000..b5fe8eac
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.log
@@ -0,0 +1,36 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 1
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 1
+25 1
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 1
+33 1
+34 0
+35 0
+36 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.om
new file mode 100644
index 00000000..edf1ff2a
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.om
@@ -0,0 +1,2989 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+fn probecheck ok bool id ulong to void
+check ok id
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn waitline lineid ulong to void
+outreset
+emitb 87
+emitb 65
+emitb 73
+emitb 84
+emitb 32
+emitb 49
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn readwire to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+waitline 1
+probecheck appreceive 1 7
+probecheck eq get R 1 1 8
+probecheck eq get T 13 1 9
+note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send.
+line 2 1
+probecheck not appreceive 2 10
+probecheck eq get Q 2 1 11
+probecheck eq get T 13 1 12
+probecheck apppoll 2 true 13
+readwire
+probecheck pkparse 14
+probecheck eq get N 0 4 15
+probecheck eq get N 2 1 16
+probecheck appsent 2 true 17
+probecheck eq get T 13 0 18
+line 2 1
+probecheck appreceive 3 19
+probecheck eq get A 2 1 20
+probecheck eq get R 1 0 21
+probecheck eq get T 13 2 22
+probecheck apppoll 3 true 23
+readwire
+probecheck pkparse 24
+probecheck eq get N 0 4 25
+probecheck eq get N 2 2 26
+probecheck appsent 3 true 27
+probecheck not apppoll 4 true 28
+note Replayed acknowledged LINE is treated as duplicate and gets its own GOT.
+waitline 1
+probecheck appreceive 4 29
+probecheck eq get T 13 1 30
+probecheck apppoll 4 true 31
+readwire
+probecheck pkparse 32
+probecheck eq get N 0 4 33
+probecheck eq get N 2 1 34
+probecheck appsent 4 true 35
+probecheck not apppoll 5 true 36
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-verified/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified/probe.om
new file mode 100644
index 00000000..6501e3dc
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified/probe.om
@@ -0,0 +1,3001 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+global Probeout uchar 8192
+global Probestate ulong 2
+fn probecheck ok bool id ulong to void
+put Probestate 0 get Outlen 0
+put Probestate 1 get Err 0
+for i ulong get Outlen 0
+put Probeout i get Outb i
+end
+check ok id
+for i ulong get Probestate 0
+put Outb i get Probeout i
+end
+put Outlen 0 get Probestate 0
+put Err 0 get Probestate 1
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn waitline lineid ulong to void
+outreset
+emitb 87
+emitb 65
+emitb 73
+emitb 84
+emitb 32
+emitb 49
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn readwire to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+waitline 1
+probecheck appreceive 1 7
+probecheck eq get R 1 1 8
+probecheck eq get T 13 1 9
+note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send.
+line 2 1
+probecheck not appreceive 2 10
+probecheck eq get Q 2 1 11
+probecheck eq get T 13 1 12
+probecheck apppoll 2 true 13
+readwire
+probecheck pkparse 14
+probecheck eq get N 0 4 15
+probecheck eq get N 2 1 16
+probecheck appsent 2 true 17
+probecheck eq get T 13 0 18
+line 2 1
+probecheck appreceive 3 19
+probecheck eq get A 2 1 20
+probecheck eq get R 1 0 21
+probecheck eq get T 13 2 22
+probecheck apppoll 3 true 23
+readwire
+probecheck pkparse 24
+probecheck eq get N 0 4 25
+probecheck eq get N 2 2 26
+probecheck appsent 3 true 27
+probecheck not apppoll 4 true 28
+note Replayed acknowledged LINE is treated as duplicate and gets its own GOT.
+waitline 1
+probecheck appreceive 4 29
+probecheck eq get T 13 1 30
+probecheck apppoll 4 true 31
+readwire
+probecheck pkparse 32
+probecheck eq get N 0 4 33
+probecheck eq get N 2 1 34
+probecheck appsent 4 true 35
+probecheck not apppoll 5 true 36
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.log
new file mode 100644
index 00000000..0e75a60b
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.log
@@ -0,0 +1,36 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 1
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 1
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 1
+34 0
+35 0
+36 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.om
new file mode 100644
index 00000000..04034e39
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.om
@@ -0,0 +1,3001 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+global Probeout uchar 8192
+global Pstate ulong 2
+fn probecheck ok bool id ulong to void
+put Pstate 0 get Outlen 0
+put Pstate 1 get Err 0
+for i ulong get Outlen 0
+put Probeout i get Outb i
+end
+check ok id
+for i ulong get Pstate 0
+put Outb i get Probeout i
+end
+put Outlen 0 get Pstate 0
+put Err 0 get Pstate 1
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn waitline lineid ulong to void
+outreset
+emitb 87
+emitb 65
+emitb 73
+emitb 84
+emitb 32
+emitb 49
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn readwire to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+waitline 1
+probecheck appreceive 1 7
+probecheck eq get R 1 1 8
+probecheck eq get T 13 1 9
+note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send.
+line 2 1
+probecheck not appreceive 2 10
+probecheck eq get Q 2 1 11
+probecheck eq get T 13 1 12
+probecheck apppoll 2 true 13
+readwire
+probecheck pkparse 14
+probecheck eq get N 0 4 15
+probecheck eq get N 2 1 16
+probecheck appsent 2 true 17
+probecheck eq get T 13 0 18
+line 2 1
+probecheck appreceive 3 19
+probecheck eq get A 2 1 20
+probecheck eq get R 1 0 21
+probecheck eq get T 13 2 22
+probecheck apppoll 3 true 23
+readwire
+probecheck pkparse 24
+probecheck eq get N 0 4 25
+probecheck eq get N 2 2 26
+probecheck appsent 3 true 27
+probecheck not apppoll 4 true 28
+note Replayed acknowledged LINE is treated as duplicate and gets its own GOT.
+waitline 1
+probecheck appreceive 4 29
+probecheck eq get T 13 1 30
+probecheck apppoll 4 true 31
+readwire
+probecheck pkparse 32
+probecheck eq get N 0 4 33
+probecheck eq get N 2 1 34
+probecheck appsent 4 true 35
+probecheck not apppoll 5 true 36
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.log
new file mode 100644
index 00000000..d5172bc2
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.log
@@ -0,0 +1,27 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 1
+10 1
+11 1
+12 1
+13 0
+14 0
+15 1
+16 1
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 1
+25 1
+26 0
+27 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.om
new file mode 100644
index 00000000..213f5ec9
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.om
@@ -0,0 +1,2959 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+fn probecheck ok bool id ulong to void
+check ok id
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+line 1 1
+probecheck appreceive 1 7
+probecheck eq get R 1 0 8
+line 2 1
+probecheck appreceive 2 9
+probecheck eq get A 2 4 10
+probecheck eq get Q 4 2 11
+probecheck eq get T 13 2 12
+probecheck apppoll 2 true 13
+probecheck eq get T 10 3 14
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+probecheck pkparse 15
+probecheck eq get N 0 4 16
+probecheck eq get N 2 2 17
+probecheck appsent 2 true 18
+probecheck eq get T 13 0 19
+probecheck not apppoll 3 true 20
+note Retry of the first accepted line is classified duplicate and then acknowledged.
+line 1 1
+probecheck appreceive 4 21
+probecheck eq get T 13 1 22
+probecheck apppoll 4 true 23
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+probecheck pkparse 24
+probecheck eq get N 0 4 25
+probecheck eq get N 2 1 26
+probecheck appsent 4 true 27
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.log
new file mode 100644
index 00000000..c66b5768
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.log
@@ -0,0 +1,27 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 1
+9 1
+10 1
+11 1
+12 1
+13 0
+14 0
+15 1
+16 1
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 1
+25 1
+26 0
+27 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.om
new file mode 100644
index 00000000..5d598edc
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.om
@@ -0,0 +1,2977 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+fn probecheck ok bool id ulong to void
+check ok id
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn waitline lineid ulong to void
+outreset
+emitb 87
+emitb 65
+emitb 73
+emitb 84
+emitb 32
+emitb 49
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+waitline 1
+probecheck appreceive 1 7
+probecheck eq get R 1 0 8
+line 2 1
+probecheck appreceive 2 9
+probecheck eq get A 2 1 10
+probecheck eq get Q 4 2 11
+probecheck eq get T 13 2 12
+probecheck apppoll 2 true 13
+probecheck eq get T 10 3 14
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+probecheck pkparse 15
+probecheck eq get N 0 4 16
+probecheck eq get N 2 2 17
+probecheck appsent 2 true 18
+probecheck eq get T 13 0 19
+probecheck not apppoll 3 true 20
+note Retry of the first accepted line is classified duplicate and then acknowledged.
+line 1 1
+probecheck appreceive 4 21
+probecheck eq get T 13 1 22
+probecheck apppoll 4 true 23
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+probecheck pkparse 24
+probecheck eq get N 0 4 25
+probecheck eq get N 2 1 26
+probecheck appsent 4 true 27
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/parent-probe.log b/evidence/allen-omega-L694/L734/independent-review/parent-probe.log
new file mode 100644
index 00000000..107e4801
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/parent-probe.log
@@ -0,0 +1,50 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
diff --git a/evidence/allen-omega-L694/L734/independent-review/parent-verification.md b/evidence/allen-omega-L694/L734/independent-review/parent-verification.md
new file mode 100644
index 00000000..ee3d2c79
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/parent-verification.md
@@ -0,0 +1,21 @@
+# Parent verification and disposition
+
+Reviewed exact8d0d11babf7cc3b57ee000a265aeda9fe531ebf0. The report has no
+substantive findings. All39 exported native files match the exact Git pin, with
+no membership changes. Reconstructed core and final probe concatenations match
+source+check.om+independent probe exactly. The reported application/probe binary
+SHA256 values match actual artifacts. Parent independently rebuilt the final
+probe byte-identically and replayed50/50 checks,exit0. Existing application
+rebuild182/182 and current combined native gate remain passing.
+
+Developmental probes are retained, not relabeled passing. Early probes assumed
+LINE could replace a pending GOT and used the wrong parsed GOT enum. The already
+published provider contract requires one-pending-GOT backpressure; final probes
+assert refusal/no mutation followed by successful retry. Enum3 is the declared
+GOT value. Another probe logger overwrote Outb; final helper preserves its bytes,
+length and error. Production source was unchanged across those probe revisions.
+
+Clears independent review only for L734 application binding, not for the new L740
+scene decoder. No socket/device/EFI/live model/physical iMac qualification.
+Original report hash:36ed362fa8693f24516659ef76808b78ea1ff8d42aa9921a5340917edb924ce1.
+Verified final probe ELF:e792b6ad96152cf123b2caa46ce46bf501e5c5f2d8f036cf078e1b0eb1a64c32.
diff --git a/evidence/allen-omega-L694/L734/independent-review/probes/L737-interleave.om b/evidence/allen-omega-L694/L734/independent-review/probes/L737-interleave.om
new file mode 100644
index 00000000..a2f15a49
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/probes/L737-interleave.om
@@ -0,0 +1,143 @@
+note Independent L737 application event-interleaving probe. Seeded Omega only.
+global Probeout uchar 8192
+global Pstate ulong 2
+fn probecheck ok bool id ulong to void
+put Pstate 0 get Outlen 0
+put Pstate 1 get Err 0
+for i ulong get Outlen 0
+put Probeout i get Outb i
+end
+check ok id
+for i ulong get Pstate 0
+put Outb i get Probeout i
+end
+put Outlen 0 get Pstate 0
+put Err 0 get Pstate 1
+end
+fn line lineid ulong conv ulong to void
+outreset
+emitb 83
+emitb 65
+emitb 89
+emitb 32
+emitn conv
+emitb 32
+emitb 49
+emitb 47
+emitb 49
+emitb 32
+emitb 111
+emitb 107
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn waitline lineid ulong to void
+outreset
+emitb 87
+emitb 65
+emitb 73
+emitb 84
+emitb 32
+emitb 49
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+b = packet 2 get Q 1 lineid 0 0
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt to void
+put Inlen 0 5
+put In 0 104
+put In 1 101
+put In 2 108
+put In 3 108
+put In 4 111
+end
+fn readwire to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn main to int
+probecheck appinit 77 0 1
+prompt
+probecheck appask 0 2
+probecheck apppoll 0 true 3
+probecheck appsent 0 true 4
+probecheck apppoll 0 true 5
+probecheck appsent 0 true 6
+waitline 1
+probecheck appreceive 1 7
+probecheck eq get R 1 1 8
+probecheck eq get T 13 1 9
+note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send.
+line 2 1
+probecheck not appreceive 2 10
+probecheck eq get Q 2 1 11
+probecheck eq get T 13 1 12
+probecheck apppoll 2 true 13
+readwire
+probecheck pkparse 14
+probecheck eq get N 0 3 15
+probecheck eq get N 2 1 16
+probecheck appsent 2 true 17
+probecheck eq get T 13 0 18
+line 2 1
+probecheck appreceive 3 19
+probecheck eq get A 2 1 20
+probecheck eq get R 1 0 21
+probecheck eq get T 13 2 22
+probecheck apppoll 3 true 23
+readwire
+probecheck pkparse 24
+probecheck eq get N 0 3 25
+probecheck eq get N 2 2 26
+probecheck appsent 3 true 27
+probecheck not apppoll 4 true 28
+note Replayed acknowledged LINE is treated as duplicate and gets its own GOT.
+waitline 1
+probecheck appreceive 4 29
+probecheck eq get T 13 1 30
+probecheck apppoll 4 true 31
+readwire
+probecheck pkparse 32
+probecheck eq get N 0 3 33
+probecheck eq get N 2 1 34
+probecheck appsent 4 true 35
+probecheck not apppoll 5 true 36
+note Cancellation discards the offered JOB but wire and conversation counters persist.
+prompt
+probecheck appask 5 37
+probecheck apppoll 5 true 38
+probecheck eq get T 10 1 39
+appcancel
+probecheck eq get T 5 0 40
+probecheck not appsent 5 true 41
+probecheck eq get Q 1 2 42
+probecheck eq get R 0 2 43
+prompt
+probecheck appask 6 44
+probecheck eq get Q 1 3 45
+probecheck eq get R 0 3 46
+appcancel
+old = get R 9
+put Q 1 4294967295
+prompt
+probecheck not appask 7 47
+probecheck eq get R 0 3 48
+probecheck eq get R 9 old 49
+probecheck eq get Q 1 4294967295 50
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/independent-review/report.md b/evidence/allen-omega-L694/L734/independent-review/report.md
new file mode 100644
index 00000000..46e6e71a
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/report.md
@@ -0,0 +1,29 @@
+# L737 independent review — L734 native Omega application binding
+
+## Verdict
+
+**No substantive findings** in the reviewed native application/runtime/courier integration at `8d0d11babf7cc3b57ee000a265aeda9fe531ebf0` (base `0db871fdc1fabefa99012cbd3f6e8cd83fdfcf2e`). Scope is the host-executed, transport-independent Omega core only. This does not qualify a socket/provider binding, live service, iMac, EFI/device path, or full Allen replacement.
+
+## Source and compiler receipts
+
+- Fresh `git archive` export: `~/handoffs/L737-review/source`; all 39 files under `native/omega/allen` matched the exact pinned Git tree byte-for-byte; no missing or extra files. Manifest: `source-closure.sha256`.
+- Application source SHA-256: `68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe`.
+- Parent application-test SHA-256: `f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f`.
+- Pinned compiler SHA-256: `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`.
+- Both freshly built test artifacts passed `build-one.sh` checks for nonempty static AArch64 `EXEC`; `readelf` showed no dynamic section for the independent probe.
+
+## Executed results
+
+1. Rebuilt and ran exact-source `tests/application.om`: **exit 0; 182/182 checks passed**. ELF SHA-256 `ba8dd2746d9612599cc96b2d98c0b2e70a9230bfa0dbb3ec003fd08bdd756fec`; log `build/app-baseline.log`.
+2. Authored and ran `probes/L737-interleave.om` (Omega only): **exit 0; 50/50 checks passed**. Binary SHA-256 `e792b6ad96152cf123b2caa46ce46bf501e5c5f2d8f036cf078e1b0eb1a64c32`; log `build/probe-final-50/probe.log`.
+
+The independent probe exercised a received WAIT followed by a distinct LINE while its GOT was pending, verified transport backpressure leaves the first receipt pending, retried the LINE after GOT send, decoded the resulting GOT sequence, replayed an acknowledged LINE and verified duplicate receipt, cancelled an offered JOB and confirmed both counters were retained, then forced wire-ID exhaustion and checked request ID/transcript count remained unchanged. All expected state/output assertions passed.
+
+## Files
+
+- `report.md` — this review.
+- `source/` and `source-closure.sha256` — exact source export and per-file closure manifest.
+- `probes/L737-interleave.om` — independent Omega probe source.
+- `build/` — assembled Omega inputs, logs and native artifacts, including the application rebuild and successful 50-check probe.
+
+No production or compiler files were modified. No whole Allen suite, socket, service, agent, hardware or deployment work was run.
diff --git a/evidence/allen-omega-L694/L734/independent-review/source-closure.sha256 b/evidence/allen-omega-L694/L734/independent-review/source-closure.sha256
new file mode 100644
index 00000000..5fbe917e
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/independent-review/source-closure.sha256
@@ -0,0 +1,39 @@
+68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+87024b3e838ab15860991cdf5f70cfa4ad2b63ec2b9b843cb2da0276143fcf5f native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+ba47aedd0244c5229f8543aad7fd5120631c6f4cf502fde038ca27e7659cecec native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L734/intent.log b/evidence/allen-omega-L694/L734/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L734/keepalive-mutant.log b/evidence/allen-omega-L694/L734/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L734/late-code/README.md b/evidence/allen-omega-L694/L734/late-code/README.md
new file mode 100644
index 00000000..51b12d27
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/README.md
@@ -0,0 +1,17 @@
+# Late CODE completion correction
+
+Follow-on to initial application milestone b4852db, before independent review.
+A late CODE and final SAY can arrive on the original wire job after the first
+missing-code response queues AGAIN, but before that retry is submitted. The
+original code retained the queued retry after successful completion, causing an
+unnecessary new wire job. New native regression:182 assertions,3 failures,
+exit3 (`latecode-red`), preserving the original source and output.
+
+The successful-completion branch now clears queued recovery bytes. The unchanged
+regression passes182/182 within the complete fresh native suite. `counts.json`
+and `final.log` are the final source verdict:1274 checks pass,9 compiled mutants
+rejected, original stdio/memory goldens and overflow refusal pass. This supersedes
+the initial1253-check source qualification for the changed application file; the
+initial receipts are preserved, not rewritten. Source inventory was checked
+against actual bytes immediately before commit. Independent review pending;
+transport, device, x86 and iMac qualification remain open.
diff --git a/evidence/allen-omega-L694/L734/late-code/ackstop-mutant.log b/evidence/allen-omega-L694/L734/late-code/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L734/late-code/appcode-mutant.log b/evidence/allen-omega-L694/L734/late-code/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L734/late-code/application.log b/evidence/allen-omega-L694/L734/late-code/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L734/late-code/binaries.sha256 b/evidence/allen-omega-L694/L734/late-code/binaries.sha256
new file mode 100644
index 00000000..db656bad
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/binaries.sha256
@@ -0,0 +1,26 @@
+e5d3907955e236707da8e5b8ed6e34165143caa831f047e2024cba0314a806f4 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/scheduler
+ebcf9ea3694e69d069456900d2250c283989fa3525e32b636d57bbeb26dfbb43 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/readback-mutant
+878923c2258017161625eb83188b275ca2517e3412916835e68ec1d24e7e570d /home/drakestapleton/handoffs/allen-omega-L694/L734/final/view
+c13da7dfc5871d35aa1eab052bf2f7218337ca159b4a8d2ab4701521022b6a03 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/allen
+4fb0d8e1b3cc37f828c0cd0f72ac8bab84feed81e0ab767547ae46c273aa0383 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/reply
+9b83444c081a485681f61a161aa280fb68d1e635f25adac62cc8892123c3cfc9 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/ackstop-mutant
+08040e2787db231623521f3c4084c88a1e0c934564c81ce2b661b67153d5a293 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/hash-mutant
+c7798bf8dbbbc479a2547d8d0449aff9707cedb543f08f0870992ecf6a95c7d0 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/golden
+16037d607f5ca2278972b7b0c07b5568989a7d19c4f82a84bd8ec65c3ef6322a /home/drakestapleton/handoffs/allen-omega-L694/L734/final/session-mutant
+3f8b6e5302e5f165f73abe2e489082216a8c0a72ec569792c3665355952ba061 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/intent
+a7fad3f6ed5ab1c8ff8f023c3d6d54d30da029477b3ca7a0b16c107f5fe72a04 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/fixture
+b723f84c3dbe8691b3b1c900586870dfad91cae6020fccb992a7327828687a2c /home/drakestapleton/handoffs/allen-omega-L694/L734/final/runtime
+e70b23633a58acf37ef50a12ddd0ca0bd70d2f7744573cdd3c3ba98c1f99becc /home/drakestapleton/handoffs/allen-omega-L694/L734/final/code
+a9c6e5f82217cff365eae1e121b6414be7d9a52b0202458702f6fda34fe49444 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/edges
+5968019310f93974d7ebf26b7b817708fa02058f2b3ea9983560498f96a3fd59 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/appcode-mutant
+0ac520c7e2763254d02111b995d23541ea9bc355cecadf2814cce814ee1ff51d /home/drakestapleton/handoffs/allen-omega-L694/L734/final/render
+97b4555c4ac9ad831dea927b3833e0be141f995c424ebf452c9859b176755403 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/stale-mutant
+0c40d9d2b4e0329b54c616ca16d70c3c66fe286b5d7494686e96f6d1fe0cfccd /home/drakestapleton/handoffs/allen-omega-L694/L734/final/courier
+b8e4f1a6991cefa6b637a946dd389d7c92245331f89233df02d64d72c3965439 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/scene
+db290f2f155c6fcb9f621784b05a4689e3a699e9a45d92dbc510267bb78500d3 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/pendingwire-mutant
+0eee44c73c1dbc196f9a3b8b5242029dbaf99f1585cd4b2a19e35678b60320de /home/drakestapleton/handoffs/allen-omega-L694/L734/final/paint
+2ac6c3c5a460a9986ba711e034827d2416ea0c81ef8704a0f50a92bdcf44814d /home/drakestapleton/handoffs/allen-omega-L694/L734/final/crc-mutant
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/stdio-overflow-input
+7c96e2826e75ab48fa2f82be4440f7730bc1b6c439731749e8d641ea901abd57 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/keepalive-mutant
+f740bf09552e214294af7aeadfea9a447869b2318aab28383b64a3b2635eeefa /home/drakestapleton/handoffs/allen-omega-L694/L734/final/memory
+ba8dd2746d9612599cc96b2d98c0b2e70a9230bfa0dbb3ec003fd08bdd756fec /home/drakestapleton/handoffs/allen-omega-L694/L734/final/application
diff --git a/evidence/allen-omega-L694/L734/late-code/code.log b/evidence/allen-omega-L694/L734/late-code/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L734/late-code/counts.json b/evidence/allen-omega-L694/L734/late-code/counts.json
new file mode 100644
index 00000000..06b62209
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/counts.json
@@ -0,0 +1,20 @@
+{
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "memory": 79,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292
+ },
+ "total": 1274,
+ "compiled_mutants_rejected": 9
+}
diff --git a/evidence/allen-omega-L694/L734/late-code/courier.log b/evidence/allen-omega-L694/L734/late-code/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L734/late-code/crc-mutant.log b/evidence/allen-omega-L694/L734/late-code/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L734/late-code/edges.log b/evidence/allen-omega-L694/L734/late-code/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L734/late-code/final.exit b/evidence/allen-omega-L694/L734/late-code/final.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/final.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L734/late-code/final.log b/evidence/allen-omega-L694/L734/late-code/final.log
new file mode 100644
index 00000000..6e989ecf
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/final.log
@@ -0,0 +1,27 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L734/late-code/hash-mutant.log b/evidence/allen-omega-L694/L734/late-code/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L734/late-code/intent.log b/evidence/allen-omega-L694/L734/late-code/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L734/late-code/keepalive-mutant.log b/evidence/allen-omega-L694/L734/late-code/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L734/late-code/latecode-red.exit b/evidence/allen-omega-L694/L734/late-code/latecode-red.exit
new file mode 100644
index 00000000..00750edc
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/latecode-red.exit
@@ -0,0 +1 @@
+3
diff --git a/evidence/allen-omega-L694/L734/late-code/latecode-red.log b/evidence/allen-omega-L694/L734/late-code/latecode-red.log
new file mode 100644
index 00000000..02252442
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/latecode-red.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 1
+179 0
+180 0
+181 1
+182 1
diff --git a/evidence/allen-omega-L694/L734/late-code/latecode-red.om b/evidence/allen-omega-L694/L734/late-code/latecode-red.om
new file mode 100644
index 00000000..bf792141
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/latecode-red.om
@@ -0,0 +1,3223 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note End-to-end application core over real Omega protocol bytes; no socket simulation claim.
+text Smallask "hello"
+text Codeaskt "Please make me a calculator"
+text Finaltxt " 1/1 Model answer."
+text Codetxt " 1/1 9 3ce11e06 python print(1)\\n"
+text Prefixes "SAY WAIT CODE "
+text Againexp "AGAIN 2"
+global SavedOut uchar 8192
+global Heldwire uchar 8192
+global Heldlen ulong 2
+fn holdwire to void
+put Heldlen 0 get Outlen 0
+put Heldlen 1 get Err 0
+for i ulong get Outlen 0
+put Heldwire i get Outb i
+end
+end
+fn unhold to void
+for i ulong get Heldlen 0
+put Outb i get Heldwire i
+end
+put Outlen 0 get Heldlen 0
+put Err 0 get Heldlen 1
+end
+fn samewire to bool
+if ne get Outlen 0 get Heldlen 0
+ret false
+end
+for i ulong get Heldlen 0
+if ne get Outb i get Heldwire i
+ret false
+end
+end
+ret eq get Err 0 get Heldlen 1
+end
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt code bool to void
+if code
+put Inlen 0 len Codeaskt
+for i ulong len Codeaskt
+put In i get Codeaskt i
+end
+else
+put Inlen 0 len Smallask
+for i ulong len Smallask
+put In i get Smallask i
+end
+end
+end
+fn incoming part ulong seq ulong kind ulong to void
+outreset
+off = ulong 0
+size = ulong 4
+if eq kind 1
+off = ulong 4
+size = ulong 5
+end
+if eq kind 2
+off = ulong 9
+size = ulong 5
+end
+for i ulong size
+emitb get Prefixes add off i
+end
+emitn seq
+if eq kind 0
+for i ulong len Finaltxt
+emitb get Finaltxt i
+end
+end
+if eq kind 2
+for i ulong len Codetxt
+emitb get Codetxt i
+end
+end
+copyout
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test not appinit 0 100
+test appinit 42 100
+test not appinit 43 100
+test eq get Q 0 42
+prompt false
+test appask 100
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+test eq get R 1 1
+test eq get A 2 0
+prompt false
+test not appask 101
+test eq get R 9 1
+test apppoll 100 true
+test eq get T 10 5
+test appsent 100 true
+test apppoll 100 true
+test eq get T 10 1
+copyout
+test pkparse
+test eq get N 1 1
+test eq get In get N 5 74
+test appsent 100 true
+incoming 1 1 0
+test appreceive 101
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 8 13
+test eq get R 9 2
+test eq get Answer 0 77
+prompt true
+test not appask 102
+test eq get R 0 1
+test apppoll 102 true
+test eq get T 10 3
+test appsent 102 true
+note Code acknowledgement is visible immediately, but missing code requests AGAIN.
+prompt true
+test appask 103
+test eq get R 0 2
+test eq get Q 1 2
+test eq get R 2 2
+test eq get A 2 1
+test eq get R 8 len Ack
+test apppoll 103 true
+test appsent 103 false
+test apppoll 104 true
+test eq get T 10 1
+test appsent 104 true
+incoming 1 2 0
+test appreceive 105
+test eq get A 2 2
+test eq get A 1 len Againexp
+test eq get R 1 1
+test eq get R 13 1
+test apppoll 105 true
+test eq get T 10 3
+test eq get Q 1 2
+test appsent 105 true
+test apppoll 106 true
+test eq get T 10 1
+test eq get Q 1 3
+test eq get R 0 2
+copyout
+test pkparse
+test eq get N 6 len Againexp
+bad = ulong 0
+for i ulong len Againexp
+if ne get In add get N 5 i get Againexp i
+bad = add bad 1
+end
+end
+test eq bad 0
+test appsent 106 true
+incoming 1 2 0
+test appreceive 107
+test eq get A 2 3
+test eq get R 1 0
+test eq get A 1 0
+note Reset cancels pending delivery without reusing either counter.
+appreset
+test eq get R 0 2
+test eq get Q 1 3
+test eq get R 9 0
+prompt false
+test appask 108
+test eq get R 0 3
+test eq get Q 1 4
+test apppoll 108 true
+test appsent 108 true
+note Old CODE must not mutate the code buffer during a newer chat job.
+incoming 1 2 2
+test appreceive 109
+test eq get A 2 4
+test eq get C 1 0
+test eq get C 2 0
+test eq get Code 0 0
+test apppoll 109 true
+test appsent 109 true
+incoming 2 2 0
+test appreceive 109
+test eq get A 2 4
+test eq get R 1 1
+test eq get R 8 0
+test apppoll 109 true
+test appsent 109 true
+incoming 3 3 0
+test appreceive 110
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 9 2
+test apppoll 110 true
+test appsent 110 true
+note Cancellation drops an outstanding send and stale response safely.
+prompt false
+test appask 111
+test apppoll 111 true
+appcancel
+test eq get R 1 0
+test eq get T 5 0
+test not appsent 111 true
+incoming 1 4 0
+test not appreceive 112
+note Complete CODE bytes must arrive before a code response becomes visible.
+prompt true
+test appask 113
+test eq get R 0 5
+test eq get Q 1 6
+test apppoll 113 true
+test appsent 113 true
+incoming 1 5 2
+test appreceive 114
+test eq get A 2 0
+test eq codestat 2
+test eq get R 6 0
+test apppoll 114 true
+test appsent 114 true
+incoming 2 5 0
+test appreceive 115
+test eq get A 2 1
+test eq get R 6 1
+test eq get R 1 0
+test eq get Code 6 49
+test apppoll 115 true
+test appsent 115 true
+note WAIT updates silence deadline, no answer; slow and timeout cancel both layers.
+prompt false
+test appask 116
+test eq get R 0 6
+test apppoll 116 true
+test appsent 116 true
+incoming 1 6 1
+test appreceive 117
+test eq get A 2 0
+test eq get R 4 117
+test apppoll 117 true
+test appsent 117 true
+v = apppoll 20116 true
+test eq get A 2 5
+test eq get R 1 1
+if v
+test appsent 20116 true
+end
+v = apppoll 30116 true
+test eq get R 1 1
+if v
+test appsent 30116 true
+end
+v = apppoll 30117 true
+test eq get A 2 6
+test eq get R 1 0
+test eq get T 5 0
+test eq get A 1 0
+if v
+test appsent 30117 true
+end
+n = get R 9
+prompt false
+test not appask 30116
+test eq get R 9 n
+test not apppoll 30116 true
+note Invalid prompt never becomes a pending job or transcript line.
+put Inlen 0 160
+test not appask 30118
+test eq get R 9 n
+test eq get R 0 6
+test eq get Q 1 7
+note Receiving a code completion before send-result reporting cannot replace
+note the pending datagram with the newly generated AGAIN text.
+prompt true
+test appask 30118
+test apppoll 30118 true
+test eq get T 10 1
+holdwire
+incoming 1 7 0
+unhold
+test appreceive 30119
+test eq get A 2 2
+test samewire
+test eq get T 10 1
+test appsent 30119 true
+test apppoll 30120 true
+test eq get T 10 3
+test appsent 30120 true
+test apppoll 30121 true
+test eq get Q 1 9
+test eq get R 0 7
+test appsent 30121 true
+appcancel
+note Idle runtime still refuses a new prompt while a HELLO send is outstanding.
+test apppoll 32122 true
+test eq get T 10 5
+holdwire
+n = get R 9
+prompt false
+test not appask 32122
+test samewire
+test eq get R 9 n
+test appsent 32122 true
+note Late CODE may complete the original job before queued AGAIN is sent.
+prompt true
+test appask 32123
+test eq get R 0 8
+test eq get Q 1 10
+test apppoll 32123 true
+test appsent 32123 true
+incoming 1 8 0
+test appreceive 32124
+test gt get A 1 0
+test apppoll 32124 true
+test appsent 32124 true
+incoming 2 8 2
+test appreceive 32125
+test eq codestat 2
+test apppoll 32125 true
+test appsent 32125 true
+incoming 3 8 0
+test appreceive 32126
+test eq get A 2 1
+test eq get R 1 0
+test eq get A 1 0
+test apppoll 32126 true
+test appsent 32126 true
+test not apppoll 32127 true
+test eq get Q 1 10
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/late-code/long.log b/evidence/allen-omega-L694/L734/late-code/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L734/late-code/memory.log b/evidence/allen-omega-L694/L734/late-code/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L734/late-code/paint.log b/evidence/allen-omega-L694/L734/late-code/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L734/late-code/pendingwire-mutant.log b/evidence/allen-omega-L694/L734/late-code/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L734/late-code/readback-mutant.log b/evidence/allen-omega-L694/L734/late-code/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L734/late-code/reply.log b/evidence/allen-omega-L694/L734/late-code/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L734/late-code/runtime.log b/evidence/allen-omega-L694/L734/late-code/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L734/late-code/scene.log b/evidence/allen-omega-L694/L734/late-code/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L734/late-code/scheduler.log b/evidence/allen-omega-L694/L734/late-code/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L734/late-code/session-mutant.log b/evidence/allen-omega-L694/L734/late-code/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L734/late-code/short.log b/evidence/allen-omega-L694/L734/late-code/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L734/late-code/source.sha256 b/evidence/allen-omega-L694/L734/late-code/source.sha256
new file mode 100644
index 00000000..5fbe917e
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/source.sha256
@@ -0,0 +1,39 @@
+68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+87024b3e838ab15860991cdf5f70cfa4ad2b63ec2b9b843cb2da0276143fcf5f native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+ba47aedd0244c5229f8543aad7fd5120631c6f4cf502fde038ca27e7659cecec native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L734/late-code/stale-mutant.log b/evidence/allen-omega-L694/L734/late-code/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L734/late-code/view.log b/evidence/allen-omega-L694/L734/late-code/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/late-code/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L734/long.log b/evidence/allen-omega-L694/L734/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L734/memory.log b/evidence/allen-omega-L694/L734/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L734/paint.log b/evidence/allen-omega-L694/L734/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L734/pending-green.exit b/evidence/allen-omega-L694/L734/pending-green.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/pending-green.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L734/pending-green.log b/evidence/allen-omega-L694/L734/pending-green.log
new file mode 100644
index 00000000..9ec18f20
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/pending-green.log
@@ -0,0 +1,154 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
diff --git a/evidence/allen-omega-L694/L734/pending-red.exit b/evidence/allen-omega-L694/L734/pending-red.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/pending-red.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L734/pending-red.log b/evidence/allen-omega-L694/L734/pending-red.log
new file mode 100644
index 00000000..6db2fa74
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/pending-red.log
@@ -0,0 +1,154 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 1
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
diff --git a/evidence/allen-omega-L694/L734/pending-red.om b/evidence/allen-omega-L694/L734/pending-red.om
new file mode 100644
index 00000000..f5a6c061
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/pending-red.om
@@ -0,0 +1,3167 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note End-to-end application core over real Omega protocol bytes; no socket simulation claim.
+text Smallask "hello"
+text Codeaskt "Please make me a calculator"
+text Finaltxt " 1/1 Model answer."
+text Codetxt " 1/1 9 3ce11e06 python print(1)\\n"
+text Prefixes "SAY WAIT CODE "
+text Againexp "AGAIN 2"
+global SavedOut uchar 8192
+global Heldwire uchar 8192
+global Heldlen ulong 2
+fn holdwire to void
+put Heldlen 0 get Outlen 0
+put Heldlen 1 get Err 0
+for i ulong get Outlen 0
+put Heldwire i get Outb i
+end
+end
+fn unhold to void
+for i ulong get Heldlen 0
+put Outb i get Heldwire i
+end
+put Outlen 0 get Heldlen 0
+put Err 0 get Heldlen 1
+end
+fn samewire to bool
+if ne get Outlen 0 get Heldlen 0
+ret false
+end
+for i ulong get Heldlen 0
+if ne get Outb i get Heldwire i
+ret false
+end
+end
+ret eq get Err 0 get Heldlen 1
+end
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt code bool to void
+if code
+put Inlen 0 len Codeaskt
+for i ulong len Codeaskt
+put In i get Codeaskt i
+end
+else
+put Inlen 0 len Smallask
+for i ulong len Smallask
+put In i get Smallask i
+end
+end
+end
+fn incoming part ulong seq ulong kind ulong to void
+outreset
+off = ulong 0
+size = ulong 4
+if eq kind 1
+off = ulong 4
+size = ulong 5
+end
+if eq kind 2
+off = ulong 9
+size = ulong 5
+end
+for i ulong size
+emitb get Prefixes add off i
+end
+emitn seq
+if eq kind 0
+for i ulong len Finaltxt
+emitb get Finaltxt i
+end
+end
+if eq kind 2
+for i ulong len Codetxt
+emitb get Codetxt i
+end
+end
+copyout
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test not appinit 0 100
+test appinit 42 100
+test not appinit 43 100
+test eq get Q 0 42
+prompt false
+test appask 100
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+test eq get R 1 1
+test eq get A 2 0
+prompt false
+test not appask 101
+test eq get R 9 1
+test apppoll 100 true
+test eq get T 10 5
+test appsent 100 true
+test apppoll 100 true
+test eq get T 10 1
+copyout
+test pkparse
+test eq get N 1 1
+test eq get In get N 5 74
+test appsent 100 true
+incoming 1 1 0
+test appreceive 101
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 8 13
+test eq get R 9 2
+test eq get Answer 0 77
+prompt true
+test not appask 102
+test eq get R 0 1
+test apppoll 102 true
+test eq get T 10 3
+test appsent 102 true
+note Code acknowledgement is visible immediately, but missing code requests AGAIN.
+prompt true
+test appask 103
+test eq get R 0 2
+test eq get Q 1 2
+test eq get R 2 2
+test eq get A 2 1
+test eq get R 8 len Ack
+test apppoll 103 true
+test appsent 103 false
+test apppoll 104 true
+test eq get T 10 1
+test appsent 104 true
+incoming 1 2 0
+test appreceive 105
+test eq get A 2 2
+test eq get A 1 len Againexp
+test eq get R 1 1
+test eq get R 13 1
+test apppoll 105 true
+test eq get T 10 3
+test eq get Q 1 2
+test appsent 105 true
+test apppoll 106 true
+test eq get T 10 1
+test eq get Q 1 3
+test eq get R 0 2
+copyout
+test pkparse
+test eq get N 6 len Againexp
+bad = ulong 0
+for i ulong len Againexp
+if ne get In add get N 5 i get Againexp i
+bad = add bad 1
+end
+end
+test eq bad 0
+test appsent 106 true
+incoming 1 2 0
+test appreceive 107
+test eq get A 2 3
+test eq get R 1 0
+test eq get A 1 0
+note Reset cancels pending delivery without reusing either counter.
+appreset
+test eq get R 0 2
+test eq get Q 1 3
+test eq get R 9 0
+prompt false
+test appask 108
+test eq get R 0 3
+test eq get Q 1 4
+test apppoll 108 true
+test appsent 108 true
+incoming 1 2 0
+test appreceive 109
+test eq get A 2 4
+test eq get R 1 1
+test eq get R 8 0
+test apppoll 109 true
+test appsent 109 true
+incoming 2 3 0
+test appreceive 110
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 9 2
+test apppoll 110 true
+test appsent 110 true
+note Cancellation drops an outstanding send and stale response safely.
+prompt false
+test appask 111
+test apppoll 111 true
+appcancel
+test eq get R 1 0
+test eq get T 5 0
+test not appsent 111 true
+incoming 1 4 0
+test not appreceive 112
+note Complete CODE bytes must arrive before a code response becomes visible.
+prompt true
+test appask 113
+test eq get R 0 5
+test eq get Q 1 6
+test apppoll 113 true
+test appsent 113 true
+incoming 1 5 2
+test appreceive 114
+test eq get A 2 0
+test eq codestat 2
+test eq get R 6 0
+test apppoll 114 true
+test appsent 114 true
+incoming 2 5 0
+test appreceive 115
+test eq get A 2 1
+test eq get R 6 1
+test eq get R 1 0
+test eq get Code 6 49
+test apppoll 115 true
+test appsent 115 true
+note WAIT updates silence deadline, no answer; slow and timeout cancel both layers.
+prompt false
+test appask 116
+test eq get R 0 6
+test apppoll 116 true
+test appsent 116 true
+incoming 1 6 1
+test appreceive 117
+test eq get A 2 0
+test eq get R 4 117
+test apppoll 117 true
+test appsent 117 true
+v = apppoll 20116 true
+test eq get A 2 5
+test eq get R 1 1
+if v
+test appsent 20116 true
+end
+v = apppoll 30116 true
+test eq get R 1 1
+if v
+test appsent 30116 true
+end
+v = apppoll 30117 true
+test eq get A 2 6
+test eq get R 1 0
+test eq get T 5 0
+test eq get A 1 0
+if v
+test appsent 30117 true
+end
+n = get R 9
+prompt false
+test not appask 30116
+test eq get R 9 n
+test not apppoll 30116 true
+note Invalid prompt never becomes a pending job or transcript line.
+put Inlen 0 160
+test not appask 30118
+test eq get R 9 n
+test eq get R 0 6
+test eq get Q 1 7
+note Receiving a code completion before send-result reporting cannot replace
+note the pending datagram with the newly generated AGAIN text.
+prompt true
+test appask 30118
+test apppoll 30118 true
+test eq get T 10 1
+holdwire
+incoming 1 7 0
+unhold
+test appreceive 30119
+test eq get A 2 2
+test samewire
+test eq get T 10 1
+test appsent 30119 true
+test apppoll 30120 true
+test eq get T 10 3
+test appsent 30120 true
+test apppoll 30121 true
+test eq get Q 1 9
+test eq get R 0 7
+test appsent 30121 true
+appcancel
+note Idle runtime still refuses a new prompt while a HELLO send is outstanding.
+test apppoll 32122 true
+test eq get T 10 5
+holdwire
+n = get R 9
+prompt false
+test not appask 32122
+test samewire
+test eq get R 9 n
+test appsent 32122 true
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/pendingwire-mutant.log b/evidence/allen-omega-L694/L734/pendingwire-mutant.log
new file mode 100644
index 00000000..09c53f20
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/pendingwire-mutant.log
@@ -0,0 +1,161 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
diff --git a/evidence/allen-omega-L694/L734/readback-mutant.log b/evidence/allen-omega-L694/L734/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L734/red.om b/evidence/allen-omega-L694/L734/red.om
new file mode 100644
index 00000000..f481e6e5
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/red.om
@@ -0,0 +1,2921 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Compilable behavioral RED stub only; not product implementation.
+global A ulong 4
+global Appjob uchar 4096
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+ret false
+end
+fn appask now ulong to bool
+ret false
+end
+fn apppoll now ulong link bool to bool
+ret false
+end
+fn appsent now ulong ok bool to bool
+ret false
+end
+fn appreceive now ulong to bool
+ret false
+end
+fn appcancel to void
+end
+fn appreset to void
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note End-to-end application core over real Omega protocol bytes; no socket simulation claim.
+text Smallask "hello"
+text Codeasktest "Please make me a calculator"
+text Finalwords " 1/1 Model answer."
+text Codewords " 1/1 9 3ce11e06 python print(1)\\n"
+text Prefixes "SAY WAIT CODE "
+text Againexpected "AGAIN 2"
+global SavedOut uchar 8192
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt code bool to void
+if code
+put Inlen 0 len Codeasktest
+for i ulong len Codeasktest
+put In i get Codeasktest i
+end
+else
+put Inlen 0 len Smallask
+for i ulong len Smallask
+put In i get Smallask i
+end
+end
+end
+fn incoming part ulong seq ulong kind ulong to void
+outreset
+off = ulong 0
+size = ulong 4
+if eq kind 1
+off = ulong 4
+size = ulong 5
+end
+if eq kind 2
+off = ulong 9
+size = ulong 5
+end
+for i ulong size
+emitb get Prefixes add off i
+end
+emitn seq
+if eq kind 0
+for i ulong len Finalwords
+emitb get Finalwords i
+end
+end
+if eq kind 2
+for i ulong len Codewords
+emitb get Codewords i
+end
+end
+copyout
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test not appinit 0 100
+test appinit 42 100
+test not appinit 43 100
+test eq get Q 0 42
+prompt false
+test appask 100
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+test eq get R 1 1
+test eq get A 2 0
+prompt false
+test not appask 101
+test eq get R 9 1
+test apppoll 100 true
+test eq get T 10 5
+test appsent 100 true
+test apppoll 100 true
+test eq get T 10 1
+copyout
+test pkparse
+test eq get N 1 1
+test eq get In get N 5 74
+test appsent 100 true
+incoming 1 1 0
+test appreceive 101
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 8 13
+test eq get R 9 2
+test eq get Answer 0 77
+prompt true
+test not appask 102
+test eq get R 0 1
+test apppoll 102 true
+test eq get T 10 3
+test appsent 102 true
+note Code acknowledgement is visible immediately, but missing code requests AGAIN.
+prompt true
+test appask 103
+test eq get R 0 2
+test eq get Q 1 2
+test eq get R 2 2
+test eq get A 2 1
+test eq get R 8 len Ack
+test apppoll 103 true
+test appsent 103 false
+test apppoll 104 true
+test eq get T 10 1
+test appsent 104 true
+incoming 1 2 0
+test appreceive 105
+test eq get A 2 2
+test eq get A 1 len Againexpected
+test eq get R 1 1
+test eq get R 13 1
+test apppoll 105 true
+test eq get T 10 3
+test eq get Q 1 2
+test appsent 105 true
+test apppoll 106 true
+test eq get T 10 1
+test eq get Q 1 3
+test eq get R 0 2
+copyout
+test pkparse
+test eq get N 6 len Againexpected
+bad = ulong 0
+for i ulong len Againexpected
+if ne get In add get N 5 i get Againexpected i
+bad = add bad 1
+end
+end
+test eq bad 0
+test appsent 106 true
+incoming 1 2 0
+test appreceive 107
+test eq get A 2 3
+test eq get R 1 0
+test eq get A 1 0
+note Reset cancels pending delivery without reusing either counter.
+appreset
+test eq get R 0 2
+test eq get Q 1 3
+test eq get R 9 0
+prompt false
+test appask 108
+test eq get R 0 3
+test eq get Q 1 4
+test apppoll 108 true
+test appsent 108 true
+incoming 1 2 0
+test appreceive 109
+test eq get A 2 4
+test eq get R 1 1
+test eq get R 8 0
+test apppoll 109 true
+test appsent 109 true
+incoming 2 3 0
+test appreceive 110
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 9 2
+test apppoll 110 true
+test appsent 110 true
+note Cancellation drops an outstanding send and stale response safely.
+prompt false
+test appask 111
+test apppoll 111 true
+appcancel
+test eq get R 1 0
+test eq get T 5 0
+test not appsent 111 true
+incoming 1 4 0
+test not appreceive 112
+note Complete CODE bytes must arrive before a code response becomes visible.
+prompt true
+test appask 113
+test eq get R 0 5
+test eq get Q 1 6
+test apppoll 113 true
+test appsent 113 true
+incoming 1 5 2
+test appreceive 114
+test eq get A 2 0
+test eq codestat 2
+test eq get R 6 0
+test apppoll 114 true
+test appsent 114 true
+incoming 2 5 0
+test appreceive 115
+test eq get A 2 1
+test eq get R 6 1
+test eq get R 1 0
+test eq get Code 6 49
+test apppoll 115 true
+test appsent 115 true
+note WAIT updates silence deadline, no answer; slow and timeout cancel both layers.
+prompt false
+test appask 116
+test eq get R 0 6
+test apppoll 116 true
+test appsent 116 true
+incoming 1 6 1
+test appreceive 117
+test eq get A 2 0
+test eq get R 4 117
+test apppoll 117 true
+test appsent 117 true
+v = apppoll 20116 true
+test eq get A 2 5
+test eq get R 1 1
+if v
+test appsent 20116 true
+end
+v = apppoll 30116 true
+test eq get R 1 1
+if v
+test appsent 30116 true
+end
+v = apppoll 30117 true
+test eq get A 2 6
+test eq get R 1 0
+test eq get T 5 0
+test eq get A 1 0
+if v
+test appsent 30117 true
+end
+n = get R 9
+prompt false
+test not appask 30116
+test eq get R 9 n
+test not apppoll 30116 true
+note Invalid prompt never becomes a pending job or transcript line.
+put Inlen 0 160
+test not appask 30118
+test eq get R 9 n
+test eq get R 0 6
+test eq get Q 1 7
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/red2.exit b/evidence/allen-omega-L694/L734/red2.exit
new file mode 100644
index 00000000..a9c8fe82
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/red2.exit
@@ -0,0 +1 @@
+103
diff --git a/evidence/allen-omega-L694/L734/red2.log b/evidence/allen-omega-L694/L734/red2.log
new file mode 100644
index 00000000..a8f0f1b5
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/red2.log
@@ -0,0 +1,131 @@
+1 0
+2 1
+3 0
+4 1
+5 1
+6 1
+7 1
+8 1
+9 1
+10 0
+11 0
+12 1
+13 1
+14 1
+15 1
+16 1
+17 1
+18 1
+19 1
+20 1
+21 1
+22 1
+23 1
+24 0
+25 1
+26 1
+27 1
+28 0
+29 1
+30 1
+31 1
+32 1
+33 1
+34 1
+35 1
+36 1
+37 1
+38 1
+39 1
+40 1
+41 1
+42 1
+43 1
+44 1
+45 1
+46 1
+47 1
+48 1
+49 1
+50 1
+51 1
+52 1
+53 1
+54 1
+55 1
+56 1
+57 0
+58 1
+59 1
+60 1
+61 1
+62 1
+63 0
+64 0
+65 1
+66 1
+67 0
+68 1
+69 1
+70 1
+71 1
+72 1
+73 1
+74 1
+75 1
+76 0
+77 1
+78 1
+79 1
+80 1
+81 0
+82 1
+83 1
+84 1
+85 1
+86 1
+87 0
+88 0
+89 0
+90 0
+91 1
+92 1
+93 1
+94 1
+95 1
+96 1
+97 0
+98 1
+99 0
+100 1
+101 1
+102 1
+103 1
+104 1
+105 0
+106 1
+107 1
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 0
+115 1
+116 1
+117 1
+118 1
+119 1
+120 1
+121 1
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 1
+131 1
diff --git a/evidence/allen-omega-L694/L734/red2.om b/evidence/allen-omega-L694/L734/red2.om
new file mode 100644
index 00000000..5f46476a
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/red2.om
@@ -0,0 +1,2921 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Compilable behavioral RED stub only; not product implementation.
+global A ulong 4
+global Appjob uchar 4096
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+ret false
+end
+fn appask now ulong to bool
+ret false
+end
+fn apppoll now ulong link bool to bool
+ret false
+end
+fn appsent now ulong ok bool to bool
+ret false
+end
+fn appreceive now ulong to bool
+ret false
+end
+fn appcancel to void
+end
+fn appreset to void
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note End-to-end application core over real Omega protocol bytes; no socket simulation claim.
+text Smallask "hello"
+text Codeaskt "Please make me a calculator"
+text Finaltxt " 1/1 Model answer."
+text Codetxt " 1/1 9 3ce11e06 python print(1)\\n"
+text Prefixes "SAY WAIT CODE "
+text Againexp "AGAIN 2"
+global SavedOut uchar 8192
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt code bool to void
+if code
+put Inlen 0 len Codeaskt
+for i ulong len Codeaskt
+put In i get Codeaskt i
+end
+else
+put Inlen 0 len Smallask
+for i ulong len Smallask
+put In i get Smallask i
+end
+end
+end
+fn incoming part ulong seq ulong kind ulong to void
+outreset
+off = ulong 0
+size = ulong 4
+if eq kind 1
+off = ulong 4
+size = ulong 5
+end
+if eq kind 2
+off = ulong 9
+size = ulong 5
+end
+for i ulong size
+emitb get Prefixes add off i
+end
+emitn seq
+if eq kind 0
+for i ulong len Finaltxt
+emitb get Finaltxt i
+end
+end
+if eq kind 2
+for i ulong len Codetxt
+emitb get Codetxt i
+end
+end
+copyout
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test not appinit 0 100
+test appinit 42 100
+test not appinit 43 100
+test eq get Q 0 42
+prompt false
+test appask 100
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+test eq get R 1 1
+test eq get A 2 0
+prompt false
+test not appask 101
+test eq get R 9 1
+test apppoll 100 true
+test eq get T 10 5
+test appsent 100 true
+test apppoll 100 true
+test eq get T 10 1
+copyout
+test pkparse
+test eq get N 1 1
+test eq get In get N 5 74
+test appsent 100 true
+incoming 1 1 0
+test appreceive 101
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 8 13
+test eq get R 9 2
+test eq get Answer 0 77
+prompt true
+test not appask 102
+test eq get R 0 1
+test apppoll 102 true
+test eq get T 10 3
+test appsent 102 true
+note Code acknowledgement is visible immediately, but missing code requests AGAIN.
+prompt true
+test appask 103
+test eq get R 0 2
+test eq get Q 1 2
+test eq get R 2 2
+test eq get A 2 1
+test eq get R 8 len Ack
+test apppoll 103 true
+test appsent 103 false
+test apppoll 104 true
+test eq get T 10 1
+test appsent 104 true
+incoming 1 2 0
+test appreceive 105
+test eq get A 2 2
+test eq get A 1 len Againexp
+test eq get R 1 1
+test eq get R 13 1
+test apppoll 105 true
+test eq get T 10 3
+test eq get Q 1 2
+test appsent 105 true
+test apppoll 106 true
+test eq get T 10 1
+test eq get Q 1 3
+test eq get R 0 2
+copyout
+test pkparse
+test eq get N 6 len Againexp
+bad = ulong 0
+for i ulong len Againexp
+if ne get In add get N 5 i get Againexp i
+bad = add bad 1
+end
+end
+test eq bad 0
+test appsent 106 true
+incoming 1 2 0
+test appreceive 107
+test eq get A 2 3
+test eq get R 1 0
+test eq get A 1 0
+note Reset cancels pending delivery without reusing either counter.
+appreset
+test eq get R 0 2
+test eq get Q 1 3
+test eq get R 9 0
+prompt false
+test appask 108
+test eq get R 0 3
+test eq get Q 1 4
+test apppoll 108 true
+test appsent 108 true
+incoming 1 2 0
+test appreceive 109
+test eq get A 2 4
+test eq get R 1 1
+test eq get R 8 0
+test apppoll 109 true
+test appsent 109 true
+incoming 2 3 0
+test appreceive 110
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 9 2
+test apppoll 110 true
+test appsent 110 true
+note Cancellation drops an outstanding send and stale response safely.
+prompt false
+test appask 111
+test apppoll 111 true
+appcancel
+test eq get R 1 0
+test eq get T 5 0
+test not appsent 111 true
+incoming 1 4 0
+test not appreceive 112
+note Complete CODE bytes must arrive before a code response becomes visible.
+prompt true
+test appask 113
+test eq get R 0 5
+test eq get Q 1 6
+test apppoll 113 true
+test appsent 113 true
+incoming 1 5 2
+test appreceive 114
+test eq get A 2 0
+test eq codestat 2
+test eq get R 6 0
+test apppoll 114 true
+test appsent 114 true
+incoming 2 5 0
+test appreceive 115
+test eq get A 2 1
+test eq get R 6 1
+test eq get R 1 0
+test eq get Code 6 49
+test apppoll 115 true
+test appsent 115 true
+note WAIT updates silence deadline, no answer; slow and timeout cancel both layers.
+prompt false
+test appask 116
+test eq get R 0 6
+test apppoll 116 true
+test appsent 116 true
+incoming 1 6 1
+test appreceive 117
+test eq get A 2 0
+test eq get R 4 117
+test apppoll 117 true
+test appsent 117 true
+v = apppoll 20116 true
+test eq get A 2 5
+test eq get R 1 1
+if v
+test appsent 20116 true
+end
+v = apppoll 30116 true
+test eq get R 1 1
+if v
+test appsent 30116 true
+end
+v = apppoll 30117 true
+test eq get A 2 6
+test eq get R 1 0
+test eq get T 5 0
+test eq get A 1 0
+if v
+test appsent 30117 true
+end
+n = get R 9
+prompt false
+test not appask 30116
+test eq get R 9 n
+test not apppoll 30116 true
+note Invalid prompt never becomes a pending job or transcript line.
+put Inlen 0 160
+test not appask 30118
+test eq get R 9 n
+test eq get R 0 6
+test eq get Q 1 7
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/reply.log b/evidence/allen-omega-L694/L734/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L734/runtime.log b/evidence/allen-omega-L694/L734/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L734/scene.log b/evidence/allen-omega-L694/L734/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L734/scheduler.log b/evidence/allen-omega-L694/L734/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L734/session-mutant.log b/evidence/allen-omega-L694/L734/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L734/short.log b/evidence/allen-omega-L694/L734/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L734/source.sha256 b/evidence/allen-omega-L694/L734/source.sha256
new file mode 100644
index 00000000..5dfc4a21
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/source.sha256
@@ -0,0 +1,39 @@
+3e50df43c5be10dc91c5ee1c996197ca5137930312b7801908209ac1e46297be native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+87024b3e838ab15860991cdf5f70cfa4ad2b63ec2b9b843cb2da0276143fcf5f native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+ba47aedd0244c5229f8543aad7fd5120631c6f4cf502fde038ca27e7659cecec native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+1ee602d161b261f0051f4403592d3e01000b91f63c0b5e157fe105d72f7d44da native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L734/stale-mutant.log b/evidence/allen-omega-L694/L734/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L734/stalecode-red.exit b/evidence/allen-omega-L694/L734/stalecode-red.exit
new file mode 100644
index 00000000..00750edc
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/stalecode-red.exit
@@ -0,0 +1 @@
+3
diff --git a/evidence/allen-omega-L694/L734/stalecode-red.log b/evidence/allen-omega-L694/L734/stalecode-red.log
new file mode 100644
index 00000000..a7e8e5a9
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/stalecode-red.log
@@ -0,0 +1,161 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
diff --git a/evidence/allen-omega-L694/L734/stalecode-red.om b/evidence/allen-omega-L694/L734/stalecode-red.om
new file mode 100644
index 00000000..1edd6596
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/stalecode-red.om
@@ -0,0 +1,3193 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note End-to-end application core over real Omega protocol bytes; no socket simulation claim.
+text Smallask "hello"
+text Codeaskt "Please make me a calculator"
+text Finaltxt " 1/1 Model answer."
+text Codetxt " 1/1 9 3ce11e06 python print(1)\\n"
+text Prefixes "SAY WAIT CODE "
+text Againexp "AGAIN 2"
+global SavedOut uchar 8192
+global Heldwire uchar 8192
+global Heldlen ulong 2
+fn holdwire to void
+put Heldlen 0 get Outlen 0
+put Heldlen 1 get Err 0
+for i ulong get Outlen 0
+put Heldwire i get Outb i
+end
+end
+fn unhold to void
+for i ulong get Heldlen 0
+put Outb i get Heldwire i
+end
+put Outlen 0 get Heldlen 0
+put Err 0 get Heldlen 1
+end
+fn samewire to bool
+if ne get Outlen 0 get Heldlen 0
+ret false
+end
+for i ulong get Heldlen 0
+if ne get Outb i get Heldwire i
+ret false
+end
+end
+ret eq get Err 0 get Heldlen 1
+end
+fn test ok bool to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put SavedOut i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong n
+put Outb i get SavedOut i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn copyout to void
+put Inlen 0 get Outlen 0
+for i ulong get Outlen 0
+put In i get Outb i
+end
+end
+fn prompt code bool to void
+if code
+put Inlen 0 len Codeaskt
+for i ulong len Codeaskt
+put In i get Codeaskt i
+end
+else
+put Inlen 0 len Smallask
+for i ulong len Smallask
+put In i get Smallask i
+end
+end
+end
+fn incoming part ulong seq ulong kind ulong to void
+outreset
+off = ulong 0
+size = ulong 4
+if eq kind 1
+off = ulong 4
+size = ulong 5
+end
+if eq kind 2
+off = ulong 9
+size = ulong 5
+end
+for i ulong size
+emitb get Prefixes add off i
+end
+emitn seq
+if eq kind 0
+for i ulong len Finaltxt
+emitb get Finaltxt i
+end
+end
+if eq kind 2
+for i ulong len Codetxt
+emitb get Codetxt i
+end
+end
+copyout
+b = packet 2 get Q 1 part 0 0
+copyout
+end
+fn main to int
+test not appinit 0 100
+test appinit 42 100
+test not appinit 43 100
+test eq get Q 0 42
+prompt false
+test appask 100
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+test eq get R 1 1
+test eq get A 2 0
+prompt false
+test not appask 101
+test eq get R 9 1
+test apppoll 100 true
+test eq get T 10 5
+test appsent 100 true
+test apppoll 100 true
+test eq get T 10 1
+copyout
+test pkparse
+test eq get N 1 1
+test eq get In get N 5 74
+test appsent 100 true
+incoming 1 1 0
+test appreceive 101
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 8 13
+test eq get R 9 2
+test eq get Answer 0 77
+prompt true
+test not appask 102
+test eq get R 0 1
+test apppoll 102 true
+test eq get T 10 3
+test appsent 102 true
+note Code acknowledgement is visible immediately, but missing code requests AGAIN.
+prompt true
+test appask 103
+test eq get R 0 2
+test eq get Q 1 2
+test eq get R 2 2
+test eq get A 2 1
+test eq get R 8 len Ack
+test apppoll 103 true
+test appsent 103 false
+test apppoll 104 true
+test eq get T 10 1
+test appsent 104 true
+incoming 1 2 0
+test appreceive 105
+test eq get A 2 2
+test eq get A 1 len Againexp
+test eq get R 1 1
+test eq get R 13 1
+test apppoll 105 true
+test eq get T 10 3
+test eq get Q 1 2
+test appsent 105 true
+test apppoll 106 true
+test eq get T 10 1
+test eq get Q 1 3
+test eq get R 0 2
+copyout
+test pkparse
+test eq get N 6 len Againexp
+bad = ulong 0
+for i ulong len Againexp
+if ne get In add get N 5 i get Againexp i
+bad = add bad 1
+end
+end
+test eq bad 0
+test appsent 106 true
+incoming 1 2 0
+test appreceive 107
+test eq get A 2 3
+test eq get R 1 0
+test eq get A 1 0
+note Reset cancels pending delivery without reusing either counter.
+appreset
+test eq get R 0 2
+test eq get Q 1 3
+test eq get R 9 0
+prompt false
+test appask 108
+test eq get R 0 3
+test eq get Q 1 4
+test apppoll 108 true
+test appsent 108 true
+note Old CODE must not mutate the code buffer during a newer chat job.
+incoming 1 2 2
+test appreceive 109
+test eq get A 2 4
+test eq get C 1 0
+test eq get C 2 0
+test eq get Code 0 0
+test apppoll 109 true
+test appsent 109 true
+incoming 2 2 0
+test appreceive 109
+test eq get A 2 4
+test eq get R 1 1
+test eq get R 8 0
+test apppoll 109 true
+test appsent 109 true
+incoming 3 3 0
+test appreceive 110
+test eq get A 2 1
+test eq get R 1 0
+test eq get R 9 2
+test apppoll 110 true
+test appsent 110 true
+note Cancellation drops an outstanding send and stale response safely.
+prompt false
+test appask 111
+test apppoll 111 true
+appcancel
+test eq get R 1 0
+test eq get T 5 0
+test not appsent 111 true
+incoming 1 4 0
+test not appreceive 112
+note Complete CODE bytes must arrive before a code response becomes visible.
+prompt true
+test appask 113
+test eq get R 0 5
+test eq get Q 1 6
+test apppoll 113 true
+test appsent 113 true
+incoming 1 5 2
+test appreceive 114
+test eq get A 2 0
+test eq codestat 2
+test eq get R 6 0
+test apppoll 114 true
+test appsent 114 true
+incoming 2 5 0
+test appreceive 115
+test eq get A 2 1
+test eq get R 6 1
+test eq get R 1 0
+test eq get Code 6 49
+test apppoll 115 true
+test appsent 115 true
+note WAIT updates silence deadline, no answer; slow and timeout cancel both layers.
+prompt false
+test appask 116
+test eq get R 0 6
+test apppoll 116 true
+test appsent 116 true
+incoming 1 6 1
+test appreceive 117
+test eq get A 2 0
+test eq get R 4 117
+test apppoll 117 true
+test appsent 117 true
+v = apppoll 20116 true
+test eq get A 2 5
+test eq get R 1 1
+if v
+test appsent 20116 true
+end
+v = apppoll 30116 true
+test eq get R 1 1
+if v
+test appsent 30116 true
+end
+v = apppoll 30117 true
+test eq get A 2 6
+test eq get R 1 0
+test eq get T 5 0
+test eq get A 1 0
+if v
+test appsent 30117 true
+end
+n = get R 9
+prompt false
+test not appask 30116
+test eq get R 9 n
+test not apppoll 30116 true
+note Invalid prompt never becomes a pending job or transcript line.
+put Inlen 0 160
+test not appask 30118
+test eq get R 9 n
+test eq get R 0 6
+test eq get Q 1 7
+note Receiving a code completion before send-result reporting cannot replace
+note the pending datagram with the newly generated AGAIN text.
+prompt true
+test appask 30118
+test apppoll 30118 true
+test eq get T 10 1
+holdwire
+incoming 1 7 0
+unhold
+test appreceive 30119
+test eq get A 2 2
+test samewire
+test eq get T 10 1
+test appsent 30119 true
+test apppoll 30120 true
+test eq get T 10 3
+test appsent 30120 true
+test apppoll 30121 true
+test eq get Q 1 9
+test eq get R 0 7
+test appsent 30121 true
+appcancel
+note Idle runtime still refuses a new prompt while a HELLO send is outstanding.
+test apppoll 32122 true
+test eq get T 10 5
+holdwire
+n = get R 9
+prompt false
+test not appask 32122
+test samewire
+test eq get R 9 n
+test appsent 32122 true
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L734/stdio-overflow.stderr b/evidence/allen-omega-L694/L734/stdio-overflow.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L734/stdio-overflow.stdout b/evidence/allen-omega-L694/L734/stdio-overflow.stdout
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L734/view.log b/evidence/allen-omega-L694/L734/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L734/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L740/README.md b/evidence/allen-omega-L694/L740/README.md
new file mode 100644
index 00000000..7b82875b
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/README.md
@@ -0,0 +1,23 @@
+# L740 native scene-input normalization
+
+Host-only seeded Omega component, based on8d0d11b. Invocation on Spark:
+`quiet-build native/omega/allen/gate.sh ~/handoffs/allen-omega-L694/L740/full`.
+All new executable fixture/decoder code is handwritten Omega. Existing host
+utilities only compile, inspect, compare and collect receipts.
+
+Initial RED: compilable stub,54 checks,30 failures,exit30 (`red2`). Earlier
+compile-only failure was an unsupported backslash-r literal; the Omega fixture
+now constructs CR explicitly as byte13. That compiler error is not RED evidence.
+
+Initial implementation passed54/54. Expanded boundary tests exposed nested-prefix
+handling and mood/fallback decisions after the strict parser's twelve-line cap:
+63 checks,4 failures,exit4 (`boundary-red`). Replaced nested prefix handling with
+one iterative scanner and restricted fallback/mood eligibility to the same
+canonical-line cap. Unchanged63-check suite then passed. Full native suite
+passes; exact counts and eleven rejected behavioral mutants in counts.json.
+Original checks, memory/stdio goldens and oversized-stdio refusal remain intact.
+
+The published source inventory was verified byte-for-byte immediately before
+commit. Full gate built all native components together. Independent review of
+this new decoder remains pending. scdecode is not yet attached to the application
+reply/display provider; this is neither full UI parity nor target/live proof.
diff --git a/evidence/allen-omega-L694/L740/ackstop-mutant.log b/evidence/allen-omega-L694/L740/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L740/appcode-mutant.log b/evidence/allen-omega-L694/L740/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L740/application.log b/evidence/allen-omega-L694/L740/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L740/binaries.sha256 b/evidence/allen-omega-L694/L740/binaries.sha256
new file mode 100644
index 00000000..e8f8e0ee
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/binaries.sha256
@@ -0,0 +1,29 @@
+fc6b2a7c80f2074e23da4b2629696e0b44b09fe29c8f0a60452f3388e03addcf /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scheduler
+ac1de3d32e6d184fe83ad07fdbf46d5d613f82509be52262f347d3035ee82282 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/readback-mutant
+e33d72f80c931c5e04bc1b1e401bae634ac045aee36516d2b90e5f23f43fe4d4 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/view
+f436de24380b65ec512aa08297c4e283625db769f0315a1f7930e576ab4fc8e0 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/allen
+80f65ed7d474f5732f2d0aa51067d1d1196b657f03593c0d883684e2e81a652a /home/drakestapleton/handoffs/allen-omega-L694/L740/full/reply
+16dc0ff6f370d518c5c3df72daddbebd383bd91c7bf09d9fb6fcba9d420ee2e9 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/thinking-mutant
+7ce2961880ae32232e36b77b015a96c686bf7e9e20d733f9882abe1a99f24588 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/ackstop-mutant
+1c3dd929f1f2925f7c8e502ec113e6dc64ec96fc47946f778066bded0e8576fe /home/drakestapleton/handoffs/allen-omega-L694/L740/full/hash-mutant
+111882afad305486a00a9802271f8a500d7450c47b6189671eff7f14b44349ee /home/drakestapleton/handoffs/allen-omega-L694/L740/full/golden
+02200fd42e88326192df118a71257347d91fd9d1c689b97c2a7518a7d3db2574 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/session-mutant
+d2e24d3d808b4665a12c13709e79dfd534346fda27b3fec8db0443912aef68bc /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scene-input
+0de2beb20699d540e9ee272ad0ae11023f5c0e139a690c704b167b945d9a3431 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/intent
+9b6d128eb0ead62fd21d4df9939b76a157a6bc1ae06d290063f841dd57cb42be /home/drakestapleton/handoffs/allen-omega-L694/L740/full/fixture
+09328c9765e0e49501e5edc93e80ce9cf939bb25ad75c2a7f978e6dcb21f808b /home/drakestapleton/handoffs/allen-omega-L694/L740/full/runtime
+a759d9d92a369d67b9160b633e792a9281c28d8c33e12b0f35cc11044b08b2e9 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/code
+3549fa6a28094b7c91f9506063b4d7db74a7cddf47c88b02312110757c0293ad /home/drakestapleton/handoffs/allen-omega-L694/L740/full/edges
+66345ef16f9ba058529e4132460499cde8297f7d77834d62259512f842ac42b3 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/appcode-mutant
+42cb832125b210279ce72f888d02945dee926e090cbfcc4ec6bb9ae82ba592f0 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/render
+86d17146d30fe250bef091ff08bb731611ec617d81d171acc99a962cd242836f /home/drakestapleton/handoffs/allen-omega-L694/L740/full/stale-mutant
+4a25e2fbcca906827f311b7df9289b803c1e306c2334da530520a163dae6667f /home/drakestapleton/handoffs/allen-omega-L694/L740/full/courier
+e4b572cc127b72c04d90c40fa04bdbf56c3367ebc2e39b622e180c3a66955093 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scene
+4a678078a364618e7bbd7b5392bf5b96c3892111bc470404baba942cd059ea16 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/pendingwire-mutant
+3fd5baca3fb6dd3bc590c6348513b105b7927b584aaf14c59d48b690dd5fc3d7 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scenecap-mutant
+95021b9839810159ac055fcdc38cec1aa6c086da2f5672c6ac25696845e8cfe8 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/paint
+a11bc634f57064ef3ecc8e9acbad9396916169b97629cfcc434576f869d73708 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/crc-mutant
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/stdio-overflow-input
+74e92e88b14f2b5c41922ec90c6c607a132fce3d26963fcc503dba024eeaa0b7 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/keepalive-mutant
+0251d77464363cbbc20228c913cebd5dac4f4824976cf0d1eba74d58d1316c0a /home/drakestapleton/handoffs/allen-omega-L694/L740/full/memory
+3c516b1017cec2445585eede96debe51edcd0c75ffe21dbaf35d75017b90d121 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/application
diff --git a/evidence/allen-omega-L694/L740/boundary-green.exit b/evidence/allen-omega-L694/L740/boundary-green.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/boundary-green.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L740/boundary-green.log b/evidence/allen-omega-L694/L740/boundary-green.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/boundary-green.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L740/boundary-red.exit b/evidence/allen-omega-L694/L740/boundary-red.exit
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/boundary-red.exit
@@ -0,0 +1 @@
+4
diff --git a/evidence/allen-omega-L694/L740/boundary-red.log b/evidence/allen-omega-L694/L740/boundary-red.log
new file mode 100644
index 00000000..ca5964d7
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/boundary-red.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L740/boundary-red.om b/evidence/allen-omega-L694/L740/boundary-red.om
new file mode 100644
index 00000000..fcbd919c
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/boundary-red.om
@@ -0,0 +1,3458 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes. Input and its length are restored.
+global Nm ulong 8
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn nprefix to ulong
+s = ulong 0
+n = get Nm 4
+while lt s n
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if not nlead get Nline add s 1
+ret s
+end
+s = add s 1
+put Nm 2 add get Nm 2 1
+else
+if isdigit c
+p = s
+while lt p n
+if isdigit get Nline p
+p = add p 1
+else
+ret nnumber s p n
+end
+end
+ret s
+else
+ret s
+end
+end
+while lt s n
+if eq get Nline s 32
+s = add s 1
+else
+ret npmore s
+end
+end
+end
+ret s
+end
+note Continue stripping nested marks without recursive calls or hidden state.
+fn npmore s ulong to ulong
+n = get Nm 4
+p = s
+while lt p n
+if not nmark get Nline p
+if isdigit get Nline p
+q = p
+while lt q n
+if isdigit get Nline q
+q = add q 1
+else
+ret nnumber p q n
+end
+end
+end
+ret p
+end
+if eq add p 1 n
+ret n
+end
+if not nlead get Nline add p 1
+ret p
+end
+p = add p 1
+put Nm 2 add get Nm 2 1
+while lt p n
+if eq get Nline p 32
+p = add p 1
+else
+ret npword p
+end
+end
+end
+ret p
+end
+fn npword s ulong to ulong
+note Star/hash runs need only skip repeated marks; ordinary words stop the loop.
+p = s
+n = get Nm 4
+while lt p n
+if not nmark get Nline p
+ret p
+end
+if eq add p 1 n
+ret n
+end
+if not nlead get Nline add p 1
+ret p
+end
+p = add p 1
+put Nm 2 add get Nm 2 1
+end
+ret p
+end
+fn nnumber original ulong p ulong n ulong to ulong
+if ge add p 1 n
+ret original
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret original
+end
+if ne get Nline add p 1 32
+ret original
+end
+p = add p 2
+put Nm 2 add get Nm 2 1
+ret npword p
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+put Nm 5 1
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 8
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fancy "\t- **SaY**:\tKeep My CASE.~\n> NOTE RIGHT WARM: Title | Body TEXT\n"
+text Private "say secret\nnote: secret | hidden\n\n```scene\nsay Visible\n```\n"
+text Inline "say public secret\nsay Safe\n"
+text Unclosed "never closed\nsay secret\n"
+text Plain "Hello there.\nAnother sentence.\n"
+text Mixed "Unrecognized text.\nnote: Heading | Body\n"
+text Invalid "number: nope\n"
+text Moodonly "MOOD Dawn Lively\n"
+text Listmark "1. note left: Heading | Body\n"
+text Wanted "Keep My CASE."
+text Vis "Visible"
+text Hello "Hello there."
+text Nested "- > - **SaY**: Nested works.\n"
+text Negative "-3 is negative.\n"
+global Savedin uchar 2048
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn load which ulong to void
+if eq which 0
+put Inlen 0 len Fancy
+for i ulong len Fancy
+c = get Fancy i
+if eq c 126
+c = uchar 13
+end
+put In i c
+end
+end
+if eq which 1
+put Inlen 0 len Private
+for i ulong len Private
+put In i get Private i
+end
+end
+if eq which 2
+put Inlen 0 len Inline
+for i ulong len Inline
+put In i get Inline i
+end
+end
+if eq which 3
+put Inlen 0 len Unclosed
+for i ulong len Unclosed
+put In i get Unclosed i
+end
+end
+if eq which 4
+put Inlen 0 len Plain
+for i ulong len Plain
+put In i get Plain i
+end
+end
+if eq which 5
+put Inlen 0 len Mixed
+for i ulong len Mixed
+put In i get Mixed i
+end
+end
+if eq which 6
+put Inlen 0 len Invalid
+for i ulong len Invalid
+put In i get Invalid i
+end
+end
+if eq which 7
+put Inlen 0 len Moodonly
+for i ulong len Moodonly
+put In i get Moodonly i
+end
+end
+if eq which 8
+put Inlen 0 len Listmark
+for i ulong len Listmark
+put In i get Listmark i
+end
+end
+end
+fn main to int
+load 0
+n = get Inlen 0
+for i ulong n
+put Savedin i get In i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 1
+test eq get Things 0 1
+test eq get Things 1 2
+test eq get Things 4 1
+test gt get Nm 2 0
+test eq get Inlen 0 n
+same = true
+for i ulong n
+if ne get In i get Savedin i
+same = false
+end
+end
+test same
+same = true
+for i ulong len Wanted
+if ne get Stext add get Sw 3 i get Wanted i
+same = false
+end
+end
+test same
+test eq get Stext add get Sw 3 len Wanted 0
+load 1
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 0
+test eq get Nm 3 3
+same = true
+for i ulong len Vis
+if ne get Stext add get Sw 3 i get Vis i
+same = false
+end
+end
+test same
+test eq get Stext add get Sw 3 len Vis 0
+load 2
+test scdecode
+test eq get Nm 3 1
+test eq get Stext get Sw 3 83
+load 3
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 1
+load 4
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 0
+same = true
+for i ulong len Hello
+if ne get Stext add get Sw 3 i get Hello i
+same = false
+end
+end
+test same
+load 5
+test scdecode
+test eq get Sc 2 0
+test eq get Sc 3 1
+load 6
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+load 7
+test scdecode
+test eq get Sc 0 1
+test eq get Sc 1 2
+test eq get Sc 2 0
+load 8
+test scdecode
+test eq get Things 1 1
+put Inlen 0 160
+for i ulong 160
+put In i 120
+end
+test not scdecode
+test eq get Sc 2 0
+put Inlen 0 159
+test scdecode
+test eq get Sc 2 1
+test eq get Stext add get Sw 3 159 0
+put Inlen 0 2049
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+load 4
+put In 2 0
+test not scdecode
+test eq get Nm 6 1
+test eq get In 2 0
+put Inlen 0 0
+test not scdecode
+test eq get Sc 2 0
+put Inlen 0 len Nested
+for i ulong len Nested
+put In i get Nested i
+end
+test scdecode
+test eq get Stext get Sw 3 78
+put Inlen 0 len Negative
+for i ulong len Negative
+put In i get Negative i
+end
+test scdecode
+test eq get Stext get Sw 3 45
+note A thirteenth line cannot enable mood or plain fallback after twelve refusals.
+for k ulong 12
+for i ulong len Invalid
+put In add mul k len Invalid i get Invalid i
+end
+end
+n = mul 12 len Invalid
+for i ulong len Moodonly
+put In add n i get Moodonly i
+end
+put Inlen 0 add n len Moodonly
+test not scdecode
+test eq get Sc 0 0
+test eq get Sc 7 1
+for i ulong len Plain
+put In add n i get Plain i
+end
+put Inlen 0 add n len Plain
+test not scdecode
+test eq get Sc 2 0
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/code.log b/evidence/allen-omega-L694/L740/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L740/counts.json b/evidence/allen-omega-L694/L740/counts.json
new file mode 100644
index 00000000..6c1ee741
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/counts.json
@@ -0,0 +1,33 @@
+{
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "memory": 79,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "scene-input": 63,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292
+ },
+ "total": 1337,
+ "mutant_failures": {
+ "stale": 3,
+ "crc": 2,
+ "hash": 2,
+ "readback": 7,
+ "session": 1,
+ "keepalive": 40,
+ "ackstop": 27,
+ "pendingwire": 1,
+ "appcode": 3,
+ "thinking": 6,
+ "scenecap": 3
+ }
+}
diff --git a/evidence/allen-omega-L694/L740/courier.log b/evidence/allen-omega-L694/L740/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L740/crc-mutant.log b/evidence/allen-omega-L694/L740/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L740/edges.log b/evidence/allen-omega-L694/L740/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L740/full.exit b/evidence/allen-omega-L694/L740/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L740/full.log b/evidence/allen-omega-L694/L740/full.log
new file mode 100644
index 00000000..8d6f5639
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/full.log
@@ -0,0 +1,30 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L740/hash-mutant.log b/evidence/allen-omega-L694/L740/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-full.om b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-full.om
new file mode 100644
index 00000000..903ff4fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-full.om
@@ -0,0 +1,2923 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n"
+text Bad "number: nope\n"
+text Fallback "Plain words survive.\n"
+global Saved uchar 2048
+fn test ok bool to void
+check ok get Checks 0
+end
+fn main to int
+put Inlen 0 len Thought
+for i ulong len Thought
+put In i get Thought i
+put Saved i get Thought i
+end
+test scdecode
+test eq get Nm 3 2
+test eq get Sc 2 1
+same = true
+for i ulong len Thought
+if ne get In i get Saved i
+same = false
+end
+end
+test same
+test eq get Inlen 0 len Thought
+test eq get Stext get Sw 3 75
+put Inlen 0 len Bad
+for i ulong len Bad
+put In i get Bad i
+end
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 0
+test eq get Inlen 0 len Bad
+for i ulong len Bad
+test eq get In i get Bad i
+end
+put Inlen 0 len Fallback
+for i ulong len Fallback
+put In i get Fallback i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Stext get Sw 3 80
+put Inlen 0 2048
+for i ulong 2048
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Inlen 0 2048
+for i ulong 2048
+test eq get In i 120
+end
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.log b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.log
new file mode 100644
index 00000000..b980e71e
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.log
@@ -0,0 +1,2080 @@
+0 0
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+551 0
+552 0
+553 0
+554 0
+555 0
+556 0
+557 0
+558 0
+559 0
+560 0
+561 0
+562 0
+563 0
+564 0
+565 0
+566 0
+567 0
+568 0
+569 0
+570 0
+571 0
+572 0
+573 0
+574 0
+575 0
+576 0
+577 0
+578 0
+579 0
+580 0
+581 0
+582 0
+583 0
+584 0
+585 0
+586 0
+587 0
+588 0
+589 0
+590 0
+591 0
+592 0
+593 0
+594 0
+595 0
+596 0
+597 0
+598 0
+599 0
+600 0
+601 0
+602 0
+603 0
+604 0
+605 0
+606 0
+607 0
+608 0
+609 0
+610 0
+611 0
+612 0
+613 0
+614 0
+615 0
+616 0
+617 0
+618 0
+619 0
+620 0
+621 0
+622 0
+623 0
+624 0
+625 0
+626 0
+627 0
+628 0
+629 0
+630 0
+631 0
+632 0
+633 0
+634 0
+635 0
+636 0
+637 0
+638 0
+639 0
+640 0
+641 0
+642 0
+643 0
+644 0
+645 0
+646 0
+647 0
+648 0
+649 0
+650 0
+651 0
+652 0
+653 0
+654 0
+655 0
+656 0
+657 0
+658 0
+659 0
+660 0
+661 0
+662 0
+663 0
+664 0
+665 0
+666 0
+667 0
+668 0
+669 0
+670 0
+671 0
+672 0
+673 0
+674 0
+675 0
+676 0
+677 0
+678 0
+679 0
+680 0
+681 0
+682 0
+683 0
+684 0
+685 0
+686 0
+687 0
+688 0
+689 0
+690 0
+691 0
+692 0
+693 0
+694 0
+695 0
+696 0
+697 0
+698 0
+699 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+842 0
+843 0
+844 0
+845 0
+846 0
+847 0
+848 0
+849 0
+850 0
+851 0
+852 0
+853 0
+854 0
+855 0
+856 0
+857 0
+858 0
+859 0
+860 0
+861 0
+862 0
+863 0
+864 0
+865 0
+866 0
+867 0
+868 0
+869 0
+870 0
+871 0
+872 0
+873 0
+874 0
+875 0
+876 0
+877 0
+878 0
+879 0
+880 0
+881 0
+882 0
+883 0
+884 0
+885 0
+886 0
+887 0
+888 0
+889 0
+890 0
+891 0
+892 0
+893 0
+894 0
+895 0
+896 0
+897 0
+898 0
+899 0
+900 0
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
+914 0
+915 0
+916 0
+917 0
+918 0
+919 0
+920 0
+921 0
+922 0
+923 0
+924 0
+925 0
+926 0
+927 0
+928 0
+929 0
+930 0
+931 0
+932 0
+933 0
+934 0
+935 0
+936 0
+937 0
+938 0
+939 0
+940 0
+941 0
+942 0
+943 0
+944 0
+945 0
+946 0
+947 0
+948 0
+949 0
+950 0
+951 0
+952 0
+953 0
+954 0
+955 0
+956 0
+957 0
+958 0
+959 0
+960 0
+961 0
+962 0
+963 0
+964 0
+965 0
+966 0
+967 0
+968 0
+969 0
+970 0
+971 0
+972 0
+973 0
+974 0
+975 0
+976 0
+977 0
+978 0
+979 0
+980 0
+981 0
+982 0
+983 0
+984 0
+985 0
+986 0
+987 0
+988 0
+989 0
+990 0
+991 0
+992 0
+993 0
+994 0
+995 0
+996 0
+997 0
+998 0
+999 0
+1000 0
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
+1015 0
+1016 0
+1017 0
+1018 0
+1019 0
+1020 0
+1021 0
+1022 0
+1023 0
+1024 0
+1025 0
+1026 0
+1027 0
+1028 0
+1029 0
+1030 0
+1031 0
+1032 0
+1033 0
+1034 0
+1035 0
+1036 0
+1037 0
+1038 0
+1039 0
+1040 0
+1041 0
+1042 0
+1043 0
+1044 0
+1045 0
+1046 0
+1047 0
+1048 0
+1049 0
+1050 0
+1051 0
+1052 0
+1053 0
+1054 0
+1055 0
+1056 0
+1057 0
+1058 0
+1059 0
+1060 0
+1061 0
+1062 0
+1063 0
+1064 0
+1065 0
+1066 0
+1067 0
+1068 0
+1069 0
+1070 0
+1071 0
+1072 0
+1073 0
+1074 0
+1075 0
+1076 0
+1077 0
+1078 0
+1079 0
+1080 0
+1081 0
+1082 0
+1083 0
+1084 0
+1085 0
+1086 0
+1087 0
+1088 0
+1089 0
+1090 0
+1091 0
+1092 0
+1093 0
+1094 0
+1095 0
+1096 0
+1097 0
+1098 0
+1099 0
+1100 0
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
+1112 0
+1113 0
+1114 0
+1115 0
+1116 0
+1117 0
+1118 0
+1119 0
+1120 0
+1121 0
+1122 0
+1123 0
+1124 0
+1125 0
+1126 0
+1127 0
+1128 0
+1129 0
+1130 0
+1131 0
+1132 0
+1133 0
+1134 0
+1135 0
+1136 0
+1137 0
+1138 0
+1139 0
+1140 0
+1141 0
+1142 0
+1143 0
+1144 0
+1145 0
+1146 0
+1147 0
+1148 0
+1149 0
+1150 0
+1151 0
+1152 0
+1153 0
+1154 0
+1155 0
+1156 0
+1157 0
+1158 0
+1159 0
+1160 0
+1161 0
+1162 0
+1163 0
+1164 0
+1165 0
+1166 0
+1167 0
+1168 0
+1169 0
+1170 0
+1171 0
+1172 0
+1173 0
+1174 0
+1175 0
+1176 0
+1177 0
+1178 0
+1179 0
+1180 0
+1181 0
+1182 0
+1183 0
+1184 0
+1185 0
+1186 0
+1187 0
+1188 0
+1189 0
+1190 0
+1191 0
+1192 0
+1193 0
+1194 0
+1195 0
+1196 0
+1197 0
+1198 0
+1199 0
+1200 0
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1215 0
+1216 0
+1217 0
+1218 0
+1219 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1263 0
+1264 0
+1265 0
+1266 0
+1267 0
+1268 0
+1269 0
+1270 0
+1271 0
+1272 0
+1273 0
+1274 0
+1275 0
+1276 0
+1277 0
+1278 0
+1279 0
+1280 0
+1281 0
+1282 0
+1283 0
+1284 0
+1285 0
+1286 0
+1287 0
+1288 0
+1289 0
+1290 0
+1291 0
+1292 0
+1293 0
+1294 0
+1295 0
+1296 0
+1297 0
+1298 0
+1299 0
+1300 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1307 0
+1308 0
+1309 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1566 0
+1567 0
+1568 0
+1569 0
+1570 0
+1571 0
+1572 0
+1573 0
+1574 0
+1575 0
+1576 0
+1577 0
+1578 0
+1579 0
+1580 0
+1581 0
+1582 0
+1583 0
+1584 0
+1585 0
+1586 0
+1587 0
+1588 0
+1589 0
+1590 0
+1591 0
+1592 0
+1593 0
+1594 0
+1595 0
+1596 0
+1597 0
+1598 0
+1599 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1608 0
+1609 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1618 0
+1619 0
+1620 0
+1621 0
+1622 0
+1623 0
+1624 0
+1625 0
+1626 0
+1627 0
+1628 0
+1629 0
+1630 0
+1631 0
+1632 0
+1633 0
+1634 0
+1635 0
+1636 0
+1637 0
+1638 0
+1639 0
+1640 0
+1641 0
+1642 0
+1643 0
+1644 0
+1645 0
+1646 0
+1647 0
+1648 0
+1649 0
+1650 0
+1651 0
+1652 0
+1653 0
+1654 0
+1655 0
+1656 0
+1657 0
+1658 0
+1659 0
+1660 0
+1661 0
+1662 0
+1663 0
+1664 0
+1665 0
+1666 0
+1667 0
+1668 0
+1669 0
+1670 0
+1671 0
+1672 0
+1673 0
+1674 0
+1675 0
+1676 0
+1677 0
+1678 0
+1679 0
+1680 0
+1681 0
+1682 0
+1683 0
+1684 0
+1685 0
+1686 0
+1687 0
+1688 0
+1689 0
+1690 0
+1691 0
+1692 0
+1693 0
+1694 0
+1695 0
+1696 0
+1697 0
+1698 0
+1699 0
+1700 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
+1712 0
+1713 0
+1714 0
+1715 0
+1716 0
+1717 0
+1718 0
+1719 0
+1720 0
+1721 0
+1722 0
+1723 0
+1724 0
+1725 0
+1726 0
+1727 0
+1728 0
+1729 0
+1730 0
+1731 0
+1732 0
+1733 0
+1734 0
+1735 0
+1736 0
+1737 0
+1738 0
+1739 0
+1740 0
+1741 0
+1742 0
+1743 0
+1744 0
+1745 0
+1746 0
+1747 0
+1748 0
+1749 0
+1750 0
+1751 0
+1752 0
+1753 0
+1754 0
+1755 0
+1756 0
+1757 0
+1758 0
+1759 0
+1760 0
+1761 0
+1762 0
+1763 0
+1764 0
+1765 0
+1766 0
+1767 0
+1768 0
+1769 0
+1770 0
+1771 0
+1772 0
+1773 0
+1774 0
+1775 0
+1776 0
+1777 0
+1778 0
+1779 0
+1780 0
+1781 0
+1782 0
+1783 0
+1784 0
+1785 0
+1786 0
+1787 0
+1788 0
+1789 0
+1790 0
+1791 0
+1792 0
+1793 0
+1794 0
+1795 0
+1796 0
+1797 0
+1798 0
+1799 0
+1800 0
+1801 0
+1802 0
+1803 0
+1804 0
+1805 0
+1806 0
+1807 0
+1808 0
+1809 0
+1810 0
+1811 0
+1812 0
+1813 0
+1814 0
+1815 0
+1816 0
+1817 0
+1818 0
+1819 0
+1820 0
+1821 0
+1822 0
+1823 0
+1824 0
+1825 0
+1826 0
+1827 0
+1828 0
+1829 0
+1830 0
+1831 0
+1832 0
+1833 0
+1834 0
+1835 0
+1836 0
+1837 0
+1838 0
+1839 0
+1840 0
+1841 0
+1842 0
+1843 0
+1844 0
+1845 0
+1846 0
+1847 0
+1848 0
+1849 0
+1850 0
+1851 0
+1852 0
+1853 0
+1854 0
+1855 0
+1856 0
+1857 0
+1858 0
+1859 0
+1860 0
+1861 0
+1862 0
+1863 0
+1864 0
+1865 0
+1866 0
+1867 0
+1868 0
+1869 0
+1870 0
+1871 0
+1872 0
+1873 0
+1874 0
+1875 0
+1876 0
+1877 0
+1878 0
+1879 0
+1880 0
+1881 0
+1882 0
+1883 0
+1884 0
+1885 0
+1886 0
+1887 0
+1888 0
+1889 0
+1890 0
+1891 0
+1892 0
+1893 0
+1894 0
+1895 0
+1896 0
+1897 0
+1898 0
+1899 0
+1900 0
+1901 0
+1902 0
+1903 0
+1904 0
+1905 0
+1906 0
+1907 0
+1908 0
+1909 0
+1910 0
+1911 0
+1912 0
+1913 0
+1914 0
+1915 0
+1916 0
+1917 0
+1918 0
+1919 0
+1920 0
+1921 0
+1922 0
+1923 0
+1924 0
+1925 0
+1926 0
+1927 0
+1928 0
+1929 0
+1930 0
+1931 0
+1932 0
+1933 0
+1934 0
+1935 0
+1936 0
+1937 0
+1938 0
+1939 0
+1940 0
+1941 0
+1942 0
+1943 0
+1944 0
+1945 0
+1946 0
+1947 0
+1948 0
+1949 0
+1950 0
+1951 0
+1952 0
+1953 0
+1954 0
+1955 0
+1956 0
+1957 0
+1958 0
+1959 0
+1960 0
+1961 0
+1962 0
+1963 0
+1964 0
+1965 0
+1966 0
+1967 0
+1968 0
+1969 0
+1970 0
+1971 0
+1972 0
+1973 0
+1974 0
+1975 0
+1976 0
+1977 0
+1978 0
+1979 0
+1980 0
+1981 0
+1982 0
+1983 0
+1984 0
+1985 0
+1986 0
+1987 0
+1988 0
+1989 0
+1990 0
+1991 0
+1992 0
+1993 0
+1994 0
+1995 0
+1996 0
+1997 0
+1998 0
+1999 0
+2000 0
+2001 0
+2002 0
+2003 0
+2004 0
+2005 0
+2006 0
+2007 0
+2008 0
+2009 0
+2010 0
+2011 0
+2012 0
+2013 0
+2014 0
+2015 0
+2016 0
+2017 0
+2018 0
+2019 0
+2020 0
+2021 0
+2022 0
+2023 0
+2024 0
+2025 0
+2026 0
+2027 0
+2028 0
+2029 0
+2030 0
+2031 0
+2032 0
+2033 0
+2034 0
+2035 0
+2036 0
+2037 0
+2038 0
+2039 0
+2040 0
+2041 0
+2042 0
+2043 0
+2044 0
+2045 0
+2046 0
+2047 0
+2048 0
+2049 0
+2050 0
+2051 0
+2052 0
+2053 0
+2054 0
+2055 0
+2056 0
+2057 0
+2058 0
+2059 0
+2060 0
+2061 0
+2062 0
+2063 0
+2064 0
+2065 0
+2066 0
+2067 0
+2068 0
+2069 0
+2070 0
+2071 0
+2072 0
+2073 0
+2074 0
+2075 0
+2076 0
+2077 0
+2078 0
+2079 0
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.om b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.om
new file mode 100644
index 00000000..a76a572a
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.om
@@ -0,0 +1,2923 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n"
+text Bad "number: nope\n"
+text Fallback "Plain words survive.\n"
+global Saved uchar 2048
+fn test ok bool to void
+check ok get Checks 0
+end
+fn main to int
+put Inlen 0 len Thought
+for i ulong len Thought
+put In i get Thought i
+put Saved i get Thought i
+end
+test scdecode
+test eq get Nm 3 3
+test eq get Sc 2 1
+same = true
+for i ulong len Thought
+if ne get In i get Saved i
+same = false
+end
+end
+test same
+test eq get Inlen 0 len Thought
+test eq get Stext get Sw 3 75
+put Inlen 0 len Bad
+for i ulong len Bad
+put In i get Bad i
+end
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 0
+test eq get Inlen 0 len Bad
+for i ulong len Bad
+test eq get In i get Bad i
+end
+put Inlen 0 len Fallback
+for i ulong len Fallback
+put In i get Fallback i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Stext get Sw 3 80
+put Inlen 0 2048
+for i ulong 2048
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Inlen 0 2048
+for i ulong 2048
+test eq get In i 120
+end
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.full.om b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.full.om
new file mode 100644
index 00000000..7955c036
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.full.om
@@ -0,0 +1,2931 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n"
+text Bad "number: nope\n"
+text Fallback "Plain words survive.\n"
+global Saved uchar 2048
+fn test ok bool to void
+check ok get Checks 0
+end
+fn main to int
+put Inlen 0 len Thought
+for i ulong len Thought
+put In i get Thought i
+put Saved i get Thought i
+end
+test scdecode
+test eq get Nm 3 3
+test eq get Sc 2 1
+same = true
+for i ulong len Thought
+if ne get In i get Saved i
+same = false
+end
+end
+test same
+test eq get Inlen 0 len Thought
+test eq get Stext get Sw 3 75
+put Inlen 0 len Bad
+for i ulong len Bad
+put In i get Bad i
+end
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 0
+test eq get Inlen 0 len Bad
+for i ulong len Bad
+test eq get In i get Bad i
+end
+put Inlen 0 len Fallback
+for i ulong len Fallback
+put In i get Fallback i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Stext get Sw 3 80
+put Inlen 0 2047
+for i ulong 2047
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 0
+test eq get Nm 1 2048
+test eq get Inlen 0 2047
+put Inlen 0 2048
+for i ulong 2048
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Inlen 0 2048
+for i ulong 2048
+test eq get In i 120
+end
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.log b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.log
new file mode 100644
index 00000000..0a9fc972
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.log
@@ -0,0 +1,2084 @@
+0 0
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+551 0
+552 0
+553 0
+554 0
+555 0
+556 0
+557 0
+558 0
+559 0
+560 0
+561 0
+562 0
+563 0
+564 0
+565 0
+566 0
+567 0
+568 0
+569 0
+570 0
+571 0
+572 0
+573 0
+574 0
+575 0
+576 0
+577 0
+578 0
+579 0
+580 0
+581 0
+582 0
+583 0
+584 0
+585 0
+586 0
+587 0
+588 0
+589 0
+590 0
+591 0
+592 0
+593 0
+594 0
+595 0
+596 0
+597 0
+598 0
+599 0
+600 0
+601 0
+602 0
+603 0
+604 0
+605 0
+606 0
+607 0
+608 0
+609 0
+610 0
+611 0
+612 0
+613 0
+614 0
+615 0
+616 0
+617 0
+618 0
+619 0
+620 0
+621 0
+622 0
+623 0
+624 0
+625 0
+626 0
+627 0
+628 0
+629 0
+630 0
+631 0
+632 0
+633 0
+634 0
+635 0
+636 0
+637 0
+638 0
+639 0
+640 0
+641 0
+642 0
+643 0
+644 0
+645 0
+646 0
+647 0
+648 0
+649 0
+650 0
+651 0
+652 0
+653 0
+654 0
+655 0
+656 0
+657 0
+658 0
+659 0
+660 0
+661 0
+662 0
+663 0
+664 0
+665 0
+666 0
+667 0
+668 0
+669 0
+670 0
+671 0
+672 0
+673 0
+674 0
+675 0
+676 0
+677 0
+678 0
+679 0
+680 0
+681 0
+682 0
+683 0
+684 0
+685 0
+686 0
+687 0
+688 0
+689 0
+690 0
+691 0
+692 0
+693 0
+694 0
+695 0
+696 0
+697 0
+698 0
+699 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+842 0
+843 0
+844 0
+845 0
+846 0
+847 0
+848 0
+849 0
+850 0
+851 0
+852 0
+853 0
+854 0
+855 0
+856 0
+857 0
+858 0
+859 0
+860 0
+861 0
+862 0
+863 0
+864 0
+865 0
+866 0
+867 0
+868 0
+869 0
+870 0
+871 0
+872 0
+873 0
+874 0
+875 0
+876 0
+877 0
+878 0
+879 0
+880 0
+881 0
+882 0
+883 0
+884 0
+885 0
+886 0
+887 0
+888 0
+889 0
+890 0
+891 0
+892 0
+893 0
+894 0
+895 0
+896 0
+897 0
+898 0
+899 0
+900 0
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
+914 0
+915 0
+916 0
+917 0
+918 0
+919 0
+920 0
+921 0
+922 0
+923 0
+924 0
+925 0
+926 0
+927 0
+928 0
+929 0
+930 0
+931 0
+932 0
+933 0
+934 0
+935 0
+936 0
+937 0
+938 0
+939 0
+940 0
+941 0
+942 0
+943 0
+944 0
+945 0
+946 0
+947 0
+948 0
+949 0
+950 0
+951 0
+952 0
+953 0
+954 0
+955 0
+956 0
+957 0
+958 0
+959 0
+960 0
+961 0
+962 0
+963 0
+964 0
+965 0
+966 0
+967 0
+968 0
+969 0
+970 0
+971 0
+972 0
+973 0
+974 0
+975 0
+976 0
+977 0
+978 0
+979 0
+980 0
+981 0
+982 0
+983 0
+984 0
+985 0
+986 0
+987 0
+988 0
+989 0
+990 0
+991 0
+992 0
+993 0
+994 0
+995 0
+996 0
+997 0
+998 0
+999 0
+1000 0
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
+1015 0
+1016 0
+1017 0
+1018 0
+1019 0
+1020 0
+1021 0
+1022 0
+1023 0
+1024 0
+1025 0
+1026 0
+1027 0
+1028 0
+1029 0
+1030 0
+1031 0
+1032 0
+1033 0
+1034 0
+1035 0
+1036 0
+1037 0
+1038 0
+1039 0
+1040 0
+1041 0
+1042 0
+1043 0
+1044 0
+1045 0
+1046 0
+1047 0
+1048 0
+1049 0
+1050 0
+1051 0
+1052 0
+1053 0
+1054 0
+1055 0
+1056 0
+1057 0
+1058 0
+1059 0
+1060 0
+1061 0
+1062 0
+1063 0
+1064 0
+1065 0
+1066 0
+1067 0
+1068 0
+1069 0
+1070 0
+1071 0
+1072 0
+1073 0
+1074 0
+1075 0
+1076 0
+1077 0
+1078 0
+1079 0
+1080 0
+1081 0
+1082 0
+1083 0
+1084 0
+1085 0
+1086 0
+1087 0
+1088 0
+1089 0
+1090 0
+1091 0
+1092 0
+1093 0
+1094 0
+1095 0
+1096 0
+1097 0
+1098 0
+1099 0
+1100 0
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
+1112 0
+1113 0
+1114 0
+1115 0
+1116 0
+1117 0
+1118 0
+1119 0
+1120 0
+1121 0
+1122 0
+1123 0
+1124 0
+1125 0
+1126 0
+1127 0
+1128 0
+1129 0
+1130 0
+1131 0
+1132 0
+1133 0
+1134 0
+1135 0
+1136 0
+1137 0
+1138 0
+1139 0
+1140 0
+1141 0
+1142 0
+1143 0
+1144 0
+1145 0
+1146 0
+1147 0
+1148 0
+1149 0
+1150 0
+1151 0
+1152 0
+1153 0
+1154 0
+1155 0
+1156 0
+1157 0
+1158 0
+1159 0
+1160 0
+1161 0
+1162 0
+1163 0
+1164 0
+1165 0
+1166 0
+1167 0
+1168 0
+1169 0
+1170 0
+1171 0
+1172 0
+1173 0
+1174 0
+1175 0
+1176 0
+1177 0
+1178 0
+1179 0
+1180 0
+1181 0
+1182 0
+1183 0
+1184 0
+1185 0
+1186 0
+1187 0
+1188 0
+1189 0
+1190 0
+1191 0
+1192 0
+1193 0
+1194 0
+1195 0
+1196 0
+1197 0
+1198 0
+1199 0
+1200 0
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1215 0
+1216 0
+1217 0
+1218 0
+1219 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1263 0
+1264 0
+1265 0
+1266 0
+1267 0
+1268 0
+1269 0
+1270 0
+1271 0
+1272 0
+1273 0
+1274 0
+1275 0
+1276 0
+1277 0
+1278 0
+1279 0
+1280 0
+1281 0
+1282 0
+1283 0
+1284 0
+1285 0
+1286 0
+1287 0
+1288 0
+1289 0
+1290 0
+1291 0
+1292 0
+1293 0
+1294 0
+1295 0
+1296 0
+1297 0
+1298 0
+1299 0
+1300 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1307 0
+1308 0
+1309 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1566 0
+1567 0
+1568 0
+1569 0
+1570 0
+1571 0
+1572 0
+1573 0
+1574 0
+1575 0
+1576 0
+1577 0
+1578 0
+1579 0
+1580 0
+1581 0
+1582 0
+1583 0
+1584 0
+1585 0
+1586 0
+1587 0
+1588 0
+1589 0
+1590 0
+1591 0
+1592 0
+1593 0
+1594 0
+1595 0
+1596 0
+1597 0
+1598 0
+1599 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1608 0
+1609 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1618 0
+1619 0
+1620 0
+1621 0
+1622 0
+1623 0
+1624 0
+1625 0
+1626 0
+1627 0
+1628 0
+1629 0
+1630 0
+1631 0
+1632 0
+1633 0
+1634 0
+1635 0
+1636 0
+1637 0
+1638 0
+1639 0
+1640 0
+1641 0
+1642 0
+1643 0
+1644 0
+1645 0
+1646 0
+1647 0
+1648 0
+1649 0
+1650 0
+1651 0
+1652 0
+1653 0
+1654 0
+1655 0
+1656 0
+1657 0
+1658 0
+1659 0
+1660 0
+1661 0
+1662 0
+1663 0
+1664 0
+1665 0
+1666 0
+1667 0
+1668 0
+1669 0
+1670 0
+1671 0
+1672 0
+1673 0
+1674 0
+1675 0
+1676 0
+1677 0
+1678 0
+1679 0
+1680 0
+1681 0
+1682 0
+1683 0
+1684 0
+1685 0
+1686 0
+1687 0
+1688 0
+1689 0
+1690 0
+1691 0
+1692 0
+1693 0
+1694 0
+1695 0
+1696 0
+1697 0
+1698 0
+1699 0
+1700 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
+1712 0
+1713 0
+1714 0
+1715 0
+1716 0
+1717 0
+1718 0
+1719 0
+1720 0
+1721 0
+1722 0
+1723 0
+1724 0
+1725 0
+1726 0
+1727 0
+1728 0
+1729 0
+1730 0
+1731 0
+1732 0
+1733 0
+1734 0
+1735 0
+1736 0
+1737 0
+1738 0
+1739 0
+1740 0
+1741 0
+1742 0
+1743 0
+1744 0
+1745 0
+1746 0
+1747 0
+1748 0
+1749 0
+1750 0
+1751 0
+1752 0
+1753 0
+1754 0
+1755 0
+1756 0
+1757 0
+1758 0
+1759 0
+1760 0
+1761 0
+1762 0
+1763 0
+1764 0
+1765 0
+1766 0
+1767 0
+1768 0
+1769 0
+1770 0
+1771 0
+1772 0
+1773 0
+1774 0
+1775 0
+1776 0
+1777 0
+1778 0
+1779 0
+1780 0
+1781 0
+1782 0
+1783 0
+1784 0
+1785 0
+1786 0
+1787 0
+1788 0
+1789 0
+1790 0
+1791 0
+1792 0
+1793 0
+1794 0
+1795 0
+1796 0
+1797 0
+1798 0
+1799 0
+1800 0
+1801 0
+1802 0
+1803 0
+1804 0
+1805 0
+1806 0
+1807 0
+1808 0
+1809 0
+1810 0
+1811 0
+1812 0
+1813 0
+1814 0
+1815 0
+1816 0
+1817 0
+1818 0
+1819 0
+1820 0
+1821 0
+1822 0
+1823 0
+1824 0
+1825 0
+1826 0
+1827 0
+1828 0
+1829 0
+1830 0
+1831 0
+1832 0
+1833 0
+1834 0
+1835 0
+1836 0
+1837 0
+1838 0
+1839 0
+1840 0
+1841 0
+1842 0
+1843 0
+1844 0
+1845 0
+1846 0
+1847 0
+1848 0
+1849 0
+1850 0
+1851 0
+1852 0
+1853 0
+1854 0
+1855 0
+1856 0
+1857 0
+1858 0
+1859 0
+1860 0
+1861 0
+1862 0
+1863 0
+1864 0
+1865 0
+1866 0
+1867 0
+1868 0
+1869 0
+1870 0
+1871 0
+1872 0
+1873 0
+1874 0
+1875 0
+1876 0
+1877 0
+1878 0
+1879 0
+1880 0
+1881 0
+1882 0
+1883 0
+1884 0
+1885 0
+1886 0
+1887 0
+1888 0
+1889 0
+1890 0
+1891 0
+1892 0
+1893 0
+1894 0
+1895 0
+1896 0
+1897 0
+1898 0
+1899 0
+1900 0
+1901 0
+1902 0
+1903 0
+1904 0
+1905 0
+1906 0
+1907 0
+1908 0
+1909 0
+1910 0
+1911 0
+1912 0
+1913 0
+1914 0
+1915 0
+1916 0
+1917 0
+1918 0
+1919 0
+1920 0
+1921 0
+1922 0
+1923 0
+1924 0
+1925 0
+1926 0
+1927 0
+1928 0
+1929 0
+1930 0
+1931 0
+1932 0
+1933 0
+1934 0
+1935 0
+1936 0
+1937 0
+1938 0
+1939 0
+1940 0
+1941 0
+1942 0
+1943 0
+1944 0
+1945 0
+1946 0
+1947 0
+1948 0
+1949 0
+1950 0
+1951 0
+1952 0
+1953 0
+1954 0
+1955 0
+1956 0
+1957 0
+1958 0
+1959 0
+1960 0
+1961 0
+1962 0
+1963 0
+1964 0
+1965 0
+1966 0
+1967 0
+1968 0
+1969 0
+1970 0
+1971 0
+1972 0
+1973 0
+1974 0
+1975 0
+1976 0
+1977 0
+1978 0
+1979 0
+1980 0
+1981 0
+1982 0
+1983 0
+1984 0
+1985 0
+1986 0
+1987 0
+1988 0
+1989 0
+1990 0
+1991 0
+1992 0
+1993 0
+1994 0
+1995 0
+1996 0
+1997 0
+1998 0
+1999 0
+2000 0
+2001 0
+2002 0
+2003 0
+2004 0
+2005 0
+2006 0
+2007 0
+2008 0
+2009 0
+2010 0
+2011 0
+2012 0
+2013 0
+2014 0
+2015 0
+2016 0
+2017 0
+2018 0
+2019 0
+2020 0
+2021 0
+2022 0
+2023 0
+2024 0
+2025 0
+2026 0
+2027 0
+2028 0
+2029 0
+2030 0
+2031 0
+2032 0
+2033 0
+2034 0
+2035 0
+2036 0
+2037 0
+2038 0
+2039 0
+2040 0
+2041 0
+2042 0
+2043 0
+2044 0
+2045 0
+2046 0
+2047 0
+2048 0
+2049 0
+2050 0
+2051 0
+2052 0
+2053 0
+2054 0
+2055 0
+2056 0
+2057 0
+2058 0
+2059 0
+2060 0
+2061 0
+2062 0
+2063 0
+2064 0
+2065 0
+2066 0
+2067 0
+2068 0
+2069 0
+2070 0
+2071 0
+2072 0
+2073 0
+2074 0
+2075 0
+2076 0
+2077 0
+2078 0
+2079 0
+2080 0
+2081 0
+2082 0
+2083 0
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent.log b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent.log
new file mode 100644
index 00000000..d1c1d167
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent.log
@@ -0,0 +1,2080 @@
+0 0
+1 1
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+551 0
+552 0
+553 0
+554 0
+555 0
+556 0
+557 0
+558 0
+559 0
+560 0
+561 0
+562 0
+563 0
+564 0
+565 0
+566 0
+567 0
+568 0
+569 0
+570 0
+571 0
+572 0
+573 0
+574 0
+575 0
+576 0
+577 0
+578 0
+579 0
+580 0
+581 0
+582 0
+583 0
+584 0
+585 0
+586 0
+587 0
+588 0
+589 0
+590 0
+591 0
+592 0
+593 0
+594 0
+595 0
+596 0
+597 0
+598 0
+599 0
+600 0
+601 0
+602 0
+603 0
+604 0
+605 0
+606 0
+607 0
+608 0
+609 0
+610 0
+611 0
+612 0
+613 0
+614 0
+615 0
+616 0
+617 0
+618 0
+619 0
+620 0
+621 0
+622 0
+623 0
+624 0
+625 0
+626 0
+627 0
+628 0
+629 0
+630 0
+631 0
+632 0
+633 0
+634 0
+635 0
+636 0
+637 0
+638 0
+639 0
+640 0
+641 0
+642 0
+643 0
+644 0
+645 0
+646 0
+647 0
+648 0
+649 0
+650 0
+651 0
+652 0
+653 0
+654 0
+655 0
+656 0
+657 0
+658 0
+659 0
+660 0
+661 0
+662 0
+663 0
+664 0
+665 0
+666 0
+667 0
+668 0
+669 0
+670 0
+671 0
+672 0
+673 0
+674 0
+675 0
+676 0
+677 0
+678 0
+679 0
+680 0
+681 0
+682 0
+683 0
+684 0
+685 0
+686 0
+687 0
+688 0
+689 0
+690 0
+691 0
+692 0
+693 0
+694 0
+695 0
+696 0
+697 0
+698 0
+699 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+842 0
+843 0
+844 0
+845 0
+846 0
+847 0
+848 0
+849 0
+850 0
+851 0
+852 0
+853 0
+854 0
+855 0
+856 0
+857 0
+858 0
+859 0
+860 0
+861 0
+862 0
+863 0
+864 0
+865 0
+866 0
+867 0
+868 0
+869 0
+870 0
+871 0
+872 0
+873 0
+874 0
+875 0
+876 0
+877 0
+878 0
+879 0
+880 0
+881 0
+882 0
+883 0
+884 0
+885 0
+886 0
+887 0
+888 0
+889 0
+890 0
+891 0
+892 0
+893 0
+894 0
+895 0
+896 0
+897 0
+898 0
+899 0
+900 0
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
+914 0
+915 0
+916 0
+917 0
+918 0
+919 0
+920 0
+921 0
+922 0
+923 0
+924 0
+925 0
+926 0
+927 0
+928 0
+929 0
+930 0
+931 0
+932 0
+933 0
+934 0
+935 0
+936 0
+937 0
+938 0
+939 0
+940 0
+941 0
+942 0
+943 0
+944 0
+945 0
+946 0
+947 0
+948 0
+949 0
+950 0
+951 0
+952 0
+953 0
+954 0
+955 0
+956 0
+957 0
+958 0
+959 0
+960 0
+961 0
+962 0
+963 0
+964 0
+965 0
+966 0
+967 0
+968 0
+969 0
+970 0
+971 0
+972 0
+973 0
+974 0
+975 0
+976 0
+977 0
+978 0
+979 0
+980 0
+981 0
+982 0
+983 0
+984 0
+985 0
+986 0
+987 0
+988 0
+989 0
+990 0
+991 0
+992 0
+993 0
+994 0
+995 0
+996 0
+997 0
+998 0
+999 0
+1000 0
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
+1015 0
+1016 0
+1017 0
+1018 0
+1019 0
+1020 0
+1021 0
+1022 0
+1023 0
+1024 0
+1025 0
+1026 0
+1027 0
+1028 0
+1029 0
+1030 0
+1031 0
+1032 0
+1033 0
+1034 0
+1035 0
+1036 0
+1037 0
+1038 0
+1039 0
+1040 0
+1041 0
+1042 0
+1043 0
+1044 0
+1045 0
+1046 0
+1047 0
+1048 0
+1049 0
+1050 0
+1051 0
+1052 0
+1053 0
+1054 0
+1055 0
+1056 0
+1057 0
+1058 0
+1059 0
+1060 0
+1061 0
+1062 0
+1063 0
+1064 0
+1065 0
+1066 0
+1067 0
+1068 0
+1069 0
+1070 0
+1071 0
+1072 0
+1073 0
+1074 0
+1075 0
+1076 0
+1077 0
+1078 0
+1079 0
+1080 0
+1081 0
+1082 0
+1083 0
+1084 0
+1085 0
+1086 0
+1087 0
+1088 0
+1089 0
+1090 0
+1091 0
+1092 0
+1093 0
+1094 0
+1095 0
+1096 0
+1097 0
+1098 0
+1099 0
+1100 0
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
+1112 0
+1113 0
+1114 0
+1115 0
+1116 0
+1117 0
+1118 0
+1119 0
+1120 0
+1121 0
+1122 0
+1123 0
+1124 0
+1125 0
+1126 0
+1127 0
+1128 0
+1129 0
+1130 0
+1131 0
+1132 0
+1133 0
+1134 0
+1135 0
+1136 0
+1137 0
+1138 0
+1139 0
+1140 0
+1141 0
+1142 0
+1143 0
+1144 0
+1145 0
+1146 0
+1147 0
+1148 0
+1149 0
+1150 0
+1151 0
+1152 0
+1153 0
+1154 0
+1155 0
+1156 0
+1157 0
+1158 0
+1159 0
+1160 0
+1161 0
+1162 0
+1163 0
+1164 0
+1165 0
+1166 0
+1167 0
+1168 0
+1169 0
+1170 0
+1171 0
+1172 0
+1173 0
+1174 0
+1175 0
+1176 0
+1177 0
+1178 0
+1179 0
+1180 0
+1181 0
+1182 0
+1183 0
+1184 0
+1185 0
+1186 0
+1187 0
+1188 0
+1189 0
+1190 0
+1191 0
+1192 0
+1193 0
+1194 0
+1195 0
+1196 0
+1197 0
+1198 0
+1199 0
+1200 0
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1215 0
+1216 0
+1217 0
+1218 0
+1219 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1263 0
+1264 0
+1265 0
+1266 0
+1267 0
+1268 0
+1269 0
+1270 0
+1271 0
+1272 0
+1273 0
+1274 0
+1275 0
+1276 0
+1277 0
+1278 0
+1279 0
+1280 0
+1281 0
+1282 0
+1283 0
+1284 0
+1285 0
+1286 0
+1287 0
+1288 0
+1289 0
+1290 0
+1291 0
+1292 0
+1293 0
+1294 0
+1295 0
+1296 0
+1297 0
+1298 0
+1299 0
+1300 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1307 0
+1308 0
+1309 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1566 0
+1567 0
+1568 0
+1569 0
+1570 0
+1571 0
+1572 0
+1573 0
+1574 0
+1575 0
+1576 0
+1577 0
+1578 0
+1579 0
+1580 0
+1581 0
+1582 0
+1583 0
+1584 0
+1585 0
+1586 0
+1587 0
+1588 0
+1589 0
+1590 0
+1591 0
+1592 0
+1593 0
+1594 0
+1595 0
+1596 0
+1597 0
+1598 0
+1599 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1608 0
+1609 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1618 0
+1619 0
+1620 0
+1621 0
+1622 0
+1623 0
+1624 0
+1625 0
+1626 0
+1627 0
+1628 0
+1629 0
+1630 0
+1631 0
+1632 0
+1633 0
+1634 0
+1635 0
+1636 0
+1637 0
+1638 0
+1639 0
+1640 0
+1641 0
+1642 0
+1643 0
+1644 0
+1645 0
+1646 0
+1647 0
+1648 0
+1649 0
+1650 0
+1651 0
+1652 0
+1653 0
+1654 0
+1655 0
+1656 0
+1657 0
+1658 0
+1659 0
+1660 0
+1661 0
+1662 0
+1663 0
+1664 0
+1665 0
+1666 0
+1667 0
+1668 0
+1669 0
+1670 0
+1671 0
+1672 0
+1673 0
+1674 0
+1675 0
+1676 0
+1677 0
+1678 0
+1679 0
+1680 0
+1681 0
+1682 0
+1683 0
+1684 0
+1685 0
+1686 0
+1687 0
+1688 0
+1689 0
+1690 0
+1691 0
+1692 0
+1693 0
+1694 0
+1695 0
+1696 0
+1697 0
+1698 0
+1699 0
+1700 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
+1712 0
+1713 0
+1714 0
+1715 0
+1716 0
+1717 0
+1718 0
+1719 0
+1720 0
+1721 0
+1722 0
+1723 0
+1724 0
+1725 0
+1726 0
+1727 0
+1728 0
+1729 0
+1730 0
+1731 0
+1732 0
+1733 0
+1734 0
+1735 0
+1736 0
+1737 0
+1738 0
+1739 0
+1740 0
+1741 0
+1742 0
+1743 0
+1744 0
+1745 0
+1746 0
+1747 0
+1748 0
+1749 0
+1750 0
+1751 0
+1752 0
+1753 0
+1754 0
+1755 0
+1756 0
+1757 0
+1758 0
+1759 0
+1760 0
+1761 0
+1762 0
+1763 0
+1764 0
+1765 0
+1766 0
+1767 0
+1768 0
+1769 0
+1770 0
+1771 0
+1772 0
+1773 0
+1774 0
+1775 0
+1776 0
+1777 0
+1778 0
+1779 0
+1780 0
+1781 0
+1782 0
+1783 0
+1784 0
+1785 0
+1786 0
+1787 0
+1788 0
+1789 0
+1790 0
+1791 0
+1792 0
+1793 0
+1794 0
+1795 0
+1796 0
+1797 0
+1798 0
+1799 0
+1800 0
+1801 0
+1802 0
+1803 0
+1804 0
+1805 0
+1806 0
+1807 0
+1808 0
+1809 0
+1810 0
+1811 0
+1812 0
+1813 0
+1814 0
+1815 0
+1816 0
+1817 0
+1818 0
+1819 0
+1820 0
+1821 0
+1822 0
+1823 0
+1824 0
+1825 0
+1826 0
+1827 0
+1828 0
+1829 0
+1830 0
+1831 0
+1832 0
+1833 0
+1834 0
+1835 0
+1836 0
+1837 0
+1838 0
+1839 0
+1840 0
+1841 0
+1842 0
+1843 0
+1844 0
+1845 0
+1846 0
+1847 0
+1848 0
+1849 0
+1850 0
+1851 0
+1852 0
+1853 0
+1854 0
+1855 0
+1856 0
+1857 0
+1858 0
+1859 0
+1860 0
+1861 0
+1862 0
+1863 0
+1864 0
+1865 0
+1866 0
+1867 0
+1868 0
+1869 0
+1870 0
+1871 0
+1872 0
+1873 0
+1874 0
+1875 0
+1876 0
+1877 0
+1878 0
+1879 0
+1880 0
+1881 0
+1882 0
+1883 0
+1884 0
+1885 0
+1886 0
+1887 0
+1888 0
+1889 0
+1890 0
+1891 0
+1892 0
+1893 0
+1894 0
+1895 0
+1896 0
+1897 0
+1898 0
+1899 0
+1900 0
+1901 0
+1902 0
+1903 0
+1904 0
+1905 0
+1906 0
+1907 0
+1908 0
+1909 0
+1910 0
+1911 0
+1912 0
+1913 0
+1914 0
+1915 0
+1916 0
+1917 0
+1918 0
+1919 0
+1920 0
+1921 0
+1922 0
+1923 0
+1924 0
+1925 0
+1926 0
+1927 0
+1928 0
+1929 0
+1930 0
+1931 0
+1932 0
+1933 0
+1934 0
+1935 0
+1936 0
+1937 0
+1938 0
+1939 0
+1940 0
+1941 0
+1942 0
+1943 0
+1944 0
+1945 0
+1946 0
+1947 0
+1948 0
+1949 0
+1950 0
+1951 0
+1952 0
+1953 0
+1954 0
+1955 0
+1956 0
+1957 0
+1958 0
+1959 0
+1960 0
+1961 0
+1962 0
+1963 0
+1964 0
+1965 0
+1966 0
+1967 0
+1968 0
+1969 0
+1970 0
+1971 0
+1972 0
+1973 0
+1974 0
+1975 0
+1976 0
+1977 0
+1978 0
+1979 0
+1980 0
+1981 0
+1982 0
+1983 0
+1984 0
+1985 0
+1986 0
+1987 0
+1988 0
+1989 0
+1990 0
+1991 0
+1992 0
+1993 0
+1994 0
+1995 0
+1996 0
+1997 0
+1998 0
+1999 0
+2000 0
+2001 0
+2002 0
+2003 0
+2004 0
+2005 0
+2006 0
+2007 0
+2008 0
+2009 0
+2010 0
+2011 0
+2012 0
+2013 0
+2014 0
+2015 0
+2016 0
+2017 0
+2018 0
+2019 0
+2020 0
+2021 0
+2022 0
+2023 0
+2024 0
+2025 0
+2026 0
+2027 0
+2028 0
+2029 0
+2030 0
+2031 0
+2032 0
+2033 0
+2034 0
+2035 0
+2036 0
+2037 0
+2038 0
+2039 0
+2040 0
+2041 0
+2042 0
+2043 0
+2044 0
+2045 0
+2046 0
+2047 0
+2048 0
+2049 0
+2050 0
+2051 0
+2052 0
+2053 0
+2054 0
+2055 0
+2056 0
+2057 0
+2058 0
+2059 0
+2060 0
+2061 0
+2062 0
+2063 0
+2064 0
+2065 0
+2066 0
+2067 0
+2068 0
+2069 0
+2070 0
+2071 0
+2072 0
+2073 0
+2074 0
+2075 0
+2076 0
+2077 0
+2078 0
+2079 0
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.log b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.om b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.om
new file mode 100644
index 00000000..6d71533a
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.om
@@ -0,0 +1,3078 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fancy "\t- **SaY**:\tKeep My CASE.~\n> NOTE RIGHT WARM: Title | Body TEXT\n"
+text Private "say secret\nnote: secret | hidden\n\n```scene\nsay Visible\n```\n"
+text Inline "say public secret\nsay Safe\n"
+text Unclosed "never closed\nsay secret\n"
+text Plain "Hello there.\nAnother sentence.\n"
+text Mixed "Unrecognized text.\nnote: Heading | Body\n"
+text Invalid "number: nope\n"
+text Moodonly "MOOD Dawn Lively\n"
+text Listmark "1. note left: Heading | Body\n"
+text Wanted "Keep My CASE."
+text Vis "Visible"
+text Hello "Hello there."
+text Nested "- > - **SaY**: Nested works.\n"
+text Negative "-3 is negative.\n"
+global Savedin uchar 2048
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn load which ulong to void
+if eq which 0
+put Inlen 0 len Fancy
+for i ulong len Fancy
+c = get Fancy i
+if eq c 126
+c = uchar 13
+end
+put In i c
+end
+end
+if eq which 1
+put Inlen 0 len Private
+for i ulong len Private
+put In i get Private i
+end
+end
+if eq which 2
+put Inlen 0 len Inline
+for i ulong len Inline
+put In i get Inline i
+end
+end
+if eq which 3
+put Inlen 0 len Unclosed
+for i ulong len Unclosed
+put In i get Unclosed i
+end
+end
+if eq which 4
+put Inlen 0 len Plain
+for i ulong len Plain
+put In i get Plain i
+end
+end
+if eq which 5
+put Inlen 0 len Mixed
+for i ulong len Mixed
+put In i get Mixed i
+end
+end
+if eq which 6
+put Inlen 0 len Invalid
+for i ulong len Invalid
+put In i get Invalid i
+end
+end
+if eq which 7
+put Inlen 0 len Moodonly
+for i ulong len Moodonly
+put In i get Moodonly i
+end
+end
+if eq which 8
+put Inlen 0 len Listmark
+for i ulong len Listmark
+put In i get Listmark i
+end
+end
+end
+fn main to int
+load 0
+n = get Inlen 0
+for i ulong n
+put Savedin i get In i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 1
+test eq get Things 0 1
+test eq get Things 1 2
+test eq get Things 4 1
+test gt get Nm 2 0
+test eq get Inlen 0 n
+same = true
+for i ulong n
+if ne get In i get Savedin i
+same = false
+end
+end
+test same
+same = true
+for i ulong len Wanted
+if ne get Stext add get Sw 3 i get Wanted i
+same = false
+end
+end
+test same
+test eq get Stext add get Sw 3 len Wanted 0
+load 1
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 0
+test eq get Nm 3 3
+same = true
+for i ulong len Vis
+if ne get Stext add get Sw 3 i get Vis i
+same = false
+end
+end
+test same
+test eq get Stext add get Sw 3 len Vis 0
+load 2
+test scdecode
+test eq get Nm 3 1
+test eq get Stext get Sw 3 83
+load 3
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 1
+load 4
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 0
+same = true
+for i ulong len Hello
+if ne get Stext add get Sw 3 i get Hello i
+same = false
+end
+end
+test same
+load 5
+test scdecode
+test eq get Sc 2 0
+test eq get Sc 3 1
+load 6
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+load 7
+test scdecode
+test eq get Sc 0 1
+test eq get Sc 1 2
+test eq get Sc 2 0
+load 8
+test scdecode
+test eq get Things 1 1
+put Inlen 0 160
+for i ulong 160
+put In i 120
+end
+test not scdecode
+test eq get Sc 2 0
+put Inlen 0 159
+test scdecode
+test eq get Sc 2 1
+test eq get Stext add get Sw 3 159 0
+put Inlen 0 2049
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+load 4
+put In 2 0
+test not scdecode
+test eq get Nm 6 1
+test eq get In 2 0
+put Inlen 0 0
+test not scdecode
+test eq get Sc 2 0
+put Inlen 0 len Nested
+for i ulong len Nested
+put In i get Nested i
+end
+test scdecode
+test eq get Stext get Sw 3 78
+put Inlen 0 len Negative
+for i ulong len Negative
+put In i get Negative i
+end
+test scdecode
+test eq get Stext get Sw 3 45
+note A thirteenth line cannot enable mood or plain fallback after twelve refusals.
+for k ulong 12
+for i ulong len Invalid
+put In add mul k len Invalid i get Invalid i
+end
+end
+n = mul 12 len Invalid
+for i ulong len Moodonly
+put In add n i get Moodonly i
+end
+put Inlen 0 add n len Moodonly
+test not scdecode
+test eq get Sc 0 0
+test eq get Sc 7 1
+for i ulong len Plain
+put In add n i get Plain i
+end
+put Inlen 0 add n len Plain
+test not scdecode
+test eq get Sc 2 0
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/parent-probe.log b/evidence/allen-omega-L694/L740/independent-review/parent-probe.log
new file mode 100644
index 00000000..0a9fc972
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/parent-probe.log
@@ -0,0 +1,2084 @@
+0 0
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+551 0
+552 0
+553 0
+554 0
+555 0
+556 0
+557 0
+558 0
+559 0
+560 0
+561 0
+562 0
+563 0
+564 0
+565 0
+566 0
+567 0
+568 0
+569 0
+570 0
+571 0
+572 0
+573 0
+574 0
+575 0
+576 0
+577 0
+578 0
+579 0
+580 0
+581 0
+582 0
+583 0
+584 0
+585 0
+586 0
+587 0
+588 0
+589 0
+590 0
+591 0
+592 0
+593 0
+594 0
+595 0
+596 0
+597 0
+598 0
+599 0
+600 0
+601 0
+602 0
+603 0
+604 0
+605 0
+606 0
+607 0
+608 0
+609 0
+610 0
+611 0
+612 0
+613 0
+614 0
+615 0
+616 0
+617 0
+618 0
+619 0
+620 0
+621 0
+622 0
+623 0
+624 0
+625 0
+626 0
+627 0
+628 0
+629 0
+630 0
+631 0
+632 0
+633 0
+634 0
+635 0
+636 0
+637 0
+638 0
+639 0
+640 0
+641 0
+642 0
+643 0
+644 0
+645 0
+646 0
+647 0
+648 0
+649 0
+650 0
+651 0
+652 0
+653 0
+654 0
+655 0
+656 0
+657 0
+658 0
+659 0
+660 0
+661 0
+662 0
+663 0
+664 0
+665 0
+666 0
+667 0
+668 0
+669 0
+670 0
+671 0
+672 0
+673 0
+674 0
+675 0
+676 0
+677 0
+678 0
+679 0
+680 0
+681 0
+682 0
+683 0
+684 0
+685 0
+686 0
+687 0
+688 0
+689 0
+690 0
+691 0
+692 0
+693 0
+694 0
+695 0
+696 0
+697 0
+698 0
+699 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+842 0
+843 0
+844 0
+845 0
+846 0
+847 0
+848 0
+849 0
+850 0
+851 0
+852 0
+853 0
+854 0
+855 0
+856 0
+857 0
+858 0
+859 0
+860 0
+861 0
+862 0
+863 0
+864 0
+865 0
+866 0
+867 0
+868 0
+869 0
+870 0
+871 0
+872 0
+873 0
+874 0
+875 0
+876 0
+877 0
+878 0
+879 0
+880 0
+881 0
+882 0
+883 0
+884 0
+885 0
+886 0
+887 0
+888 0
+889 0
+890 0
+891 0
+892 0
+893 0
+894 0
+895 0
+896 0
+897 0
+898 0
+899 0
+900 0
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
+914 0
+915 0
+916 0
+917 0
+918 0
+919 0
+920 0
+921 0
+922 0
+923 0
+924 0
+925 0
+926 0
+927 0
+928 0
+929 0
+930 0
+931 0
+932 0
+933 0
+934 0
+935 0
+936 0
+937 0
+938 0
+939 0
+940 0
+941 0
+942 0
+943 0
+944 0
+945 0
+946 0
+947 0
+948 0
+949 0
+950 0
+951 0
+952 0
+953 0
+954 0
+955 0
+956 0
+957 0
+958 0
+959 0
+960 0
+961 0
+962 0
+963 0
+964 0
+965 0
+966 0
+967 0
+968 0
+969 0
+970 0
+971 0
+972 0
+973 0
+974 0
+975 0
+976 0
+977 0
+978 0
+979 0
+980 0
+981 0
+982 0
+983 0
+984 0
+985 0
+986 0
+987 0
+988 0
+989 0
+990 0
+991 0
+992 0
+993 0
+994 0
+995 0
+996 0
+997 0
+998 0
+999 0
+1000 0
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
+1015 0
+1016 0
+1017 0
+1018 0
+1019 0
+1020 0
+1021 0
+1022 0
+1023 0
+1024 0
+1025 0
+1026 0
+1027 0
+1028 0
+1029 0
+1030 0
+1031 0
+1032 0
+1033 0
+1034 0
+1035 0
+1036 0
+1037 0
+1038 0
+1039 0
+1040 0
+1041 0
+1042 0
+1043 0
+1044 0
+1045 0
+1046 0
+1047 0
+1048 0
+1049 0
+1050 0
+1051 0
+1052 0
+1053 0
+1054 0
+1055 0
+1056 0
+1057 0
+1058 0
+1059 0
+1060 0
+1061 0
+1062 0
+1063 0
+1064 0
+1065 0
+1066 0
+1067 0
+1068 0
+1069 0
+1070 0
+1071 0
+1072 0
+1073 0
+1074 0
+1075 0
+1076 0
+1077 0
+1078 0
+1079 0
+1080 0
+1081 0
+1082 0
+1083 0
+1084 0
+1085 0
+1086 0
+1087 0
+1088 0
+1089 0
+1090 0
+1091 0
+1092 0
+1093 0
+1094 0
+1095 0
+1096 0
+1097 0
+1098 0
+1099 0
+1100 0
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
+1112 0
+1113 0
+1114 0
+1115 0
+1116 0
+1117 0
+1118 0
+1119 0
+1120 0
+1121 0
+1122 0
+1123 0
+1124 0
+1125 0
+1126 0
+1127 0
+1128 0
+1129 0
+1130 0
+1131 0
+1132 0
+1133 0
+1134 0
+1135 0
+1136 0
+1137 0
+1138 0
+1139 0
+1140 0
+1141 0
+1142 0
+1143 0
+1144 0
+1145 0
+1146 0
+1147 0
+1148 0
+1149 0
+1150 0
+1151 0
+1152 0
+1153 0
+1154 0
+1155 0
+1156 0
+1157 0
+1158 0
+1159 0
+1160 0
+1161 0
+1162 0
+1163 0
+1164 0
+1165 0
+1166 0
+1167 0
+1168 0
+1169 0
+1170 0
+1171 0
+1172 0
+1173 0
+1174 0
+1175 0
+1176 0
+1177 0
+1178 0
+1179 0
+1180 0
+1181 0
+1182 0
+1183 0
+1184 0
+1185 0
+1186 0
+1187 0
+1188 0
+1189 0
+1190 0
+1191 0
+1192 0
+1193 0
+1194 0
+1195 0
+1196 0
+1197 0
+1198 0
+1199 0
+1200 0
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1215 0
+1216 0
+1217 0
+1218 0
+1219 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1263 0
+1264 0
+1265 0
+1266 0
+1267 0
+1268 0
+1269 0
+1270 0
+1271 0
+1272 0
+1273 0
+1274 0
+1275 0
+1276 0
+1277 0
+1278 0
+1279 0
+1280 0
+1281 0
+1282 0
+1283 0
+1284 0
+1285 0
+1286 0
+1287 0
+1288 0
+1289 0
+1290 0
+1291 0
+1292 0
+1293 0
+1294 0
+1295 0
+1296 0
+1297 0
+1298 0
+1299 0
+1300 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1307 0
+1308 0
+1309 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1566 0
+1567 0
+1568 0
+1569 0
+1570 0
+1571 0
+1572 0
+1573 0
+1574 0
+1575 0
+1576 0
+1577 0
+1578 0
+1579 0
+1580 0
+1581 0
+1582 0
+1583 0
+1584 0
+1585 0
+1586 0
+1587 0
+1588 0
+1589 0
+1590 0
+1591 0
+1592 0
+1593 0
+1594 0
+1595 0
+1596 0
+1597 0
+1598 0
+1599 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1608 0
+1609 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1618 0
+1619 0
+1620 0
+1621 0
+1622 0
+1623 0
+1624 0
+1625 0
+1626 0
+1627 0
+1628 0
+1629 0
+1630 0
+1631 0
+1632 0
+1633 0
+1634 0
+1635 0
+1636 0
+1637 0
+1638 0
+1639 0
+1640 0
+1641 0
+1642 0
+1643 0
+1644 0
+1645 0
+1646 0
+1647 0
+1648 0
+1649 0
+1650 0
+1651 0
+1652 0
+1653 0
+1654 0
+1655 0
+1656 0
+1657 0
+1658 0
+1659 0
+1660 0
+1661 0
+1662 0
+1663 0
+1664 0
+1665 0
+1666 0
+1667 0
+1668 0
+1669 0
+1670 0
+1671 0
+1672 0
+1673 0
+1674 0
+1675 0
+1676 0
+1677 0
+1678 0
+1679 0
+1680 0
+1681 0
+1682 0
+1683 0
+1684 0
+1685 0
+1686 0
+1687 0
+1688 0
+1689 0
+1690 0
+1691 0
+1692 0
+1693 0
+1694 0
+1695 0
+1696 0
+1697 0
+1698 0
+1699 0
+1700 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
+1712 0
+1713 0
+1714 0
+1715 0
+1716 0
+1717 0
+1718 0
+1719 0
+1720 0
+1721 0
+1722 0
+1723 0
+1724 0
+1725 0
+1726 0
+1727 0
+1728 0
+1729 0
+1730 0
+1731 0
+1732 0
+1733 0
+1734 0
+1735 0
+1736 0
+1737 0
+1738 0
+1739 0
+1740 0
+1741 0
+1742 0
+1743 0
+1744 0
+1745 0
+1746 0
+1747 0
+1748 0
+1749 0
+1750 0
+1751 0
+1752 0
+1753 0
+1754 0
+1755 0
+1756 0
+1757 0
+1758 0
+1759 0
+1760 0
+1761 0
+1762 0
+1763 0
+1764 0
+1765 0
+1766 0
+1767 0
+1768 0
+1769 0
+1770 0
+1771 0
+1772 0
+1773 0
+1774 0
+1775 0
+1776 0
+1777 0
+1778 0
+1779 0
+1780 0
+1781 0
+1782 0
+1783 0
+1784 0
+1785 0
+1786 0
+1787 0
+1788 0
+1789 0
+1790 0
+1791 0
+1792 0
+1793 0
+1794 0
+1795 0
+1796 0
+1797 0
+1798 0
+1799 0
+1800 0
+1801 0
+1802 0
+1803 0
+1804 0
+1805 0
+1806 0
+1807 0
+1808 0
+1809 0
+1810 0
+1811 0
+1812 0
+1813 0
+1814 0
+1815 0
+1816 0
+1817 0
+1818 0
+1819 0
+1820 0
+1821 0
+1822 0
+1823 0
+1824 0
+1825 0
+1826 0
+1827 0
+1828 0
+1829 0
+1830 0
+1831 0
+1832 0
+1833 0
+1834 0
+1835 0
+1836 0
+1837 0
+1838 0
+1839 0
+1840 0
+1841 0
+1842 0
+1843 0
+1844 0
+1845 0
+1846 0
+1847 0
+1848 0
+1849 0
+1850 0
+1851 0
+1852 0
+1853 0
+1854 0
+1855 0
+1856 0
+1857 0
+1858 0
+1859 0
+1860 0
+1861 0
+1862 0
+1863 0
+1864 0
+1865 0
+1866 0
+1867 0
+1868 0
+1869 0
+1870 0
+1871 0
+1872 0
+1873 0
+1874 0
+1875 0
+1876 0
+1877 0
+1878 0
+1879 0
+1880 0
+1881 0
+1882 0
+1883 0
+1884 0
+1885 0
+1886 0
+1887 0
+1888 0
+1889 0
+1890 0
+1891 0
+1892 0
+1893 0
+1894 0
+1895 0
+1896 0
+1897 0
+1898 0
+1899 0
+1900 0
+1901 0
+1902 0
+1903 0
+1904 0
+1905 0
+1906 0
+1907 0
+1908 0
+1909 0
+1910 0
+1911 0
+1912 0
+1913 0
+1914 0
+1915 0
+1916 0
+1917 0
+1918 0
+1919 0
+1920 0
+1921 0
+1922 0
+1923 0
+1924 0
+1925 0
+1926 0
+1927 0
+1928 0
+1929 0
+1930 0
+1931 0
+1932 0
+1933 0
+1934 0
+1935 0
+1936 0
+1937 0
+1938 0
+1939 0
+1940 0
+1941 0
+1942 0
+1943 0
+1944 0
+1945 0
+1946 0
+1947 0
+1948 0
+1949 0
+1950 0
+1951 0
+1952 0
+1953 0
+1954 0
+1955 0
+1956 0
+1957 0
+1958 0
+1959 0
+1960 0
+1961 0
+1962 0
+1963 0
+1964 0
+1965 0
+1966 0
+1967 0
+1968 0
+1969 0
+1970 0
+1971 0
+1972 0
+1973 0
+1974 0
+1975 0
+1976 0
+1977 0
+1978 0
+1979 0
+1980 0
+1981 0
+1982 0
+1983 0
+1984 0
+1985 0
+1986 0
+1987 0
+1988 0
+1989 0
+1990 0
+1991 0
+1992 0
+1993 0
+1994 0
+1995 0
+1996 0
+1997 0
+1998 0
+1999 0
+2000 0
+2001 0
+2002 0
+2003 0
+2004 0
+2005 0
+2006 0
+2007 0
+2008 0
+2009 0
+2010 0
+2011 0
+2012 0
+2013 0
+2014 0
+2015 0
+2016 0
+2017 0
+2018 0
+2019 0
+2020 0
+2021 0
+2022 0
+2023 0
+2024 0
+2025 0
+2026 0
+2027 0
+2028 0
+2029 0
+2030 0
+2031 0
+2032 0
+2033 0
+2034 0
+2035 0
+2036 0
+2037 0
+2038 0
+2039 0
+2040 0
+2041 0
+2042 0
+2043 0
+2044 0
+2045 0
+2046 0
+2047 0
+2048 0
+2049 0
+2050 0
+2051 0
+2052 0
+2053 0
+2054 0
+2055 0
+2056 0
+2057 0
+2058 0
+2059 0
+2060 0
+2061 0
+2062 0
+2063 0
+2064 0
+2065 0
+2066 0
+2067 0
+2068 0
+2069 0
+2070 0
+2071 0
+2072 0
+2073 0
+2074 0
+2075 0
+2076 0
+2077 0
+2078 0
+2079 0
+2080 0
+2081 0
+2082 0
+2083 0
diff --git a/evidence/allen-omega-L694/L740/independent-review/parent-verification.md b/evidence/allen-omega-L694/L740/independent-review/parent-verification.md
new file mode 100644
index 00000000..b8c4c404
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/parent-verification.md
@@ -0,0 +1,20 @@
+# L744 parent verification
+
+No correctness finding at exact a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d.
+All16 exported source files match pinned Git bytes. Independently reconstructed
+final probe concatenation: base, vendor/sha256-core, runtime, code, courier,
+scheduler, memory, intent, reply, view, scene, scene-input, tests/check, then
+probes/scene-independent-v3.om. Reported bundle and ELF hashes match actual bytes.
+Parent rebuilt final probe byte-identically and ran2084/2084 assertions,exit0.
+The published63-check scene-input suite also remains green in the current full
+gate. Scene product/test files are unchanged from the reviewed pin.
+
+Original v1 expected two hidden lines but its fixture has three (opening line,
+inside line, closing line). The already-published contract hides all three;
+corrected v2 and added-boundaries v3 did not alter production. Original failure,
+probe revisions and report are preserved. This clears only L740/L744 scene core,
+not new L746 context, application/display attachment or target qualification.
+
+Report SHA:e3ca62be1d5876da089c86852874f380c6c9876bf7d9e1a375ffc049804ef421.
+Bundle SHA:2c1c00919db88b0b40e294b23f4d4431d1d3638e2c9eb2e371c194a8e5c9886e.
+ELF SHA:9c47cbb650c222bf0ac310664c00b316638dbf85dc6f32621f799142b8dfc94b.
diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v1.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v1.om
new file mode 100644
index 00000000..31f2c7ce
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v1.om
@@ -0,0 +1,58 @@
+text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n"
+text Bad "number: nope\n"
+text Fallback "Plain words survive.\n"
+global Saved uchar 2048
+fn test ok bool to void
+check ok get Checks 0
+end
+fn main to int
+put Inlen 0 len Thought
+for i ulong len Thought
+put In i get Thought i
+put Saved i get Thought i
+end
+test scdecode
+test eq get Nm 3 2
+test eq get Sc 2 1
+same = true
+for i ulong len Thought
+if ne get In i get Saved i
+same = false
+end
+end
+test same
+test eq get Inlen 0 len Thought
+test eq get Stext get Sw 3 75
+put Inlen 0 len Bad
+for i ulong len Bad
+put In i get Bad i
+end
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 0
+test eq get Inlen 0 len Bad
+for i ulong len Bad
+test eq get In i get Bad i
+end
+put Inlen 0 len Fallback
+for i ulong len Fallback
+put In i get Fallback i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Stext get Sw 3 80
+put Inlen 0 2048
+for i ulong 2048
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Inlen 0 2048
+for i ulong 2048
+test eq get In i 120
+end
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v2.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v2.om
new file mode 100644
index 00000000..b557f1b9
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v2.om
@@ -0,0 +1,58 @@
+text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n"
+text Bad "number: nope\n"
+text Fallback "Plain words survive.\n"
+global Saved uchar 2048
+fn test ok bool to void
+check ok get Checks 0
+end
+fn main to int
+put Inlen 0 len Thought
+for i ulong len Thought
+put In i get Thought i
+put Saved i get Thought i
+end
+test scdecode
+test eq get Nm 3 3
+test eq get Sc 2 1
+same = true
+for i ulong len Thought
+if ne get In i get Saved i
+same = false
+end
+end
+test same
+test eq get Inlen 0 len Thought
+test eq get Stext get Sw 3 75
+put Inlen 0 len Bad
+for i ulong len Bad
+put In i get Bad i
+end
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 0
+test eq get Inlen 0 len Bad
+for i ulong len Bad
+test eq get In i get Bad i
+end
+put Inlen 0 len Fallback
+for i ulong len Fallback
+put In i get Fallback i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Stext get Sw 3 80
+put Inlen 0 2048
+for i ulong 2048
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Inlen 0 2048
+for i ulong 2048
+test eq get In i 120
+end
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v3.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v3.om
new file mode 100644
index 00000000..5df72446
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v3.om
@@ -0,0 +1,66 @@
+text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n"
+text Bad "number: nope\n"
+text Fallback "Plain words survive.\n"
+global Saved uchar 2048
+fn test ok bool to void
+check ok get Checks 0
+end
+fn main to int
+put Inlen 0 len Thought
+for i ulong len Thought
+put In i get Thought i
+put Saved i get Thought i
+end
+test scdecode
+test eq get Nm 3 3
+test eq get Sc 2 1
+same = true
+for i ulong len Thought
+if ne get In i get Saved i
+same = false
+end
+end
+test same
+test eq get Inlen 0 len Thought
+test eq get Stext get Sw 3 75
+put Inlen 0 len Bad
+for i ulong len Bad
+put In i get Bad i
+end
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 0
+test eq get Inlen 0 len Bad
+for i ulong len Bad
+test eq get In i get Bad i
+end
+put Inlen 0 len Fallback
+for i ulong len Fallback
+put In i get Fallback i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Stext get Sw 3 80
+put Inlen 0 2047
+for i ulong 2047
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 0
+test eq get Nm 1 2048
+test eq get Inlen 0 2047
+put Inlen 0 2048
+for i ulong 2048
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Inlen 0 2048
+for i ulong 2048
+test eq get In i 120
+end
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent.om
new file mode 100644
index 00000000..31f2c7ce
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent.om
@@ -0,0 +1,58 @@
+text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n"
+text Bad "number: nope\n"
+text Fallback "Plain words survive.\n"
+global Saved uchar 2048
+fn test ok bool to void
+check ok get Checks 0
+end
+fn main to int
+put Inlen 0 len Thought
+for i ulong len Thought
+put In i get Thought i
+put Saved i get Thought i
+end
+test scdecode
+test eq get Nm 3 2
+test eq get Sc 2 1
+same = true
+for i ulong len Thought
+if ne get In i get Saved i
+same = false
+end
+end
+test same
+test eq get Inlen 0 len Thought
+test eq get Stext get Sw 3 75
+put Inlen 0 len Bad
+for i ulong len Bad
+put In i get Bad i
+end
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 0
+test eq get Inlen 0 len Bad
+for i ulong len Bad
+test eq get In i get Bad i
+end
+put Inlen 0 len Fallback
+for i ulong len Fallback
+put In i get Fallback i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Stext get Sw 3 80
+put Inlen 0 2048
+for i ulong 2048
+put In i 120
+end
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Inlen 0 2048
+for i ulong 2048
+test eq get In i 120
+end
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/independent-review/report.md b/evidence/allen-omega-L694/L740/independent-review/report.md
new file mode 100644
index 00000000..2718fbc5
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/report.md
@@ -0,0 +1,41 @@
+# L744 independent review — L740 native Omega scene decoder
+
+## Verdict
+
+No correctness finding in the reviewed `scdecode` scope at `a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d`. The implementation behaved as documented on the focused upstream test and independent boundary/recovery probes below. This does not approve application attachment, full Allen parity, target UI, hardware, service, or deployment.
+
+## Immutable source and execution closure
+
+- Spark checkout: `/home/drakestapleton/workspace/aienos-allen-omega-L694`
+- Exact HEAD: `a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d`; parent: `8d0d11babf7cc3b57ee000a265aeda9fe531ebf0`; checkout porcelain status count: `0`.
+- Exported required source using `git archive ... | tar -x` under `/home/drakestapleton/handoffs/L744-review/source`. `git hash-object` matched pinned Git blobs for `scene-input.om` (`48c58ce8702d5108bfe4114ed53e363195f7e578`), `tests/scene-input.om` (`51ef9bf7259a9d41625f6cca20fe60fbc1240a5f`), strict `scene.om` (`376fd36150c85bd2e9774e8e7a1ef7204911457d`), `README.md` (`dfaa4d1cce2cdcc3c7e4c1d77f2aecc6cca3b111`) and `build-one.sh` (`c2c303dbb96bc3f9e7449983ce30cf39e64cbd55`).
+- Pinned compiler `/home/drakestapleton/handoffs/allen-omega-L694/omc`, SHA256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Each binary was built by exported `build-one.sh`, which checked that hash and required nonempty static AArch64 EXEC output. `readelf` confirmed `Type: EXEC` and `Machine: AArch64` for both.
+
+## Executed probes and receipts
+
+All new executable probe logic is handwritten Omega; shell only assembled source, invoked the pinned build, ran binaries and collected logs.
+
+1. **Focused pinned test, independently rebuilt:** concatenated exported dependencies, strict `scene.om`, `scene-input.om`, `tests/check.om` and pinned `tests/scene-input.om`; ran `build-one.sh` then `outputs/upstream-scene-test`. Exit `0`; 63 check lines, zero failure (`1`) lines. ELF SHA256 `4f4490e78b193ae6b1f4df12700db73dde18f7e7ffd5a9e3bfd76f5c5d873774`. Source bundle SHA256 `2f6b3345cf8e0633c0217d141929b2d961b044f78a258c46ead9a0d106885151`.
+2. **Independent Omega probe:** `probes/scene-independent-v3.om`; checks mixed-case thought tags and hidden-line behavior, visible mixed-case text, exact caller input/length restoration, malformed known `number:` refusal without fallback, plain-text fallback, 2047-byte input normalizing to exactly 2048 bytes, and 2048-byte unterminated input whose appended newline overflows normalization (full refusal and cleared metadata). Rebuilt from exported source and ran `outputs/scene-independent-v3`; exit `0`, 2084/2084 assertions pass. ELF SHA256 `9c47cbb650c222bf0ac310664c00b316638dbf85dc6f32621f799142b8dfc94b`; complete Omega source bundle SHA256 `2c1c00919db88b0b40e294b23f4d4431d1d3638e2c9eb2e371c194a8e5c9886e`.
+3. **Preserved probe iteration:** v1 expected two hidden lines for `secret\nsay: hidden\n`, but actual was three: the opening-tag line, enclosed line and closing-tag line are all hidden. This was a mistaken probe expectation, not a product failure. v1 compiled to a valid executable and failed only check 1 (`outputs/scene-independent.log`, exit 1). Corrected v2 changed only expected hidden-line count to 3 and passed. v3 adds exact 2047/2048 normalization-boundary assertions. All revisions remain in `probes/` and corresponding `outputs/`.
+
+## Source review notes
+
+- `scene-input.om` locations: `nmatch` line 20; bounded `nemit` line 31; thought/fence/canonical-line handling in `nprocess` line 126; malformed-known versus prose fallback in `nappend` line 187; metadata reset in `nclear` line 232; snapshot/normalize/parse/restore transaction in `scdecode` line 241. README contract/attachment caveat: lines 76–95.
+- `scene-input.om`: `nmatch` performs ASCII case-folded byte-exact matching of `` and ``; `nprocess` hides tag-bearing lines and all lines while the state is open, including the unclosed-to-end case. The probe confirms mixed-case tags do not expose enclosed text.
+- `nemit` bounds normalized output before writing; overflow sets `Nm[6]`, and `scdecode` clears scene metadata instead of parsing partial output. Probe observed 2047 raw bytes plus synthesized LF => exactly 2048 normalized bytes, while 2048 raw bytes without LF are refused because normalization would require byte 2049.
+- `scdecode` snapshots bytes before normalization, publishes normalized bytes only during `scene` / fallback parsing, then restores all `n` input bytes and `Inlen`; malformed-known-command, fallback and overflow calls were followed by checks of unchanged input and refreshed metadata.
+- `nprocess` tracks only the first 12 nonempty eligible canonical lines; hidden thought lines and fence lines return before incrementing that count. Pinned test covers canonical-line fallback/mood cap; this review did not rerun the full Allen suite.
+- `nappend` keeps malformed recognized structured keywords out of prose fallback while allowing the first short unknown line if no recognized scene is accepted. Independent malformed-number and plain-text cases passed.
+- README explicitly says this API is not yet attached to the application reply/display provider; that integration and full visual/target parity remain unqualified.
+
+## Commands / raw receipts
+
+Compiler/build pattern (run on Spark):
+
+```sh
+/native/omega/allen/build-one.sh
+ >
+```
+
+Artifacts, Omega probe revisions, binaries and logs are retained under `/home/drakestapleton/handoffs/L744-review/{source,probes,outputs}`. Parent's prior full 1337-check / mutant evidence was not rerun; this review re-executed only the focused scene-input test and new focused probes.
diff --git a/evidence/allen-omega-L694/L740/independent-review/source-closure.sha256 b/evidence/allen-omega-L694/L740/independent-review/source-closure.sha256
new file mode 100644
index 00000000..fea33e38
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/independent-review/source-closure.sha256
@@ -0,0 +1,16 @@
+026fbf4376c85993a23d66cfab302440ebc26544c7f07405bedae50cf0f1b701 native/omega/allen/README.md
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L740/intent.log b/evidence/allen-omega-L694/L740/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L740/keepalive-mutant.log b/evidence/allen-omega-L694/L740/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L740/long.log b/evidence/allen-omega-L694/L740/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L740/memory.log b/evidence/allen-omega-L694/L740/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L740/paint.log b/evidence/allen-omega-L694/L740/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L740/pendingwire-mutant.log b/evidence/allen-omega-L694/L740/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L740/readback-mutant.log b/evidence/allen-omega-L694/L740/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L740/red2.exit b/evidence/allen-omega-L694/L740/red2.exit
new file mode 100644
index 00000000..64bb6b74
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/red2.exit
@@ -0,0 +1 @@
+30
diff --git a/evidence/allen-omega-L694/L740/red2.log b/evidence/allen-omega-L694/L740/red2.log
new file mode 100644
index 00000000..783446bc
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/red2.log
@@ -0,0 +1,54 @@
+1 1
+2 1
+3 1
+4 1
+5 1
+6 1
+7 1
+8 0
+9 0
+10 1
+11 0
+12 1
+13 1
+14 0
+15 1
+16 1
+17 0
+18 1
+19 1
+20 1
+21 0
+22 0
+23 0
+24 1
+25 1
+26 1
+27 0
+28 1
+29 1
+30 0
+31 1
+32 0
+33 0
+34 0
+35 1
+36 1
+37 1
+38 0
+39 1
+40 1
+41 0
+42 0
+43 1
+44 1
+45 0
+46 0
+47 1
+48 0
+49 0
+50 0
+51 1
+52 0
+53 0
+54 0
diff --git a/evidence/allen-omega-L694/L740/red2.om b/evidence/allen-omega-L694/L740/red2.om
new file mode 100644
index 00000000..738ab470
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/red2.om
@@ -0,0 +1,3063 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+global Nm ulong 8
+fn scdecode to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fancy "\t- **SaY**:\tKeep My CASE.~\n> NOTE RIGHT WARM: Title | Body TEXT\n"
+text Private "say secret\nnote: secret | hidden\n\n```scene\nsay Visible\n```\n"
+text Inline "say public secret\nsay Safe\n"
+text Unclosed "never closed\nsay secret\n"
+text Plain "Hello there.\nAnother sentence.\n"
+text Mixed "Unrecognized text.\nnote: Heading | Body\n"
+text Invalid "number: nope\n"
+text Moodonly "MOOD Dawn Lively\n"
+text Listmark "1. note left: Heading | Body\n"
+text Wanted "Keep My CASE."
+text Vis "Visible"
+text Hello "Hello there."
+global Savedin uchar 2048
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn load which ulong to void
+if eq which 0
+put Inlen 0 len Fancy
+for i ulong len Fancy
+c = get Fancy i
+if eq c 126
+c = uchar 13
+end
+put In i c
+end
+end
+if eq which 1
+put Inlen 0 len Private
+for i ulong len Private
+put In i get Private i
+end
+end
+if eq which 2
+put Inlen 0 len Inline
+for i ulong len Inline
+put In i get Inline i
+end
+end
+if eq which 3
+put Inlen 0 len Unclosed
+for i ulong len Unclosed
+put In i get Unclosed i
+end
+end
+if eq which 4
+put Inlen 0 len Plain
+for i ulong len Plain
+put In i get Plain i
+end
+end
+if eq which 5
+put Inlen 0 len Mixed
+for i ulong len Mixed
+put In i get Mixed i
+end
+end
+if eq which 6
+put Inlen 0 len Invalid
+for i ulong len Invalid
+put In i get Invalid i
+end
+end
+if eq which 7
+put Inlen 0 len Moodonly
+for i ulong len Moodonly
+put In i get Moodonly i
+end
+end
+if eq which 8
+put Inlen 0 len Listmark
+for i ulong len Listmark
+put In i get Listmark i
+end
+end
+end
+fn main to int
+load 0
+n = get Inlen 0
+for i ulong n
+put Savedin i get In i
+end
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 1
+test eq get Things 0 1
+test eq get Things 1 2
+test eq get Things 4 1
+test gt get Nm 2 0
+test eq get Inlen 0 n
+same = true
+for i ulong n
+if ne get In i get Savedin i
+same = false
+end
+end
+test same
+same = true
+for i ulong len Wanted
+if ne get Stext add get Sw 3 i get Wanted i
+same = false
+end
+end
+test same
+test eq get Stext add get Sw 3 len Wanted 0
+load 1
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 0
+test eq get Nm 3 3
+same = true
+for i ulong len Vis
+if ne get Stext add get Sw 3 i get Vis i
+same = false
+end
+end
+test same
+test eq get Stext add get Sw 3 len Vis 0
+load 2
+test scdecode
+test eq get Nm 3 1
+test eq get Stext get Sw 3 83
+load 3
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+test eq get Nm 0 1
+load 4
+test scdecode
+test eq get Sc 2 1
+test eq get Sc 3 0
+same = true
+for i ulong len Hello
+if ne get Stext add get Sw 3 i get Hello i
+same = false
+end
+end
+test same
+load 5
+test scdecode
+test eq get Sc 2 0
+test eq get Sc 3 1
+load 6
+test not scdecode
+test eq get Sc 2 0
+test eq get Sc 3 0
+load 7
+test scdecode
+test eq get Sc 0 1
+test eq get Sc 1 2
+test eq get Sc 2 0
+load 8
+test scdecode
+test eq get Things 1 1
+put Inlen 0 160
+for i ulong 160
+put In i 120
+end
+test not scdecode
+test eq get Sc 2 0
+put Inlen 0 159
+test scdecode
+test eq get Sc 2 1
+test eq get Stext add get Sw 3 159 0
+put Inlen 0 2049
+test not scdecode
+test eq get Nm 6 1
+test eq get Sc 2 0
+test eq get Sc 3 0
+load 4
+put In 2 0
+test not scdecode
+test eq get Nm 6 1
+test eq get In 2 0
+put Inlen 0 0
+test not scdecode
+test eq get Sc 2 0
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L740/reply.log b/evidence/allen-omega-L694/L740/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L740/runtime.log b/evidence/allen-omega-L694/L740/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L740/scene-input.log b/evidence/allen-omega-L694/L740/scene-input.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/scene-input.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L740/scene.log b/evidence/allen-omega-L694/L740/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L740/scenecap-mutant.log b/evidence/allen-omega-L694/L740/scenecap-mutant.log
new file mode 100644
index 00000000..502843ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/scenecap-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L740/scheduler.log b/evidence/allen-omega-L694/L740/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L740/session-mutant.log b/evidence/allen-omega-L694/L740/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L740/short.log b/evidence/allen-omega-L694/L740/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L740/source.sha256 b/evidence/allen-omega-L694/L740/source.sha256
new file mode 100644
index 00000000..b3368fdf
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/source.sha256
@@ -0,0 +1,41 @@
+68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+4952ec81822586a6018b32ffaf0ad4de50320e195b5c509c6b4bb4b9da96241c native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+026fbf4376c85993a23d66cfab302440ebc26544c7f07405bedae50cf0f1b701 native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L740/stale-mutant.log b/evidence/allen-omega-L694/L740/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L740/thinking-mutant.log b/evidence/allen-omega-L694/L740/thinking-mutant.log
new file mode 100644
index 00000000..74b41a12
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/thinking-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L740/view.log b/evidence/allen-omega-L694/L740/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L740/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L746/README.md b/evidence/allen-omega-L694/L746/README.md
new file mode 100644
index 00000000..4398a74c
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/README.md
@@ -0,0 +1,30 @@
+# L746 restored memory to real application jobs
+
+Based on a65b70e. Handwritten seeded Omega context.om and tests/context.om;
+appask now validates/stages context before jobbuild reads variable-layout names,
+then appends memory metadata before the actual qsubmit snapshots the wire job.
+No disk, networking, live model or target provider was added.
+
+Initial old-application RED (`red`) trapped103 after62 checks at deliberately
+invalid fact count33: self-name offset3769 exceeded Mem capacity3692. Preserved
+as the old unchecked application path, not a complete assertion-suite result.
+After connecting compilable context stubs, RED (`red2`) completed84 assertions,
+46 failures,exit46. Implementation passed84/84. Expanded tests ran against the
+same stub:142 checks,76 failures,exit76 (`red3`); real implementation then passed
+142/142 (`green3`). Initial implementation compile error3 was unsupported `mod`;
+corrected to the seed grammar's `rem`, not counted as behavioral evidence.
+
+Coverage includes actual memory codec load, note record validation/loading in
+arbitrary order, duplicate/damaged/deleted handling, incomplete catalog refusal,
+newest-six/zero-note selection, literal metadata bytes, context carried inside
+actual appask/qsubmit JOB, exact4096-byte append and overflow refusal, maximum
+counts, malformed fields, u32 decimal starts, preserved Unit/Enc, and untouched
+conversation/wire IDs and history on refused admission. Metadata-only and
+complete-JOB overflow are tested separately. No silent dropping or truncation.
+
+Fresh complete combined gate:
+`quiet-build native/omega/allen/gate.sh ~/handoffs/allen-omega-L694/L746/full`.
+Exact totals and13 rejected compiled mutants in counts.json/full.log. Original
+memory/stdio goldens and oversized-stdio refusal remain passing. Input inventory
+was verified byte-for-byte before commit. Independent review pending for L746;
+newest-source whole-repo strict/hardware qualification is not claimed.
diff --git a/evidence/allen-omega-L694/L746/ackstop-mutant.log b/evidence/allen-omega-L694/L746/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L746/appcode-mutant.log b/evidence/allen-omega-L694/L746/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L746/application.log b/evidence/allen-omega-L694/L746/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L746/binaries.sha256 b/evidence/allen-omega-L694/L746/binaries.sha256
new file mode 100644
index 00000000..5d262913
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/binaries.sha256
@@ -0,0 +1,32 @@
+b696eb3591d6f099cdeda23fde9f95190bac8032af8373f37939a2b022bc7868 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scheduler
+a255cf7f1ac2515745c4da4d26b0ea3f548220e842f4ae7c9a90891001d90677 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/readback-mutant
+8600e48a2b32b303e464ec56f736592a1e80fb654a308a361ffb0af1f53d70ce /home/drakestapleton/handoffs/allen-omega-L694/L746/full/view
+a0905642a10c77023ad8ec014b7a3842cc1449cf388051cdddbeb5829053954b /home/drakestapleton/handoffs/allen-omega-L694/L746/full/contextnote-mutant
+f9fadb9d2623638f3266c4b40caf789d5210d975cd40e960594cfbaea103b5e1 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/allen
+1a02760c7152dcd00d0b54e1d18e76363027844b50d1fcf7acca7215d9d44bf1 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/reply
+6cb7df727ed6456b7276cdcbd061220f4d67ba3adb8e115e5db831e96298c5c0 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/thinking-mutant
+ab479627a8fa91ae687e027c0f450fbe04e643d98aaf376003b7e74d02315fd6 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/ackstop-mutant
+ded0c8ffcc70b47fdafeb44bd1c3c235e369e1cf2f4631700859106a4a48056d /home/drakestapleton/handoffs/allen-omega-L694/L746/full/hash-mutant
+43d42b51b2a262bd399d285115d8e68844660cbee480f74b82f1a4d5739a7e33 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/golden
+6f00b6497d66d78de3fc2b4df886edf08f316459d513abdc55f0a538b5252d0c /home/drakestapleton/handoffs/allen-omega-L694/L746/full/session-mutant
+9caf41933bd193fb0012809245fab1d7398c4759efdd6a03ba7e907cd70e1394 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scene-input
+81e82e958dcfed364010d7f7eafe127c95381ffa3f6c1c0d92462214268381bd /home/drakestapleton/handoffs/allen-omega-L694/L746/full/intent
+10124a093e1d219a06bef656b6012ec5bcfa192c1f18e78ebc5c469cdc685dc0 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/fixture
+beace704881d0aed22615498b6b9e4b28e9ace95572c144b2c6d122ef3d600b8 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/context
+b44dc70ca4ec047a2bdc46bbd9913de36db00c4a2d76f1d54c27cfc68b1b1550 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/runtime
+67f40effbf7280b838eeed031ac9b69437a8868a6f1fa2ee168c2df41c1415ab /home/drakestapleton/handoffs/allen-omega-L694/L746/full/code
+db1e42016167744085b7b99ab8ec9a085d8521e96d96a54bdc1fa223de5a95ba /home/drakestapleton/handoffs/allen-omega-L694/L746/full/edges
+32d23cfee2c65f9320ff148f1c55db25d48b46cb42ccd8726323a2896cef1314 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/appcode-mutant
+01a7ef0a7542e60d1d27da0e07d7694d9ff5033da07435f7f9b1bbc158cd42ed /home/drakestapleton/handoffs/allen-omega-L694/L746/full/render
+e4ced11e495f81bc9902e18ef3119f217410cdf6147d3609e8413ae1135d74bd /home/drakestapleton/handoffs/allen-omega-L694/L746/full/stale-mutant
+1c743428e14dfb473fb11c383af6837bd0f4951948c0e31494154456f8f008f0 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/courier
+b6dbecc0f1757ac461f3fcd5c0e436ae3c4203435c261076bd385d46441e3993 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scene
+c9d202bb68794878f5d93fef837235a7aabc589493bbb0f0711bd896054a1265 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/pendingwire-mutant
+244cafef174b7fbdb72926c5881d91aae8de9ef530c5762f637e8386f339bbb9 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scenecap-mutant
+0593efe9ba395152b4a0a5ff50030a6d5f7dd2f485b38734f28de23544e21b0b /home/drakestapleton/handoffs/allen-omega-L694/L746/full/contextjob-mutant
+73aaca5355e563fb210827fcbd57c77ebde4e2641ee5505231eae2e387e3ff21 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/paint
+7954a1fda3c09acd8c71cab853cd001b1f81e3981a31e9de946968d29d8004be /home/drakestapleton/handoffs/allen-omega-L694/L746/full/crc-mutant
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/stdio-overflow-input
+9690cec2712a297c10ac004bc6c962f8a2c643fbc0209dba7c9477815806a4cf /home/drakestapleton/handoffs/allen-omega-L694/L746/full/keepalive-mutant
+1d43602bc8b9d06677f22f19937c84f4300e05684c9c5b45ffea7124b9985b68 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/memory
+c985545de37f9de140312316b13e41cd82b4532fb1d71c3ddd89a60c9de1b1d4 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/application
diff --git a/evidence/allen-omega-L694/L746/code.log b/evidence/allen-omega-L694/L746/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L746/context.log b/evidence/allen-omega-L694/L746/context.log
new file mode 100644
index 00000000..df62cddb
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/context.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L746/contextjob-mutant.log b/evidence/allen-omega-L694/L746/contextjob-mutant.log
new file mode 100644
index 00000000..3432d4b2
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/contextjob-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 0
+78 0
+79 1
+80 1
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 1
+89 0
+90 1
+91 0
+92 1
+93 0
+94 1
+95 0
+96 1
+97 0
+98 1
+99 0
+100 1
+101 0
+102 1
+103 0
+104 1
+105 0
+106 1
+107 0
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 1
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 1
+123 0
+124 1
+125 0
+126 1
+127 0
+128 1
+129 0
+130 1
+131 0
+132 1
+133 0
+134 1
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 1
+142 1
diff --git a/evidence/allen-omega-L694/L746/contextnote-mutant.log b/evidence/allen-omega-L694/L746/contextnote-mutant.log
new file mode 100644
index 00000000..b5c08759
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/contextnote-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 1
+38 1
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 1
+47 0
+48 1
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L746/counts.json b/evidence/allen-omega-L694/L746/counts.json
new file mode 100644
index 00000000..12ce083a
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/counts.json
@@ -0,0 +1,36 @@
+{
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "memory": 79,
+ "context": 142,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "scene-input": 63,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292
+ },
+ "total": 1479,
+ "mutant_failures": {
+ "stale": 3,
+ "crc": 2,
+ "hash": 2,
+ "readback": 7,
+ "session": 1,
+ "keepalive": 40,
+ "ackstop": 27,
+ "pendingwire": 1,
+ "appcode": 3,
+ "thinking": 6,
+ "scenecap": 3,
+ "contextnote": 5,
+ "contextjob": 36
+ }
+}
diff --git a/evidence/allen-omega-L694/L746/courier.log b/evidence/allen-omega-L694/L746/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L746/crc-mutant.log b/evidence/allen-omega-L694/L746/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L746/edges.log b/evidence/allen-omega-L694/L746/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L746/full.exit b/evidence/allen-omega-L694/L746/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L746/full.log b/evidence/allen-omega-L694/L746/full.log
new file mode 100644
index 00000000..e20a4123
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/full.log
@@ -0,0 +1,33 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L746/green2.exit b/evidence/allen-omega-L694/L746/green2.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/green2.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L746/green2.log b/evidence/allen-omega-L694/L746/green2.log
new file mode 100644
index 00000000..e1a7003c
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/green2.log
@@ -0,0 +1,84 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
diff --git a/evidence/allen-omega-L694/L746/green3.exit b/evidence/allen-omega-L694/L746/green3.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/green3.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L746/green3.log b/evidence/allen-omega-L694/L746/green3.log
new file mode 100644
index 00000000..df62cddb
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/green3.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L746/hash-mutant.log b/evidence/allen-omega-L694/L746/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L746/independent-review/inventory.json b/evidence/allen-omega-L694/L746/independent-review/inventory.json
new file mode 100644
index 00000000..d7cfe0b0
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/inventory.json
@@ -0,0 +1,22 @@
+{
+ "logs/build-v2.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "logs/build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "logs/compiler.sha256": "41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4",
+ "logs/context-independent-v2.log": "c53d3a95b75b9432e13209a484cf22ddbe554343b6b677d4fb13df78b4842492",
+ "logs/context-independent.failed-v1.log": "895d006cddd239d16658d8ad7b1a33eaeb1b196dd0538c00b9ca5f46ec33bbd6",
+ "logs/context-independent.log": "895d006cddd239d16658d8ad7b1a33eaeb1b196dd0538c00b9ca5f46ec33bbd6",
+ "logs/diff-check.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "logs/elf.txt": "168e6e039cda1e132c5f7906891896d9660ee6048a60337576a5ea1713a2ef3f",
+ "logs/export-members.txt": "3a001eb2a2fa7a3a9df2b18a5746d5490343e85810976699caa8545ab5fd8bed",
+ "logs/pin-source.sha256": "72f21cdc5a6e8f0e58311bcdf9c9e1c62fe851d89f120256876660191fd3497b",
+ "logs/probe.sha256": "f00354cad4a75dd5d2f8f01e4033cc0a13c5d7ecb39b2cd5642301a5ff356c9d",
+ "logs/scoped-source.sha256": "7832dee2649464574cb7b2be8a4ede6db1406415719298211c4e1b0c145501ac",
+ "logs/scoped.diff": "d2d8705c57aec09b9ab8e752f5da1e9f1f6ed7ba111a1e84a7f5d925d69bc4cc",
+ "parent-replay.log": "c53d3a95b75b9432e13209a484cf22ddbe554343b6b677d4fb13df78b4842492",
+ "parent-verification.json": "8d91ab9a5d045544772c184b0122f4b78e62dee6e0dd5b7c3d973bc4d6876603",
+ "probes/context-independent.failed-v1.full.om": "947295569c30fbb1a28db7b475fded345612ba3389fa40d5a52657958a92890d",
+ "probes/context-independent.full.om": "947295569c30fbb1a28db7b475fded345612ba3389fa40d5a52657958a92890d",
+ "probes/context-independent.om": "018ff259680b1a85579e101adb88b5a6d681108a8054df33f5ced59965b5480d",
+ "probes/core.om": "1bacb79258ca9c765f97ed45f62686f7edbfaca302d87b09f5a05ede70ef99b0",
+ "report.md": "ce5862d96c8f8f2b6dd11596f1f16f8996b336aad88ef98051a5b7bf626385d3"
+}
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/build-v2.log b/evidence/allen-omega-L694/L746/independent-review/logs/build-v2.log
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/build.log b/evidence/allen-omega-L694/L746/independent-review/logs/build.log
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/compiler.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/compiler.sha256
new file mode 100644
index 00000000..50e79ea9
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/compiler.sha256
@@ -0,0 +1 @@
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/context-independent-v2.log b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent-v2.log
new file mode 100644
index 00000000..600acb67
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent-v2.log
@@ -0,0 +1,150 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.failed-v1.log b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.failed-v1.log
new file mode 100644
index 00000000..daa4aaf1
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.failed-v1.log
@@ -0,0 +1,150 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.log b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.log
new file mode 100644
index 00000000..daa4aaf1
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.log
@@ -0,0 +1,150 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/diff-check.log b/evidence/allen-omega-L694/L746/independent-review/logs/diff-check.log
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/elf.txt b/evidence/allen-omega-L694/L746/independent-review/logs/elf.txt
new file mode 100644
index 00000000..b2862c75
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/elf.txt
@@ -0,0 +1,30 @@
+ELF Header:
+ Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
+ Class: ELF64
+ Data: 2's complement, little endian
+ Version: 1 (current)
+ OS/ABI: UNIX - System V
+ ABI Version: 0
+ Type: EXEC (Executable file)
+ Machine: AArch64
+ Version: 0x1
+ Entry point address: 0x4000b0
+ Start of program headers: 64 (bytes into file)
+ Start of section headers: 0 (bytes into file)
+ Flags: 0x0
+ Size of this header: 64 (bytes)
+ Size of program headers: 56 (bytes)
+ Number of program headers: 2
+ Size of section headers: 0 (bytes)
+ Number of section headers: 0
+ Section header string table index: 0
+
+Program Headers:
+ Type Offset VirtAddr PhysAddr
+ FileSiz MemSiz Flags Align
+ LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000
+ 0x0000000000015d88 0x0000000000015d88 R E 0x1000
+ LOAD 0x0000000000000000 0x0000000010000000 0x0000000010000000
+ 0x0000000000000000 0x00000000008749e0 RW 0x1000
+
+There is no dynamic section in this file.
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/export-members.txt b/evidence/allen-omega-L694/L746/independent-review/logs/export-members.txt
new file mode 100644
index 00000000..a8ff89bd
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/export-members.txt
@@ -0,0 +1,43 @@
+native/omega/allen/application.om
+native/omega/allen/base.om
+native/omega/allen/build-one.sh
+native/omega/allen/code.om
+native/omega/allen/context.om
+native/omega/allen/courier.om
+native/omega/allen/gate.sh
+native/omega/allen/golden.sh
+native/omega/allen/intent.om
+native/omega/allen/main.om
+native/omega/allen/memory.om
+native/omega/allen/paint.om
+native/omega/allen/README.md
+native/omega/allen/reply.om
+native/omega/allen/runtime.om
+native/omega/allen/scene-input.om
+native/omega/allen/scene.om
+native/omega/allen/scheduler.om
+native/omega/allen/tests/application.om
+native/omega/allen/tests/check.om
+native/omega/allen/tests/code.om
+native/omega/allen/tests/context.om
+native/omega/allen/tests/courier.om
+native/omega/allen/tests/edges.om
+native/omega/allen/tests/fixture.om
+native/omega/allen/tests/golden.om
+native/omega/allen/tests/intent.om
+native/omega/allen/tests/memory.om
+native/omega/allen/tests/paint.om
+native/omega/allen/tests/probe.om
+native/omega/allen/tests/render.om
+native/omega/allen/tests/reply.om
+native/omega/allen/tests/runtime.om
+native/omega/allen/tests/scene-input.om
+native/omega/allen/tests/scene.om
+native/omega/allen/tests/scheduler.om
+native/omega/allen/tests/stdio-overflow.om
+native/omega/allen/tests/view.om
+native/omega/allen/vendor/OMEGA-LICENSE
+native/omega/allen/vendor/PROVENANCE.md
+native/omega/allen/vendor/sha256-core.om
+native/omega/allen/vendor/sha256.om
+native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/pin-source.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/pin-source.sha256
new file mode 100644
index 00000000..993dab67
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/pin-source.sha256
@@ -0,0 +1,43 @@
+d1e99e2c1f4bcff06f6fda75fe2c3b48b75129526f15681cbd135b717bf1d11b native/omega/allen/README.md
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+69224f53c3c8a3f952fff210320cdfabc58da8a7f9e933ca863a33df528dc646 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/probe.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/probe.sha256
new file mode 100644
index 00000000..b8fbf7ef
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/probe.sha256
@@ -0,0 +1,3 @@
+018ff259680b1a85579e101adb88b5a6d681108a8054df33f5ced59965b5480d /home/drakestapleton/handoffs/L747-review/probes/context-independent.om
+947295569c30fbb1a28db7b475fded345612ba3389fa40d5a52657958a92890d /home/drakestapleton/handoffs/L747-review/probes/context-independent.full.om
+4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6 /home/drakestapleton/handoffs/L747-review/build/context-independent
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/scoped-source.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/scoped-source.sha256
new file mode 100644
index 00000000..49df24eb
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/scoped-source.sha256
@@ -0,0 +1,43 @@
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 ./application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 ./base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b ./build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b ./code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 ./context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d ./courier.om
+69224f53c3c8a3f952fff210320cdfabc58da8a7f9e933ca863a33df528dc646 ./gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 ./golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 ./intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 ./main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 ./memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 ./paint.om
+d1e99e2c1f4bcff06f6fda75fe2c3b48b75129526f15681cbd135b717bf1d11b ./README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc ./reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed ./runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 ./scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 ./scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df ./scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f ./tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 ./tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 ./tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc ./tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 ./tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 ./tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af ./tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 ./tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 ./tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b ./tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 ./tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a ./tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df ./tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 ./tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 ./tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 ./tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f ./tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 ./tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 ./tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c ./tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 ./vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc ./vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 ./vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 ./vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac ./view.om
diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/scoped.diff b/evidence/allen-omega-L694/L746/independent-review/logs/scoped.diff
new file mode 100644
index 00000000..2af0ef88
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/logs/scoped.diff
@@ -0,0 +1,420 @@
+diff --git a/native/omega/allen/README.md b/native/omega/allen/README.md
+index dfaa4d1..3328043 100644
+--- a/native/omega/allen/README.md
++++ b/native/omega/allen/README.md
+@@ -13,17 +13,17 @@ Run from this checkout on Linux AArch64, with the brief's immutable compiler:
+ ```sh
+ quiet-build native/omega/allen/gate.sh target/allen-omega-L694/fresh-output
+ ```
+
+ The output directory must be fresh. `build-one.sh` hashes the compiler before
+ **every invocation**, rejects empty/wrong-machine/nonstatic ELF and marks only
+ qualified output executable. The gate builds all modules together for every test,
+ executes handwritten Omega test programs, compares a byte-exact independent memory
+-fixture and rejects eleven compiled behavioral mutants. The build uses POSIX shell,
++fixture and rejects thirteen compiled behavioral mutants. The build uses POSIX shell,
+ Git (source reconstruction), GNU file/text utilities, readelf, dd, xxd and
+ sha256sum as external development tools. Existing Rust courier `--split` was used
+ once as a fixture oracle, never as an Omega runtime dependency.
+
+ ## Modules and API boundary
+
+ * `runtime.om`: one outstanding job, chat/code/follow-up, immediate code ack,
+ ID exhaustion refusal, stale answer rejection, cancel/reset,20s slow-once and
+@@ -64,16 +64,35 @@ once as a fixture oracle, never as an Omega runtime dependency.
+ SHA256(header0:32 || payload) is **unkeyed integrity**, never authorization or
+ rollback freshness. Those independent proofs remain absent in this legacy format.
+ `loadbeg` resets load state, `loadcopy(slot)` considers each valid copy once.
+ `txbegin -> txwrite -> txflush -> txread` publishes store generation only after
+ exact readback. Provider reads back into Unit and writes Enc to Tx's target.
+ `nbegin -> nwrite -> nflush -> nread` verifies note writes before parent saves;
+ provider must update the parent's note count only after nread succeeds. No disk
+ syscall/driver is bound. Crash tests use explicit fixed simulated disk buffers.
++* `context.om`: restores a512-slot catalog from already committed note records
++ and appends bounded memory context to actual application JOBs. After loading
++ canonical Mem through the memory codec, call `ctxbegin`; for each declared slot,
++ place its4096-byte record in Unit and call `ctxtake(index)` exactly once, in any
++ order. Return0 means refused/no visit,1 valid retained,2 damaged visit retained
++ as gone. Deleted/damaged notes never enter model context. The catalog becomes
++ ready only after every declared slot was visited. Cx contains declared count,
++ visited count, readiness, damaged count and loading flag. Loading is refused
++ during a live conversation or note/parent write transaction. The provider must
++ keep the chosen Mem generation stable and restart catalog loading after any
++ memory reload; this is not an incremental concurrent store interface.
++ `ctxmeta(limit)` stages byte-exact legacy self/name/starts/fact and newest-live-
++ note metadata into Meta/Mx without touching Unit, Enc or outgoing bytes.
++ `ctxappend` appends all or none within the4096-byte JOB cap, preserving outgoing
++ bytes/length/error on refusal. `appask` validates context before reading its
++ variable-layout identity fields, includes the newest six live notes, and refuses
++ incomplete catalogs/oversized context before conversation or wire IDs advance.
++ SHA validation is still unkeyed integrity, not authentication. No physical disk
++ loader/writer, note search index or concurrent mutation/commit provider is bound.
+ * `view.om`: legacy code row wrapping, continuation numbering and saturated scroll,
+ bounded4096 rows. The full code remains held when the row index reaches capacity.
+ * `scene.om`: mood/say/eight thing kinds, placement/emphasis/arrival/direction,
+ typed field bounds, four things/six fields/2048-byte input/12 lines.
+ * `scene-input.om`: `scdecode` consumes In/Inlen through bounded scene cleanup,
+ restores the exact caller input and length, and fills the same Sc/Things/Stext
+ output as the strict `scene` parser. Input and normalized output each have a
+ 2048-byte cap. NUL or normalization overflow refuses the whole scene and clears
+@@ -109,17 +128,18 @@ CODE assembly and SAY/WAIT handling. This is an executed native core entry path,
+ not a bound socket/device loop. The older development `main.om` stdio entry
+ remains separate; it does not exercise this datagram binding.
+
+ 1. `appinit(run,now)` initializes one boot session using a nonzero unique run ID
+ and actual monotonic milliseconds supplied by the future qualified provider.
+ Reinitialization is refused rather than reusing job IDs.
+ 2. Put a prompt into In/Inlen, then `appask(now)`. It validates admission before
+ adding a transcript entry, builds the real JOB text and queues it. Code requests
+- expose the existing acknowledgement immediately. Busy, outstanding-send,
++ expose the existing acknowledgement immediately. Restored facts and up to six
++ newest live notes are included in the queued job. Busy, outstanding-send,
+ pending-receipt, invalid-prompt and ID-exhaustion cases refuse admission.
+ 3. `apppoll(now,link)` advances silence/slow deadlines and returns whether one
+ datagram is offered in Outb/Outlen. Send those exact bytes and call
+ `appsent(now,success)` with the real whole-datagram outcome. Do not call core
+ serializers yourself while a send is pending.
+ 4. Copy a received datagram into In/Inlen and call `appreceive(now)`. Its boolean
+ reports **transport acceptance**, not acceptance of the inner reply. A[2]
+ distinguishes visible text1, queued code recovery2, code give-up3, refused
+@@ -145,17 +165,17 @@ Overflow refuses whole prompts/answers/scene fields instead of silent truncation
+ Reply capacity159, prompt capacity159, code32768, job4096, note127. Conflicting
+ CODE duplicates and differing language headers are refused rather than overwriting.
+ Numeric overflow, backward timestamps, request ID wrap and v4 sky pad are refused.
+ Job instructions and record bytes retain legacy structure; envelope metadata is
+ never added to Store v1 superblocks. No identity migration fields are rewritten.
+
+ Remaining portable work: remaining scene aliases/missing-colon repairs, field
+ ellipsis, timer interpretation, transcript-to-notes restore,
+-full notes indexing/retrieval, full memory metadata job append, transport binding,
++full notes indexing/retrieval, catalog update/store integration, transport binding,
+ full sky/catalogue/font/animated-network/canvas visual parity, integration and
+ broader malformed-input coverage. Partial modules are not whole compatibility.
+
+ Required target gates: qualified seeded x86 EFI target (FR9), privileged/MMIO and
+ interrupt/native device access(FR8), durable I/O(FR1), bounded networking(FR16),
+ keyboard/framebuffer/disk/NIC providers, iMac QEMU boot/chat/keyboard/bootdisk,
+ then signed physical trial. No C bridge can satisfy these. L408 owns compiler
+ work; L690 owns Hermes JSON/WebSocket/admission. Neither tree was modified.
+diff --git a/native/omega/allen/application.om b/native/omega/allen/application.om
+index 3b79e6a..734efee 100644
+--- a/native/omega/allen/application.om
++++ b/native/omega/allen/application.om
+@@ -51,19 +51,26 @@ ret false
+ end
+ kind = classify
+ if or lt kind 1 gt kind 3
+ ret false
+ end
+ if and eq kind 3 eq get R 6 0
+ ret false
+ end
++note Validate restored context before jobbuild reads its variable-layout names.
++if not ctxmeta 6
++ret false
++end
+ if not jobbuild kind add get R 0 1
+ ret false
+ end
++if not ctxappend
++ret false
++end
+ n = get Inlen 0
+ size = get Outlen 0
+ for i ulong n
+ put Askin i get In i
+ end
+ for i ulong size
+ put Appjob i get Outb i
+ end
+diff --git a/native/omega/allen/context.om b/native/omega/allen/context.om
+new file mode 100644
+index 0000000..401d418
+--- /dev/null
++++ b/native/omega/allen/context.om
+@@ -0,0 +1,237 @@
++note Restored note catalog and bounded model-job context. No storage provider.
++note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
++global Cx ulong 5
++global Ctxtext uchar 65536
++global Ctxlen ulong 512
++global Ctxgone uchar 512
++global Ctxseen uchar 512
++global Ctxstart ulong 512
++global Meta uchar 4096
++global Mx ulong 2
++global Mdigits uchar 20
++text Mtself "\tself="
++text Mtname "\tname="
++text Mtstart "\tstarts="
++text Mtfact "\tfact "
++text Mtis " is "
++text Mtare " are "
++text Mtnote "\tnote "
++fn ctxidle to bool
++if ne get R 1 0
++ret false
++end
++ret and eq get Tx 0 0 eq get Nt 0 0
++end
++fn ctxbegin to bool
++if not ctxidle
++ret false
++end
++n = mem32 36
++if gt n 512
++ret false
++end
++for i ulong 512
++put Ctxlen i 0
++put Ctxgone i 1
++put Ctxseen i 0
++put Ctxstart i 0
++end
++put Cx 0 n
++put Cx 1 0
++put Cx 2 0
++put Cx 3 0
++put Cx 4 1
++if eq n 0
++put Cx 2 1
++put Cx 4 0
++end
++ret true
++end
++note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
++fn ctxtake index ulong to ulong
++if not ctxidle
++ret 0
++end
++if or eq get Cx 4 0 ge index get Cx 0
++ret 0
++end
++if ne get Ctxseen index 0
++ret 0
++end
++status = ulong 2
++if notedec index
++n = get Ns 0
++for i ulong n
++put Ctxtext add mul index 128 i get Note i
++end
++put Ctxlen index n
++put Ctxgone index uchar get Ns 3
++put Ctxstart index get Ns 2
++status = 1
++else
++put Cx 3 add get Cx 3 1
++end
++put Ctxseen index 1
++put Cx 1 add get Cx 1 1
++if eq get Cx 1 get Cx 0
++put Cx 2 1
++put Cx 4 0
++end
++ret status
++end
++fn mtemit c uchar to void
++if ne get Mx 1 0
++ret
++end
++n = get Mx 0
++if ge n 4096
++put Mx 1 1
++ret
++end
++put Meta n c
++put Mx 0 add n 1
++end
++fn mtnum v ulong to void
++n = ulong 0
++while gt v 9
++put Mdigits n uchar rem v 10
++v = div v 10
++n = add n 1
++end
++put Mdigits n uchar v
++n = add n 1
++for i ulong n
++mtemit add uchar 48 get Mdigits sub sub n 1 i
++end
++end
++note Memory fields are length-bounded; require a terminator and printable bytes.
++fn mtfield off ulong cap ulong to bool
++for i ulong cap
++c = get Mem add off i
++if eq c 0
++if eq i 0
++put Mx 1 1
++ret false
++end
++ret true
++end
++if or lt c 32 gt c 126
++put Mx 1 1
++ret false
++end
++mtemit c
++end
++put Mx 1 1
++ret false
++end
++fn mtfacts count ulong to bool
++for k ulong count
++off = add 40 mul k 113
++for i ulong len Mtfact
++mtemit get Mtfact i
++end
++if not mtfield off 48
++ret false
++end
++are = get Mem add off 112
++if gt are 1
++put Mx 1 1
++ret false
++end
++if eq are 1
++for i ulong len Mtare
++mtemit get Mtare i
++end
++else
++for i ulong len Mtis
++mtemit get Mtis i
++end
++end
++if not mtfield add off 48 64
++ret false
++end
++end
++ret eq get Mx 1 0
++end
++fn mtnotes count ulong limit ulong to void
++given = ulong 0
++for k ulong count
++index = sub sub count 1 k
++if and eq get Ctxgone index 0 lt given limit
++for i ulong len Mtnote
++mtemit get Mtnote i
++end
++for i ulong get Ctxlen index
++mtemit get Ctxtext add mul index 128 i
++end
++given = add given 1
++end
++end
++end
++fn ctxmeta limit ulong to bool
++put Mx 0 0
++put Mx 1 1
++facts = mem32 32
++notes = mem32 36
++if or gt facts 32 gt notes 512
++ret false
++end
++if gt limit 512
++ret false
++end
++if gt notes 0
++if or eq get Cx 2 0 ne get Cx 0 notes
++ret false
++end
++end
++put Mx 1 0
++for i ulong len Mtself
++mtemit get Mtself i
++end
++off = add 40 mul facts 113
++if eq get Mem off 0
++for i ulong len Allen
++mtemit get Allen i
++end
++else
++if not mtfield off 24
++ret false
++end
++end
++if ne get Mem 8 0
++for i ulong len Mtname
++mtemit get Mtname i
++end
++if not mtfield 8 24
++ret false
++end
++end
++for i ulong len Mtstart
++mtemit get Mtstart i
++end
++mtnum mem32 0
++if not mtfacts facts
++ret false
++end
++mtnotes notes limit
++ret eq get Mx 1 0
++end
++note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
++fn ctxappend to bool
++if or ne get Mx 1 0 ne get Err 0 0
++ret false
++end
++n = get Outlen 0
++size = get Mx 0
++if or gt n 4096 gt size 4096
++ret false
++end
++if gt add n size 4096
++ret false
++end
++for i ulong size
++put Outb add n i get Meta i
++end
++put Outlen 0 add n size
++ret true
++end
+diff --git a/native/omega/allen/gate.sh b/native/omega/allen/gate.sh
+index d4171d2..326cb1c 100755
+--- a/native/omega/allen/gate.sh
++++ b/native/omega/allen/gate.sh
+@@ -6,18 +6,18 @@ cd "$root"
+ out=$1
+ mkdir -p "$out"
+ [ -z "$(ls -A "$out")" ] || { echo 'gate requires fresh output directory' >&2; exit 73; }
+ core="$out/core.om"
+ cat native/omega/allen/base.om native/omega/allen/vendor/sha256-core.om \
+ native/omega/allen/runtime.om native/omega/allen/code.om \
+ native/omega/allen/courier.om native/omega/allen/scheduler.om native/omega/allen/memory.om \
+ native/omega/allen/intent.om native/omega/allen/reply.om \
+- native/omega/allen/view.om native/omega/allen/scene.om native/omega/allen/paint.om native/omega/allen/application.om native/omega/allen/scene-input.om > "$core"
+-for name in runtime code courier scheduler application memory intent reply view scene scene-input paint edges fixture golden render; do
++ native/omega/allen/view.om native/omega/allen/scene.om native/omega/allen/paint.om native/omega/allen/application.om native/omega/allen/scene-input.om native/omega/allen/context.om > "$core"
++for name in runtime code courier scheduler application memory context intent reply view scene scene-input paint edges fixture golden render; do
+ cat "$core" > "$out/$name.om"
+ case "$name" in golden|render) ;; *) cat native/omega/allen/tests/check.om >> "$out/$name.om" ;; esac
+ cat "native/omega/allen/tests/$name.om" >> "$out/$name.om"
+ native/omega/allen/build-one.sh "$out/$name.om" "$out/$name"
+ case "$name" in
+ fixture)
+ "$out/$name" < evidence/allen-omega-L694/short.wire > "$out/short.log"
+ "$out/$name" < evidence/allen-omega-L694/long.wire > "$out/long.log"
+@@ -66,17 +66,21 @@ cat native/omega/allen/tests/check.om native/omega/allen/tests/scheduler.om >> "
+ sed 's/put Outb i get Appwire i/put Outb i get Outb i/' "$core" > "$out/pendingwire-mutant.om"
+ cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/pendingwire-mutant.om"
+ sed 's/if or le get R 2 1 ne get C 0 get R 0/if false/' "$core" > "$out/appcode-mutant.om"
+ cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/appcode-mutant.om"
+ sed 's/if hide/if false/' "$core" > "$out/thinking-mutant.om"
+ cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/thinking-mutant.om"
+ sed 's/if lt get Nm 8 12/if true/' "$core" > "$out/scenecap-mutant.om"
+ cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/scenecap-mutant.om"
+-for name in stale crc hash readback session keepalive ackstop pendingwire appcode thinking scenecap; do
++sed 's/if and eq get Ctxgone index 0 lt given limit/if lt given limit/' "$core" > "$out/contextnote-mutant.om"
++cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextnote-mutant.om"
++sed 's/if not ctxappend/if false/' "$core" > "$out/contextjob-mutant.om"
++cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextjob-mutant.om"
++for name in stale crc hash readback session keepalive ackstop pendingwire appcode thinking scenecap contextnote contextjob; do
+ native/omega/allen/build-one.sh "$out/$name-mutant.om" "$out/$name-mutant"
+ set +e
+ "$out/$name-mutant" > "$out/$name-mutant.log"
+ rc=$?
+ set -e
+ if [ "$rc" -le 0 ] || [ "$rc" -ge 100 ]; then echo "mutant did not fail behaviorally: $name exit=$rc" >&2; exit 1; fi
+ printf '%s mutant compile=0 rejected-exit=%s\n' "$name" "$rc"
+ done
diff --git a/evidence/allen-omega-L694/L746/independent-review/parent-replay.log b/evidence/allen-omega-L694/L746/independent-review/parent-replay.log
new file mode 100644
index 00000000..600acb67
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/parent-replay.log
@@ -0,0 +1,150 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
diff --git a/evidence/allen-omega-L694/L746/independent-review/parent-verification.json b/evidence/allen-omega-L694/L746/independent-review/parent-verification.json
new file mode 100644
index 00000000..46820832
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/parent-verification.json
@@ -0,0 +1,8 @@
+{
+ "pin": "be28deb21721f54fc46b5402076c7e8ac8fde151",
+ "source_files": 43,
+ "parent_probe_sha256": "4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6",
+ "parent_checks": 150,
+ "report_sha256": "ce5862d96c8f8f2b6dd11596f1f16f8996b336aad88ef98051a5b7bf626385d3",
+ "verdict": "No findings; original failed probe retained as expectation error; host-only."
+}
diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.failed-v1.full.om b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.failed-v1.full.om
new file mode 100644
index 00000000..313faadf
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.failed-v1.full.om
@@ -0,0 +1,3840 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Who "Drake"
+text Selfname "Allen"
+text Fkey "gate code"
+text Fval "4471"
+text Note0 "Meet at noon."
+text Note1 "Old private note."
+text Note3 "Bring tools."
+text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon."
+text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools."
+text Emptyctx "\tself=Allen\tstarts=0"
+text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4"
+text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471"
+global Unitsave uchar 8192
+global Saveout uchar 8192
+global Saveos ulong 2
+global Appsave ulong 16
+global Joblen ulong 1
+global Qsave ulong 2
+fn test ok bool to void
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Outlen 0
+put Saveout i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Saveos 0
+put Outb i get Saveout i
+end
+put Outlen 0 get Saveos 0
+put Err 0 get Saveos 1
+end
+fn fixture index ulong gone ulong to void
+put Ns 0 len Note0
+put Ns 1 index
+put Ns 2 7
+put Ns 3 gone
+for i ulong len Note0
+put Note i get Note0 i
+end
+if eq index 1
+put Ns 0 len Note1
+for i ulong len Note1
+put Note i get Note1 i
+end
+end
+if eq index 3
+put Ns 0 len Note3
+for i ulong len Note3
+put Note i get Note3 i
+end
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+end
+fn memsetup to void
+for i ulong 3692
+put Mem i 0
+end
+mset32 0 7
+mset32 32 1
+mset32 36 4
+for i ulong len Who
+put Mem add i 8 get Who i
+end
+for i ulong len Fkey
+put Mem add i 40 get Fkey i
+end
+for i ulong len Fval
+put Mem add i 88 get Fval i
+end
+for i ulong len Selfname
+put Mem add i 153 get Selfname i
+end
+end
+fn prompt to void
+put Inlen 0 2
+put In 0 104
+put In 1 105
+end
+fn main to int
+test appinit 123 0
+test ctxmeta 6
+test eq get Mx 0 len Emptyctx
+same = true
+for i ulong len Emptyctx
+if ne get Meta i get Emptyctx i
+same = false
+end
+end
+test same
+memsetup
+test memenc 100
+for i ulong 4096
+put Unit i get Enc i
+end
+loadbeg
+test loadcopy 0
+test eq get St 0 100
+test ctxbegin
+test eq get Cx 0 4
+test eq get Cx 1 0
+test eq get Cx 2 0
+test not ctxmeta 6
+note Independent admission snapshot: incomplete catalog must not consume ids/history/job.
+for i ulong 16
+put Appsave i get R i
+end
+put Joblen 0 get T 8
+put Qsave 0 get Q 0
+put Qsave 1 get Q 1
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Saveos 0
+put Saveout i get Outb i
+end
+for i ulong get T 8
+put Unitsave i get JobOut i
+end
+prompt
+test not appask 0
+test eq get R 0 get Appsave 0
+test eq get R 1 get Appsave 1
+test eq get R 9 get Appsave 9
+test eq get Q 1 get Qsave 1
+test eq get Q 0 get Qsave 0
+test eq get T 8 get Joblen 0
+test eq get Outlen 0 get Saveos 0
+test eq get Err 0 get Saveos 1
+same = true
+for i ulong get Saveos 0
+if ne get Outb i get Saveout i
+same = false
+end
+end
+test same
+same = true
+for i ulong get Joblen 0
+if ne get JobOut i get Unitsave i
+same = false
+end
+end
+test same
+appcancel
+fixture 3 0
+test eq ctxtake 3 1
+test eq get Ctxlen 3 len Note3
+test eq get Ctxstart 3 7
+test eq ctxtake 3 0
+test eq get Cx 1 1
+fixture 1 1
+test eq ctxtake 1 1
+test eq get Ctxgone 1 1
+fixture 2 0
+put Unit 64 33
+test eq ctxtake 2 2
+test eq get Cx 3 1
+test eq get Ctxgone 2 1
+test not ctxmeta 6
+fixture 0 0
+test eq ctxtake 0 1
+test eq get Cx 1 4
+test eq get Cx 2 1
+test eq get Cx 4 0
+test eq ctxtake 4 0
+test ctxmeta 6
+test eq get Mx 0 len MetaWant
+same = true
+for i ulong len MetaWant
+if ne get Meta i get MetaWant i
+same = false
+end
+end
+test same
+test ctxmeta 1
+test eq get Mx 0 len NewOnly
+same = true
+for i ulong len NewOnly
+if ne get Meta i get NewOnly i
+same = false
+end
+end
+test same
+test not ctxmeta 513
+test not ctxappend
+test ctxmeta 6
+outreset
+emitb 120
+test ctxappend
+test eq get Outlen 0 add 1 len MetaWant
+test eq get Outb 0 120
+same = true
+for i ulong len MetaWant
+if ne get Outb add i 1 get MetaWant i
+same = false
+end
+end
+test same
+note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers.
+prompt
+test appask 1
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+n = get T 8
+test ge n len MetaWant
+same = ge n len MetaWant
+if same
+for i ulong len MetaWant
+if ne get JobOut add sub n len MetaWant i get MetaWant i
+same = false
+end
+end
+end
+test same
+test not ctxbegin
+test eq ctxtake 0 0
+appcancel
+note Exact append capacity and one byte above, preserving Outb/length/error on refusal.
+test ctxmeta 6
+n = sub ulong 4096 get Mx 0
+put Outlen 0 n
+for i ulong n
+put Outb i 90
+end
+test ctxappend
+test eq get Outlen 0 4096
+put Outlen 0 add n 1
+put Outb n 88
+test not ctxappend
+test eq get Outlen 0 add n 1
+test eq get Outb n 88
+put Err 0 5
+test not ctxappend
+test eq get Err 0 5
+outreset
+mset32 36 5
+test not ctxmeta 6
+mset32 36 4
+mset32 32 33
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+mset32 32 1
+note Deliberately full valid facts make metadata fit but the whole JOB exceed4096.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxmeta 6
+test le get Mx 0 4096
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+note Catalog capacity and transaction exclusion.
+mset32 36 512
+test ctxbegin
+test eq get Cx 0 512
+test eq ctxtake 512 0
+fixture 511 0
+test eq ctxtake 511 1
+test eq get Ctxlen 511 len Note0
+test not ctxmeta 6
+put Tx 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Tx 0 0
+put Nt 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Nt 0 0
+mset32 36 513
+test not ctxbegin
+test eq get Cx 0 512
+note Load ten real records, select exactly the newest six, and allow zero selected.
+for i ulong 3692
+put Mem i 0
+end
+mset32 36 10
+test ctxbegin
+for k ulong 10
+put Ns 0 2
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+put Note 0 78
+put Note 1 uchar add 48 k
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test ctxmeta 6
+test eq get Mx 0 len Lastsix
+same = true
+for i ulong len Lastsix
+if ne get Meta i get Lastsix i
+same = false
+end
+end
+test same
+test ctxmeta 0
+test eq get Mx 0 len Emptyctx
+note Context construction cannot overwrite a staged memory/note transaction image.
+for i ulong 4096
+put Unitsave i get Unit i
+put Unitsave add i 4096 get Enc i
+end
+test ctxmeta 6
+same = true
+for i ulong 4096
+if ne get Unit i get Unitsave i
+same = false
+end
+if ne get Enc i get Unitsave add i 4096
+same = false
+end
+end
+test same
+memsetup
+mset32 36 0
+mset32 0 4294967295
+put Mem 152 1
+test ctxmeta 6
+test eq get Mx 0 len Plural
+same = true
+for i ulong len Plural
+if ne get Meta i get Plural i
+same = false
+end
+end
+test same
+put Mem 40 9
+test not ctxmeta 6
+test not ctxappend
+put Mem 40 103
+for i ulong 48
+put Mem add i 40 107
+end
+test not ctxmeta 6
+note Thirty-two full facts and six full notes overflow metadata itself, not only JOB.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+mset32 36 6
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxbegin
+for k ulong 6
+put Ns 0 127
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+for i ulong 127
+put Note i 110
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test not ctxmeta 6
+test eq get Mx 1 1
+outreset
+emitb 90
+test not ctxappend
+test eq get Outlen 0 1
+test eq get Outb 0 90
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.full.om b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.full.om
new file mode 100644
index 00000000..313faadf
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.full.om
@@ -0,0 +1,3840 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Who "Drake"
+text Selfname "Allen"
+text Fkey "gate code"
+text Fval "4471"
+text Note0 "Meet at noon."
+text Note1 "Old private note."
+text Note3 "Bring tools."
+text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon."
+text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools."
+text Emptyctx "\tself=Allen\tstarts=0"
+text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4"
+text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471"
+global Unitsave uchar 8192
+global Saveout uchar 8192
+global Saveos ulong 2
+global Appsave ulong 16
+global Joblen ulong 1
+global Qsave ulong 2
+fn test ok bool to void
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Outlen 0
+put Saveout i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Saveos 0
+put Outb i get Saveout i
+end
+put Outlen 0 get Saveos 0
+put Err 0 get Saveos 1
+end
+fn fixture index ulong gone ulong to void
+put Ns 0 len Note0
+put Ns 1 index
+put Ns 2 7
+put Ns 3 gone
+for i ulong len Note0
+put Note i get Note0 i
+end
+if eq index 1
+put Ns 0 len Note1
+for i ulong len Note1
+put Note i get Note1 i
+end
+end
+if eq index 3
+put Ns 0 len Note3
+for i ulong len Note3
+put Note i get Note3 i
+end
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+end
+fn memsetup to void
+for i ulong 3692
+put Mem i 0
+end
+mset32 0 7
+mset32 32 1
+mset32 36 4
+for i ulong len Who
+put Mem add i 8 get Who i
+end
+for i ulong len Fkey
+put Mem add i 40 get Fkey i
+end
+for i ulong len Fval
+put Mem add i 88 get Fval i
+end
+for i ulong len Selfname
+put Mem add i 153 get Selfname i
+end
+end
+fn prompt to void
+put Inlen 0 2
+put In 0 104
+put In 1 105
+end
+fn main to int
+test appinit 123 0
+test ctxmeta 6
+test eq get Mx 0 len Emptyctx
+same = true
+for i ulong len Emptyctx
+if ne get Meta i get Emptyctx i
+same = false
+end
+end
+test same
+memsetup
+test memenc 100
+for i ulong 4096
+put Unit i get Enc i
+end
+loadbeg
+test loadcopy 0
+test eq get St 0 100
+test ctxbegin
+test eq get Cx 0 4
+test eq get Cx 1 0
+test eq get Cx 2 0
+test not ctxmeta 6
+note Independent admission snapshot: incomplete catalog must not consume ids/history/job.
+for i ulong 16
+put Appsave i get R i
+end
+put Joblen 0 get T 8
+put Qsave 0 get Q 0
+put Qsave 1 get Q 1
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Saveos 0
+put Saveout i get Outb i
+end
+for i ulong get T 8
+put Unitsave i get JobOut i
+end
+prompt
+test not appask 0
+test eq get R 0 get Appsave 0
+test eq get R 1 get Appsave 1
+test eq get R 9 get Appsave 9
+test eq get Q 1 get Qsave 1
+test eq get Q 0 get Qsave 0
+test eq get T 8 get Joblen 0
+test eq get Outlen 0 get Saveos 0
+test eq get Err 0 get Saveos 1
+same = true
+for i ulong get Saveos 0
+if ne get Outb i get Saveout i
+same = false
+end
+end
+test same
+same = true
+for i ulong get Joblen 0
+if ne get JobOut i get Unitsave i
+same = false
+end
+end
+test same
+appcancel
+fixture 3 0
+test eq ctxtake 3 1
+test eq get Ctxlen 3 len Note3
+test eq get Ctxstart 3 7
+test eq ctxtake 3 0
+test eq get Cx 1 1
+fixture 1 1
+test eq ctxtake 1 1
+test eq get Ctxgone 1 1
+fixture 2 0
+put Unit 64 33
+test eq ctxtake 2 2
+test eq get Cx 3 1
+test eq get Ctxgone 2 1
+test not ctxmeta 6
+fixture 0 0
+test eq ctxtake 0 1
+test eq get Cx 1 4
+test eq get Cx 2 1
+test eq get Cx 4 0
+test eq ctxtake 4 0
+test ctxmeta 6
+test eq get Mx 0 len MetaWant
+same = true
+for i ulong len MetaWant
+if ne get Meta i get MetaWant i
+same = false
+end
+end
+test same
+test ctxmeta 1
+test eq get Mx 0 len NewOnly
+same = true
+for i ulong len NewOnly
+if ne get Meta i get NewOnly i
+same = false
+end
+end
+test same
+test not ctxmeta 513
+test not ctxappend
+test ctxmeta 6
+outreset
+emitb 120
+test ctxappend
+test eq get Outlen 0 add 1 len MetaWant
+test eq get Outb 0 120
+same = true
+for i ulong len MetaWant
+if ne get Outb add i 1 get MetaWant i
+same = false
+end
+end
+test same
+note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers.
+prompt
+test appask 1
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+n = get T 8
+test ge n len MetaWant
+same = ge n len MetaWant
+if same
+for i ulong len MetaWant
+if ne get JobOut add sub n len MetaWant i get MetaWant i
+same = false
+end
+end
+end
+test same
+test not ctxbegin
+test eq ctxtake 0 0
+appcancel
+note Exact append capacity and one byte above, preserving Outb/length/error on refusal.
+test ctxmeta 6
+n = sub ulong 4096 get Mx 0
+put Outlen 0 n
+for i ulong n
+put Outb i 90
+end
+test ctxappend
+test eq get Outlen 0 4096
+put Outlen 0 add n 1
+put Outb n 88
+test not ctxappend
+test eq get Outlen 0 add n 1
+test eq get Outb n 88
+put Err 0 5
+test not ctxappend
+test eq get Err 0 5
+outreset
+mset32 36 5
+test not ctxmeta 6
+mset32 36 4
+mset32 32 33
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+mset32 32 1
+note Deliberately full valid facts make metadata fit but the whole JOB exceed4096.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxmeta 6
+test le get Mx 0 4096
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+note Catalog capacity and transaction exclusion.
+mset32 36 512
+test ctxbegin
+test eq get Cx 0 512
+test eq ctxtake 512 0
+fixture 511 0
+test eq ctxtake 511 1
+test eq get Ctxlen 511 len Note0
+test not ctxmeta 6
+put Tx 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Tx 0 0
+put Nt 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Nt 0 0
+mset32 36 513
+test not ctxbegin
+test eq get Cx 0 512
+note Load ten real records, select exactly the newest six, and allow zero selected.
+for i ulong 3692
+put Mem i 0
+end
+mset32 36 10
+test ctxbegin
+for k ulong 10
+put Ns 0 2
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+put Note 0 78
+put Note 1 uchar add 48 k
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test ctxmeta 6
+test eq get Mx 0 len Lastsix
+same = true
+for i ulong len Lastsix
+if ne get Meta i get Lastsix i
+same = false
+end
+end
+test same
+test ctxmeta 0
+test eq get Mx 0 len Emptyctx
+note Context construction cannot overwrite a staged memory/note transaction image.
+for i ulong 4096
+put Unitsave i get Unit i
+put Unitsave add i 4096 get Enc i
+end
+test ctxmeta 6
+same = true
+for i ulong 4096
+if ne get Unit i get Unitsave i
+same = false
+end
+if ne get Enc i get Unitsave add i 4096
+same = false
+end
+end
+test same
+memsetup
+mset32 36 0
+mset32 0 4294967295
+put Mem 152 1
+test ctxmeta 6
+test eq get Mx 0 len Plural
+same = true
+for i ulong len Plural
+if ne get Meta i get Plural i
+same = false
+end
+end
+test same
+put Mem 40 9
+test not ctxmeta 6
+test not ctxappend
+put Mem 40 103
+for i ulong 48
+put Mem add i 40 107
+end
+test not ctxmeta 6
+note Thirty-two full facts and six full notes overflow metadata itself, not only JOB.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+mset32 36 6
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxbegin
+for k ulong 6
+put Ns 0 127
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+for i ulong 127
+put Note i 110
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test not ctxmeta 6
+test eq get Mx 1 1
+outreset
+emitb 90
+test not ctxappend
+test eq get Outlen 0 1
+test eq get Outb 0 90
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.om b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.om
new file mode 100644
index 00000000..561a6bc5
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.om
@@ -0,0 +1,397 @@
+text Who "Drake"
+text Selfname "Allen"
+text Fkey "gate code"
+text Fval "4471"
+text Note0 "Meet at noon."
+text Note1 "Old private note."
+text Note3 "Bring tools."
+text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon."
+text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools."
+text Emptyctx "\tself=Allen\tstarts=0"
+text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4"
+text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471"
+global Unitsave uchar 8192
+global Saveout uchar 8192
+global Saveos ulong 2
+global Appsave ulong 16
+global Joblen ulong 1
+global Qsave ulong 2
+fn test ok bool to void
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Outlen 0
+put Saveout i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Saveos 0
+put Outb i get Saveout i
+end
+put Outlen 0 get Saveos 0
+put Err 0 get Saveos 1
+end
+fn fixture index ulong gone ulong to void
+put Ns 0 len Note0
+put Ns 1 index
+put Ns 2 7
+put Ns 3 gone
+for i ulong len Note0
+put Note i get Note0 i
+end
+if eq index 1
+put Ns 0 len Note1
+for i ulong len Note1
+put Note i get Note1 i
+end
+end
+if eq index 3
+put Ns 0 len Note3
+for i ulong len Note3
+put Note i get Note3 i
+end
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+end
+fn memsetup to void
+for i ulong 3692
+put Mem i 0
+end
+mset32 0 7
+mset32 32 1
+mset32 36 4
+for i ulong len Who
+put Mem add i 8 get Who i
+end
+for i ulong len Fkey
+put Mem add i 40 get Fkey i
+end
+for i ulong len Fval
+put Mem add i 88 get Fval i
+end
+for i ulong len Selfname
+put Mem add i 153 get Selfname i
+end
+end
+fn prompt to void
+put Inlen 0 2
+put In 0 104
+put In 1 105
+end
+fn main to int
+test appinit 123 0
+test ctxmeta 6
+test eq get Mx 0 len Emptyctx
+same = true
+for i ulong len Emptyctx
+if ne get Meta i get Emptyctx i
+same = false
+end
+end
+test same
+memsetup
+test memenc 100
+for i ulong 4096
+put Unit i get Enc i
+end
+loadbeg
+test loadcopy 0
+test eq get St 0 100
+test ctxbegin
+test eq get Cx 0 4
+test eq get Cx 1 0
+test eq get Cx 2 0
+test not ctxmeta 6
+note Independent admission snapshot: incomplete catalog must not consume ids/history/job.
+for i ulong 16
+put Appsave i get R i
+end
+put Joblen 0 get T 8
+put Qsave 0 get Q 0
+put Qsave 1 get Q 1
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Saveos 0
+put Saveout i get Outb i
+end
+for i ulong get T 8
+put Unitsave i get JobOut i
+end
+prompt
+test not appask 0
+test eq get R 0 get Appsave 0
+test eq get R 1 get Appsave 1
+test eq get R 9 get Appsave 9
+test eq get Q 1 get Qsave 1
+test eq get Q 0 get Qsave 0
+test eq get T 8 get Joblen 0
+test eq get Outlen 0 get Saveos 0
+test eq get Err 0 get Saveos 1
+same = true
+for i ulong get Saveos 0
+if ne get Outb i get Saveout i
+same = false
+end
+end
+test same
+same = true
+for i ulong get Joblen 0
+if ne get JobOut i get Unitsave i
+same = false
+end
+end
+test same
+appcancel
+fixture 3 0
+test eq ctxtake 3 1
+test eq get Ctxlen 3 len Note3
+test eq get Ctxstart 3 7
+test eq ctxtake 3 0
+test eq get Cx 1 1
+fixture 1 1
+test eq ctxtake 1 1
+test eq get Ctxgone 1 1
+fixture 2 0
+put Unit 64 33
+test eq ctxtake 2 2
+test eq get Cx 3 1
+test eq get Ctxgone 2 1
+test not ctxmeta 6
+fixture 0 0
+test eq ctxtake 0 1
+test eq get Cx 1 4
+test eq get Cx 2 1
+test eq get Cx 4 0
+test eq ctxtake 4 0
+test ctxmeta 6
+test eq get Mx 0 len MetaWant
+same = true
+for i ulong len MetaWant
+if ne get Meta i get MetaWant i
+same = false
+end
+end
+test same
+test ctxmeta 1
+test eq get Mx 0 len NewOnly
+same = true
+for i ulong len NewOnly
+if ne get Meta i get NewOnly i
+same = false
+end
+end
+test same
+test not ctxmeta 513
+test not ctxappend
+test ctxmeta 6
+outreset
+emitb 120
+test ctxappend
+test eq get Outlen 0 add 1 len MetaWant
+test eq get Outb 0 120
+same = true
+for i ulong len MetaWant
+if ne get Outb add i 1 get MetaWant i
+same = false
+end
+end
+test same
+note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers.
+prompt
+test appask 1
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+n = get T 8
+test ge n len MetaWant
+same = ge n len MetaWant
+if same
+for i ulong len MetaWant
+if ne get JobOut add sub n len MetaWant i get MetaWant i
+same = false
+end
+end
+end
+test same
+test not ctxbegin
+test eq ctxtake 0 0
+appcancel
+note Exact append capacity and one byte above, preserving Outb/length/error on refusal.
+test ctxmeta 6
+n = sub ulong 4096 get Mx 0
+put Outlen 0 n
+for i ulong n
+put Outb i 90
+end
+test ctxappend
+test eq get Outlen 0 4096
+put Outlen 0 add n 1
+put Outb n 88
+test not ctxappend
+test eq get Outlen 0 add n 1
+test eq get Outb n 88
+put Err 0 5
+test not ctxappend
+test eq get Err 0 5
+outreset
+mset32 36 5
+test not ctxmeta 6
+mset32 36 4
+mset32 32 33
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+mset32 32 1
+note Deliberately full valid facts make metadata fit but the whole JOB exceed4096.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxmeta 6
+test le get Mx 0 4096
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+note Catalog capacity and transaction exclusion.
+mset32 36 512
+test ctxbegin
+test eq get Cx 0 512
+test eq ctxtake 512 0
+fixture 511 0
+test eq ctxtake 511 1
+test eq get Ctxlen 511 len Note0
+test not ctxmeta 6
+put Tx 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Tx 0 0
+put Nt 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Nt 0 0
+mset32 36 513
+test not ctxbegin
+test eq get Cx 0 512
+note Load ten real records, select exactly the newest six, and allow zero selected.
+for i ulong 3692
+put Mem i 0
+end
+mset32 36 10
+test ctxbegin
+for k ulong 10
+put Ns 0 2
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+put Note 0 78
+put Note 1 uchar add 48 k
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test ctxmeta 6
+test eq get Mx 0 len Lastsix
+same = true
+for i ulong len Lastsix
+if ne get Meta i get Lastsix i
+same = false
+end
+end
+test same
+test ctxmeta 0
+test eq get Mx 0 len Emptyctx
+note Context construction cannot overwrite a staged memory/note transaction image.
+for i ulong 4096
+put Unitsave i get Unit i
+put Unitsave add i 4096 get Enc i
+end
+test ctxmeta 6
+same = true
+for i ulong 4096
+if ne get Unit i get Unitsave i
+same = false
+end
+if ne get Enc i get Unitsave add i 4096
+same = false
+end
+end
+test same
+memsetup
+mset32 36 0
+mset32 0 4294967295
+put Mem 152 1
+test ctxmeta 6
+test eq get Mx 0 len Plural
+same = true
+for i ulong len Plural
+if ne get Meta i get Plural i
+same = false
+end
+end
+test same
+put Mem 40 9
+test not ctxmeta 6
+test not ctxappend
+put Mem 40 103
+for i ulong 48
+put Mem add i 40 107
+end
+test not ctxmeta 6
+note Thirty-two full facts and six full notes overflow metadata itself, not only JOB.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+mset32 36 6
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxbegin
+for k ulong 6
+put Ns 0 127
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+for i ulong 127
+put Note i 110
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test not ctxmeta 6
+test eq get Mx 1 1
+outreset
+emitb 90
+test not ctxappend
+test eq get Outlen 0 1
+test eq get Outb 0 90
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/core.om b/evidence/allen-omega-L694/L746/independent-review/probes/core.om
new file mode 100644
index 00000000..f33b766e
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/probes/core.om
@@ -0,0 +1,3426 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
diff --git a/evidence/allen-omega-L694/L746/independent-review/report.md b/evidence/allen-omega-L694/L746/independent-review/report.md
new file mode 100644
index 00000000..0504af64
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/independent-review/report.md
@@ -0,0 +1,36 @@
+# L747 independent review — L746 restored-context / JOB binding
+
+## Verdict
+
+**No findings** in the scoped native Omega implementation at `be28deb21721f54fc46b5402076c7e8ac8fde151`, compared with parent `a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d`.
+
+Scope reviewed: `native/omega/allen/context.om`, its `tests/context.om` integration coverage, `application.om`'s `appask -> jobbuild -> ctxappend -> qsubmit` path, and the related gate/README changes. This review does not repeat L737/L744 or the full 1479-check suite and makes no disk, live-model, service, target, or hardware qualification claim.
+
+## Independent source/build/probe receipts
+
+- Source repository: Spark `~/workspace/aienos-allen-omega-L694`; exact commit resolved to `be28deb21721f54fc46b5402076c7e8ac8fde151` (repository HEAD matched); working tree was clean at inspection.
+- Private exact-source export: `~/handoffs/L747-review/native/omega/allen/` (Git archive of the pinned directory; 43 files). Export/member and SHA receipts: `logs/export-members.txt`, `logs/scoped-source.sha256`, `logs/pin-source.sha256`.
+- Compiler: `~/handoffs/allen-omega-L694/omc`, SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9` (`logs/compiler.sha256`). The exported `build-one.sh` checked this identity before build.
+- Independent Omega probe: `probes/context-independent.om`; assembled exact-source input: `probes/context-independent.full.om`; build command used the exported `native/omega/allen/build-one.sh` into fresh `build/context-independent`. The compile returned success and produced a nonempty static AArch64 ELF64 EXEC, SHA-256 `4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6` (`logs/elf.txt`, `logs/probe.sha256`). No `INTERP`/`NEEDED` entries.
+- Execution: `build/context-independent > logs/context-independent-v2.log`; exit status 0; 150 emitted checks, all `0` (all passed). This runs the Omega context and application test body against the freshly built native executable.
+- The probe adds direct refusal-state snapshots around `appask` with an incomplete restored catalog. It asserts R/history, Q/session and sequence, pending `T8` job length and `JobOut` bytes, and outgoing `Outb`/length/error remain unchanged. The inherited context integration also runs real `appask`/`qsubmit`, checks the appended context at the tail of the queued `JobOut`, verifies deleted/damaged notes are omitted, and exercises whole-job overflow refusal.
+- Source diff hygiene: `git diff --check -- ` returned 0 (`logs/diff-check.log`).
+
+## Probe iteration note
+
+The first probe revision (`logs/context-independent.failed-v1.log`, `probes/context-independent.failed-v1.full.om`) reported one failed assertion: it incorrectly expected `Q[0] == 0` after `appinit`; `qstart` correctly initializes `Q[0]` to run/session `123`. This was a probe expectation error, not a product failure. The corrected probe snapshots both Q fields before `appask` and compares against that state. Its rebuilt run passed all 150 checks. No production source was edited.
+
+## Boundary disposition
+
+Inspected the context catalog lifecycle (declared-count cap, loading/ready/visited/damaged state, duplicate/out-of-range refusal, deleted/damaged-note omission, and transaction exclusion), metadata staging/field validation/4096-byte append boundary, and the provider-facing `appask` ordering. The implementation validates restored context before variable-layout identity reads; stages metadata privately; appends before `qsubmit`; and rejects an incomplete catalog or oversized complete job before queue/history admission. No scoped correctness defect was reproduced.
+
+SHA integrity remains unkeyed and does not establish authentication or freshness. This is source review plus host-executed native Omega boundary evidence only.
+
+## Raw receipts
+
+All retained under `~/handoffs/L747-review/` on Spark:
+
+- `logs/scoped.diff`, `logs/diff-check.log`
+- `logs/build-v2.log`, `logs/context-independent-v2.log`, `logs/probe.sha256`, `logs/elf.txt`
+- failed probe revision/log: `probes/context-independent.failed-v1.full.om`, `logs/context-independent.failed-v1.log`
+- corrected probe: `probes/context-independent.om`, `probes/context-independent.full.om`
diff --git a/evidence/allen-omega-L694/L746/intent.log b/evidence/allen-omega-L694/L746/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L746/keepalive-mutant.log b/evidence/allen-omega-L694/L746/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L746/long.log b/evidence/allen-omega-L694/L746/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L746/memory.log b/evidence/allen-omega-L694/L746/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L746/paint.log b/evidence/allen-omega-L694/L746/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L746/pendingwire-mutant.log b/evidence/allen-omega-L694/L746/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L746/readback-mutant.log b/evidence/allen-omega-L694/L746/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L746/red.exit b/evidence/allen-omega-L694/L746/red.exit
new file mode 100644
index 00000000..a9c8fe82
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red.exit
@@ -0,0 +1 @@
+103
diff --git a/evidence/allen-omega-L694/L746/red.log b/evidence/allen-omega-L694/L746/red.log
new file mode 100644
index 00000000..d828c614
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red.log
@@ -0,0 +1,62 @@
+1 0
+2 1
+3 1
+4 1
+5 1
+6 1
+7 0
+8 0
+9 0
+10 1
+11 1
+12 1
+13 0
+14 1
+15 1
+16 1
+17 0
+18 1
+19 0
+20 1
+21 1
+22 0
+23 1
+24 1
+25 1
+26 0
+27 0
+28 1
+29 1
+30 1
+31 0
+32 0
+33 1
+34 1
+35 1
+36 1
+37 1
+38 1
+39 0
+40 0
+41 1
+42 1
+43 1
+44 0
+45 1
+46 0
+47 1
+48 1
+49 1
+50 0
+51 1
+52 0
+53 0
+54 1
+55 1
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
diff --git a/evidence/allen-omega-L694/L746/red.om b/evidence/allen-omega-L694/L746/red.om
new file mode 100644
index 00000000..b9a2bb25
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red.om
@@ -0,0 +1,3460 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+fn ctxbegin to bool
+ret false
+end
+fn ctxtake index ulong to ulong
+ret 0
+end
+fn ctxmeta limit ulong to bool
+ret false
+end
+fn ctxappend to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Who "Drake"
+text Selfname "Allen"
+text Fkey "gate code"
+text Fval "4471"
+text Note0 "Meet at noon."
+text Note1 "Old private note."
+text Note3 "Bring tools."
+text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon."
+text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools."
+text Emptyctx "\tself=Allen\tstarts=0"
+global Saveout uchar 8192
+global Saveos ulong 2
+fn test ok bool to void
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Outlen 0
+put Saveout i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Saveos 0
+put Outb i get Saveout i
+end
+put Outlen 0 get Saveos 0
+put Err 0 get Saveos 1
+end
+fn fixture index ulong gone ulong to void
+put Ns 0 len Note0
+put Ns 1 index
+put Ns 2 7
+put Ns 3 gone
+for i ulong len Note0
+put Note i get Note0 i
+end
+if eq index 1
+put Ns 0 len Note1
+for i ulong len Note1
+put Note i get Note1 i
+end
+end
+if eq index 3
+put Ns 0 len Note3
+for i ulong len Note3
+put Note i get Note3 i
+end
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+end
+fn memsetup to void
+for i ulong 3692
+put Mem i 0
+end
+mset32 0 7
+mset32 32 1
+mset32 36 4
+for i ulong len Who
+put Mem add i 8 get Who i
+end
+for i ulong len Fkey
+put Mem add i 40 get Fkey i
+end
+for i ulong len Fval
+put Mem add i 88 get Fval i
+end
+for i ulong len Selfname
+put Mem add i 153 get Selfname i
+end
+end
+fn prompt to void
+put Inlen 0 2
+put In 0 104
+put In 1 105
+end
+fn main to int
+test appinit 123 0
+test ctxmeta 6
+test eq get Mx 0 len Emptyctx
+same = true
+for i ulong len Emptyctx
+if ne get Meta i get Emptyctx i
+same = false
+end
+end
+test same
+memsetup
+test ctxbegin
+test eq get Cx 0 4
+test eq get Cx 1 0
+test eq get Cx 2 0
+test not ctxmeta 6
+prompt
+test not appask 0
+test eq get R 0 0
+test eq get Q 1 0
+appcancel
+fixture 3 0
+test eq ctxtake 3 1
+test eq get Ctxlen 3 len Note3
+test eq get Ctxstart 3 7
+test eq ctxtake 3 0
+test eq get Cx 1 1
+fixture 1 1
+test eq ctxtake 1 1
+test eq get Ctxgone 1 1
+fixture 2 0
+put Unit 64 33
+test eq ctxtake 2 2
+test eq get Cx 3 1
+test eq get Ctxgone 2 1
+test not ctxmeta 6
+fixture 0 0
+test eq ctxtake 0 1
+test eq get Cx 1 4
+test eq get Cx 2 1
+test eq get Cx 4 0
+test eq ctxtake 4 0
+test ctxmeta 6
+test eq get Mx 0 len MetaWant
+same = true
+for i ulong len MetaWant
+if ne get Meta i get MetaWant i
+same = false
+end
+end
+test same
+test ctxmeta 1
+test eq get Mx 0 len NewOnly
+same = true
+for i ulong len NewOnly
+if ne get Meta i get NewOnly i
+same = false
+end
+end
+test same
+test not ctxmeta 513
+test not ctxappend
+test ctxmeta 6
+outreset
+emitb 120
+test ctxappend
+test eq get Outlen 0 add 1 len MetaWant
+test eq get Outb 0 120
+same = true
+for i ulong len MetaWant
+if ne get Outb add i 1 get MetaWant i
+same = false
+end
+end
+test same
+note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers.
+prompt
+test appask 1
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+n = get T 8
+test ge n len MetaWant
+same = ge n len MetaWant
+if same
+for i ulong len MetaWant
+if ne get JobOut add sub n len MetaWant i get MetaWant i
+same = false
+end
+end
+end
+test same
+test not ctxbegin
+test eq ctxtake 0 0
+appcancel
+note Exact append capacity and one byte above, preserving Outb/length/error on refusal.
+test ctxmeta 6
+n = sub ulong 4096 get Mx 0
+put Outlen 0 n
+for i ulong n
+put Outb i 90
+end
+test ctxappend
+test eq get Outlen 0 4096
+put Outlen 0 add n 1
+put Outb n 88
+test not ctxappend
+test eq get Outlen 0 add n 1
+test eq get Outb n 88
+put Err 0 5
+test not ctxappend
+test eq get Err 0 5
+outreset
+mset32 36 5
+test not ctxmeta 6
+mset32 36 4
+mset32 32 33
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+mset32 32 1
+note Deliberately full valid facts make metadata fit but the whole JOB exceed4096.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxmeta 6
+test le get Mx 0 4096
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+note Catalog capacity and transaction exclusion.
+mset32 36 512
+test ctxbegin
+test eq get Cx 0 512
+test eq ctxtake 512 0
+fixture 511 0
+test eq ctxtake 511 1
+test eq get Ctxlen 511 len Note0
+test not ctxmeta 6
+put Tx 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Tx 0 0
+put Nt 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Nt 0 0
+mset32 36 513
+test not ctxbegin
+test eq get Cx 0 512
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L746/red2.exit b/evidence/allen-omega-L694/L746/red2.exit
new file mode 100644
index 00000000..9e5feb52
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red2.exit
@@ -0,0 +1 @@
+46
diff --git a/evidence/allen-omega-L694/L746/red2.log b/evidence/allen-omega-L694/L746/red2.log
new file mode 100644
index 00000000..a34a5259
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red2.log
@@ -0,0 +1,84 @@
+1 0
+2 1
+3 1
+4 1
+5 1
+6 1
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 1
+17 0
+18 1
+19 0
+20 1
+21 1
+22 0
+23 1
+24 1
+25 1
+26 0
+27 0
+28 1
+29 1
+30 1
+31 0
+32 0
+33 1
+34 1
+35 1
+36 1
+37 1
+38 1
+39 0
+40 0
+41 1
+42 1
+43 1
+44 0
+45 1
+46 1
+47 1
+48 1
+49 1
+50 1
+51 1
+52 0
+53 0
+54 1
+55 1
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 1
+67 0
+68 0
+69 1
+70 1
+71 1
+72 1
+73 1
+74 0
+75 0
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 1
diff --git a/evidence/allen-omega-L694/L746/red2.om b/evidence/allen-omega-L694/L746/red2.om
new file mode 100644
index 00000000..cbc59b48
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red2.om
@@ -0,0 +1,3467 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+fn ctxbegin to bool
+ret false
+end
+fn ctxtake index ulong to ulong
+ret 0
+end
+fn ctxmeta limit ulong to bool
+ret false
+end
+fn ctxappend to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Who "Drake"
+text Selfname "Allen"
+text Fkey "gate code"
+text Fval "4471"
+text Note0 "Meet at noon."
+text Note1 "Old private note."
+text Note3 "Bring tools."
+text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon."
+text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools."
+text Emptyctx "\tself=Allen\tstarts=0"
+global Saveout uchar 8192
+global Saveos ulong 2
+fn test ok bool to void
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Outlen 0
+put Saveout i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Saveos 0
+put Outb i get Saveout i
+end
+put Outlen 0 get Saveos 0
+put Err 0 get Saveos 1
+end
+fn fixture index ulong gone ulong to void
+put Ns 0 len Note0
+put Ns 1 index
+put Ns 2 7
+put Ns 3 gone
+for i ulong len Note0
+put Note i get Note0 i
+end
+if eq index 1
+put Ns 0 len Note1
+for i ulong len Note1
+put Note i get Note1 i
+end
+end
+if eq index 3
+put Ns 0 len Note3
+for i ulong len Note3
+put Note i get Note3 i
+end
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+end
+fn memsetup to void
+for i ulong 3692
+put Mem i 0
+end
+mset32 0 7
+mset32 32 1
+mset32 36 4
+for i ulong len Who
+put Mem add i 8 get Who i
+end
+for i ulong len Fkey
+put Mem add i 40 get Fkey i
+end
+for i ulong len Fval
+put Mem add i 88 get Fval i
+end
+for i ulong len Selfname
+put Mem add i 153 get Selfname i
+end
+end
+fn prompt to void
+put Inlen 0 2
+put In 0 104
+put In 1 105
+end
+fn main to int
+test appinit 123 0
+test ctxmeta 6
+test eq get Mx 0 len Emptyctx
+same = true
+for i ulong len Emptyctx
+if ne get Meta i get Emptyctx i
+same = false
+end
+end
+test same
+memsetup
+test ctxbegin
+test eq get Cx 0 4
+test eq get Cx 1 0
+test eq get Cx 2 0
+test not ctxmeta 6
+prompt
+test not appask 0
+test eq get R 0 0
+test eq get Q 1 0
+appcancel
+fixture 3 0
+test eq ctxtake 3 1
+test eq get Ctxlen 3 len Note3
+test eq get Ctxstart 3 7
+test eq ctxtake 3 0
+test eq get Cx 1 1
+fixture 1 1
+test eq ctxtake 1 1
+test eq get Ctxgone 1 1
+fixture 2 0
+put Unit 64 33
+test eq ctxtake 2 2
+test eq get Cx 3 1
+test eq get Ctxgone 2 1
+test not ctxmeta 6
+fixture 0 0
+test eq ctxtake 0 1
+test eq get Cx 1 4
+test eq get Cx 2 1
+test eq get Cx 4 0
+test eq ctxtake 4 0
+test ctxmeta 6
+test eq get Mx 0 len MetaWant
+same = true
+for i ulong len MetaWant
+if ne get Meta i get MetaWant i
+same = false
+end
+end
+test same
+test ctxmeta 1
+test eq get Mx 0 len NewOnly
+same = true
+for i ulong len NewOnly
+if ne get Meta i get NewOnly i
+same = false
+end
+end
+test same
+test not ctxmeta 513
+test not ctxappend
+test ctxmeta 6
+outreset
+emitb 120
+test ctxappend
+test eq get Outlen 0 add 1 len MetaWant
+test eq get Outb 0 120
+same = true
+for i ulong len MetaWant
+if ne get Outb add i 1 get MetaWant i
+same = false
+end
+end
+test same
+note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers.
+prompt
+test appask 1
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+n = get T 8
+test ge n len MetaWant
+same = ge n len MetaWant
+if same
+for i ulong len MetaWant
+if ne get JobOut add sub n len MetaWant i get MetaWant i
+same = false
+end
+end
+end
+test same
+test not ctxbegin
+test eq ctxtake 0 0
+appcancel
+note Exact append capacity and one byte above, preserving Outb/length/error on refusal.
+test ctxmeta 6
+n = sub ulong 4096 get Mx 0
+put Outlen 0 n
+for i ulong n
+put Outb i 90
+end
+test ctxappend
+test eq get Outlen 0 4096
+put Outlen 0 add n 1
+put Outb n 88
+test not ctxappend
+test eq get Outlen 0 add n 1
+test eq get Outb n 88
+put Err 0 5
+test not ctxappend
+test eq get Err 0 5
+outreset
+mset32 36 5
+test not ctxmeta 6
+mset32 36 4
+mset32 32 33
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+mset32 32 1
+note Deliberately full valid facts make metadata fit but the whole JOB exceed4096.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxmeta 6
+test le get Mx 0 4096
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+note Catalog capacity and transaction exclusion.
+mset32 36 512
+test ctxbegin
+test eq get Cx 0 512
+test eq ctxtake 512 0
+fixture 511 0
+test eq ctxtake 511 1
+test eq get Ctxlen 511 len Note0
+test not ctxmeta 6
+put Tx 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Tx 0 0
+put Nt 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Nt 0 0
+mset32 36 513
+test not ctxbegin
+test eq get Cx 0 512
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L746/red3.exit b/evidence/allen-omega-L694/L746/red3.exit
new file mode 100644
index 00000000..dd475631
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red3.exit
@@ -0,0 +1 @@
+76
diff --git a/evidence/allen-omega-L694/L746/red3.log b/evidence/allen-omega-L694/L746/red3.log
new file mode 100644
index 00000000..584ad86c
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red3.log
@@ -0,0 +1,142 @@
+1 0
+2 1
+3 1
+4 1
+5 0
+6 0
+7 0
+8 1
+9 1
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 1
+18 1
+19 1
+20 0
+21 1
+22 0
+23 1
+24 1
+25 0
+26 1
+27 1
+28 1
+29 0
+30 0
+31 1
+32 1
+33 1
+34 0
+35 0
+36 1
+37 1
+38 1
+39 1
+40 1
+41 1
+42 0
+43 0
+44 1
+45 1
+46 1
+47 0
+48 1
+49 1
+50 1
+51 1
+52 1
+53 1
+54 1
+55 0
+56 0
+57 1
+58 1
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 1
+68 1
+69 1
+70 0
+71 0
+72 1
+73 1
+74 1
+75 1
+76 1
+77 0
+78 0
+79 1
+80 1
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 1
+89 0
+90 1
+91 0
+92 1
+93 0
+94 1
+95 0
+96 1
+97 0
+98 1
+99 0
+100 1
+101 0
+102 1
+103 0
+104 1
+105 0
+106 1
+107 0
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 1
+115 0
+116 1
+117 1
+118 1
+119 0
+120 0
+121 0
+122 1
+123 0
+124 1
+125 0
+126 1
+127 0
+128 1
+129 0
+130 1
+131 0
+132 1
+133 0
+134 1
+135 0
+136 1
+137 0
+138 0
+139 0
+140 0
+141 1
+142 1
diff --git a/evidence/allen-omega-L694/L746/red3.om b/evidence/allen-omega-L694/L746/red3.om
new file mode 100644
index 00000000..4252fb20
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/red3.om
@@ -0,0 +1,3585 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+fn ctxbegin to bool
+ret false
+end
+fn ctxtake index ulong to ulong
+ret 0
+end
+fn ctxmeta limit ulong to bool
+ret false
+end
+fn ctxappend to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Who "Drake"
+text Selfname "Allen"
+text Fkey "gate code"
+text Fval "4471"
+text Note0 "Meet at noon."
+text Note1 "Old private note."
+text Note3 "Bring tools."
+text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon."
+text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools."
+text Emptyctx "\tself=Allen\tstarts=0"
+text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4"
+text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471"
+global Unitsave uchar 8192
+global Saveout uchar 8192
+global Saveos ulong 2
+fn test ok bool to void
+put Saveos 0 get Outlen 0
+put Saveos 1 get Err 0
+for i ulong get Outlen 0
+put Saveout i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Saveos 0
+put Outb i get Saveout i
+end
+put Outlen 0 get Saveos 0
+put Err 0 get Saveos 1
+end
+fn fixture index ulong gone ulong to void
+put Ns 0 len Note0
+put Ns 1 index
+put Ns 2 7
+put Ns 3 gone
+for i ulong len Note0
+put Note i get Note0 i
+end
+if eq index 1
+put Ns 0 len Note1
+for i ulong len Note1
+put Note i get Note1 i
+end
+end
+if eq index 3
+put Ns 0 len Note3
+for i ulong len Note3
+put Note i get Note3 i
+end
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+end
+fn memsetup to void
+for i ulong 3692
+put Mem i 0
+end
+mset32 0 7
+mset32 32 1
+mset32 36 4
+for i ulong len Who
+put Mem add i 8 get Who i
+end
+for i ulong len Fkey
+put Mem add i 40 get Fkey i
+end
+for i ulong len Fval
+put Mem add i 88 get Fval i
+end
+for i ulong len Selfname
+put Mem add i 153 get Selfname i
+end
+end
+fn prompt to void
+put Inlen 0 2
+put In 0 104
+put In 1 105
+end
+fn main to int
+test appinit 123 0
+test ctxmeta 6
+test eq get Mx 0 len Emptyctx
+same = true
+for i ulong len Emptyctx
+if ne get Meta i get Emptyctx i
+same = false
+end
+end
+test same
+memsetup
+test memenc 100
+for i ulong 4096
+put Unit i get Enc i
+end
+loadbeg
+test loadcopy 0
+test eq get St 0 100
+test ctxbegin
+test eq get Cx 0 4
+test eq get Cx 1 0
+test eq get Cx 2 0
+test not ctxmeta 6
+prompt
+test not appask 0
+test eq get R 0 0
+test eq get Q 1 0
+appcancel
+fixture 3 0
+test eq ctxtake 3 1
+test eq get Ctxlen 3 len Note3
+test eq get Ctxstart 3 7
+test eq ctxtake 3 0
+test eq get Cx 1 1
+fixture 1 1
+test eq ctxtake 1 1
+test eq get Ctxgone 1 1
+fixture 2 0
+put Unit 64 33
+test eq ctxtake 2 2
+test eq get Cx 3 1
+test eq get Ctxgone 2 1
+test not ctxmeta 6
+fixture 0 0
+test eq ctxtake 0 1
+test eq get Cx 1 4
+test eq get Cx 2 1
+test eq get Cx 4 0
+test eq ctxtake 4 0
+test ctxmeta 6
+test eq get Mx 0 len MetaWant
+same = true
+for i ulong len MetaWant
+if ne get Meta i get MetaWant i
+same = false
+end
+end
+test same
+test ctxmeta 1
+test eq get Mx 0 len NewOnly
+same = true
+for i ulong len NewOnly
+if ne get Meta i get NewOnly i
+same = false
+end
+end
+test same
+test not ctxmeta 513
+test not ctxappend
+test ctxmeta 6
+outreset
+emitb 120
+test ctxappend
+test eq get Outlen 0 add 1 len MetaWant
+test eq get Outb 0 120
+same = true
+for i ulong len MetaWant
+if ne get Outb add i 1 get MetaWant i
+same = false
+end
+end
+test same
+note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers.
+prompt
+test appask 1
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+n = get T 8
+test ge n len MetaWant
+same = ge n len MetaWant
+if same
+for i ulong len MetaWant
+if ne get JobOut add sub n len MetaWant i get MetaWant i
+same = false
+end
+end
+end
+test same
+test not ctxbegin
+test eq ctxtake 0 0
+appcancel
+note Exact append capacity and one byte above, preserving Outb/length/error on refusal.
+test ctxmeta 6
+n = sub ulong 4096 get Mx 0
+put Outlen 0 n
+for i ulong n
+put Outb i 90
+end
+test ctxappend
+test eq get Outlen 0 4096
+put Outlen 0 add n 1
+put Outb n 88
+test not ctxappend
+test eq get Outlen 0 add n 1
+test eq get Outb n 88
+put Err 0 5
+test not ctxappend
+test eq get Err 0 5
+outreset
+mset32 36 5
+test not ctxmeta 6
+mset32 36 4
+mset32 32 33
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+mset32 32 1
+note Deliberately full valid facts make metadata fit but the whole JOB exceed4096.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxmeta 6
+test le get Mx 0 4096
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+test eq get R 9 1
+note Catalog capacity and transaction exclusion.
+mset32 36 512
+test ctxbegin
+test eq get Cx 0 512
+test eq ctxtake 512 0
+fixture 511 0
+test eq ctxtake 511 1
+test eq get Ctxlen 511 len Note0
+test not ctxmeta 6
+put Tx 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Tx 0 0
+put Nt 0 1
+test not ctxbegin
+test eq ctxtake 0 0
+put Nt 0 0
+mset32 36 513
+test not ctxbegin
+test eq get Cx 0 512
+note Load ten real records, select exactly the newest six, and allow zero selected.
+for i ulong 3692
+put Mem i 0
+end
+mset32 36 10
+test ctxbegin
+for k ulong 10
+put Ns 0 2
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+put Note 0 78
+put Note 1 uchar add 48 k
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test ctxmeta 6
+test eq get Mx 0 len Lastsix
+same = true
+for i ulong len Lastsix
+if ne get Meta i get Lastsix i
+same = false
+end
+end
+test same
+test ctxmeta 0
+test eq get Mx 0 len Emptyctx
+note Context construction cannot overwrite a staged memory/note transaction image.
+for i ulong 4096
+put Unitsave i get Unit i
+put Unitsave add i 4096 get Enc i
+end
+test ctxmeta 6
+same = true
+for i ulong 4096
+if ne get Unit i get Unitsave i
+same = false
+end
+if ne get Enc i get Unitsave add i 4096
+same = false
+end
+end
+test same
+memsetup
+mset32 36 0
+mset32 0 4294967295
+put Mem 152 1
+test ctxmeta 6
+test eq get Mx 0 len Plural
+same = true
+for i ulong len Plural
+if ne get Meta i get Plural i
+same = false
+end
+end
+test same
+put Mem 40 9
+test not ctxmeta 6
+test not ctxappend
+put Mem 40 103
+for i ulong 48
+put Mem add i 40 107
+end
+test not ctxmeta 6
+note Thirty-two full facts and six full notes overflow metadata itself, not only JOB.
+for i ulong 3692
+put Mem i 0
+end
+mset32 32 32
+mset32 36 6
+for k ulong 32
+off = add 40 mul k 113
+for i ulong 47
+put Mem add off i 107
+end
+for i ulong 63
+put Mem add add off 48 i 118
+end
+end
+test ctxbegin
+for k ulong 6
+put Ns 0 127
+put Ns 1 k
+put Ns 2 7
+put Ns 3 0
+for i ulong 127
+put Note i 110
+end
+test noteenc
+for i ulong 4096
+put Unit i get Enc i
+end
+test eq ctxtake k 1
+end
+test not ctxmeta 6
+test eq get Mx 1 1
+outreset
+emitb 90
+test not ctxappend
+test eq get Outlen 0 1
+test eq get Outb 0 90
+prompt
+test not appask 2
+test eq get R 0 1
+test eq get Q 1 1
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L746/reply.log b/evidence/allen-omega-L694/L746/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L746/runtime.log b/evidence/allen-omega-L694/L746/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L746/scene-input.log b/evidence/allen-omega-L694/L746/scene-input.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/scene-input.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L746/scene.log b/evidence/allen-omega-L694/L746/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L746/scenecap-mutant.log b/evidence/allen-omega-L694/L746/scenecap-mutant.log
new file mode 100644
index 00000000..502843ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/scenecap-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L746/scheduler.log b/evidence/allen-omega-L694/L746/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L746/session-mutant.log b/evidence/allen-omega-L694/L746/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L746/short.log b/evidence/allen-omega-L694/L746/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L746/source.sha256 b/evidence/allen-omega-L694/L746/source.sha256
new file mode 100644
index 00000000..32b58465
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/source.sha256
@@ -0,0 +1,43 @@
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+69224f53c3c8a3f952fff210320cdfabc58da8a7f9e933ca863a33df528dc646 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+d1e99e2c1f4bcff06f6fda75fe2c3b48b75129526f15681cbd135b717bf1d11b native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L746/stale-mutant.log b/evidence/allen-omega-L694/L746/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L746/thinking-mutant.log b/evidence/allen-omega-L694/L746/thinking-mutant.log
new file mode 100644
index 00000000..74b41a12
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/thinking-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L746/view.log b/evidence/allen-omega-L694/L746/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L746/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L748/README.md b/evidence/allen-omega-L694/L748/README.md
new file mode 100644
index 00000000..6be85e20
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/README.md
@@ -0,0 +1,32 @@
+# L748 executable provider entry
+
+The parent personally authored provider-core.om and provider.om. The final native
+suite passed; summary.json counts actual assertion rows and names artifact hashes.
+The 100-check provider core covers restoration, application calls, pending wire
+preservation, explicit send results, answer/code delivery and refusal sequencing.
+Two independent 292-check output-verifier executions exercised file and real pipe
+streams. Native process-receipt checks validate six malformed/truncated/oversized
+cases, including no later command after the malformed frame. These inputs are
+synthetic qualification fixtures, not live model outputs.
+
+Reproduce: `quiet-build native/omega/allen/gate.sh /absolute/fresh/private/output`.
+The built `provider` is the actual static executable, not the older stdio adapter.
+All new behavioral fixtures, refusal assertions and mutant construction execute
+seeded Omega. The existing shell runner orchestrates builds/processes, collects
+exit/byte metadata and uses external byte comparison. Historical gate shell and
+legacy golden-oracle dependencies remain disclosed, not retired by this work.
+
+Meaningful REDs: initial compilable core stub failed 74 of 97 checks; empty native
+entry failed the output verifier; native refusal receipt validator rejected that
+entry's incorrect exit0. Original logs/source are retained. Initial verifier
+compilation exceeded the seed register budget and was split through vbyte without
+changing expected values. Initial broad shell mutation also changed a function
+signature and failed compilation (error16); it was not counted as a caught mutant.
+The final exact-line mutation generator is Omega and requires exactly one match.
+The first passing development runner still contained new shell test decisions;
+those were moved to provider-process.om before this publication. New test exits
+are fixed 1 on any assertion failure, not failure counts modulo256.
+
+The final gate is release.log with exit0, not the earlier intermediate logs.
+L748 independent final-source review is still required. No service, physical disk,
+x86 EFI, QEMU Omega boot, netboot staging or physical iMac execution is claimed.
diff --git a/evidence/allen-omega-L694/L748/ackstop-mutant.log b/evidence/allen-omega-L694/L748/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L748/appcode-mutant.log b/evidence/allen-omega-L694/L748/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L748/application.log b/evidence/allen-omega-L694/L748/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L748/autosent-mutant.log b/evidence/allen-omega-L694/L748/autosent-mutant.log
new file mode 100644
index 00000000..2aed7f8a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/autosent-mutant.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 1
+48 0
+49 0
+50 1
+51 1
+52 0
+53 1
+54 0
+55 1
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 1
+70 0
+71 0
+72 0
+73 0
+74 1
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L748/binaries.sha256 b/evidence/allen-omega-L694/L748/binaries.sha256
new file mode 100644
index 00000000..b45cc267
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/binaries.sha256
@@ -0,0 +1,40 @@
+49085d1c4e23dcd67fd89df63a711ccd57adfac88e2fd83f84c6ab9982abcaee /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-core
+3189b02674156ce257d5c97ad192c70bf71df6c2354304748f12626674cc2aba /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scheduler
+f24a2971111c84bf97ee23dc4f2541a4a8f57011f058ffe00d2e80ce993a98bc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/readback-mutant
+afe04934ba58367705dd7624951d502c23a7bdf0fce871ff97e03580ed372a6a /home/drakestapleton/handoffs/allen-omega-L694/L748/release/view
+87597377b16e4c1a08b3f674b10d3413a27943d979e48464d8b9988f1a34b767 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/contextnote-mutant
+5dac9b9e165c6303cf504c0fe9a70d5f5060be3cc2383eb44470b4fab7540581 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/allen
+d8f67f714b4e7bebdba1052fee978514f79a7efe501ade61009e3266d6ca250b /home/drakestapleton/handoffs/allen-omega-L694/L748/release/reply
+502ac1eb5c244e0ee20d5cdc1cc2a638a1ee87e203954ce9f8419c2959a2a207 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/thinking-mutant
+02497220d5acba2dd8529460c296e7adb4104d5a0ff5fe997343ae230b795fcb /home/drakestapleton/handoffs/allen-omega-L694/L748/release/ackstop-mutant
+9916d8f00f5aaa4c9c4ff89b1bc8292d7a5a32e4eb356c303bffb635bd34009f /home/drakestapleton/handoffs/allen-omega-L694/L748/release/hash-mutant
+91cc6ad1782a819213feb65ca5e7d1a2a4589c6cd751434a2c6702a70c847654 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/golden
+8fca38ff5b02e4d7dce2948dc198f8d1a0bae24dde13f4de262c6ac3d5439afc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/session-mutant
+909bbc60755edd44b455c18ebd50a49ce0e6c48b45c294bfd348455eec248764 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scene-input
+dfb5ceb46b04718b94f447550b1318ffd7fd2592a749bd39fe63613dc5812fb4 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/intent
+e35924cdb3da915ae919b4addefade4b702202655e1ea3c320b4835631ba22b0 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-input
+0ec8e1a4a590ce25d2cc9e5023b9cdc93910ffa1dc092a23188663452f73fe02 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/fixture
+c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider
+da2db26d9ec09c6b09d71f408cc8fc4aede4f4caba8d869195402c7d23d5c3a1 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/context
+dc65f1ffb7fd01f98c92ec80cd9e11bdd9c3c2fd0ee7522bc346074822ab7cf3 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/runtime
+5f611bc8b08963a572782f60f3c561947a92185d070da598f286156b65999f36 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/code
+52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-mutants
+124cc427a2196686fa820d3abd9a9d37a699be4ff1585eef521fcbf956c61323 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/edges
+8236a24960d473003e128ee736fb322a341e9f30aae1a7c091c93466bbb26c50 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/appcode-mutant
+b8241b0765f869f49ef570f7bd09ffcaa1ccdbb42968aca848b459c0671a89c1 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/render
+86810438f6ca30599f4bf6881b550d8ce56da2cf5e7d1ad4e4a8af77ccad338d /home/drakestapleton/handoffs/allen-omega-L694/L748/release/stale-mutant
+2407b19d8bcd6a13c26b5f79ffbf4fbd2f05ad2e48b8dfa355ab56aad3499dbc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/courier
+cb12cc9f683c4771ebbf5d2a6045235ea7a19f8718c58b32546806c7feb93c6b /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scene
+582b5ef0de574661ea2378f9a055d382904094646b0880fa2659a91630e8f150 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/pendingwire-mutant
+f117936d5e3aa088d164118340155fa3617c51066d5aff53916071a467aa4269 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/framecheck-mutant
+4b834d81b3a020fc6ff6f8b6481322fc43b2e3509fb7d9e17105a7410d4b5293 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scenecap-mutant
+65040ef18b342252efcf2fd5fc2897f90b8d6219e3ac7f5ca089c7f5de6a9d63 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/contextjob-mutant
+fb69832f54e73986c5a52a3dcf6d26b02e5dca2d64339c83d5779426244c9575 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/paint
+6459e7f0af5d66d64e566e418a33c60873625c1d9e58cd5ad88358132f41955d /home/drakestapleton/handoffs/allen-omega-L694/L748/release/crc-mutant
+cff536041b98c6a40fe2c7f96bd9fe0cc029352459d1ad63fb904b6a808d757d /home/drakestapleton/handoffs/allen-omega-L694/L748/release/autosent-mutant
+8eeda9f344c1c28f6e05308acbeb243ea8ee74e29e290e45b746e20cd5873e24 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-output
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/stdio-overflow-input
+e04adf1e16f4b935870a0c1f2f4ed347236305a27fb571e8dbccee8c75e01f7e /home/drakestapleton/handoffs/allen-omega-L694/L748/release/keepalive-mutant
+f27b24582f22767dbf7eb3f9e8b5d06b0f37f54371e91dec125ee7544f65d259 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-process
+115dfc604c12b15660289905b00caa566c6cfeaeb709241da9e8b4b7c34714fc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/memory
+a150ad34968970185a836a52ca2c48f882254f1faa0a8c576dbc241624505ed9 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/application
diff --git a/evidence/allen-omega-L694/L748/code.log b/evidence/allen-omega-L694/L748/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L748/context.log b/evidence/allen-omega-L694/L748/context.log
new file mode 100644
index 00000000..df62cddb
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/context.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L748/contextjob-mutant.log b/evidence/allen-omega-L694/L748/contextjob-mutant.log
new file mode 100644
index 00000000..3432d4b2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/contextjob-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 0
+78 0
+79 1
+80 1
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 1
+89 0
+90 1
+91 0
+92 1
+93 0
+94 1
+95 0
+96 1
+97 0
+98 1
+99 0
+100 1
+101 0
+102 1
+103 0
+104 1
+105 0
+106 1
+107 0
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 1
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 1
+123 0
+124 1
+125 0
+126 1
+127 0
+128 1
+129 0
+130 1
+131 0
+132 1
+133 0
+134 1
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 1
+142 1
diff --git a/evidence/allen-omega-L694/L748/contextnote-mutant.log b/evidence/allen-omega-L694/L748/contextnote-mutant.log
new file mode 100644
index 00000000..b5c08759
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/contextnote-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 1
+38 1
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 1
+47 0
+48 1
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L748/courier.log b/evidence/allen-omega-L694/L748/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L748/crc-mutant.log b/evidence/allen-omega-L694/L748/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L748/edges.log b/evidence/allen-omega-L694/L748/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L748/final.exit b/evidence/allen-omega-L694/L748/final.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/final.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/final.log b/evidence/allen-omega-L694/L748/final.log
new file mode 100644
index 00000000..ecf723fa
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/final.log
@@ -0,0 +1,43 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=8
+framecheck mutant compile=0 rejected-exit=4
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L748/framecheck-mutant.log b/evidence/allen-omega-L694/L748/framecheck-mutant.log
new file mode 100644
index 00000000..d5454577
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/framecheck-mutant.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 1
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L748/full.exit b/evidence/allen-omega-L694/L748/full.exit
new file mode 100644
index 00000000..b6a7d89c
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/full.exit
@@ -0,0 +1 @@
+16
diff --git a/evidence/allen-omega-L694/L748/full.log b/evidence/allen-omega-L694/L748/full.log
new file mode 100644
index 00000000..0919171a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/full.log
@@ -0,0 +1,41 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+omc: line 3510: error 16
diff --git a/evidence/allen-omega-L694/L748/green1.exit b/evidence/allen-omega-L694/L748/green1.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/green1.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/green1.log b/evidence/allen-omega-L694/L748/green1.log
new file mode 100644
index 00000000..5bff02cf
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/green1.log
@@ -0,0 +1,97 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
diff --git a/evidence/allen-omega-L694/L748/hash-mutant.log b/evidence/allen-omega-L694/L748/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/count-correction.md b/evidence/allen-omega-L694/L748/independent-review/count-correction.md
new file mode 100644
index 00000000..e9dcb194
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/count-correction.md
@@ -0,0 +1 @@
+The original report says25 boundary assertions and872 total. The retained log has26 passing rows, including its final count assertion. Parent rebuilt the exact boundary input, obtained a byte-identical binary, and replayed26/26. Actual provider-review total is873 passing assertion rows. Original report retained unchanged.
diff --git a/evidence/allen-omega-L694/L748/independent-review/inventory.json b/evidence/allen-omega-L694/L748/independent-review/inventory.json
new file mode 100644
index 00000000..7e242e0b
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/inventory.json
@@ -0,0 +1,154 @@
+{
+ "count-correction.md": "e0fc65d2dd4428e6ba2ea9c0f63e7d617a4ef91b6fd22217365127b0b82d6143",
+ "parent-boundary.log": "69318135260b334c2b4e28c0dcde808e8ea649fab689b7ce9dc6a61aa1effdc4",
+ "parent-provider.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0",
+ "parent-verification.json": "e0a9a2c4149144932e4a1827fcceb6561fe6882ef5b85b1fff325800492c7569",
+ "probes/core.om": "f5984ce7290b7853446ca2bc2d192d76dfd13bd90dad2c97c5acfd5720f95ba5",
+ "probes/provider-boundary-test-final.om": "7b05323ea8180d39996404367059426371b082028cbd52bba8a2fe55ba0fe57e",
+ "probes/provider-boundary-test-v2.om": "b3cbcb68a885546aac1338d3e5c1f80dde1d6627f08911198e34a46fcf1e0ba2",
+ "probes/provider-boundary-test.om": "ca1b9d61eab55954ac0fed582b22f27eea0ca6daad534ef0363624f54d345fd8",
+ "probes/provider-boundary.om": "f0642cdbea86e6181cb5cf9349d2069cea35e398197a1d264a56adc1d26b42b8",
+ "probes/provider-core-test.om": "e56b53d01133d3fd7babd76a37bc59af8b31156d33e2b79ccbf8a3ea6b49868d",
+ "probes/provider-input-test.om": "5815a0c8afeb4f2eb858a1180099bf0d21883a3543d704ac3e2613cb860d9bcd",
+ "probes/provider-output-test.om": "5da89211ae500e9190b3e2ab8919b78dce6bbb0078cf15ab8daf4de6fce30352",
+ "probes/provider-process-test.om": "281f4e63aeb402de2752b342820dac97e67053bcc8868fb4e2ff9df8506012db",
+ "probes/provider-semantic-input-test-v2.om": "7adfe5e00906277368761ce6f12e4fe53249963e56fa1e0b4880bfe9823c5eaa",
+ "probes/provider-semantic-input-test-v3.om": "cca7ec68e609bef07289afa4053f71f1af75aca69c289ccab94768017ed0a344",
+ "probes/provider-semantic-input-test-v4.om": "cd1f6da74057c4118c1dbc20d85334082558caac07a92e90b040429cb22265d6",
+ "probes/provider-semantic-input-test.om": "7adfe5e00906277368761ce6f12e4fe53249963e56fa1e0b4880bfe9823c5eaa",
+ "probes/provider-semantic-input.om": "9932322990aee378f59097663b341f7dff6cacf004cef8971762f34e84dd7766",
+ "probes/provider-semantic-output-test-final.om": "bdfe51578d66616d051fbe8557e42a1cd7de0e25f5c077c57472109a2a28bd15",
+ "probes/provider-semantic-output-test-final2.om": "a0c530ae578c178f8972588518a2a26fd9509ba87f89b816e53bf1e8af63c402",
+ "probes/provider-semantic-output-test-final3.om": "04a9e4facb92689ba2d56727704f6d1d5b5c38affff868a40cc441ac2025158c",
+ "probes/provider-semantic-output-test-v3.om": "1da10526358510342d59818732adece30ed7529b696cb4a505cca47e58af1ca2",
+ "probes/provider-semantic-output-test-v4.om": "8591ca0dc189c7a7b52bc9e698e72e1247d932f6c1ba6fc701383710d5dcadbd",
+ "probes/provider-semantic-output-test-v5.om": "6d678e1f4da778139d34facc5f4940f2eb78c313345dada839be150aabb9f67e",
+ "probes/provider-semantic-output-test-v6.om": "f06d2b0a77dffa160f09995e0545357647f16aca3033a2ba30b432262ccf4512",
+ "probes/provider-semantic-output.om": "1ad2c2667f403d92664768b5cc008b16aff570a2d97ea9827cdee333bb3f6ff3",
+ "probes/provider-shortwrite-check-test-final.om": "4c4fce3ddbaf2b266c6df43804754637cdb1cd1a189c23945f7ab002ef9e3e69",
+ "probes/provider-shortwrite-check-test-v2.om": "4eecb657385c51d6f529ae98d6baf28769646c9ca835c164314babd52786ee98",
+ "probes/provider-shortwrite-check-test-v3.om": "fdda8e4be5615a26890861726c60a318026943ceb38e966f73c75104d6d1ad83",
+ "probes/provider-shortwrite-check-test-v4.om": "129b8ae97efa4b14efb1191eff2412a1b0bb705e29c455e3afece517299309ee",
+ "probes/provider-shortwrite-check-test-v5.om": "56275a40ba2f9881123d35b48c1bf472adb5ba4dd35aa9db172d4831cdbf7eb5",
+ "probes/provider-shortwrite-check-test.om": "e446c58a76bf5f695faaf02b25686a5c04dcaa99d728dae56c47cb4d3bb8cae9",
+ "probes/provider-shortwrite-check.om": "7a41bf77c01faf4adea9da7c5bd63a7a96e5c51ca8a9dec70a1270ed77a3686d",
+ "probes/provider.om": "7ce870b4adc39d0fe38a336ba0f19009dcb28f9761d7c10c760603efe564f924",
+ "raw/SHA256SUMS.pre-report": "17c3b0fe00774d762fd4590f2cc8476c79c4d0b23ea3ab35bc7c2764cd80d896",
+ "raw/application-numbered.txt": "149c86c580d055212b030f15223efbf61fc77e941cd3026a329d98f04373e797",
+ "raw/builds-final.sha256": "c60310ca34301e81cef053e9ba376ac7dd7f064f0c5a829d29b60caece99e67a",
+ "raw/builds.sha256": "e1143e9516dc5614a94515370c20655a46f9000fd9aed19f08662d45a0e623bd",
+ "raw/compiler.sha256": "41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4",
+ "raw/context-restore-numbered.txt": "2d9a3c4c37f3234249719134d11aff790623b930e838c0cdca311745e3cc8702",
+ "raw/failed-probes/invalid-time.exit": "979b894f2d91bf199766571d58024f020d1a44a417da5f48e1fa1cdf554a14f5",
+ "raw/failed-probes/invalid-time.input": "46eaf5338a37ae4de81bbe77714ba8df5a54d0b9d39cf9390db0fe3c6a9a5fe1",
+ "raw/failed-probes/invalid-time.output": "0a1dae7e76e5fb41aed0ce664f9a8a8196c0cdcd620b535b5dfc7005a5799681",
+ "raw/failed-probes/invalid-time.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/failed-probes/missing-entry.compile.exit": "f0b5c2c2211c8d67ed15e75e656c7862d086e9245420892a7de62cd9ec582a06",
+ "raw/failed-probes/missing-entry.compile.log": "bac11db2729587f90a499b706c6aa92ed2183c7c9c37e5b3a3a85d329922a12e",
+ "raw/failed-probes/provider-boundary-missing-entry": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/failed-probes/provider-boundary-missing-entry.om": "a87e6c7d19c6b7f3332c6a1eadc8771ec2f9d4c7b2e0ad5ebd1efafa3907a9b5",
+ "raw/failed-probes/provider-boundary-wrong-count-test": "75a8cca0a568f268e617c4a3131e71cc9967aa9e4f0b7495d0487cd60a4802fd",
+ "raw/failed-probes/provider-boundary-wrong-count-test.om": "6aa2d32599babbaffcf7c354e50addd36ddeff6d2f12cad2ec7e897d52da13a1",
+ "raw/failed-probes/provider-boundary-wrong-count.om": "b18266366739227acca27d9ead48c42f370b64e062bbf21fb96e3177e641de6c",
+ "raw/failed-probes/provider-semantic-invalid-time-test": "4040de7fe90c2dca9d68556a7bb23d5264d71027bd54f8277a1eebea452a1d66",
+ "raw/failed-probes/provider-semantic-invalid-time-test.om": "cca7ec68e609bef07289afa4053f71f1af75aca69c289ccab94768017ed0a344",
+ "raw/failed-probes/provider-semantic-invalid-time.om": "19370bac9519c21e6c71207657321a6bd22df380befa7b3c19f9405054318a4c",
+ "raw/failed-probes/wrong-count.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "raw/failed-probes/wrong-count.log": "3bfa0432504c94ba21aaf265f73af49ada07d4bc484ef2fa3a809f68cc9749ce",
+ "raw/focused-inputs.sha256": "3d59cfaef014da864a760771938fa0847da539f5946816136ff4721931c1a4b9",
+ "raw/git-source.paths": "671c5d51da86d0554bb6d242f145b51bb22fd520177e45fbeef200a02e04863f",
+ "raw/memory-restore-numbered.txt": "d70c344115f1aac0b1ecbf348f3298cc1975331634b9a41be196d5c1b59acf33",
+ "raw/pins.txt": "7d931199f90a0d238d58c2d9abac45df4520ac9f2ef396504e136b9d503b17d5",
+ "raw/provider-boundary-final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-boundary-final.log": "69318135260b334c2b4e28c0dcde808e8ea649fab689b7ce9dc6a61aa1effdc4",
+ "raw/provider-boundary.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "raw/provider-boundary.log": "3bfa0432504c94ba21aaf265f73af49ada07d4bc484ef2fa3a809f68cc9749ce",
+ "raw/provider-core-numbered.txt": "4b6fcafad2946e37eb832da122176742047661874351d7151658885d3fc8e472",
+ "raw/provider-core.exit": "9a6f0211f12d0930331efa31d7bf65dcbf2a4c71c55d101e1df4077cd3d71db4",
+ "raw/provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04",
+ "raw/provider-entry-numbered.txt": "f96657de953a7827768f2a62851b8830926c2f1a556a72272654742125c4f48f",
+ "raw/provider-eof.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-eof.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-eof.out": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-fragment-producer.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-fragment-producer.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-fragment.check.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-fragment.check.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "raw/provider-fragment.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-fragment.mode": "7902699be42c8a8e46fbbb4501726517e86b22c56a189f7625a6da49081b2451",
+ "raw/provider-fragment.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0",
+ "raw/provider-fragment.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-fragment.strace": "718fa4fce2aafd2d658e1d7a776ed8ca22b23bbbc616a28ed74aac5b787e55fb",
+ "raw/provider-full.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8",
+ "raw/provider-full.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-normal-producer.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-normal.check.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-normal.check.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "raw/provider-normal.input": "520bdb2f475e7ff86edfd6618b04d672c6a9b90ce09e4f249e3c615078855867",
+ "raw/provider-normal.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0",
+ "raw/provider-normal.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-partial-write-check-final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-partial-write-check-final.log": "247f163efbac7aca478706f7ba00072b808450055e6ba819208f1d20a41a1f50",
+ "raw/provider-partial-write-check.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "raw/provider-partial-write-check.log": "5458fb305ce1bed0daf4a87e2afe15dffa92d34e239d90ec4db99cd8f7bbdc05",
+ "raw/provider-partial-write.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8",
+ "raw/provider-partial-write.output": "c9d6ffd3da9f61111b290c837735758566f93a95f203467268e3cc70e2b84a01",
+ "raw/provider-partial-write.receipt": "93e3aee03715093b7cbf8b04c9c6f7355739cff5e33cdecb2df16893020e4b40",
+ "raw/provider-partial-write.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider-partial-write.strace": "310c498a976ca7397be904709499cad567c341e35d39ddd9ed9df81d148c5903",
+ "raw/provider-semantic-check.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-semantic-check.log": "6a87eb69ca54f8d30d653737c7ba17efe564a66d1a6b343fd8483e370441d90b",
+ "raw/provider-semantic.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/provider-semantic.input": "b52911d5d588f47d3a3469a966975d52e7c7646a2793f3533741247d316125e4",
+ "raw/provider-semantic.output": "c3db64fe5747f8601b4aee0dd132e881676249faa93709a7c296dc7ef060098c",
+ "raw/provider-semantic.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/provider.elf.txt": "763921ec6cbbfbe18891cc29b474ee14cfb20851846b6ef6bd5757d65540b90b",
+ "raw/release-source.paths": "671c5d51da86d0554bb6d242f145b51bb22fd520177e45fbeef200a02e04863f",
+ "raw/report.sha256": "043bfc6b007cf28852903a366736c165fb1f6c6c781c99e3244f967acd7d064d",
+ "raw/report.sha256.verify": "043bfc6b007cf28852903a366736c165fb1f6c6c781c99e3244f967acd7d064d",
+ "raw/short-1.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "raw/short-1.input": "b9d4174daac045b3088a0d53515083432b86dd4b5bdf5f1d67b8c7a4c144dd13",
+ "raw/short-1.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4",
+ "raw/short-1.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-2.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "raw/short-2.input": "5db852bf971a13086b099baa093cf88fbdaf42852f1cba8e938799a34109f332",
+ "raw/short-2.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b",
+ "raw/short-2.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-3-traced.exit": "979b894f2d91bf199766571d58024f020d1a44a417da5f48e1fa1cdf554a14f5",
+ "raw/short-3-traced.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-3-traced.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-3.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "raw/short-3.input": "509158d4cc5ee28556c0a1518ef3f7a97594e33aebe934a02a59f18c7ac5c230",
+ "raw/short-3.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05",
+ "raw/short-3.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-3.strace": "ff002d74cd52f18355e768381e8dc8af5f8b44f87cdb39cc604aec984bd6367c",
+ "raw/short-4-traced.exit": "979b894f2d91bf199766571d58024f020d1a44a417da5f48e1fa1cdf554a14f5",
+ "raw/short-4-traced.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-4-traced.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-4.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "raw/short-4.input": "9aec780192d96833fb57d407522db00fc6c6bf60b2fdf99ffbbbf5bdd9bfcb8d",
+ "raw/short-4.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a",
+ "raw/short-4.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-4.strace": "bcd0008ce257d99d270023add3ebdb45a84317ce804107fe85e5106453ce2c95",
+ "raw/short-5.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "raw/short-5.input": "c42c9f8a6a3589d3aa3dfa90194663bfc26bd5575c60787c9a355f93fb9511fb",
+ "raw/short-5.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646",
+ "raw/short-5.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/short-6.check.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435",
+ "raw/short-6.input": "8ea63ccc995ca2f50cae898a5dd97a15c90d8650e190a824f857d4cb362a8e91",
+ "raw/short-6.output": "691fee447b7b1453a429e23f01152ffacca0570ccce92f525af024aa0d934519",
+ "raw/short-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b",
+ "raw/short-6.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/source-membership.diff": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/trace-producer.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "raw/trace-producer.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "raw/trace-provider.err": "074ffaa4fc78b6d5e8c4cc646123d4e16efe0ef9e081c9aab78c479da1b07e34",
+ "raw/trace-provider.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8",
+ "raw/trace-provider.out": "c9d6ffd3da9f61111b290c837735758566f93a95f203467268e3cc70e2b84a01",
+ "report.md": "f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274"
+}
diff --git a/evidence/allen-omega-L694/L748/independent-review/parent-boundary.log b/evidence/allen-omega-L694/L748/independent-review/parent-boundary.log
new file mode 100644
index 00000000..4ef2f89c
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/parent-boundary.log
@@ -0,0 +1,26 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/parent-provider.output b/evidence/allen-omega-L694/L748/independent-review/parent-provider.output
new file mode 100644
index 00000000..12949c15
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/parent-provider.output differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/parent-verification.json b/evidence/allen-omega-L694/L748/independent-review/parent-verification.json
new file mode 100644
index 00000000..1fcf8a5c
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/parent-verification.json
@@ -0,0 +1,34 @@
+{
+ "source_closures": [
+ {
+ "pin": "43eae848f0a44604b42378d9ea3170278b5f3f8f",
+ "files": 51,
+ "core_sha256": "f5984ce7290b7853446ca2bc2d192d76dfd13bd90dad2c97c5acfd5720f95ba5"
+ },
+ {
+ "pin": "4c7888f65dca209a1e2b859ba695ae308657c03e",
+ "files": 55,
+ "core_sha256": "65db52e4ec165ae64b71b7a2c68c6263890ecf6fc9cc9f27db68e2374dcfcbf0"
+ }
+ ],
+ "provider_review_checks": {
+ "provider-core.log": 100,
+ "provider-normal.check.log": 292,
+ "provider-fragment.check.log": 292,
+ "provider-boundary-final.log": 26,
+ "provider-semantic-check.log": 38,
+ "provider-partial-write-check-final.log": 83,
+ "short-1.check.log": 5,
+ "short-2.check.log": 5,
+ "short-3.check.log": 5,
+ "short-4.check.log": 5,
+ "short-5.check.log": 5,
+ "short-6.check.log": 17
+ },
+ "presentation_review_checks": 98,
+ "parent_provider_sha256": "c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd",
+ "parent_presentation_sha256": "24285077f8ff55875bac7834cb711f28b116ee11b5dd055fdd12bbfb7756c8aa",
+ "parent_presentation_checks": 23,
+ "report_sha256": "f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274",
+ "scope": "Host only; no correctness findings; original raw failures and scope limits retained."
+}
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/core.om b/evidence/allen-omega-L694/L748/independent-review/probes/core.om
new file mode 100644
index 00000000..0047c212
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/core.om
@@ -0,0 +1,3682 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-final.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-final.om
new file mode 100644
index 00000000..c5a63ca2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-final.om
@@ -0,0 +1,3771 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Bmagic "ALNPRV01"
+fn btest ok bool to void
+check ok add get Checks 0 1
+end
+fn bword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn bframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Bmagic i
+end
+bword 8 op
+bword 16 now
+bword 24 arg
+bword 32 size
+end
+fn main to int
+bframe 1 sub ulong 0 1 1 0
+btest prparse
+btest eq get Pv 1 sub ulong 0 1
+bframe 1 shl ulong 1 63 sub ulong 0 1 0
+btest prparse
+btest eq get Pv 1 shl ulong 1 63
+btest eq get Pv 2 sub ulong 0 1
+bframe sub ulong 0 1 0 0 0
+btest not prparse
+bframe 2 0 0 0
+btest not prparse
+bframe 2 0 0 1
+btest prparse
+bframe 2 0 0 159
+btest prparse
+bframe 2 0 0 160
+btest not prparse
+bframe 5 0 0 64
+btest not prparse
+bframe 5 0 0 65
+btest prparse
+bframe 5 0 0 1200
+btest prparse
+bframe 5 0 0 1201
+btest not prparse
+bframe 8 0 0 4096
+btest prparse
+bframe 8 0 1 4096
+btest prparse
+bframe 8 0 2 4096
+btest not prparse
+bframe 8 1 0 4096
+btest not prparse
+bframe 9 0 0 4096
+btest prparse
+bframe 9 0 511 4096
+btest prparse
+bframe 9 0 512 4096
+btest not prparse
+bframe 6 0 0 0
+btest prparse
+bframe 6 1 0 0
+btest not prparse
+bframe 7 0 1 0
+btest not prparse
+bframe 10 0 0 0
+btest prparse
+btest eq get Checks 0 25
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-v2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-v2.om
new file mode 100644
index 00000000..a1ae6ef8
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-v2.om
@@ -0,0 +1,3771 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Bmagic "ALNPRV01"
+fn btest ok bool to void
+check ok add get Checks 0 1
+end
+fn bword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn bframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Bmagic i
+end
+bword 8 op
+bword 16 now
+bword 24 arg
+bword 32 size
+end
+fn main to int
+bframe 1 sub ulong 0 1 1 0
+btest prparse
+btest eq get Pv 1 sub ulong 0 1
+bframe 1 shl ulong 1 63 sub ulong 0 1 0
+btest prparse
+btest eq get Pv 1 shl ulong 1 63
+btest eq get Pv 2 sub ulong 0 1
+bframe sub ulong 0 1 0 0 0
+btest not prparse
+bframe 2 0 0 0
+btest not prparse
+bframe 2 0 0 1
+btest prparse
+bframe 2 0 0 159
+btest prparse
+bframe 2 0 0 160
+btest not prparse
+bframe 5 0 0 64
+btest not prparse
+bframe 5 0 0 65
+btest prparse
+bframe 5 0 0 1200
+btest prparse
+bframe 5 0 0 1201
+btest not prparse
+bframe 8 0 0 4096
+btest prparse
+bframe 8 0 1 4096
+btest prparse
+bframe 8 0 2 4096
+btest not prparse
+bframe 8 1 0 4096
+btest not prparse
+bframe 9 0 0 4096
+btest prparse
+bframe 9 0 511 4096
+btest prparse
+bframe 9 0 512 4096
+btest not prparse
+bframe 6 0 0 0
+btest prparse
+bframe 6 1 0 0
+btest not prparse
+bframe 7 0 1 0
+btest not prparse
+bframe 10 0 0 0
+btest prparse
+btest eq get Checks 0 28
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test.om
new file mode 100644
index 00000000..d5fba9fa
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test.om
@@ -0,0 +1,3771 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Bmagic "ALNPRV01"
+fn btest ok bool to void
+check ok add get Checks 0 1
+end
+fn bword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn bframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Bmagic i
+end
+bword 8 op
+bword 16 now
+bword 24 arg
+bword 32 size
+end
+fn bmain to int
+bframe 1 sub ulong 0 1 1 0
+btest prparse
+btest eq get Pv 1 sub ulong 0 1
+bframe 1 shl ulong 1 63 sub ulong 0 1 0
+btest prparse
+btest eq get Pv 1 shl ulong 1 63
+btest eq get Pv 2 sub ulong 0 1
+bframe sub ulong 0 1 0 0 0
+btest not prparse
+bframe 2 0 0 0
+btest not prparse
+bframe 2 0 0 1
+btest prparse
+bframe 2 0 0 159
+btest prparse
+bframe 2 0 0 160
+btest not prparse
+bframe 5 0 0 64
+btest not prparse
+bframe 5 0 0 65
+btest prparse
+bframe 5 0 0 1200
+btest prparse
+bframe 5 0 0 1201
+btest not prparse
+bframe 8 0 0 4096
+btest prparse
+bframe 8 0 1 4096
+btest prparse
+bframe 8 0 2 4096
+btest not prparse
+bframe 8 1 0 4096
+btest not prparse
+bframe 9 0 0 4096
+btest prparse
+bframe 9 0 511 4096
+btest prparse
+bframe 9 0 512 4096
+btest not prparse
+bframe 6 0 0 0
+btest prparse
+bframe 6 1 0 0
+btest not prparse
+bframe 7 0 1 0
+btest not prparse
+bframe 10 0 0 0
+btest prparse
+btest eq get Checks 0 28
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary.om
new file mode 100644
index 00000000..cf104df5
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary.om
@@ -0,0 +1,72 @@
+text Bmagic "ALNPRV01"
+fn btest ok bool to void
+check ok add get Checks 0 1
+end
+fn bword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn bframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Bmagic i
+end
+bword 8 op
+bword 16 now
+bword 24 arg
+bword 32 size
+end
+fn main to int
+bframe 1 sub ulong 0 1 1 0
+btest prparse
+btest eq get Pv 1 sub ulong 0 1
+bframe 1 shl ulong 1 63 sub ulong 0 1 0
+btest prparse
+btest eq get Pv 1 shl ulong 1 63
+btest eq get Pv 2 sub ulong 0 1
+bframe sub ulong 0 1 0 0 0
+btest not prparse
+bframe 2 0 0 0
+btest not prparse
+bframe 2 0 0 1
+btest prparse
+bframe 2 0 0 159
+btest prparse
+bframe 2 0 0 160
+btest not prparse
+bframe 5 0 0 64
+btest not prparse
+bframe 5 0 0 65
+btest prparse
+bframe 5 0 0 1200
+btest prparse
+bframe 5 0 0 1201
+btest not prparse
+bframe 8 0 0 4096
+btest prparse
+bframe 8 0 1 4096
+btest prparse
+bframe 8 0 2 4096
+btest not prparse
+bframe 8 1 0 4096
+btest not prparse
+bframe 9 0 0 4096
+btest prparse
+bframe 9 0 511 4096
+btest prparse
+bframe 9 0 512 4096
+btest not prparse
+bframe 6 0 0 0
+btest prparse
+bframe 6 1 0 0
+btest not prparse
+bframe 7 0 1 0
+btest not prparse
+bframe 10 0 0 0
+btest prparse
+btest eq get Checks 0 25
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-core-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-core-test.om
new file mode 100644
index 00000000..c8460592
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-core-test.om
@@ -0,0 +1,3952 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fmagic "ALNPRV01"
+text Hi "hi"
+text Reply "SAY 1 1/1 hello"
+text Askcode "write a calculator"
+text Tinycode "CODE 2 1/1 2 d8932aac text hi"
+text Done "SAY 2 1/1 Done."
+global Held uchar 8192
+global Holdn ulong 2
+global Before uchar 8192
+fn test ok bool to void
+note Direct write logger would clobber the very datagram being tested.
+put Holdn 0 get Outlen 0
+put Holdn 1 get Err 0
+for i ulong get Outlen 0
+put Held i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Holdn 0
+put Outb i get Held i
+end
+put Outlen 0 get Holdn 0
+put Err 0 get Holdn 1
+end
+fn hword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn frame op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Fmagic i
+end
+hword 8 op
+hword 16 now
+hword 24 arg
+hword 32 size
+end
+fn oword off ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add off i mul i 8
+end
+ret v
+end
+fn receive part ulong size ulong to void
+note Caller placed LINE payload in In; packet overwrites Outb, so preserve it.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Held i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Held i
+end
+put Outlen 0 n
+put Err 0 e
+frame 5 4294967297 0 size
+end
+fn main to int
+frame 1 4294967296 77 0
+test prparse
+test eq get Pv 0 1
+test eq get Pv 1 4294967296
+test eq get Pv 2 77
+put Ph 0 88
+test not prparse
+frame 11 0 0 0
+test not prparse
+frame 1 0 77 1
+test not prparse
+frame 3 0 2 0
+test not prparse
+frame 2 0 0 160
+test not prparse
+frame 10 0 0 0
+test prdo
+test eq oword 16 1
+test eq get Pc 0 1
+mset32 0 3
+mset32 36 1
+test memenc 10
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 8 0 1 4096
+test prdo
+test eq oword 16 1
+test eq get St 0 10
+test prdo
+test eq oword 16 0
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+for i ulong 4096
+put Pb i 0
+end
+frame 8 0 0 4096
+test prdo
+test eq oword 16 2
+test eq get Pc 0 2
+test eq get St 0 10
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+put Ns 0 2
+put Ns 1 0
+put Ns 2 3
+put Ns 3 0
+put Note 0 78
+put Note 1 48
+test noteenc
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 9 0 1 4096
+test prdo
+test eq oword 16 0
+frame 9 0 0 4096
+test prdo
+test eq oword 16 1
+test eq get Pc 0 3
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 1
+test eq get A 0 1
+test prdo
+test eq oword 16 0
+frame 10 0 0 0
+test prdo
+test eq oword 16 0
+test eq mem32 0 3
+frame 2 4294967297 0 len Hi
+for i ulong len Hi
+put Pb i get Hi i
+end
+test prdo
+test eq oword 16 1
+test eq get R 0 1
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq oword 32 get Outlen 0
+test eq get T 10 5
+same = true
+for i ulong get Outlen 0
+if ne get Pout add i 40 get Outb i
+same = false
+end
+end
+test same
+test prdo
+test eq oword 16 1
+test eq get T 10 5
+frame 4 4294967297 0 0
+test prdo
+test eq get T 3 0
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+frame 4 4294967297 1 0
+test prdo
+test eq get T 3 1
+frame 3 4294967297 1 0
+test prdo
+test eq get T 10 1
+for i ulong len Reply
+put In i get Reply i
+end
+receive 1 len Reply
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Before i get Outb i
+end
+test prdo
+test eq get Outlen 0 n
+test eq get Err 0 e
+same = true
+for i ulong n
+if ne get Outb i get Before i
+same = false
+end
+end
+test same
+test eq oword 16 1
+test eq oword 24 1
+test eq oword 32 5
+test eq get Pout 40 104
+test eq get R 1 0
+test eq get T 10 1
+test eq get Outb 0 65
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq get T 10 3
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 1
+test eq oword 32 0
+frame 2 4294967297 0 len Askcode
+for i ulong len Askcode
+put Pb i get Askcode i
+end
+test prdo
+test eq oword 24 1
+test eq oword 32 len Ack
+for i ulong len Tinycode
+put In i get Tinycode i
+end
+receive 1 len Tinycode
+test prdo
+test eq oword 24 0
+frame 3 4294967297 1 0
+test prdo
+frame 4 4294967297 1 0
+test prdo
+for i ulong len Done
+put In i get Done i
+end
+receive 2 len Done
+test prdo
+test eq oword 24 1
+test eq oword 32 5
+off = ulong 45
+test eq oword add off 8 11
+test eq oword add off 32 2
+test eq get Pout add off 40 104
+test eq get Pout add off 41 105
+test eq get Pn 0 add off 42
+frame 3 4294967296 1 0
+test prdo
+test eq oword 16 0
+test eq oword 24 0
+frame 7 0 0 0
+test prdo
+test eq get R 9 0
+test eq get R 0 2
+test eq get Q 1 2
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-input-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-input-test.om
new file mode 100644
index 00000000..7ad3d79d
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-input-test.om
@@ -0,0 +1,3843 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Generates real framed stdin. Mode byte0 normal,1..5 malformed,6 fail-fast.
+text Iomagic "ALNPRV01"
+text Wireline "ALLEN-COURIER v=1 run=000000000000004d kind=LINE seq=1 part=1/0 bytes=0\nSAY 1 1/1 hello"
+global Ih uchar 40
+global Choice uchar 1
+fn iword off ulong v ulong to void
+for i ulong 8
+put Ih add off i uchar and shr v mul i 8 255
+end
+end
+fn ihead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ih i get Iomagic i
+end
+iword 8 op
+iword 16 now
+iword 24 arg
+iword 32 size
+end
+fn ihwrite count ulong to bool
+p = ulong 0
+while lt p count
+size = sub count p
+if eq get Choice 0 55
+size = 1
+end
+n = write 1 Ih p size
+if le n 0
+ret false
+end
+p = add p ulong n
+end
+ret true
+end
+fn ibwrite count ulong to bool
+p = ulong 0
+while lt p count
+size = sub count p
+if eq get Choice 0 55
+size = 1
+end
+n = write 1 Pb p size
+if le n 0
+ret false
+end
+p = add p ulong n
+end
+ret true
+end
+fn iframe op ulong now ulong arg ulong size ulong to bool
+ihead op now arg size
+if not ihwrite 40
+ret false
+end
+ret ibwrite size
+end
+fn main to int
+n = read 0 Choice 0 1
+if ne n 1
+ret 65
+end
+mode = get Choice 0
+if eq mode 56
+ihead 1 1 0 0
+b = ihwrite 40
+ret 0
+end
+if eq mode 49
+ihead 1 0 77 0
+put Ih 0 88
+b = ihwrite 40
+ret 0
+end
+if eq mode 50
+ihead 2 0 0 160
+b = ihwrite 40
+ret 0
+end
+if eq mode 51
+ihead 1 0 77 0
+b = ihwrite 39
+ret 0
+end
+if eq mode 52
+ihead 2 0 0 2
+b = ihwrite 40
+put Pb 0 104
+b = ibwrite 1
+ret 0
+end
+if eq mode 53
+ihead 11 0 0 0
+b = ihwrite 40
+ret 0
+end
+if not iframe 1 0 77 0
+ret 74
+end
+if eq mode 54
+ihead 2 1 0 160
+b = ihwrite 40
+for i ulong 160
+put Pb i 120
+end
+b = ibwrite 160
+put Pb 0 104
+put Pb 1 105
+b = iframe 2 1 0 2
+ret 0
+end
+put Pb 0 104
+put Pb 1 105
+if not iframe 2 1 0 2
+ret 74
+end
+if not iframe 3 1 1 0
+ret 74
+end
+if not iframe 4 1 1 0
+ret 74
+end
+if not iframe 3 1 1 0
+ret 74
+end
+if not iframe 4 1 1 0
+ret 74
+end
+for i ulong len Wireline
+put Pb i get Wireline i
+end
+if not iframe 5 2 0 len Wireline
+ret 74
+end
+if not iframe 3 2 1 0
+ret 74
+end
+if not iframe 4 2 1 0
+ret 74
+end
+if not iframe 3 2 1 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-output-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-output-test.om
new file mode 100644
index 00000000..8b36852e
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-output-test.om
@@ -0,0 +1,3803 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent stream-output assertions, not a captured/blessed output fixture.
+global Vbuf uchar 65536
+text Vmagic "ALNPRV01"
+text Ops "1234345343"
+text Hello "ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0\n"
+text Got "ALLEN-COURIER v=1 run=000000000000004d kind=GOT seq=1 part=1/0 bytes=0\n"
+text Jobtail "hi\tself=Allen\tstarts=0"
+text Wordsout "hello"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn vword off ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Vbuf add off i mul i 8
+end
+ret v
+end
+fn vbyte at ulong expected uchar to void
+test eq get Vbuf at expected
+end
+fn verify n ulong to int
+p = ulong 0
+count = ulong 0
+while lt p n
+if or lt sub n p 40 ge count 10
+ret 65
+end
+for i ulong 8
+vbyte add p i get Vmagic i
+end
+op = vword add p 8
+status = vword add p 16
+event = vword add p 24
+size = vword add p 32
+p = add p 40
+if gt size sub n p
+ret 65
+end
+test eq op sub ulong get Ops count 48
+wanted = ulong 1
+if or eq count 2 eq count 4
+wanted = 3
+end
+if eq count 7
+wanted = 3
+end
+test eq status wanted
+if eq count 6
+test eq event 1
+test eq size len Wordsout
+for i ulong len Wordsout
+vbyte add p i get Wordsout i
+end
+else
+test eq event 0
+end
+if eq count 2
+test eq size len Hello
+for i ulong len Hello
+vbyte add p i get Hello i
+end
+end
+if eq count 7
+test eq size len Got
+for i ulong len Got
+vbyte add p i get Got i
+end
+end
+if eq count 4
+test ge size len Jobtail
+if ge size len Jobtail
+at = add p sub size len Jobtail
+for i ulong len Jobtail
+vbyte add at i get Jobtail i
+end
+end
+end
+if and ne wanted 3 ne count 6
+test eq size 0
+end
+p = add p size
+count = add count 1
+end
+test eq count 10
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
+fn main to int
+n = ulong 0
+while lt n len Vbuf
+r = read 0 Vbuf n sub len Vbuf n
+if lt r 0
+ret 74
+end
+if eq r 0
+ret verify n
+end
+n = add n ulong r
+end
+ret 65
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-process-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-process-test.om
new file mode 100644
index 00000000..dab97e9d
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-process-test.om
@@ -0,0 +1,3799 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Native assertions over host-collected process receipts.
+note Four decimal lines: mode, exit, stdout bytes, stderr bytes; then stdout+stderr.
+global Procbuf uchar 65536
+global Procnum ulong 4
+global Procpos ulong 1
+text Procmag "ALNPRV01"
+fn pcheck ok bool to void
+check ok add get Checks 0 1
+end
+fn pnumber n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Procpos 0 n
+c = get Procbuf get Procpos 0
+put Procpos 0 add get Procpos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put Procnum 3 v
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+if ge digits 8
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn pword off ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Procbuf add off i mul i 8
+end
+ret v
+end
+fn pverify n ulong to int
+for i ulong 3
+if not pnumber n
+ret 65
+end
+put Procnum i get Procnum 3
+end
+if not pnumber n
+ret 65
+end
+mode = get Procnum 0
+rc = get Procnum 1
+size = get Procnum 2
+err = get Procnum 3
+p = get Procpos 0
+pcheck eq n add add p size err
+pcheck eq err 0
+if le mode 6
+pcheck ge mode 1
+pcheck eq rc 65
+if eq mode 6
+pcheck eq size 40
+if ge sub n p 40
+for i ulong 8
+pcheck eq get Procbuf add p i get Procmag i
+end
+pcheck eq pword add p 8 1
+pcheck eq pword add p 16 1
+pcheck eq pword add p 24 0
+pcheck eq pword add p 32 0
+end
+else
+pcheck eq size 0
+end
+else
+if eq mode 7
+pcheck eq rc 0
+else
+ret 65
+end
+end
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
+fn main to int
+n = ulong 0
+while lt n len Procbuf
+r = read 0 Procbuf n sub len Procbuf n
+if lt r 0
+ret 74
+end
+if eq r 0
+ret pverify n
+end
+n = add n ulong r
+end
+ret 65
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v2.om
new file mode 100644
index 00000000..c0cba97d
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v2.om
@@ -0,0 +1,3743 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Smagic "ALNPRV01"
+global Sh uchar 40
+fn sword off ulong v ulong to void
+for i ulong 8
+put Sh add off i uchar and shr v mul i 8 255
+end
+end
+fn shead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Sh i get Smagic i
+end
+sword 8 op
+sword 16 now
+sword 24 arg
+sword 32 size
+end
+fn swrite p ulong n ulong to bool
+at = ulong 0
+while lt at n
+left = sub n at
+r = write 1 p at left
+if le r 0
+ret false
+end
+at = add at ulong r
+end
+ret true
+end
+fn frame op ulong now ulong arg ulong size ulong to bool
+shead op now arg size
+ret swrite Sh 40
+end
+fn main to int
+if not frame 1 1 77 0
+ret 74
+end
+if not frame 1 2 78 0
+ret 74
+end
+if not frame 6 3 0 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v3.om
new file mode 100644
index 00000000..c028a9ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v3.om
@@ -0,0 +1,3743 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Smagic "ALNPRV01"
+global Sh uchar 40
+fn sword off ulong v ulong to void
+for i ulong 8
+put Sh add off i uchar and shr v mul i 8 255
+end
+end
+fn shead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Sh i get Smagic i
+end
+sword 8 op
+sword 16 now
+sword 24 arg
+sword 32 size
+end
+fn swrite n ulong to bool
+at = ulong 0
+while lt at n
+left = sub n at
+r = write 1 Sh at left
+if le r 0
+ret false
+end
+at = add at ulong r
+end
+ret true
+end
+fn frame op ulong now ulong arg ulong size ulong to bool
+shead op now arg size
+ret swrite 40
+end
+fn main to int
+if not frame 1 1 77 0
+ret 74
+end
+if not frame 1 2 78 0
+ret 74
+end
+if not frame 6 3 0 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v4.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v4.om
new file mode 100644
index 00000000..7e13fb0b
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v4.om
@@ -0,0 +1,3743 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Smagic "ALNPRV01"
+global Sh uchar 40
+fn sword off ulong v ulong to void
+for i ulong 8
+put Sh add off i uchar and shr v mul i 8 255
+end
+end
+fn shead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Sh i get Smagic i
+end
+sword 8 op
+sword 16 now
+sword 24 arg
+sword 32 size
+end
+fn swrite n ulong to bool
+at = ulong 0
+while lt at n
+left = sub n at
+r = write 1 Sh at left
+if le r 0
+ret false
+end
+at = add at ulong r
+end
+ret true
+end
+fn frame op ulong now ulong arg ulong size ulong to bool
+shead op now arg size
+ret swrite 40
+end
+fn main to int
+if not frame 1 1 77 0
+ret 74
+end
+if not frame 1 2 78 0
+ret 74
+end
+if not frame 6 0 0 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test.om
new file mode 100644
index 00000000..c0cba97d
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test.om
@@ -0,0 +1,3743 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Smagic "ALNPRV01"
+global Sh uchar 40
+fn sword off ulong v ulong to void
+for i ulong 8
+put Sh add off i uchar and shr v mul i 8 255
+end
+end
+fn shead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Sh i get Smagic i
+end
+sword 8 op
+sword 16 now
+sword 24 arg
+sword 32 size
+end
+fn swrite p ulong n ulong to bool
+at = ulong 0
+while lt at n
+left = sub n at
+r = write 1 p at left
+if le r 0
+ret false
+end
+at = add at ulong r
+end
+ret true
+end
+fn frame op ulong now ulong arg ulong size ulong to bool
+shead op now arg size
+ret swrite Sh 40
+end
+fn main to int
+if not frame 1 1 77 0
+ret 74
+end
+if not frame 1 2 78 0
+ret 74
+end
+if not frame 6 3 0 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input.om
new file mode 100644
index 00000000..b414928a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input.om
@@ -0,0 +1,44 @@
+text Smagic "ALNPRV01"
+global Sh uchar 40
+fn sword off ulong v ulong to void
+for i ulong 8
+put Sh add off i uchar and shr v mul i 8 255
+end
+end
+fn shead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Sh i get Smagic i
+end
+sword 8 op
+sword 16 now
+sword 24 arg
+sword 32 size
+end
+fn swrite n ulong to bool
+at = ulong 0
+while lt at n
+left = sub n at
+r = write 1 Sh at left
+if le r 0
+ret false
+end
+at = add at ulong r
+end
+ret true
+end
+fn frame op ulong now ulong arg ulong size ulong to bool
+shead op now arg size
+ret swrite 40
+end
+fn main to int
+if not frame 1 1 77 0
+ret 74
+end
+if not frame 1 2 78 0
+ret 74
+end
+if not frame 6 0 0 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final.om
new file mode 100644
index 00000000..cf40e0d2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final.om
@@ -0,0 +1,3745 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Obuf uchar 256
+text Omagic "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn getheader p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Obuf add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Obuf
+r = read 0 Obuf n sub len Obuf n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get Obuf add p i get Omagic i
+end
+test eq getheader add p 8 sub rec 3
+if eq rec 0
+test eq getheader add p 16 1
+else
+if eq rec 1
+test eq getheader add p 16 0
+else
+test eq getheader add p 16 1
+end
+end
+test eq getheader add p 24 0
+test eq getheader add p 32 0
+end
+test eq get Checks 0 60
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final2.om
new file mode 100644
index 00000000..2f6762aa
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final2.om
@@ -0,0 +1,3749 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Obuf uchar 256
+text Omagic "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn getheader p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Obuf add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Obuf
+r = read 0 Obuf n sub len Obuf n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get Obuf add p i get Omagic i
+end
+if eq rec 2
+test eq getheader add p 8 6
+else
+test eq getheader add p 8 1
+end
+if eq rec 0
+test eq getheader add p 16 1
+else
+if eq rec 1
+test eq getheader add p 16 0
+else
+test eq getheader add p 16 1
+end
+end
+test eq getheader add p 24 0
+test eq getheader add p 32 0
+end
+test eq get Checks 0 37
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final3.om
new file mode 100644
index 00000000..72ed7adc
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final3.om
@@ -0,0 +1,3749 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Obuf uchar 256
+text Omagic "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn getheader p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Obuf add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n 120
+r = read 0 Obuf n sub len Obuf n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get Obuf add p i get Omagic i
+end
+if eq rec 2
+test eq getheader add p 8 6
+else
+test eq getheader add p 8 1
+end
+if eq rec 0
+test eq getheader add p 16 1
+else
+if eq rec 1
+test eq getheader add p 16 0
+else
+test eq getheader add p 16 1
+end
+end
+test eq getheader add p 24 0
+test eq getheader add p 32 0
+end
+test eq get Checks 0 37
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v3.om
new file mode 100644
index 00000000..98af86c5
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v3.om
@@ -0,0 +1,3745 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global O uchar 256
+text M "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn word p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get O add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len O
+r = read 0 O n sub len O n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get O add p i get M i
+end
+test eq word add p 8 sub rec 3
+if eq rec 0
+test eq word add p 16 1
+else
+if eq rec 1
+test eq word add p 16 0
+else
+test eq word add p 16 1
+end
+end
+test eq word add p 24 0
+test eq word add p 32 0
+end
+test eq get Checks 0 60
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v4.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v4.om
new file mode 100644
index 00000000..57c669f1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v4.om
@@ -0,0 +1,3745 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Obuf uchar 256
+text Omagic "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn oword p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Obuf add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Obuf
+r = read 0 Obuf n sub len Obuf n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get Obuf add p i get Omagic i
+end
+test eq oword add p 8 sub rec 3
+if eq rec 0
+test eq word add p 16 1
+else
+if eq rec 1
+test eq word add p 16 0
+else
+test eq word add p 16 1
+end
+end
+test eq word add p 24 0
+test eq word add p 32 0
+end
+test eq get Checks 0 60
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v5.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v5.om
new file mode 100644
index 00000000..c74ae9bb
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v5.om
@@ -0,0 +1,3745 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Obuf uchar 256
+text Omagic "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn ooword p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Obuf add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Obuf
+r = read 0 Obuf n sub len Obuf n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get Obuf add p i get Omagic i
+end
+test eq ooword add p 8 sub rec 3
+if eq rec 0
+test eq oword add p 16 1
+else
+if eq rec 1
+test eq oword add p 16 0
+else
+test eq oword add p 16 1
+end
+end
+test eq oword add p 24 0
+test eq oword add p 32 0
+end
+test eq get Checks 0 60
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v6.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v6.om
new file mode 100644
index 00000000..0218dbd3
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v6.om
@@ -0,0 +1,3745 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Obuf uchar 256
+text Omagic "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn oooword p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Obuf add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Obuf
+r = read 0 Obuf n sub len Obuf n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get Obuf add p i get Omagic i
+end
+test eq oooword add p 8 sub rec 3
+if eq rec 0
+test eq ooword add p 16 1
+else
+if eq rec 1
+test eq ooword add p 16 0
+else
+test eq ooword add p 16 1
+end
+end
+test eq ooword add p 24 0
+test eq ooword add p 32 0
+end
+test eq get Checks 0 60
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output.om
new file mode 100644
index 00000000..00ca94a5
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output.om
@@ -0,0 +1,50 @@
+global Obuf uchar 256
+text Omagic "ALNPRV01"
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn getheader p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Obuf add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n 120
+r = read 0 Obuf n sub len Obuf n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+test eq n 120
+for rec ulong 3
+p = mul rec 40
+for i ulong 8
+test eq get Obuf add p i get Omagic i
+end
+if eq rec 2
+test eq getheader add p 8 6
+else
+test eq getheader add p 8 1
+end
+if eq rec 0
+test eq getheader add p 16 1
+else
+if eq rec 1
+test eq getheader add p 16 0
+else
+test eq getheader add p 16 1
+end
+end
+test eq getheader add p 24 0
+test eq getheader add p 32 0
+end
+test eq get Checks 0 37
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-final.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-final.om
new file mode 100644
index 00000000..a2a38068
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-final.om
@@ -0,0 +1,3783 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Receipt uchar 4096
+global V ulong 4
+global Pos ulong 1
+global Sstart ulong 1
+text Mag "ALNPRV01"
+fn checknum ok bool to void
+check ok add get Checks 0 1
+end
+fn parsenum n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Pos 0 n
+c = get Receipt get Pos 0
+put Pos 0 add get Pos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put V get Sstart 0 v
+put Sstart 0 add get Sstart 0 1
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn sbyte p ulong c uchar to void
+checknum eq get Receipt p c
+end
+fn shead p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Receipt add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n 1036
+r = read 0 Receipt n sub len Receipt n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+for i ulong 4
+if not parsenum n
+ret 65
+end
+end
+checknum eq get V 0 8
+checknum eq get V 1 74
+checknum eq get V 2 1024
+checknum eq get V 3 0
+p = get Pos 0
+checknum eq n add p 1024
+for rec ulong 7
+for i ulong 8
+sbyte add p i get Mag i
+end
+size = shead add p 32
+checknum le size 8192
+p = add add p 40 size
+end
+checknum eq p add get Pos 0 923
+remain = sub n p
+checknum eq remain 101
+for i ulong 8
+sbyte add p i get Mag i
+end
+checknum eq shead add p 8 3
+checknum eq shead add p 16 3
+checknum eq shead add p 24 0
+checknum eq shead add p 32 71
+checknum eq get Checks 0 82
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v2.om
new file mode 100644
index 00000000..f280db1c
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v2.om
@@ -0,0 +1,3783 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Receipt uchar 4096
+global V ulong 4
+global Pos ulong 1
+global Sstart ulong 1
+text Mag "ALNPRV01"
+fn checknum ok bool to void
+check ok add get Checks 0 1
+end
+fn parsenum n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Pos 0 n
+c = get Receipt get Pos 0
+put Pos 0 add get Pos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put V get Sstart 0 v
+put Sstart 0 add get Sstart 0 1
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn sbyte p ulong c uchar to void
+checknum eq get Receipt p c
+end
+fn shead p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Receipt add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Receipt
+r = read 0 Receipt n sub len Receipt n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+for i ulong 4
+if not parsenum n
+ret 65
+end
+end
+checknum eq get V 0 8
+checknum eq get V 1 74
+checknum eq get V 2 1024
+checknum eq get V 3 0
+p = get Pos 0
+checknum eq n add p 1024
+for rec ulong 7
+for i ulong 8
+sbyte add p i get Mag i
+end
+size = shead add p 32
+checknum le size 8192
+p = add add p 40 size
+end
+checknum eq p add get Pos 0 923
+remaining = sub n p
+checknum eq remaining 101
+for i ulong 8
+sbyte add p i get Mag i
+end
+checknum eq shead add p 8 3
+checknum eq shead add p 16 3
+checknum eq shead add p 24 0
+checknum eq shead add p 32 71
+checknum eq get Checks 0 17
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v3.om
new file mode 100644
index 00000000..7cca6cee
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v3.om
@@ -0,0 +1,3783 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Receipt uchar 4096
+global V ulong 4
+global Pos ulong 1
+global Sstart ulong 1
+text Mag "ALNPRV01"
+fn checknum ok bool to void
+check ok add get Checks 0 1
+end
+fn parsenum n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Pos 0 n
+c = get Receipt get Pos 0
+put Pos 0 add get Pos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put V get Sstart 0 v
+put Sstart 0 add get Sstart 0 1
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn sbyte p ulong c uchar to void
+checknum eq get Receipt p c
+end
+fn shead p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Receipt add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Receipt
+r = read 0 Receipt n sub len Receipt n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+for i ulong 4
+if not parsenum n
+ret 65
+end
+end
+checknum eq get V 0 8
+checknum eq get V 1 74
+checknum eq get V 2 1024
+checknum eq get V 3 0
+p = get Pos 0
+checknum eq n add p 1024
+for rec ulong 7
+for i ulong 8
+sbyte add p i get Mag i
+end
+size = shead add p 32
+checknum le size 8192
+p = add add p 40 size
+end
+checknum eq p add get Pos 0 923
+remain = sub n p
+checknum eq remain 101
+for i ulong 8
+sbyte add p i get Mag i
+end
+checknum eq shead add p 8 3
+checknum eq shead add p 16 3
+checknum eq shead add p 24 0
+checknum eq shead add p 32 71
+checknum eq get Checks 0 17
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v4.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v4.om
new file mode 100644
index 00000000..79f471b9
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v4.om
@@ -0,0 +1,3783 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Receipt uchar 4096
+global V ulong 4
+global Pos ulong 1
+global Sstart ulong 1
+text Mag "ALNPRV01"
+fn checknum ok bool to void
+check ok add get Checks 0 1
+end
+fn parsenum n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Pos 0 n
+c = get Receipt get Pos 0
+put Pos 0 add get Pos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put V get Sstart 0 v
+put Sstart 0 add get Sstart 0 1
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn sbyte p ulong c uchar to void
+checknum eq get Receipt p c
+end
+fn shead p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Receipt add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n 1037
+r = read 0 Receipt n sub len Receipt n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+for i ulong 4
+if not parsenum n
+ret 65
+end
+end
+checknum eq get V 0 8
+checknum eq get V 1 74
+checknum eq get V 2 1024
+checknum eq get V 3 0
+p = get Pos 0
+checknum eq n add p 1024
+for rec ulong 7
+for i ulong 8
+sbyte add p i get Mag i
+end
+size = shead add p 32
+checknum le size 8192
+p = add add p 40 size
+end
+checknum eq p add get Pos 0 923
+remain = sub n p
+checknum eq remain 101
+for i ulong 8
+sbyte add p i get Mag i
+end
+checknum eq shead add p 8 3
+checknum eq shead add p 16 3
+checknum eq shead add p 24 0
+checknum eq shead add p 32 71
+checknum eq get Checks 0 83
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v5.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v5.om
new file mode 100644
index 00000000..583d31b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v5.om
@@ -0,0 +1,3783 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Receipt uchar 4096
+global V ulong 4
+global Pos ulong 1
+global Sstart ulong 1
+text Mag "ALNPRV01"
+fn checknum ok bool to void
+check ok add get Checks 0 1
+end
+fn parsenum n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Pos 0 n
+c = get Receipt get Pos 0
+put Pos 0 add get Pos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put V get Sstart 0 v
+put Sstart 0 add get Sstart 0 1
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn sbyte p ulong c uchar to void
+checknum eq get Receipt p c
+end
+fn shead p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Receipt add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n 1036
+r = read 0 Receipt n sub len Receipt n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+for i ulong 4
+if not parsenum n
+ret 65
+end
+end
+checknum eq get V 0 8
+checknum eq get V 1 74
+checknum eq get V 2 1024
+checknum eq get V 3 0
+p = get Pos 0
+checknum eq n add p 1024
+for rec ulong 7
+for i ulong 8
+sbyte add p i get Mag i
+end
+size = shead add p 32
+checknum le size 8192
+p = add add p 40 size
+end
+checknum eq p add get Pos 0 923
+remain = sub n p
+checknum eq remain 101
+for i ulong 8
+sbyte add p i get Mag i
+end
+checknum eq shead add p 8 3
+checknum eq shead add p 16 3
+checknum eq shead add p 24 0
+checknum eq shead add p 32 71
+checknum eq get Checks 0 83
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test.om
new file mode 100644
index 00000000..f6293d3b
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test.om
@@ -0,0 +1,3783 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Receipt uchar 4096
+global V ulong 4
+global Pos ulong 1
+global Sstart ulong 1
+text Mag "ALNPRV01"
+fn checknum ok bool to void
+check ok add get Checks 0 1
+end
+fn number n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Pos 0 n
+c = get Receipt get Pos 0
+put Pos 0 add get Pos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put V get Sstart 0 v
+put Sstart 0 add get Sstart 0 1
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn sbyte p ulong c uchar to void
+checknum eq get Receipt p c
+end
+fn shead p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Receipt add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n len Receipt
+r = read 0 Receipt n sub len Receipt n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+for i ulong 4
+if not number n
+ret 65
+end
+end
+checknum eq get V 0 8
+checknum eq get V 1 74
+checknum eq get V 2 1024
+checknum eq get V 3 0
+p = get Pos 0
+checknum eq n add p 1024
+for rec ulong 7
+for i ulong 8
+sbyte add p i get Mag i
+end
+size = shead add p 32
+checknum le size 8192
+p = add add p 40 size
+end
+checknum eq p add get Pos 0 923
+remaining = sub n p
+checknum eq remaining 101
+for i ulong 8
+sbyte add p i get Mag i
+end
+checknum eq shead add p 8 3
+checknum eq shead add p 16 3
+checknum eq shead add p 24 0
+checknum eq shead add p 32 71
+checknum eq get Checks 0 17
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check.om
new file mode 100644
index 00000000..27a8d4fb
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check.om
@@ -0,0 +1,84 @@
+global Receipt uchar 4096
+global V ulong 4
+global Pos ulong 1
+global Sstart ulong 1
+text Mag "ALNPRV01"
+fn checknum ok bool to void
+check ok add get Checks 0 1
+end
+fn parsenum n ulong to bool
+v = ulong 0
+digits = ulong 0
+while lt get Pos 0 n
+c = get Receipt get Pos 0
+put Pos 0 add get Pos 0 1
+if eq c 10
+if eq digits 0
+ret false
+end
+put V get Sstart 0 v
+put Sstart 0 add get Sstart 0 1
+ret true
+end
+if or lt c 48 gt c 57
+ret false
+end
+v = add mul v 10 sub ulong c 48
+digits = add digits 1
+end
+ret false
+end
+fn sbyte p ulong c uchar to void
+checknum eq get Receipt p c
+end
+fn shead p ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Receipt add p i mul i 8
+end
+ret v
+end
+fn main to int
+n = ulong 0
+while lt n 1036
+r = read 0 Receipt n sub len Receipt n
+if le r 0
+ret 65
+end
+n = add n ulong r
+end
+for i ulong 4
+if not parsenum n
+ret 65
+end
+end
+checknum eq get V 0 8
+checknum eq get V 1 74
+checknum eq get V 2 1024
+checknum eq get V 3 0
+p = get Pos 0
+checknum eq n add p 1024
+for rec ulong 7
+for i ulong 8
+sbyte add p i get Mag i
+end
+size = shead add p 32
+checknum le size 8192
+p = add add p 40 size
+end
+checknum eq p add get Pos 0 923
+remain = sub n p
+checknum eq remain 101
+for i ulong 8
+sbyte add p i get Mag i
+end
+checknum eq shead add p 8 3
+checknum eq shead add p 16 3
+checknum eq shead add p 24 0
+checknum eq shead add p 32 71
+checknum eq get Checks 0 82
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider.om
new file mode 100644
index 00000000..69a14d40
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider.om
@@ -0,0 +1,3752 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Native Linux stdin/stdout provider-stream entry. No fake clock or transport.
+fn prreadhead to int
+p = ulong 0
+while lt p 40
+n = read 0 Ph p sub ulong 40 p
+if lt n 0
+ret 74
+end
+if eq n 0
+if eq p 0
+ret 0
+end
+ret 65
+end
+p = add p ulong n
+end
+ret 1
+end
+fn prreadbody to int
+p = ulong 0
+size = get Pv 3
+while lt p size
+n = read 0 Pb p sub size p
+if lt n 0
+ret 74
+end
+if eq n 0
+ret 65
+end
+p = add p ulong n
+end
+ret 0
+end
+fn prwrite to bool
+p = ulong 0
+while lt p get Pn 0
+n = write 1 Pout p sub get Pn 0 p
+if le n 0
+ret false
+end
+p = add p ulong n
+end
+ret true
+end
+fn main to int
+constants
+while true
+status = prreadhead
+if eq status 0
+ret 0
+end
+if ne status 1
+ret status
+end
+if not prparse
+ret 65
+end
+status = prreadbody
+if ne status 0
+ret status
+end
+if not prdo
+ret 65
+end
+if not prwrite
+ret 74
+end
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/SHA256SUMS.pre-report b/evidence/allen-omega-L694/L748/independent-review/raw/SHA256SUMS.pre-report
new file mode 100644
index 00000000..0079f00e
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/SHA256SUMS.pre-report
@@ -0,0 +1,47 @@
+149c86c580d055212b030f15223efbf61fc77e941cd3026a329d98f04373e797 /home/drakestapleton/handoffs/L753-review/raw/application-numbered.txt
+c60310ca34301e81cef053e9ba376ac7dd7f064f0c5a829d29b60caece99e67a /home/drakestapleton/handoffs/L753-review/raw/builds-final.sha256
+e1143e9516dc5614a94515370c20655a46f9000fd9aed19f08662d45a0e623bd /home/drakestapleton/handoffs/L753-review/raw/builds.sha256
+41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4 /home/drakestapleton/handoffs/L753-review/raw/compiler.sha256
+2d9a3c4c37f3234249719134d11aff790623b930e838c0cdca311745e3cc8702 /home/drakestapleton/handoffs/L753-review/raw/context-restore-numbered.txt
+3d59cfaef014da864a760771938fa0847da539f5946816136ff4721931c1a4b9 /home/drakestapleton/handoffs/L753-review/raw/focused-inputs.sha256
+671c5d51da86d0554bb6d242f145b51bb22fd520177e45fbeef200a02e04863f /home/drakestapleton/handoffs/L753-review/raw/git-source.paths
+d70c344115f1aac0b1ecbf348f3298cc1975331634b9a41be196d5c1b59acf33 /home/drakestapleton/handoffs/L753-review/raw/memory-restore-numbered.txt
+7d931199f90a0d238d58c2d9abac45df4520ac9f2ef396504e136b9d503b17d5 /home/drakestapleton/handoffs/L753-review/raw/pins.txt
+4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 /home/drakestapleton/handoffs/L753-review/raw/provider-boundary.exit
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-boundary-final.exit
+69318135260b334c2b4e28c0dcde808e8ea649fab689b7ce9dc6a61aa1effdc4 /home/drakestapleton/handoffs/L753-review/raw/provider-boundary-final.log
+3bfa0432504c94ba21aaf265f73af49ada07d4bc484ef2fa3a809f68cc9749ce /home/drakestapleton/handoffs/L753-review/raw/provider-boundary.log
+9a6f0211f12d0930331efa31d7bf65dcbf2a4c71c55d101e1df4077cd3d71db4 /home/drakestapleton/handoffs/L753-review/raw/provider-core.exit
+fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04 /home/drakestapleton/handoffs/L753-review/raw/provider-core.log
+4b6fcafad2946e37eb832da122176742047661874351d7151658885d3fc8e472 /home/drakestapleton/handoffs/L753-review/raw/provider-core-numbered.txt
+763921ec6cbbfbe18891cc29b474ee14cfb20851846b6ef6bd5757d65540b90b /home/drakestapleton/handoffs/L753-review/raw/provider.elf.txt
+f96657de953a7827768f2a62851b8830926c2f1a556a72272654742125c4f48f /home/drakestapleton/handoffs/L753-review/raw/provider-entry-numbered.txt
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-eof.err
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-eof.exit
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-eof.out
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.check.exit
+49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.check.log
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.exit
+7902699be42c8a8e46fbbb4501726517e86b22c56a189f7625a6da49081b2451 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.mode
+94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.output
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment-producer.err
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-fragment-producer.exit
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.stderr
+718fa4fce2aafd2d658e1d7a776ed8ca22b23bbbc616a28ed74aac5b787e55fb /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace
+93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8 /home/drakestapleton/handoffs/L753-review/raw/provider-full.exit
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-full.stderr
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-normal.check.exit
+49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.check.log
+520bdb2f475e7ff86edfd6618b04d672c6a9b90ce09e4f249e3c615078855867 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.input
+94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.output
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-normal-producer.err
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.stderr
+4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check.exit
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check-final.exit
+247f163efbac7aca478706f7ba00072b808450055e6ba819208f1d20a41a1f50 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check-final.log
+5458fb305ce1bed0daf4a87e2afe15dffa92d34e239d90ec4db99cd8f7bbdc05 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check.log
+93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.exit
+c9d6ffd3da9f61111b290c837735758566f93a95f203467268e3cc70e2b84a01 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.output
+93e3aee03715093b7cbf8b04c9c6f7355739cff5e33cdecb2df16893020e4b40 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.receipt
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.stderr
+310c498a976ca7397be904709499cad567c341e35d39ddd9ed9df81d148c5903 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.strace
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/application-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/application-numbered.txt
new file mode 100644
index 00000000..71754bfa
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/application-numbered.txt
@@ -0,0 +1,241 @@
+ 1 note Native application binding: conversation state, courier lifecycle and reply/code.
+ 2 note A initialized, queued AGAIN bytes, per-call event, reserved.
+ 3 note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+ 4 note 4 refused LINE payload,5 slow notice,6 silence timeout.
+ 5 note Transport acceptance is separate from payload acceptance: appreceive true
+ 6 note means envelope accepted; inspect A2 for malformed payload, never invent text.
+ 7 global A ulong 4
+ 8 global Appjob uchar 4096
+ 9 global Appwire uchar 8192
+ 10 global Askin uchar 160
+ 11 fn appinit run ulong now ulong to bool
+ 12 if or ne get A 0 0 ne get R 0 0
+ 13 ret false
+ 14 end
+ 15 if ne get Q 0 0
+ 16 ret false
+ 17 end
+ 18 if not qstart run now
+ 19 ret false
+ 20 end
+ 21 constants
+ 22 put A 0 1
+ 23 put A 1 0
+ 24 put A 2 0
+ 25 ret true
+ 26 end
+ 27 fn appclock now ulong to bool
+ 28 if eq get A 0 0
+ 29 ret false
+ 30 end
+ 31 ret and ge now get T 0 ge now get R 4
+ 32 end
+ 33 fn appask now ulong to bool
+ 34 if not appclock now
+ 35 ret false
+ 36 end
+ 37 if or ne get R 1 0 ne get A 1 0
+ 38 ret false
+ 39 end
+ 40 if or ne get T 10 0 ne get T 13 0
+ 41 ret false
+ 42 end
+ 43 if and ne get T 5 0 eq get T 6 0
+ 44 ret false
+ 45 end
+ 46 if or ge get R 0 4294967295 ge get Q 1 4294967295
+ 47 ret false
+ 48 end
+ 49 if not textok
+ 50 ret false
+ 51 end
+ 52 kind = classify
+ 53 if or lt kind 1 gt kind 3
+ 54 ret false
+ 55 end
+ 56 if and eq kind 3 eq get R 6 0
+ 57 ret false
+ 58 end
+ 59 note Validate restored context before jobbuild reads its variable-layout names.
+ 60 if not ctxmeta 6
+ 61 ret false
+ 62 end
+ 63 if not jobbuild kind add get R 0 1
+ 64 ret false
+ 65 end
+ 66 if not ctxappend
+ 67 ret false
+ 68 end
+ 69 n = get Inlen 0
+ 70 size = get Outlen 0
+ 71 for i ulong n
+ 72 put Askin i get In i
+ 73 end
+ 74 for i ulong size
+ 75 put Appjob i get Outb i
+ 76 end
+ 77 for i ulong size
+ 78 put In i get Appjob i
+ 79 end
+ 80 put Inlen 0 size
+ 81 queued = qsubmit now
+ 82 for i ulong n
+ 83 put In i get Askin i
+ 84 end
+ 85 put Inlen 0 n
+ 86 if not queued
+ 87 ret false
+ 88 end
+ 89 note start preconditions were checked before qsubmit; no concurrent calls permitted.
+ 90 if not start kind now
+ 91 qcancel
+ 92 ret false
+ 93 end
+ 94 put A 2 0
+ 95 if gt kind 1
+ 96 codebeg get R 0
+ 97 put A 2 1
+ 98 end
+ 99 ret true
+ 100 end
+ 101 fn appcancel to void
+ 102 cancel
+ 103 qcancel
+ 104 put A 1 0
+ 105 put A 2 0
+ 106 end
+ 107 fn appreset to void
+ 108 appcancel
+ 109 reset
+ 110 end
+ 111 note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+ 112 note sequence while retaining the original conversation ID in its body.
+ 113 fn appqueue now ulong to bool
+ 114 if eq get A 1 0
+ 115 ret true
+ 116 end
+ 117 if or ne get T 10 0 ne get T 13 0
+ 118 ret true
+ 119 end
+ 120 put Inlen 0 get A 1
+ 121 for i ulong get A 1
+ 122 put In i get Appjob i
+ 123 end
+ 124 if not qsubmit now
+ 125 ret false
+ 126 end
+ 127 put A 1 0
+ 128 ret true
+ 129 end
+ 130 fn apppoll now ulong link bool to bool
+ 131 if not appclock now
+ 132 ret false
+ 133 end
+ 134 put A 2 0
+ 135 put T 0 now
+ 136 status = tick now
+ 137 if eq status 1
+ 138 put A 2 5
+ 139 end
+ 140 if eq status 2
+ 141 qcancel
+ 142 put A 1 0
+ 143 put A 2 6
+ 144 end
+ 145 if not appqueue now
+ 146 appcancel
+ 147 put A 2 3
+ 148 ret false
+ 149 end
+ 150 ret qnext now link
+ 151 end
+ 152 fn appsent now ulong ok bool to bool
+ 153 if not appclock now
+ 154 ret false
+ 155 end
+ 156 if not qsent now ok
+ 157 ret false
+ 158 end
+ 159 put A 2 0
+ 160 ret true
+ 161 end
+ 162 fn appbody now ulong to bool
+ 163 if eq get R 1 0
+ 164 put A 2 4
+ 165 ret true
+ 166 end
+ 167 if ineq 0 67
+ 168 if or le get R 2 1 ne get C 0 get R 0
+ 169 put A 2 4
+ 170 ret true
+ 171 end
+ 172 if codetake
+ 173 if heard get C 0 now
+ 174 ret true
+ 175 end
+ 176 end
+ 177 put A 2 4
+ 178 ret true
+ 179 end
+ 180 if or ineq 0 83 ineq 0 87
+ 181 status = saytake now
+ 182 if eq status 1
+ 183 if eq get R 1 0
+ 184 put A 1 0
+ 185 end
+ 186 if ne get S 1 0
+ 187 put A 2 1
+ 188 end
+ 189 ret true
+ 190 end
+ 191 if eq status 2
+ 192 n = get Outlen 0
+ 193 if or eq n 0 gt n 4096
+ 194 cancel
+ 195 put A 1 0
+ 196 put A 2 3
+ 197 ret true
+ 198 end
+ 199 for i ulong n
+ 200 put Appjob i get Outb i
+ 201 end
+ 202 put A 1 n
+ 203 put A 2 2
+ 204 ret true
+ 205 end
+ 206 if eq status 3
+ 207 put A 1 0
+ 208 put A 2 3
+ 209 ret true
+ 210 end
+ 211 end
+ 212 put A 2 4
+ 213 ret true
+ 214 end
+ 215 note Reply parsing can serialize AGAIN internally. Preserve the already offered
+ 216 note datagram until the provider records its send result, including on refusal.
+ 217 fn appreceive now ulong to bool
+ 218 if not appclock now
+ 219 ret false
+ 220 end
+ 221 result = qincoming now
+ 222 if eq result 0
+ 223 ret false
+ 224 end
+ 225 put A 2 0
+ 226 if not qtake
+ 227 ret true
+ 228 end
+ 229 n = get Outlen 0
+ 230 e = get Err 0
+ 231 for i ulong n
+ 232 put Appwire i get Outb i
+ 233 end
+ 234 ok = appbody now
+ 235 for i ulong n
+ 236 put Outb i get Appwire i
+ 237 end
+ 238 put Outlen 0 n
+ 239 put Err 0 e
+ 240 ret ok
+ 241 end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/builds-final.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/builds-final.sha256
new file mode 100644
index 00000000..c15400d5
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/builds-final.sha256
@@ -0,0 +1,8 @@
+c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd /home/drakestapleton/handoffs/L753-review/build/provider
+49085d1c4e23dcd67fd89df63a711ccd57adfac88e2fd83f84c6ab9982abcaee /home/drakestapleton/handoffs/L753-review/build/provider-core-test
+8eeda9f344c1c28f6e05308acbeb243ea8ee74e29e290e45b746e20cd5873e24 /home/drakestapleton/handoffs/L753-review/build/provider-output-test
+f27b24582f22767dbf7eb3f9e8b5d06b0f37f54371e91dec125ee7544f65d259 /home/drakestapleton/handoffs/L753-review/build/provider-process-test
+2bac15d89211b6fee18d7bfe7d17bc087151180ae4ed90b6c641e967ac6a8ec7 /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-final2
+8801a190bb476d2d1b108d0ef511e27f3b2814d91e486820e5265f675ff7d497 /home/drakestapleton/handoffs/L753-review/build/provider-semantic-input-test-v4
+a68d9aed28deaf4ba38987294df52b840bd34998132853ee9e265580c62d5472 /home/drakestapleton/handoffs/L753-review/build/provider-semantic-output-test-final3
+e35924cdb3da915ae919b4addefade4b702202655e1ea3c320b4835631ba22b0 /home/drakestapleton/handoffs/L753-review/build/provider-input-test
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/builds.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/builds.sha256
new file mode 100644
index 00000000..d9aacfd7
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/builds.sha256
@@ -0,0 +1,7 @@
+c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd /home/drakestapleton/handoffs/L753-review/build/provider
+49085d1c4e23dcd67fd89df63a711ccd57adfac88e2fd83f84c6ab9982abcaee /home/drakestapleton/handoffs/L753-review/build/provider-core-test
+8eeda9f344c1c28f6e05308acbeb243ea8ee74e29e290e45b746e20cd5873e24 /home/drakestapleton/handoffs/L753-review/build/provider-output-test
+f27b24582f22767dbf7eb3f9e8b5d06b0f37f54371e91dec125ee7544f65d259 /home/drakestapleton/handoffs/L753-review/build/provider-process-test
+d4881950daa1e6039ec6aa84c684659361e801c35109bda66468a175041609d3 /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-v3
+75a8cca0a568f268e617c4a3131e71cc9967aa9e4f0b7495d0487cd60a4802fd /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-final
+2bac15d89211b6fee18d7bfe7d17bc087151180ae4ed90b6c641e967ac6a8ec7 /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-final2
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/compiler.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/compiler.sha256
new file mode 100644
index 00000000..50e79ea9
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/compiler.sha256
@@ -0,0 +1 @@
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/context-restore-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/context-restore-numbered.txt
new file mode 100644
index 00000000..27f8038b
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/context-restore-numbered.txt
@@ -0,0 +1,100 @@
+ 1 note Restored note catalog and bounded model-job context. No storage provider.
+ 2 note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+ 3 global Cx ulong 5
+ 4 global Ctxtext uchar 65536
+ 5 global Ctxlen ulong 512
+ 6 global Ctxgone uchar 512
+ 7 global Ctxseen uchar 512
+ 8 global Ctxstart ulong 512
+ 9 global Meta uchar 4096
+ 10 global Mx ulong 2
+ 11 global Mdigits uchar 20
+ 12 text Mtself "\tself="
+ 13 text Mtname "\tname="
+ 14 text Mtstart "\tstarts="
+ 15 text Mtfact "\tfact "
+ 16 text Mtis " is "
+ 17 text Mtare " are "
+ 18 text Mtnote "\tnote "
+ 19 fn ctxidle to bool
+ 20 if ne get R 1 0
+ 21 ret false
+ 22 end
+ 23 ret and eq get Tx 0 0 eq get Nt 0 0
+ 24 end
+ 25 fn ctxbegin to bool
+ 26 if not ctxidle
+ 27 ret false
+ 28 end
+ 29 n = mem32 36
+ 30 if gt n 512
+ 31 ret false
+ 32 end
+ 33 for i ulong 512
+ 34 put Ctxlen i 0
+ 35 put Ctxgone i 1
+ 36 put Ctxseen i 0
+ 37 put Ctxstart i 0
+ 38 end
+ 39 put Cx 0 n
+ 40 put Cx 1 0
+ 41 put Cx 2 0
+ 42 put Cx 3 0
+ 43 put Cx 4 1
+ 44 if eq n 0
+ 45 put Cx 2 1
+ 46 put Cx 4 0
+ 47 end
+ 48 ret true
+ 49 end
+ 50 note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+ 51 fn ctxtake index ulong to ulong
+ 52 if not ctxidle
+ 53 ret 0
+ 54 end
+ 55 if or eq get Cx 4 0 ge index get Cx 0
+ 56 ret 0
+ 57 end
+ 58 if ne get Ctxseen index 0
+ 59 ret 0
+ 60 end
+ 61 status = ulong 2
+ 62 if notedec index
+ 63 n = get Ns 0
+ 64 for i ulong n
+ 65 put Ctxtext add mul index 128 i get Note i
+ 66 end
+ 67 put Ctxlen index n
+ 68 put Ctxgone index uchar get Ns 3
+ 69 put Ctxstart index get Ns 2
+ 70 status = 1
+ 71 else
+ 72 put Cx 3 add get Cx 3 1
+ 73 end
+ 74 put Ctxseen index 1
+ 75 put Cx 1 add get Cx 1 1
+ 76 if eq get Cx 1 get Cx 0
+ 77 put Cx 2 1
+ 78 put Cx 4 0
+ 79 end
+ 80 ret status
+ 81 end
+ 82 fn mtemit c uchar to void
+ 83 if ne get Mx 1 0
+ 84 ret
+ 85 end
+ 86 n = get Mx 0
+ 87 if ge n 4096
+ 88 put Mx 1 1
+ 89 ret
+ 90 end
+ 91 put Meta n c
+ 92 put Mx 0 add n 1
+ 93 end
+ 94 fn mtnum v ulong to void
+ 95 n = ulong 0
+ 96 while gt v 9
+ 97 put Mdigits n uchar rem v 10
+ 98 v = div v 10
+ 99 n = add n 1
+ 100 end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.exit b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.exit
new file mode 100644
index 00000000..1479e19b
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.exit
@@ -0,0 +1 @@
+65
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.input b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.input
new file mode 100644
index 00000000..92df4c82
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.output b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.output
new file mode 100644
index 00000000..97d5bdec
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.output differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.exit b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.exit
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.exit
@@ -0,0 +1 @@
+5
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.log b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.log
new file mode 100644
index 00000000..6d9c96b4
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.log
@@ -0,0 +1 @@
+omc: line 3: error 5
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry.om
new file mode 100644
index 00000000..00fb0cbe
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry.om
@@ -0,0 +1,72 @@
+text Bmagic "ALNPRV01"
+fn btest ok bool to void
+check ok add get Checks 0 1
+end
+fn bword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn bframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Bmagic i
+end
+bword 8 op
+bword 16 now
+bword 24 arg
+bword 32 size
+end
+fn bmain to int
+bframe 1 sub ulong 0 1 1 0
+btest prparse
+btest eq get Pv 1 sub ulong 0 1
+bframe 1 shl ulong 1 63 sub ulong 0 1 0
+btest prparse
+btest eq get Pv 1 shl ulong 1 63
+btest eq get Pv 2 sub ulong 0 1
+bframe sub ulong 0 1 0 0 0
+btest not prparse
+bframe 2 0 0 0
+btest not prparse
+bframe 2 0 0 1
+btest prparse
+bframe 2 0 0 159
+btest prparse
+bframe 2 0 0 160
+btest not prparse
+bframe 5 0 0 64
+btest not prparse
+bframe 5 0 0 65
+btest prparse
+bframe 5 0 0 1200
+btest prparse
+bframe 5 0 0 1201
+btest not prparse
+bframe 8 0 0 4096
+btest prparse
+bframe 8 0 1 4096
+btest prparse
+bframe 8 0 2 4096
+btest not prparse
+bframe 8 1 0 4096
+btest not prparse
+bframe 9 0 0 4096
+btest prparse
+bframe 9 0 511 4096
+btest prparse
+bframe 9 0 512 4096
+btest not prparse
+bframe 6 0 0 0
+btest prparse
+bframe 6 1 0 0
+btest not prparse
+bframe 7 0 1 0
+btest not prparse
+bframe 10 0 0 0
+btest prparse
+btest eq get Checks 0 25
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test
new file mode 100755
index 00000000..57421f2f
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test.om
new file mode 100644
index 00000000..56647643
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test.om
@@ -0,0 +1,3771 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Bmagic "ALNPRV01"
+fn btest ok bool to void
+check ok add get Checks 0 1
+end
+fn bword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn bframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Bmagic i
+end
+bword 8 op
+bword 16 now
+bword 24 arg
+bword 32 size
+end
+fn main to int
+bframe 1 sub ulong 0 1 1 0
+btest prparse
+btest eq get Pv 1 sub ulong 0 1
+bframe 1 shl ulong 1 63 sub ulong 0 1 0
+btest prparse
+btest eq get Pv 1 shl ulong 1 63
+btest eq get Pv 2 sub ulong 0 1
+bframe sub ulong 0 1 0 0 0
+btest not prparse
+bframe 2 0 0 0
+btest not prparse
+bframe 2 0 0 1
+btest prparse
+bframe 2 0 0 159
+btest prparse
+bframe 2 0 0 160
+btest not prparse
+bframe 5 0 0 64
+btest not prparse
+bframe 5 0 0 65
+btest prparse
+bframe 5 0 0 1200
+btest prparse
+bframe 5 0 0 1201
+btest not prparse
+bframe 8 0 0 4096
+btest prparse
+bframe 8 0 1 4096
+btest prparse
+bframe 8 0 2 4096
+btest not prparse
+bframe 8 1 0 4096
+btest not prparse
+bframe 9 0 0 4096
+btest prparse
+bframe 9 0 511 4096
+btest prparse
+bframe 9 0 512 4096
+btest not prparse
+bframe 6 0 0 0
+btest prparse
+bframe 6 1 0 0
+btest not prparse
+bframe 7 0 1 0
+btest not prparse
+bframe 10 0 0 0
+btest prparse
+btest eq get Checks 0 26
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count.om
new file mode 100644
index 00000000..6bff1651
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count.om
@@ -0,0 +1,72 @@
+text Bmagic "ALNPRV01"
+fn btest ok bool to void
+check ok add get Checks 0 1
+end
+fn bword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn bframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Bmagic i
+end
+bword 8 op
+bword 16 now
+bword 24 arg
+bword 32 size
+end
+fn main to int
+bframe 1 sub ulong 0 1 1 0
+btest prparse
+btest eq get Pv 1 sub ulong 0 1
+bframe 1 shl ulong 1 63 sub ulong 0 1 0
+btest prparse
+btest eq get Pv 1 shl ulong 1 63
+btest eq get Pv 2 sub ulong 0 1
+bframe sub ulong 0 1 0 0 0
+btest not prparse
+bframe 2 0 0 0
+btest not prparse
+bframe 2 0 0 1
+btest prparse
+bframe 2 0 0 159
+btest prparse
+bframe 2 0 0 160
+btest not prparse
+bframe 5 0 0 64
+btest not prparse
+bframe 5 0 0 65
+btest prparse
+bframe 5 0 0 1200
+btest prparse
+bframe 5 0 0 1201
+btest not prparse
+bframe 8 0 0 4096
+btest prparse
+bframe 8 0 1 4096
+btest prparse
+bframe 8 0 2 4096
+btest not prparse
+bframe 8 1 0 4096
+btest not prparse
+bframe 9 0 0 4096
+btest prparse
+bframe 9 0 511 4096
+btest prparse
+bframe 9 0 512 4096
+btest not prparse
+bframe 6 0 0 0
+btest prparse
+bframe 6 1 0 0
+btest not prparse
+bframe 7 0 1 0
+btest not prparse
+bframe 10 0 0 0
+btest prparse
+btest eq get Checks 0 26
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test
new file mode 100755
index 00000000..afc17e4d
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test.om
new file mode 100644
index 00000000..c028a9ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test.om
@@ -0,0 +1,3743 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Smagic "ALNPRV01"
+global Sh uchar 40
+fn sword off ulong v ulong to void
+for i ulong 8
+put Sh add off i uchar and shr v mul i 8 255
+end
+end
+fn shead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Sh i get Smagic i
+end
+sword 8 op
+sword 16 now
+sword 24 arg
+sword 32 size
+end
+fn swrite n ulong to bool
+at = ulong 0
+while lt at n
+left = sub n at
+r = write 1 Sh at left
+if le r 0
+ret false
+end
+at = add at ulong r
+end
+ret true
+end
+fn frame op ulong now ulong arg ulong size ulong to bool
+shead op now arg size
+ret swrite 40
+end
+fn main to int
+if not frame 1 1 77 0
+ret 74
+end
+if not frame 1 2 78 0
+ret 74
+end
+if not frame 6 3 0 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time.om
new file mode 100644
index 00000000..daac0e70
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time.om
@@ -0,0 +1,44 @@
+text Smagic "ALNPRV01"
+global Sh uchar 40
+fn sword off ulong v ulong to void
+for i ulong 8
+put Sh add off i uchar and shr v mul i 8 255
+end
+end
+fn shead op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Sh i get Smagic i
+end
+sword 8 op
+sword 16 now
+sword 24 arg
+sword 32 size
+end
+fn swrite n ulong to bool
+at = ulong 0
+while lt at n
+left = sub n at
+r = write 1 Sh at left
+if le r 0
+ret false
+end
+at = add at ulong r
+end
+ret true
+end
+fn frame op ulong now ulong arg ulong size ulong to bool
+shead op now arg size
+ret swrite 40
+end
+fn main to int
+if not frame 1 1 77 0
+ret 74
+end
+if not frame 1 2 78 0
+ret 74
+end
+if not frame 6 3 0 0
+ret 74
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.exit b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.log b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.log
new file mode 100644
index 00000000..0f55b086
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.log
@@ -0,0 +1,26 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 1
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/focused-inputs.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/focused-inputs.sha256
new file mode 100644
index 00000000..6ce8096a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/focused-inputs.sha256
@@ -0,0 +1,6 @@
+330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/provider-core.om
+ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/provider.om
+4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-core.om
+b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-input.om
+d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-output.om
+8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-process.om
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/git-source.paths b/evidence/allen-omega-L694/L748/independent-review/raw/git-source.paths
new file mode 100644
index 00000000..ace3a725
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/git-source.paths
@@ -0,0 +1,51 @@
+native/omega/allen/application.om
+native/omega/allen/base.om
+native/omega/allen/build-one.sh
+native/omega/allen/code.om
+native/omega/allen/context.om
+native/omega/allen/courier.om
+native/omega/allen/gate.sh
+native/omega/allen/golden.sh
+native/omega/allen/intent.om
+native/omega/allen/main.om
+native/omega/allen/memory.om
+native/omega/allen/paint.om
+native/omega/allen/provider-core.om
+native/omega/allen/PROVIDER.md
+native/omega/allen/provider.om
+native/omega/allen/README.md
+native/omega/allen/reply.om
+native/omega/allen/runtime.om
+native/omega/allen/scene-input.om
+native/omega/allen/scene.om
+native/omega/allen/scheduler.om
+native/omega/allen/tests/application.om
+native/omega/allen/tests/check.om
+native/omega/allen/tests/code.om
+native/omega/allen/tests/context.om
+native/omega/allen/tests/courier.om
+native/omega/allen/tests/edges.om
+native/omega/allen/tests/fixture.om
+native/omega/allen/tests/golden.om
+native/omega/allen/tests/intent.om
+native/omega/allen/tests/memory.om
+native/omega/allen/tests/paint.om
+native/omega/allen/tests/probe.om
+native/omega/allen/tests/provider-core.om
+native/omega/allen/tests/provider-input.om
+native/omega/allen/tests/provider-mutants.om
+native/omega/allen/tests/provider-output.om
+native/omega/allen/tests/provider-process.om
+native/omega/allen/tests/render.om
+native/omega/allen/tests/reply.om
+native/omega/allen/tests/runtime.om
+native/omega/allen/tests/scene-input.om
+native/omega/allen/tests/scene.om
+native/omega/allen/tests/scheduler.om
+native/omega/allen/tests/stdio-overflow.om
+native/omega/allen/tests/view.om
+native/omega/allen/vendor/OMEGA-LICENSE
+native/omega/allen/vendor/PROVENANCE.md
+native/omega/allen/vendor/sha256-core.om
+native/omega/allen/vendor/sha256.om
+native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/memory-restore-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/memory-restore-numbered.txt
new file mode 100644
index 00000000..0ef6b59f
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/memory-restore-numbered.txt
@@ -0,0 +1,51 @@
+ 370 if lt get St 2 2
+ 371 put St 2 add get St 2 1
+ 372 end
+ 373 ret true
+ 374 end
+ 375 note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+ 376 fn loadbeg to void
+ 377 for i ulong 3
+ 378 put St i 0
+ 379 end
+ 380 put Load 0 0
+ 381 end
+ 382 fn loadcopy slot ulong to bool
+ 383 if gt slot 1
+ 384 ret false
+ 385 end
+ 386 if ne and get Load 0 shl ulong 1 slot 0
+ 387 ret false
+ 388 end
+ 389 if not memvalid
+ 390 ret false
+ 391 end
+ 392 put Load 0 or get Load 0 shl ulong 1 slot
+ 393 put St 2 add get St 2 1
+ 394 if gt get64 16 get St 0
+ 395 b = memdec
+ 396 put St 0 get Md 0
+ 397 put St 1 slot
+ 398 end
+ 399 ret true
+ 400 end
+ 401 note Note transaction completes before the parent copy may publish its count.
+ 402 fn nbegin to bool
+ 403 if or ne get Nt 0 0 ne get Tx 0 0
+ 404 ret false
+ 405 end
+ 406 if not noteenc
+ 407 ret false
+ 408 end
+ 409 put Nt 1 get Ns 1
+ 410 put Nt 0 1
+ 411 ret true
+ 412 end
+ 413 fn nwrite ok bool to bool
+ 414 if ne get Nt 0 1
+ 415 ret false
+ 416 end
+ 417 if not ok
+ 418 put Nt 0 0
+ 419 ret false
+ 420 end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/pins.txt b/evidence/allen-omega-L694/L748/independent-review/raw/pins.txt
new file mode 100644
index 00000000..dff89471
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/pins.txt
@@ -0,0 +1,2 @@
+pin=43eae848f0a44604b42378d9ea3170278b5f3f8f
+base=be28deb21721f54fc46b5402076c7e8ac8fde151
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.log
new file mode 100644
index 00000000..4ef2f89c
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.log
@@ -0,0 +1,26 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.log
new file mode 100644
index 00000000..0f55b086
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.log
@@ -0,0 +1,26 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 1
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-core-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core-numbered.txt
new file mode 100644
index 00000000..a02b0400
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core-numbered.txt
@@ -0,0 +1,256 @@
+ 1 note Host provider stream core. PROVIDER.md is the framing/state contract.
+ 2 global Ph uchar 40
+ 3 global Pb uchar 4096
+ 4 global Pv ulong 4
+ 5 global Pc ulong 2
+ 6 global Pe ulong 2
+ 7 global Pout uchar 65536
+ 8 global Pn ulong 1
+ 9 text Prmagic "ALNPRV01"
+ 10 fn prshape to bool
+ 11 op = get Pv 0
+ 12 now = get Pv 1
+ 13 arg = get Pv 2
+ 14 n = get Pv 3
+ 15 if eq op 1
+ 16 ret and gt arg 0 eq n 0
+ 17 end
+ 18 if eq op 2
+ 19 if ne arg 0
+ 20 ret false
+ 21 end
+ 22 ret and gt n 0 le n 159
+ 23 end
+ 24 if or eq op 3 eq op 4
+ 25 ret and le arg 1 eq n 0
+ 26 end
+ 27 if eq op 5
+ 28 if ne arg 0
+ 29 ret false
+ 30 end
+ 31 ret and ge n 65 le n 1200
+ 32 end
+ 33 if ne now 0
+ 34 ret false
+ 35 end
+ 36 if or eq op 6 eq op 7
+ 37 ret and eq arg 0 eq n 0
+ 38 end
+ 39 if eq op 8
+ 40 ret and le arg 1 eq n 4096
+ 41 end
+ 42 if eq op 9
+ 43 ret and le arg 511 eq n 4096
+ 44 end
+ 45 if eq op 10
+ 46 ret and eq arg 0 eq n 0
+ 47 end
+ 48 ret false
+ 49 end
+ 50 fn prparse to bool
+ 51 for i ulong 8
+ 52 if ne get Ph i get Prmagic i
+ 53 ret false
+ 54 end
+ 55 end
+ 56 for k ulong 4
+ 57 v = ulong 0
+ 58 for i ulong 8
+ 59 off = add add 8 mul k 8 i
+ 60 v = or v shl ulong get Ph off mul i 8
+ 61 end
+ 62 put Pv k v
+ 63 end
+ 64 ret prshape
+ 65 end
+ 66 fn prbyte c uchar to void
+ 67 put Pout get Pn 0 c
+ 68 put Pn 0 add get Pn 0 1
+ 69 end
+ 70 fn prword v ulong to void
+ 71 for i ulong 8
+ 72 prbyte uchar and shr v mul i 8 255
+ 73 end
+ 74 end
+ 75 fn prhead op ulong status ulong event ulong size ulong to void
+ 76 for i ulong 8
+ 77 prbyte get Prmagic i
+ 78 end
+ 79 prword op
+ 80 prword status
+ 81 prword event
+ 82 prword size
+ 83 end
+ 84 fn prreply status ulong to void
+ 85 put Pn 0 0
+ 86 kind = get Pe 1
+ 87 size = ulong 0
+ 88 if eq kind 1
+ 89 size = get Outlen 0
+ 90 end
+ 91 if eq kind 2
+ 92 size = get R 8
+ 93 end
+ 94 prhead get Pv 0 status get Pe 0 size
+ 95 for i ulong size
+ 96 if eq kind 1
+ 97 prbyte get Outb i
+ 98 else
+ 99 prbyte get Answer i
+ 100 end
+ 101 end
+ 102 if eq kind 2
+ 103 if and gt get R 2 1 eq get R 1 0
+ 104 if and ne get R 6 0 eq codestat 2
+ 105 prhead 11 1 1 get C 2
+ 106 for i ulong get C 2
+ 107 prbyte get Code i
+ 108 end
+ 109 end
+ 110 end
+ 111 end
+ 112 end
+ 113 fn prevent to void
+ 114 put Pe 0 get A 2
+ 115 if eq get A 2 1
+ 116 put Pe 1 2
+ 117 end
+ 118 end
+ 119 fn prload to ulong
+ 120 if or ne get A 0 0 not ctxidle
+ 121 ret 0
+ 122 end
+ 123 constants
+ 124 for i ulong 3692
+ 125 put Mem i 0
+ 126 end
+ 127 loadbeg
+ 128 b = ctxbegin
+ 129 put Pc 0 1
+ 130 put Pc 1 0
+ 131 ret 1
+ 132 end
+ 133 fn prcopy to ulong
+ 134 if or ne get A 0 0 ne get Pc 0 1
+ 135 ret 0
+ 136 end
+ 137 if not ctxidle
+ 138 ret 0
+ 139 end
+ 140 slot = get Pv 2
+ 141 bit = shl ulong 1 slot
+ 142 if ne and get Pc 1 bit 0
+ 143 ret 0
+ 144 end
+ 145 for i ulong 4096
+ 146 put Unit i get Pb i
+ 147 end
+ 148 status = ulong 2
+ 149 if loadcopy slot
+ 150 status = 1
+ 151 end
+ 152 put Pc 1 or get Pc 1 bit
+ 153 if eq get Pc 1 3
+ 154 if not ctxbegin
+ 155 ret 0
+ 156 end
+ 157 put Pc 0 2
+ 158 if ne get Cx 2 0
+ 159 put Pc 0 3
+ 160 end
+ 161 end
+ 162 ret status
+ 163 end
+ 164 fn prnote to ulong
+ 165 if or ne get A 0 0 ne get Pc 0 2
+ 166 ret 0
+ 167 end
+ 168 if not ctxidle
+ 169 ret 0
+ 170 end
+ 171 for i ulong 4096
+ 172 put Unit i get Pb i
+ 173 end
+ 174 status = ctxtake get Pv 2
+ 175 if ne get Cx 2 0
+ 176 put Pc 0 3
+ 177 end
+ 178 ret status
+ 179 end
+ 180 fn prapply to ulong
+ 181 op = get Pv 0
+ 182 now = get Pv 1
+ 183 arg = get Pv 2
+ 184 if eq op 10
+ 185 ret prload
+ 186 end
+ 187 if eq op 8
+ 188 ret prcopy
+ 189 end
+ 190 if eq op 9
+ 191 ret prnote
+ 192 end
+ 193 if eq op 1
+ 194 if or eq get Pc 0 1 eq get Pc 0 2
+ 195 ret 0
+ 196 end
+ 197 if appinit arg now
+ 198 ret 1
+ 199 end
+ 200 ret 0
+ 201 end
+ 202 if eq get A 0 0
+ 203 ret 0
+ 204 end
+ 205 if eq op 6
+ 206 appcancel
+ 207 ret 1
+ 208 end
+ 209 if eq op 7
+ 210 appreset
+ 211 ret 1
+ 212 end
+ 213 if not appclock now
+ 214 ret 0
+ 215 end
+ 216 if eq op 3
+ 217 offer = apppoll now ne arg 0
+ 218 prevent
+ 219 if offer
+ 220 put Pe 1 1
+ 221 ret 3
+ 222 end
+ 223 ret 1
+ 224 end
+ 225 if eq op 4
+ 226 if appsent now ne arg 0
+ 227 ret 1
+ 228 end
+ 229 ret 0
+ 230 end
+ 231 for i ulong get Pv 3
+ 232 put In i get Pb i
+ 233 end
+ 234 put Inlen 0 get Pv 3
+ 235 if eq op 2
+ 236 if not appask now
+ 237 ret 0
+ 238 end
+ 239 else
+ 240 if not appreceive now
+ 241 ret 0
+ 242 end
+ 243 end
+ 244 prevent
+ 245 ret 1
+ 246 end
+ 247 fn prdo to bool
+ 248 if not prparse
+ 249 ret false
+ 250 end
+ 251 put Pe 0 0
+ 252 put Pe 1 0
+ 253 status = prapply
+ 254 prreply status
+ 255 ret true
+ 256 end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.exit
new file mode 100644
index 00000000..22adbfd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.exit
@@ -0,0 +1 @@
+provider-core exit=0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.log
new file mode 100644
index 00000000..88d1b135
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-entry-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/provider-entry-numbered.txt
new file mode 100644
index 00000000..485e09a5
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-entry-numbered.txt
@@ -0,0 +1,70 @@
+ 1 note Native Linux stdin/stdout provider-stream entry. No fake clock or transport.
+ 2 fn prreadhead to int
+ 3 p = ulong 0
+ 4 while lt p 40
+ 5 n = read 0 Ph p sub ulong 40 p
+ 6 if lt n 0
+ 7 ret 74
+ 8 end
+ 9 if eq n 0
+ 10 if eq p 0
+ 11 ret 0
+ 12 end
+ 13 ret 65
+ 14 end
+ 15 p = add p ulong n
+ 16 end
+ 17 ret 1
+ 18 end
+ 19 fn prreadbody to int
+ 20 p = ulong 0
+ 21 size = get Pv 3
+ 22 while lt p size
+ 23 n = read 0 Pb p sub size p
+ 24 if lt n 0
+ 25 ret 74
+ 26 end
+ 27 if eq n 0
+ 28 ret 65
+ 29 end
+ 30 p = add p ulong n
+ 31 end
+ 32 ret 0
+ 33 end
+ 34 fn prwrite to bool
+ 35 p = ulong 0
+ 36 while lt p get Pn 0
+ 37 n = write 1 Pout p sub get Pn 0 p
+ 38 if le n 0
+ 39 ret false
+ 40 end
+ 41 p = add p ulong n
+ 42 end
+ 43 ret true
+ 44 end
+ 45 fn main to int
+ 46 constants
+ 47 while true
+ 48 status = prreadhead
+ 49 if eq status 0
+ 50 ret 0
+ 51 end
+ 52 if ne status 1
+ 53 ret status
+ 54 end
+ 55 if not prparse
+ 56 ret 65
+ 57 end
+ 58 status = prreadbody
+ 59 if ne status 0
+ 60 ret status
+ 61 end
+ 62 if not prdo
+ 63 ret 65
+ 64 end
+ 65 if not prwrite
+ 66 ret 74
+ 67 end
+ 68 end
+ 69 ret 0
+ 70 end
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.err b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.err
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.out b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.out
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.err b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.err
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.mode b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.mode
new file mode 100644
index 00000000..c7930257
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.mode
@@ -0,0 +1 @@
+7
\ No newline at end of file
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.output
new file mode 100644
index 00000000..12949c15
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.output differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.strace b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.strace
new file mode 100644
index 00000000..874cad32
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.strace
@@ -0,0 +1,14 @@
+read(0, "ALNPRV01\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0M\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+read(0, "ALNPRV01\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+read(0, "hi", 2) = 2
+write(1, "ALNPRV01\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+read(0, "ALNPRV01\3\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 113) = 113
+read(0, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+read(0, "ALNPRV01\3\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 605) = 605
+read(0, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+read(0, "AL
\ No newline at end of file
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.exit
new file mode 100644
index 00000000..fff0a247
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.exit
@@ -0,0 +1 @@
+74
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal-producer.err b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal-producer.err
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.input b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.input
new file mode 100644
index 00000000..95d75826
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.output
new file mode 100644
index 00000000..12949c15
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.output differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.log
new file mode 100644
index 00000000..4a64a2b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.log
@@ -0,0 +1,83 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.log
new file mode 100644
index 00000000..52a768ab
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.log
@@ -0,0 +1,83 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 1
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.exit
new file mode 100644
index 00000000..fff0a247
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.exit
@@ -0,0 +1 @@
+74
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.output
new file mode 100644
index 00000000..168db2b7
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.output differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.receipt
new file mode 100644
index 00000000..16bf1d6a
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.receipt differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.strace b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.strace
new file mode 100644
index 00000000..d107af49
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.strace
@@ -0,0 +1,10 @@
+write(1, "ALNPRV01\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 113) = 113
+write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 605) = 605
+write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+write(1, "ALNPRV01\5\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 45) = 45
+write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 111) = 101
+write(1, "0 bytes=0\n", 10) = -1 EFBIG (File too large)
+--- SIGXFSZ {si_signo=SIGXFSZ, si_code=SI_USER, si_pid=3993378, si_uid=1000} ---
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.log
new file mode 100644
index 00000000..7a69dff3
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.log
@@ -0,0 +1,38 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.input b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.input
new file mode 100644
index 00000000..c09e7612
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.output
new file mode 100644
index 00000000..e3c35b9a
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.output differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider.elf.txt b/evidence/allen-omega-L694/L748/independent-review/raw/provider.elf.txt
new file mode 100644
index 00000000..4cb42eab
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider.elf.txt
@@ -0,0 +1,30 @@
+ELF Header:
+ Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
+ Class: ELF64
+ Data: 2's complement, little endian
+ Version: 1 (current)
+ OS/ABI: UNIX - System V
+ ABI Version: 0
+ Type: EXEC (Executable file)
+ Machine: AArch64
+ Version: 0x1
+ Entry point address: 0x4000b0
+ Start of program headers: 64 (bytes into file)
+ Start of section headers: 0 (bytes into file)
+ Flags: 0x0
+ Size of this header: 64 (bytes)
+ Size of program headers: 56 (bytes)
+ Number of program headers: 2
+ Size of section headers: 0 (bytes)
+ Number of section headers: 0
+ Section header string table index: 0
+
+Program Headers:
+ Type Offset VirtAddr PhysAddr
+ FileSiz MemSiz Flags Align
+ LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000
+ 0x00000000000131f8 0x00000000000131f8 R E 0x1000
+ LOAD 0x0000000000000000 0x0000000010000000 0x0000000010000000
+ 0x0000000000000000 0x0000000000881990 RW 0x1000
+
+There is no dynamic section in this file.
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/release-source.paths b/evidence/allen-omega-L694/L748/independent-review/raw/release-source.paths
new file mode 100644
index 00000000..ace3a725
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/release-source.paths
@@ -0,0 +1,51 @@
+native/omega/allen/application.om
+native/omega/allen/base.om
+native/omega/allen/build-one.sh
+native/omega/allen/code.om
+native/omega/allen/context.om
+native/omega/allen/courier.om
+native/omega/allen/gate.sh
+native/omega/allen/golden.sh
+native/omega/allen/intent.om
+native/omega/allen/main.om
+native/omega/allen/memory.om
+native/omega/allen/paint.om
+native/omega/allen/provider-core.om
+native/omega/allen/PROVIDER.md
+native/omega/allen/provider.om
+native/omega/allen/README.md
+native/omega/allen/reply.om
+native/omega/allen/runtime.om
+native/omega/allen/scene-input.om
+native/omega/allen/scene.om
+native/omega/allen/scheduler.om
+native/omega/allen/tests/application.om
+native/omega/allen/tests/check.om
+native/omega/allen/tests/code.om
+native/omega/allen/tests/context.om
+native/omega/allen/tests/courier.om
+native/omega/allen/tests/edges.om
+native/omega/allen/tests/fixture.om
+native/omega/allen/tests/golden.om
+native/omega/allen/tests/intent.om
+native/omega/allen/tests/memory.om
+native/omega/allen/tests/paint.om
+native/omega/allen/tests/probe.om
+native/omega/allen/tests/provider-core.om
+native/omega/allen/tests/provider-input.om
+native/omega/allen/tests/provider-mutants.om
+native/omega/allen/tests/provider-output.om
+native/omega/allen/tests/provider-process.om
+native/omega/allen/tests/render.om
+native/omega/allen/tests/reply.om
+native/omega/allen/tests/runtime.om
+native/omega/allen/tests/scene-input.om
+native/omega/allen/tests/scene.om
+native/omega/allen/tests/scheduler.om
+native/omega/allen/tests/stdio-overflow.om
+native/omega/allen/tests/view.om
+native/omega/allen/vendor/OMEGA-LICENSE
+native/omega/allen/vendor/PROVENANCE.md
+native/omega/allen/vendor/sha256-core.om
+native/omega/allen/vendor/sha256.om
+native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256
new file mode 100644
index 00000000..c273852f
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256
@@ -0,0 +1 @@
+f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274 /home/drakestapleton/handoffs/L753-review/report.md
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256.verify b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256.verify
new file mode 100644
index 00000000..c273852f
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256.verify
@@ -0,0 +1 @@
+f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274 /home/drakestapleton/handoffs/L753-review/report.md
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.check.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.check.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.input
new file mode 100644
index 00000000..1f0e4517
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.receipt
new file mode 100644
index 00000000..2b29860a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.receipt
@@ -0,0 +1,4 @@
+1
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.check.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.check.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.input
new file mode 100644
index 00000000..1db16c18
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.receipt
new file mode 100644
index 00000000..9ba12cca
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.receipt
@@ -0,0 +1,4 @@
+2
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.exit b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.exit
new file mode 100644
index 00000000..1479e19b
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.exit
@@ -0,0 +1 @@
+65
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.check.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.check.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.input
new file mode 100644
index 00000000..e57731f8
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.receipt
new file mode 100644
index 00000000..199cc204
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.receipt
@@ -0,0 +1,4 @@
+3
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.strace b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.strace
new file mode 100644
index 00000000..f59e1642
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.strace
@@ -0,0 +1,2 @@
+read(0, "ALNPRV01\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0M\0\0\0\0\0\0\0"..., 40) = 39
+read(0, "", 1) = 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.exit b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.exit
new file mode 100644
index 00000000..1479e19b
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.exit
@@ -0,0 +1 @@
+65
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.check.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.check.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.input
new file mode 100644
index 00000000..f62d999f
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.receipt
new file mode 100644
index 00000000..26a81c4a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.receipt
@@ -0,0 +1,4 @@
+4
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.strace b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.strace
new file mode 100644
index 00000000..708f17f0
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.strace
@@ -0,0 +1,3 @@
+read(0, "ALNPRV01\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
+read(0, "h", 2) = 1
+read(0, "", 1) = 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.check.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.check.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.input
new file mode 100644
index 00000000..63f04014
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.receipt
new file mode 100644
index 00000000..d79f5995
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.receipt
@@ -0,0 +1,4 @@
+5
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.check.log
new file mode 100644
index 00000000..3f9cc45d
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.check.log
@@ -0,0 +1,17 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.input
new file mode 100644
index 00000000..fd23a175
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.input differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.output
new file mode 100644
index 00000000..58e9a74d
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.output differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.receipt
new file mode 100644
index 00000000..d0b7cd17
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.receipt differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/source-membership.diff b/evidence/allen-omega-L694/L748/independent-review/raw/source-membership.diff
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.err b/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.err
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.exit b/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.err b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.err
new file mode 100644
index 00000000..8d568fd0
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.err
@@ -0,0 +1,7 @@
+strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large
+strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large
+strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large
+strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large
+strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large
+strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large
+strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.exit b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.exit
new file mode 100644
index 00000000..fff0a247
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.exit
@@ -0,0 +1 @@
+74
diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.out b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.out
new file mode 100644
index 00000000..168db2b7
Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.out differ
diff --git a/evidence/allen-omega-L694/L748/independent-review/report.md b/evidence/allen-omega-L694/L748/independent-review/report.md
new file mode 100644
index 00000000..468784c2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/independent-review/report.md
@@ -0,0 +1,49 @@
+# L753 independent review — L748 native Omega provider stream
+
+**Verdict:** No correctness finding in the reviewed provider core or native stdin/stdout entry at `43eae848f0a44604b42378d9ea3170278b5f3f8f`. The focused independent probes passed. This is source/build/host-stream evidence only; it does not qualify a live model, network, clock, persistent storage, device, x86, or iMac path.
+
+## Scope and source closure
+
+- Reviewed exact head `43eae848f0a44604b42378d9ea3170278b5f3f8f` (base `be28deb21721f54fc46b5402076c7e8ac8fde151`), including `native/omega/allen/PROVIDER.md`, `provider-core.om`, `provider.om`, provider tests, and their application, scheduler, memory, context, reply, code, courier, runtime and base callees.
+- Exported that commit with `git archive` to `~/handoffs/L753-review/source/`; all 51 tracked `native/omega/allen` paths exactly matched the L748 `source.sha256` membership and every one of its recorded hashes matched `git show :`. The 51-file manifest is broader than the 43-file L747 review closure recorded in L748 summary.
+- Pinned `omc` SHA-256: `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Rebuilt with the exported `build-one.sh`; every binary is a nonempty static AArch64 ELF EXEC with no `INTERP`/`NEEDED` entries.
+- Rebuilt provider SHA-256 `c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd`, exactly matching the L748 author receipt. Provider-core test, output verifier, process verifier, boundary test and custom probe artifact hashes are in `raw/builds-final.sha256` and `raw/builds.sha256`.
+- The production worktree was clean at initial inspection. It had unrelated concurrent modifications by final inspection (`README.md`, `gate.sh`, and presentation files); I did not modify or build from that mutable tree. All compilation/replay used the immutable exported pin.
+
+## Findings
+
+None. Header fields are decoded little-endian as full 64-bit values; malformed magic/op/shape refuses before later command processing, while semantic refusal remains a framed status-0 response and permits following records. Restore staging gates BOOT, COPY/NOTE are bounded and duplicate visits refuse, offer output is copied to its own buffer without advancing transport completion, and the actual SENT result remains owned by the caller. Reply and completed-code records remain separately framed.
+
+## Independent execution
+
+All newly written behavioral probes and receipt checks were handwritten seeded Omega (`.om`). Shell was limited to pinned export/build, wiring real processes/descriptors and retaining logs/statuses.
+
+| Probe | Result |
+|---|---|
+| Rebuilt provider-core test from exported callees and pinned source | 100 assertions; exit 0 |
+| Rebuilt native stream entry + existing independent output verifier, normal valid stream | 292 assertions; exit 0 |
+| Same valid stream through a real FIFO with Omega producer writes selected to one byte at a time | 292 assertions; producer/consumer exit 0; output byte-identical to regular-file replay (1114 bytes) |
+| Independent `.om` parser/shape boundaries | 25 assertions; exit 0; included timestamp/op/argument/body-size bounds, 64-bit high-bit round-trip, invalid high-bit op, ASK 0/1/159/160, RECV 64/65/1200/1201, COPY/NOTE index edges, and zero-timestamp rules |
+| Independent real process sequence BOOT, duplicate BOOT refusal, then CANCEL | 38 assertions; process exit 0; exactly three 40-byte replies with statuses 1, 0, 1 |
+| Existing Omega process receipt verifier over six generated malformed/truncated inputs | 42 assertions; each process refused with exit 65; output was empty except the expected prior BOOT reply (40 bytes) before the malformed next frame |
+| Clean EOF and true partial header/body EOF | Clean EOF exit 0 with empty output; 39/40-byte header and 1/2-byte body actually observed by `strace`, then EOF; each truncated process exit 65 |
+| Short output write followed by write error | `RLIMIT_FSIZE`/ignored `SIGXFSZ` caused a real 101/111-byte positive write, followed by `EFBIG`; process exited 74 after a 1024-byte prefix. Independent Omega receipt/frame-prefix checker: 83 assertions, exit 0 |
+| `/dev/full` output error | Process exit 74; no stderr |
+
+**Count:** 872 passing Omega assertions across the listed test artifacts (100 + 292 + 292 + 25 + 38 + 42 + 83). This count excludes raw syscall observations and exit-only EOF/`/dev/full` checks.
+
+## Raw evidence and replay inputs
+
+- `raw/pins.txt`, `raw/compiler.sha256`, `raw/focused-inputs.sha256`, `raw/source-membership.diff`, `raw/git-source.paths`, and `raw/release-source.paths`: pin/compiler/source closure.
+- `raw/provider.elf.txt`, `raw/builds.sha256`, `raw/builds-final.sha256`: ELF and compiled artifact identities.
+- `raw/provider-core.log`, `raw/provider-normal.check.log`, `raw/provider-fragment.check.log`, `raw/provider-semantic-check.log`, `raw/provider-boundary-final.log`, `raw/short-*.receipt`, `raw/short-*.check.log`, and `raw/provider-partial-write-check-final.log`: native Omega assertion output and process receipts.
+- `raw/short-3.strace`, `raw/short-4.strace`, `raw/provider-fragment.strace`, `raw/provider-partial-write.strace`, and associated input/output/status files: real syscall evidence.
+- `raw/failed-probes/`: retained expected probe-construction failures and their statuses. Missing `main` was a compile/setup failure; the initial boundary count was an assertion-count error; a cancellation fixture with nonzero timestamp was malformed and correctly refused (65, with only the two prior 40-byte replies). They are not product failures and were not counted as kills.
+- `source/` is the exact source archive export; `build/` contains focused inputs, Omega probes and outputs. No whole suite was rerun; L748's exact-source 2214 assertion/15 compiled-mutant receipt was inspected rather than duplicated.
+
+## Limits / remaining qualification
+
+- No live model/provider service, network or datagram transport, monotonic hardware clock, physical persistence, device, x86, or iMac execution was exercised. Host stdin/stdout framing is not those interfaces.
+- The byte-at-a-time FIFO run alone did **not** prove short `read(2)` calls (the trace showed a complete 40-byte read); separate truncated-header/body EOF cases did prove positive partial reads. Short output write accounting was directly exercised as a positive short write followed by a subsequent error, not as successful retry/recovery.
+- EINTR behavior and inherited SIGPIPE disposition were not injected. The entry maps syscall errors to 74; these signal/interruption cases remain separate qualification limits.
+- No production files were changed; no deploy/restart/push or ledger action was performed.
diff --git a/evidence/allen-omega-L694/L748/initial-invalid-mutant.om b/evidence/allen-omega-L694/L748/initial-invalid-mutant.om
new file mode 100644
index 00000000..94d5b3bf
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/initial-invalid-mutant.om
@@ -0,0 +1,3951 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn b = qsent get Pv 1 true
+prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+b = qsent get Pv 1 true
+prreply status
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fmagic "ALNPRV01"
+text Hi "hi"
+text Reply "SAY 1 1/1 hello"
+text Askcode "write a calculator"
+text Tinycode "CODE 2 1/1 2 d8932aac text hi"
+text Done "SAY 2 1/1 Done."
+global Held uchar 8192
+global Holdn ulong 2
+global Before uchar 8192
+fn test ok bool to void
+note Direct write logger would clobber the very datagram being tested.
+put Holdn 0 get Outlen 0
+put Holdn 1 get Err 0
+for i ulong get Outlen 0
+put Held i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Holdn 0
+put Outb i get Held i
+end
+put Outlen 0 get Holdn 0
+put Err 0 get Holdn 1
+end
+fn hword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn frame op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Fmagic i
+end
+hword 8 op
+hword 16 now
+hword 24 arg
+hword 32 size
+end
+fn oword off ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add off i mul i 8
+end
+ret v
+end
+fn receive part ulong size ulong to void
+note Caller placed LINE payload in In; packet overwrites Outb, so preserve it.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Held i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Held i
+end
+put Outlen 0 n
+put Err 0 e
+frame 5 4294967297 0 size
+end
+fn main to int
+frame 1 4294967296 77 0
+test prparse
+test eq get Pv 0 1
+test eq get Pv 1 4294967296
+test eq get Pv 2 77
+put Ph 0 88
+test not prparse
+frame 11 0 0 0
+test not prparse
+frame 1 0 77 1
+test not prparse
+frame 3 0 2 0
+test not prparse
+frame 2 0 0 160
+test not prparse
+frame 10 0 0 0
+test prdo
+test eq oword 16 1
+test eq get Pc 0 1
+mset32 0 3
+mset32 36 1
+test memenc 10
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 8 0 1 4096
+test prdo
+test eq oword 16 1
+test eq get St 0 10
+test prdo
+test eq oword 16 0
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+for i ulong 4096
+put Pb i 0
+end
+frame 8 0 0 4096
+test prdo
+test eq oword 16 2
+test eq get Pc 0 2
+test eq get St 0 10
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+put Ns 0 2
+put Ns 1 0
+put Ns 2 3
+put Ns 3 0
+put Note 0 78
+put Note 1 48
+test noteenc
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 9 0 1 4096
+test prdo
+test eq oword 16 0
+frame 9 0 0 4096
+test prdo
+test eq oword 16 1
+test eq get Pc 0 3
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 1
+test eq get A 0 1
+test prdo
+test eq oword 16 0
+frame 10 0 0 0
+test prdo
+test eq oword 16 0
+test eq mem32 0 3
+frame 2 4294967297 0 len Hi
+for i ulong len Hi
+put Pb i get Hi i
+end
+test prdo
+test eq oword 16 1
+test eq get R 0 1
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq oword 32 get Outlen 0
+test eq get T 10 5
+same = true
+for i ulong get Outlen 0
+if ne get Pout add i 40 get Outb i
+same = false
+end
+end
+test same
+test prdo
+test eq oword 16 1
+test eq get T 10 5
+frame 4 4294967297 0 0
+test prdo
+test eq get T 3 0
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+frame 4 4294967297 1 0
+test prdo
+test eq get T 3 1
+frame 3 4294967297 1 0
+test prdo
+test eq get T 10 1
+for i ulong len Reply
+put In i get Reply i
+end
+receive 1 len Reply
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Before i get Outb i
+end
+test prdo
+test eq get Outlen 0 n
+test eq get Err 0 e
+same = true
+for i ulong n
+if ne get Outb i get Before i
+same = false
+end
+end
+test same
+test eq oword 16 1
+test eq oword 24 1
+test eq oword 32 5
+test eq get Pout 40 104
+test eq get R 1 0
+test eq get T 10 1
+test eq get Outb 0 65
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq get T 10 3
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 1
+test eq oword 32 0
+frame 2 4294967297 0 len Askcode
+for i ulong len Askcode
+put Pb i get Askcode i
+end
+test prdo
+test eq oword 24 1
+test eq oword 32 len Ack
+for i ulong len Tinycode
+put In i get Tinycode i
+end
+receive 1 len Tinycode
+test prdo
+test eq oword 24 0
+frame 3 4294967297 1 0
+test prdo
+frame 4 4294967297 1 0
+test prdo
+for i ulong len Done
+put In i get Done i
+end
+receive 2 len Done
+test prdo
+test eq oword 24 1
+test eq oword 32 5
+off = ulong 45
+test eq oword add off 8 11
+test eq oword add off 32 2
+test eq get Pout add off 40 104
+test eq get Pout add off 41 105
+test eq get Pn 0 add off 42
+frame 3 4294967296 1 0
+test prdo
+test eq oword 16 0
+test eq oword 24 0
+frame 7 0 0 0
+test prdo
+test eq get R 9 0
+test eq get R 0 2
+test eq get Q 1 2
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L748/intent.log b/evidence/allen-omega-L694/L748/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L748/inventory.json b/evidence/allen-omega-L694/L748/inventory.json
new file mode 100644
index 00000000..88e49e1c
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/inventory.json
@@ -0,0 +1,108 @@
+{
+ "README.md": "d017f3fc4d54467299783bdf726647ead7fe59fd092c23769e787966a9888022",
+ "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433",
+ "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1",
+ "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a",
+ "autosent-mutant.log": "fd09242df722583c7e04568d177eed33aeec3b4fbc67f8d1cba666941a81bf08",
+ "binaries.sha256": "031c54d7912fc8e53d2d2843f57d1eb044d66ee96e5463e1cfce61351f223678",
+ "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390",
+ "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0",
+ "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b",
+ "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5",
+ "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1",
+ "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835",
+ "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed",
+ "final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "final.log": "53c5cfa81cec3e8482fb2b8384a0b06483846dc1250ad872c5d8dae050be8239",
+ "framecheck-mutant.log": "80857ef43f4767086a5154d915825e2d9ab8e1dacf7382cd9cec20a6c9e945eb",
+ "full.exit": "e6c21e8d260fe71882debdb339d2402a2ca7648529bc2303f48649bce0380017",
+ "full.log": "fc445be00344cb20620c4d16ce7524764ffbfbc0ca7fc1e559588b71af26324a",
+ "green1.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "green1.log": "f2c509f02a51654a605cab1eb026e3d316630cf6d9826b37670ff35fa993c3ba",
+ "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e",
+ "initial-invalid-mutant.om": "4162503beef582a5c39338e4497d1ae1a16176f7683a40cac1ead6378d16100a",
+ "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345",
+ "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e",
+ "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508",
+ "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15",
+ "native-final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "native-final.log": "f8c64e32b6443c7240f34e5f663a0ce853689e207d288a59816747b007dffc1d",
+ "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a",
+ "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657",
+ "process-red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "process-red.log": "b0a6c00cf43f729dbb43ce13a05d2d985aa4b85a65d188f2752078499db8a181",
+ "process-red.receipt": "b692935a446f9a441cdda762e29c12d2d6ab075ee10722609daef6122357a17a",
+ "provider-bad-1.input": "b9d4174daac045b3088a0d53515083432b86dd4b5bdf5f1d67b8c7a4c144dd13",
+ "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-1.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4",
+ "provider-bad-1.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-2.input": "5db852bf971a13086b099baa093cf88fbdaf42852f1cba8e938799a34109f332",
+ "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-2.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b",
+ "provider-bad-2.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-3.input": "509158d4cc5ee28556c0a1518ef3f7a97594e33aebe934a02a59f18c7ac5c230",
+ "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-3.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05",
+ "provider-bad-3.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-4.input": "9aec780192d96833fb57d407522db00fc6c6bf60b2fdf99ffbbbf5bdd9bfcb8d",
+ "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-4.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a",
+ "provider-bad-4.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-5.input": "c42c9f8a6a3589d3aa3dfa90194663bfc26bd5575c60787c9a355f93fb9511fb",
+ "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-5.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646",
+ "provider-bad-5.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-bad-6.input": "8ea63ccc995ca2f50cae898a5dd97a15c90d8650e190a824f857d4cb362a8e91",
+ "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435",
+ "provider-bad-6.output": "691fee447b7b1453a429e23f01152ffacca0570ccce92f525af024aa0d934519",
+ "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b",
+ "provider-bad-6.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-boot.expected": "691fee447b7b1453a429e23f01152ffacca0570ccce92f525af024aa0d934519",
+ "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04",
+ "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "provider-fragment.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0",
+ "provider-fragment.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9",
+ "provider-producer.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "provider.input": "520bdb2f475e7ff86edfd6618b04d672c6a9b90ce09e4f249e3c615078855867",
+ "provider.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0",
+ "provider.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61",
+ "red.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8",
+ "red.log": "40280c9a7b1c8a6314e0562384cc7d80cc6bb4a3af1486a11b4d81f9351baad3",
+ "red.om": "a503f3dbf1b0108995afb44666a4cc2e87da71a4d5318bb9ffc162032fd45461",
+ "release.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "release.log": "f8c64e32b6443c7240f34e5f663a0ce853689e207d288a59816747b007dffc1d",
+ "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162",
+ "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51",
+ "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9",
+ "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8",
+ "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d",
+ "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948",
+ "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2",
+ "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2",
+ "source.sha256": "858169ddb766dcc50d17fb2bec4449420d94d674ddff453748046a63d2df11ac",
+ "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b",
+ "stdio-overflow.input": "9273073a240b9484e26ac34d83e695fa214702c16b9bc72890d37f0a57834a92",
+ "stdio-overflow.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "stream-green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "stream-green.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "stream-red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "stream-red.log": "3f11ad6bbc7ecca0b2416b713dee77f1a635c00aaeaa946e14cde1c2bfae56d5",
+ "stream-red.om": "6cf5c717c76d61c456894d215057d67ffd686063b81beb6b7a06b3e5759b3be6",
+ "stream-verifier.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "summary.json": "98c68397adc3aee7b18f05fb8453b8765ae0572c14dd40853e2ab8d74ca84369",
+ "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474",
+ "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e"
+}
diff --git a/evidence/allen-omega-L694/L748/keepalive-mutant.log b/evidence/allen-omega-L694/L748/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L748/long.log b/evidence/allen-omega-L694/L748/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L748/memory.log b/evidence/allen-omega-L694/L748/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L748/native-final.exit b/evidence/allen-omega-L694/L748/native-final.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/native-final.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/native-final.log b/evidence/allen-omega-L694/L748/native-final.log
new file mode 100644
index 00000000..96ebefe9
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/native-final.log
@@ -0,0 +1,43 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=1
+framecheck mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L748/paint.log b/evidence/allen-omega-L694/L748/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L748/pendingwire-mutant.log b/evidence/allen-omega-L694/L748/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L748/process-red.exit b/evidence/allen-omega-L694/L748/process-red.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/process-red.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L748/process-red.log b/evidence/allen-omega-L694/L748/process-red.log
new file mode 100644
index 00000000..6ee04194
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/process-red.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 1
+5 0
diff --git a/evidence/allen-omega-L694/L748/process-red.receipt b/evidence/allen-omega-L694/L748/process-red.receipt
new file mode 100644
index 00000000..968ac3ef
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/process-red.receipt
@@ -0,0 +1,4 @@
+1
+0
+0
+0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.input b/evidence/allen-omega-L694/L748/provider-bad-1.input
new file mode 100644
index 00000000..1f0e4517
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-1.input differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.log b/evidence/allen-omega-L694/L748/provider-bad-1.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-1.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.output b/evidence/allen-omega-L694/L748/provider-bad-1.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.receipt b/evidence/allen-omega-L694/L748/provider-bad-1.receipt
new file mode 100644
index 00000000..2b29860a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-1.receipt
@@ -0,0 +1,4 @@
+1
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.stderr b/evidence/allen-omega-L694/L748/provider-bad-1.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.input b/evidence/allen-omega-L694/L748/provider-bad-2.input
new file mode 100644
index 00000000..1db16c18
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-2.input differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.log b/evidence/allen-omega-L694/L748/provider-bad-2.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-2.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.output b/evidence/allen-omega-L694/L748/provider-bad-2.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.receipt b/evidence/allen-omega-L694/L748/provider-bad-2.receipt
new file mode 100644
index 00000000..9ba12cca
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-2.receipt
@@ -0,0 +1,4 @@
+2
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.stderr b/evidence/allen-omega-L694/L748/provider-bad-2.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.input b/evidence/allen-omega-L694/L748/provider-bad-3.input
new file mode 100644
index 00000000..e57731f8
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-3.input differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.log b/evidence/allen-omega-L694/L748/provider-bad-3.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-3.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.output b/evidence/allen-omega-L694/L748/provider-bad-3.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.receipt b/evidence/allen-omega-L694/L748/provider-bad-3.receipt
new file mode 100644
index 00000000..199cc204
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-3.receipt
@@ -0,0 +1,4 @@
+3
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.stderr b/evidence/allen-omega-L694/L748/provider-bad-3.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.input b/evidence/allen-omega-L694/L748/provider-bad-4.input
new file mode 100644
index 00000000..f62d999f
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-4.input differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.log b/evidence/allen-omega-L694/L748/provider-bad-4.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-4.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.output b/evidence/allen-omega-L694/L748/provider-bad-4.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.receipt b/evidence/allen-omega-L694/L748/provider-bad-4.receipt
new file mode 100644
index 00000000..26a81c4a
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-4.receipt
@@ -0,0 +1,4 @@
+4
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.stderr b/evidence/allen-omega-L694/L748/provider-bad-4.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.input b/evidence/allen-omega-L694/L748/provider-bad-5.input
new file mode 100644
index 00000000..63f04014
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-5.input differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.log b/evidence/allen-omega-L694/L748/provider-bad-5.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-5.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.output b/evidence/allen-omega-L694/L748/provider-bad-5.output
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.receipt b/evidence/allen-omega-L694/L748/provider-bad-5.receipt
new file mode 100644
index 00000000..d79f5995
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-5.receipt
@@ -0,0 +1,4 @@
+5
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.stderr b/evidence/allen-omega-L694/L748/provider-bad-5.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.input b/evidence/allen-omega-L694/L748/provider-bad-6.input
new file mode 100644
index 00000000..fd23a175
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-6.input differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.log b/evidence/allen-omega-L694/L748/provider-bad-6.log
new file mode 100644
index 00000000..3f9cc45d
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-bad-6.log
@@ -0,0 +1,17 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.output b/evidence/allen-omega-L694/L748/provider-bad-6.output
new file mode 100644
index 00000000..58e9a74d
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-6.output differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.receipt b/evidence/allen-omega-L694/L748/provider-bad-6.receipt
new file mode 100644
index 00000000..d0b7cd17
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-6.receipt differ
diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.stderr b/evidence/allen-omega-L694/L748/provider-bad-6.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-boot.expected b/evidence/allen-omega-L694/L748/provider-boot.expected
new file mode 100644
index 00000000..58e9a74d
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-boot.expected differ
diff --git a/evidence/allen-omega-L694/L748/provider-consumer.log b/evidence/allen-omega-L694/L748/provider-consumer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-consumer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L748/provider-consumer.receipt b/evidence/allen-omega-L694/L748/provider-consumer.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-consumer.receipt differ
diff --git a/evidence/allen-omega-L694/L748/provider-core.log b/evidence/allen-omega-L694/L748/provider-core.log
new file mode 100644
index 00000000..88d1b135
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-core.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L748/provider-fragment.log b/evidence/allen-omega-L694/L748/provider-fragment.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-fragment.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L748/provider-fragment.output b/evidence/allen-omega-L694/L748/provider-fragment.output
new file mode 100644
index 00000000..12949c15
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-fragment.output differ
diff --git a/evidence/allen-omega-L694/L748/provider-fragment.stderr b/evidence/allen-omega-L694/L748/provider-fragment.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-process.log b/evidence/allen-omega-L694/L748/provider-process.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-process.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L748/provider-process.receipt b/evidence/allen-omega-L694/L748/provider-process.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-process.receipt differ
diff --git a/evidence/allen-omega-L694/L748/provider-producer.log b/evidence/allen-omega-L694/L748/provider-producer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-producer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L748/provider-producer.receipt b/evidence/allen-omega-L694/L748/provider-producer.receipt
new file mode 100644
index 00000000..0967800c
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-producer.receipt
@@ -0,0 +1,4 @@
+7
+0
+0
+0
diff --git a/evidence/allen-omega-L694/L748/provider-producer.stderr b/evidence/allen-omega-L694/L748/provider-producer.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/provider-stream.log b/evidence/allen-omega-L694/L748/provider-stream.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/provider-stream.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L748/provider.input b/evidence/allen-omega-L694/L748/provider.input
new file mode 100644
index 00000000..95d75826
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider.input differ
diff --git a/evidence/allen-omega-L694/L748/provider.output b/evidence/allen-omega-L694/L748/provider.output
new file mode 100644
index 00000000..12949c15
Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider.output differ
diff --git a/evidence/allen-omega-L694/L748/provider.stderr b/evidence/allen-omega-L694/L748/provider.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/readback-mutant.log b/evidence/allen-omega-L694/L748/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L748/red.exit b/evidence/allen-omega-L694/L748/red.exit
new file mode 100644
index 00000000..fff0a247
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/red.exit
@@ -0,0 +1 @@
+74
diff --git a/evidence/allen-omega-L694/L748/red.log b/evidence/allen-omega-L694/L748/red.log
new file mode 100644
index 00000000..ff14d3a5
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/red.log
@@ -0,0 +1,97 @@
+1 1
+2 1
+3 1
+4 1
+5 0
+6 0
+7 0
+8 0
+9 0
+10 1
+11 1
+12 1
+13 0
+14 1
+15 1
+16 1
+17 1
+18 0
+19 1
+20 0
+21 1
+22 1
+23 1
+24 1
+25 1
+26 0
+27 0
+28 1
+29 0
+30 1
+31 1
+32 1
+33 1
+34 1
+35 1
+36 1
+37 0
+38 1
+39 0
+40 0
+41 1
+42 1
+43 1
+44 1
+45 1
+46 0
+47 1
+48 0
+49 1
+50 1
+51 1
+52 1
+53 0
+54 1
+55 1
+56 1
+57 1
+58 1
+59 1
+60 1
+61 1
+62 1
+63 1
+64 1
+65 0
+66 1
+67 1
+68 1
+69 1
+70 1
+71 1
+72 1
+73 1
+74 1
+75 0
+76 1
+77 1
+78 1
+79 1
+80 0
+81 1
+82 1
+83 1
+84 1
+85 1
+86 1
+87 1
+88 1
+89 1
+90 1
+91 1
+92 0
+93 0
+94 1
+95 0
+96 1
+97 1
diff --git a/evidence/allen-omega-L694/L748/red.om b/evidence/allen-omega-L694/L748/red.om
new file mode 100644
index 00000000..2af11597
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/red.om
@@ -0,0 +1,3691 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+fn prparse to bool
+ret false
+end
+fn prdo to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fmagic "ALNPRV01"
+text Hi "hi"
+text Reply "SAY 1 1/1 hello"
+text Askcode "write a calculator"
+text Tinycode "CODE 2 1/1 2 d8932aac text hi"
+text Done "SAY 2 1/1 Done."
+global Held uchar 8192
+global Holdn ulong 2
+fn test ok bool to void
+note Direct write logger would clobber the very datagram being tested.
+put Holdn 0 get Outlen 0
+put Holdn 1 get Err 0
+for i ulong get Outlen 0
+put Held i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Holdn 0
+put Outb i get Held i
+end
+put Outlen 0 get Holdn 0
+put Err 0 get Holdn 1
+end
+fn hword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn frame op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Fmagic i
+end
+hword 8 op
+hword 16 now
+hword 24 arg
+hword 32 size
+end
+fn oword off ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add off i mul i 8
+end
+ret v
+end
+fn receive part ulong size ulong to void
+note Caller placed LINE payload in In; packet overwrites Outb, so preserve it.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Held i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Held i
+end
+put Outlen 0 n
+put Err 0 e
+frame 5 4294967297 0 size
+end
+fn main to int
+frame 1 4294967296 77 0
+test prparse
+test eq get Pv 0 1
+test eq get Pv 1 4294967296
+test eq get Pv 2 77
+put Ph 0 88
+test not prparse
+frame 11 0 0 0
+test not prparse
+frame 1 0 77 1
+test not prparse
+frame 3 0 2 0
+test not prparse
+frame 2 0 0 160
+test not prparse
+frame 10 0 0 0
+test prdo
+test eq oword 16 1
+test eq get Pc 0 1
+mset32 0 3
+mset32 36 1
+test memenc 10
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 8 0 1 4096
+test prdo
+test eq oword 16 1
+test eq get St 0 10
+test prdo
+test eq oword 16 0
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+for i ulong 4096
+put Pb i 0
+end
+frame 8 0 0 4096
+test prdo
+test eq oword 16 2
+test eq get Pc 0 2
+test eq get St 0 10
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+put Ns 0 2
+put Ns 1 0
+put Ns 2 3
+put Ns 3 0
+put Note 0 78
+put Note 1 48
+test noteenc
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 9 0 1 4096
+test prdo
+test eq oword 16 0
+frame 9 0 0 4096
+test prdo
+test eq oword 16 1
+test eq get Pc 0 3
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 1
+test eq get A 0 1
+test prdo
+test eq oword 16 0
+frame 10 0 0 0
+test prdo
+test eq oword 16 0
+test eq mem32 0 3
+frame 2 4294967297 0 len Hi
+for i ulong len Hi
+put Pb i get Hi i
+end
+test prdo
+test eq oword 16 1
+test eq get R 0 1
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq oword 32 get Outlen 0
+test eq get T 10 5
+same = true
+for i ulong get Outlen 0
+if ne get Pout add i 40 get Outb i
+same = false
+end
+end
+test same
+test prdo
+test eq oword 16 1
+test eq get T 10 5
+frame 4 4294967297 0 0
+test prdo
+test eq get T 3 0
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+frame 4 4294967297 1 0
+test prdo
+test eq get T 3 1
+frame 3 4294967297 1 0
+test prdo
+test eq get T 10 1
+for i ulong len Reply
+put In i get Reply i
+end
+receive 1 len Reply
+test prdo
+test eq oword 16 1
+test eq oword 24 1
+test eq oword 32 5
+test eq get Pout 40 104
+test eq get R 1 0
+test eq get T 10 1
+test eq get Outb 0 65
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq get T 10 3
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 1
+test eq oword 32 0
+frame 2 4294967297 0 len Askcode
+for i ulong len Askcode
+put Pb i get Askcode i
+end
+test prdo
+test eq oword 24 1
+test eq oword 32 len Ack
+for i ulong len Tinycode
+put In i get Tinycode i
+end
+receive 1 len Tinycode
+test prdo
+test eq oword 24 0
+frame 3 4294967297 1 0
+test prdo
+frame 4 4294967297 1 0
+test prdo
+for i ulong len Done
+put In i get Done i
+end
+receive 2 len Done
+test prdo
+test eq oword 24 1
+test eq oword 32 5
+off = ulong 45
+test eq oword add off 8 11
+test eq oword add off 32 2
+test eq get Pout add off 40 104
+test eq get Pout add off 41 105
+test eq get Pn 0 add off 42
+frame 3 4294967296 1 0
+test prdo
+test eq oword 16 0
+test eq oword 24 0
+frame 7 0 0 0
+test prdo
+test eq get R 9 0
+test eq get R 0 2
+test eq get Q 1 2
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/L748/release.exit b/evidence/allen-omega-L694/L748/release.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/release.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/release.log b/evidence/allen-omega-L694/L748/release.log
new file mode 100644
index 00000000..96ebefe9
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/release.log
@@ -0,0 +1,43 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=1
+framecheck mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L748/reply.log b/evidence/allen-omega-L694/L748/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L748/runtime.log b/evidence/allen-omega-L694/L748/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L748/scene-input.log b/evidence/allen-omega-L694/L748/scene-input.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/scene-input.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L748/scene.log b/evidence/allen-omega-L694/L748/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L748/scenecap-mutant.log b/evidence/allen-omega-L694/L748/scenecap-mutant.log
new file mode 100644
index 00000000..502843ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/scenecap-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L748/scheduler.log b/evidence/allen-omega-L694/L748/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L748/session-mutant.log b/evidence/allen-omega-L694/L748/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L748/short.log b/evidence/allen-omega-L694/L748/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L748/source.sha256 b/evidence/allen-omega-L694/L748/source.sha256
new file mode 100644
index 00000000..11b9dd6e
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/source.sha256
@@ -0,0 +1,51 @@
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+fc8434ba3c4eb22fef5f1c1bdceda032aa31b0165a10aefb8105fe8a4dcc9830 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om
+258b9c1f6a7447540c9a8b8cbf2176165ab3e5d80e9528e0b06c37ea745490c1 native/omega/allen/PROVIDER.md
+ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om
+2d6d84af7c653625ae62f8cd567ec3c64c5c730a87b89208ead4033aac9be183 native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe native/omega/allen/tests/provider-core.om
+b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om
+37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om
+d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om
+8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L748/stale-mutant.log b/evidence/allen-omega-L694/L748/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L748/stdio-overflow.input b/evidence/allen-omega-L694/L748/stdio-overflow.input
new file mode 100644
index 00000000..6103faf0
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stdio-overflow.input
@@ -0,0 +1,2 @@
+ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ASK hi
diff --git a/evidence/allen-omega-L694/L748/stdio-overflow.stderr b/evidence/allen-omega-L694/L748/stdio-overflow.stderr
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L748/stream-green.exit b/evidence/allen-omega-L694/L748/stream-green.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stream-green.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/stream-green.log b/evidence/allen-omega-L694/L748/stream-green.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stream-green.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L748/stream-red.exit b/evidence/allen-omega-L694/L748/stream-red.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stream-red.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L748/stream-red.log b/evidence/allen-omega-L694/L748/stream-red.log
new file mode 100644
index 00000000..2fb73a07
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stream-red.log
@@ -0,0 +1 @@
+1 1
diff --git a/evidence/allen-omega-L694/L748/stream-red.om b/evidence/allen-omega-L694/L748/stream-red.om
new file mode 100644
index 00000000..ba121bdf
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stream-red.om
@@ -0,0 +1,3685 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+fn main to int
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L748/stream-verifier.exit b/evidence/allen-omega-L694/L748/stream-verifier.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/stream-verifier.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L748/summary.json b/evidence/allen-omega-L694/L748/summary.json
new file mode 100644
index 00000000..03b6d108
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/summary.json
@@ -0,0 +1,62 @@
+{
+ "base": "be28deb21721f54fc46b5402076c7e8ac8fde151",
+ "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9",
+ "provider_sha256": "c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd",
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "provider-core": 100,
+ "memory": 79,
+ "context": 142,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "scene-input": 63,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292,
+ "provider-stream": 292,
+ "provider-fragment": 292,
+ "provider-process": 3,
+ "provider-consumer": 3,
+ "provider-producer": 3,
+ "provider-bad-1": 5,
+ "provider-bad-2": 5,
+ "provider-bad-3": 5,
+ "provider-bad-4": 5,
+ "provider-bad-5": 5,
+ "provider-bad-6": 17
+ },
+ "total_checks": 2214,
+ "compiled_rejected_mutants": {
+ "ackstop-mutant": 27,
+ "appcode-mutant": 3,
+ "autosent-mutant": 8,
+ "contextjob-mutant": 36,
+ "contextnote-mutant": 5,
+ "crc-mutant": 2,
+ "framecheck-mutant": 4,
+ "hash-mutant": 2,
+ "keepalive-mutant": 40,
+ "pendingwire-mutant": 1,
+ "readback-mutant": 7,
+ "scenecap-mutant": 3,
+ "session-mutant": 1,
+ "stale-mutant": 3,
+ "thinking-mutant": 6
+ },
+ "scope": "AArch64 Linux host streams only; live transport/storage/clock/device/x86/iMac NOT_RUN",
+ "review_L747": {
+ "pin": "be28deb21721f54fc46b5402076c7e8ac8fde151",
+ "source_files": 43,
+ "parent_probe_sha256": "4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6",
+ "parent_checks": 150,
+ "report_sha256": "ce5862d96c8f8f2b6dd11596f1f16f8996b336aad88ef98051a5b7bf626385d3",
+ "verdict": "No findings; original failed probe retained as expectation error; host-only."
+ }
+}
diff --git a/evidence/allen-omega-L694/L748/thinking-mutant.log b/evidence/allen-omega-L694/L748/thinking-mutant.log
new file mode 100644
index 00000000..74b41a12
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/thinking-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L748/view.log b/evidence/allen-omega-L694/L748/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L748/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L756/README.md b/evidence/allen-omega-L694/L756/README.md
new file mode 100644
index 00000000..e49caab1
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/README.md
@@ -0,0 +1,22 @@
+# L756 stable application presentation
+
+Parent-authored seeded Omega binding calls real application ASK/receive functions
+and projects accepted event1 into stable scene and completed-code snapshots.
+The dedicated suite has75 passing assertions; actual full counts and native hashes
+are in summary.json. Initial compilable stub failed42/65; expanded stub failed48/75.
+Original failures are retained. Full gate passed and17 compiled mutants were
+rejected, including two new Omega-constructed stale-event/input-tail mutations.
+
+Run: `quiet-build native/omega/allen/gate.sh /absolute/fresh/private/output`.
+The emitted `presentation` ELF executes the dedicated actual courier/application
+integration tests. New behavior checks, fixtures and mutant construction are Omega;
+existing host orchestration builds/connects/collects and compares artifacts.
+
+Input buffer restoration includes unused bytes touched by decoder normalization.
+Invalid/hidden replies retain the prior scene; failed receive cannot replay stale
+A2. Completed code snapshots do not alias later Code assembly, and reset zeros the
+retained presentation bytes. A code completion with empty closing text can still
+update the code snapshot. The current provider stream remains unchanged and does
+not invoke the new display wrappers. This does not render pixels or qualify a
+live model, multiline model-scene transport, display device or physical iMac.
+Independent final-source review remains required.
diff --git a/evidence/allen-omega-L694/L756/ackstop-mutant.log b/evidence/allen-omega-L694/L756/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L756/appcode-mutant.log b/evidence/allen-omega-L694/L756/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L756/application.log b/evidence/allen-omega-L694/L756/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L756/autosent-mutant.log b/evidence/allen-omega-L694/L756/autosent-mutant.log
new file mode 100644
index 00000000..2aed7f8a
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/autosent-mutant.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 1
+48 0
+49 0
+50 1
+51 1
+52 0
+53 1
+54 0
+55 1
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 1
+70 0
+71 0
+72 0
+73 0
+74 1
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L756/binaries.sha256 b/evidence/allen-omega-L694/L756/binaries.sha256
new file mode 100644
index 00000000..5546f5cf
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/binaries.sha256
@@ -0,0 +1,44 @@
+dbd72f4bb8bf510d8dc806d03a4419fac3cf4962da3c2e4d0720a6a64489c374 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-core
+f082cb8a3f730e32735e4d77ddd89f7b6c2e071f06a9352fb3be822ce6b9ebaf /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scheduler
+c924f171425228c3eb4f1d9ab8fd5756fa49294a2cbe8ff18d7df6cc916f34ca /home/drakestapleton/handoffs/allen-omega-L694/L756/full/readback-mutant
+f0ec39a426c16eb215436256eb4fbccf54388786e81b87bee835f40e450b8be2 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/view
+e2dda6a519494e3ee4c08ec67d1a8c6ee8deb749600243ee2e30d86c17346b3c /home/drakestapleton/handoffs/allen-omega-L694/L756/full/contextnote-mutant
+bde7745dea1708f0b8d8d5dacd2fbd9b2db276d52d29ea4a465398f8cc0f8851 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/allen
+3bedb5b9b50698c0996d0c7b7ce821e8c7b071f59e09576a32a0d52af6c2d656 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/reply
+d133ea1d28887edefc50f27341384ce109e5a9e7de4de895edb0fa41593a6c2a /home/drakestapleton/handoffs/allen-omega-L694/L756/full/thinking-mutant
+17665a6e3bd858133f22640ae22ee1af7ad9176cabedae86dcdfde8babd5aa68 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/inputtail-mutant
+f9d95a1ceb021d0048bb3cef4984c847ccd256bf4e203f82200f23d564d654dd /home/drakestapleton/handoffs/allen-omega-L694/L756/full/ackstop-mutant
+6a25eb5dee199e400229565772f9f0a05d3b3d9cc6e2a544cd5ef0ebae45b380 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/hash-mutant
+6f2a323dbdd1c49a6bf1b5850a0686d6aeb3b77502c4a72954ff9993e37daa29 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/golden
+b6fa715cf46fbf64c69fd48fdd7183e0ecaf253d698ef8499891f3e525a8ba8f /home/drakestapleton/handoffs/allen-omega-L694/L756/full/session-mutant
+b88af4d93bf1b1b402db86e14428140332b49b0d42dbdaa568ef964584f4c4c7 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scene-input
+4c5bca3bc2e7ba2ee9bd564bbd6782437b0cc65b0283480b91108c9ffc9936f8 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/intent
+ef364c43870518d683445eee0f6ba9f31ffeda2bd04d422e7fef8263927f08ea /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-input
+b8712e936cf9486b221dc35d38ee18831c82a90ef68aaea39e0cf78e492cad09 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/fixture
+66d1c4e8808581680a2e3dd36d1a9acc5305190374baf9b3e91d902d61a91c6b /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider
+c7683c702399f7ea261d40f75e56163dbed59f55515aa0a3ac92dd5f6d860b4f /home/drakestapleton/handoffs/allen-omega-L694/L756/full/context
+2577490ab1061c813839d940f48627a7d666b0e0b1a77c1e9dfa1ca862486bc5 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/staleview-mutant
+502d23245559a8cd7fce4e77f8c1b65cd2a6d78892b9d932da28893e5c8adad9 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/runtime
+284d4355b5b0e6599064ac937477252bd3149bd2ef26540cc3eaf7f5324567fb /home/drakestapleton/handoffs/allen-omega-L694/L756/full/code
+52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-mutants
+90436e21d335d4b363dc93f5d38b1ecb172f3dc0e105a3d2eb59b55d3f005987 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/edges
+a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/presentation-mutants
+c8ed6389d2dd725ca08b7c86f64ace2958862bc4d521a11b4f9ebd5b42f57b79 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/appcode-mutant
+8c3e5136ff1f916f905eb02e2272e6aa646023ae25cf7ebe23954a042327ab36 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/render
+a8e784178ce41ff0a49e8fb025d36d0f81ed5699459f10f64a0e358ab192fb14 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/stale-mutant
+6d73fbe8a0b457326bb150dadc2e6df6b533f57dabc6d654a9a2d62845e31e88 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/courier
+79cb2f9586d9c62c62bd804226a6b84138796021000c896a68c834f8551393be /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scene
+749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/presentation
+33d8c38b63a5ad49461f77b12edcab1715e9d937f6f36db40591949f14b02915 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/pendingwire-mutant
+305f7dff2885285b9dab36fe21963f4fb8f0a07e290a041cce16cc32034db70c /home/drakestapleton/handoffs/allen-omega-L694/L756/full/framecheck-mutant
+a5fcc51aff461160fc0ee76c5b6c7572fe7614516b8c787e22023e80d006d4c9 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scenecap-mutant
+6180bd76635a73dfdd67868f9f54f0ddcd9fbae5bf454ef489014c1666d0f89b /home/drakestapleton/handoffs/allen-omega-L694/L756/full/contextjob-mutant
+0b894efb1f7fdd49cc479175a7fdcfad32112775465c702c0cd5ce9cadfdedde /home/drakestapleton/handoffs/allen-omega-L694/L756/full/paint
+df192da44184396bbf6d1a69f4cc971d5453ee01da600cf3a10d600495e9be8f /home/drakestapleton/handoffs/allen-omega-L694/L756/full/crc-mutant
+2c388e855a3b2fe9faf204136a03150cbd6dfecb8515e703006f234bec92d51e /home/drakestapleton/handoffs/allen-omega-L694/L756/full/autosent-mutant
+2442d67aa0951561442e25fd841693b121ed25475246e318847740e1eb83e87a /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-output
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/stdio-overflow-input
+9914acec8db6305f76ae8fd3dd5f48147da60b97c65d0b4e1b19435ece236166 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/keepalive-mutant
+8dbfde8dbf2aa5faf113a88b37cc4ee7e8fe545f8e289ea79a3fa046c311d7c2 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-process
+7c9f6ffbb1453febc08b803fbf7a496cadc719e65581f604cdc0004313414ef9 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/memory
+7d28b14e96244fc0a640483ab4821dbfa9f79d35e1241dafb7fa0391099286dd /home/drakestapleton/handoffs/allen-omega-L694/L756/full/application
diff --git a/evidence/allen-omega-L694/L756/code.log b/evidence/allen-omega-L694/L756/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L756/context.log b/evidence/allen-omega-L694/L756/context.log
new file mode 100644
index 00000000..df62cddb
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/context.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L756/contextjob-mutant.log b/evidence/allen-omega-L694/L756/contextjob-mutant.log
new file mode 100644
index 00000000..3432d4b2
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/contextjob-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 0
+78 0
+79 1
+80 1
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 1
+89 0
+90 1
+91 0
+92 1
+93 0
+94 1
+95 0
+96 1
+97 0
+98 1
+99 0
+100 1
+101 0
+102 1
+103 0
+104 1
+105 0
+106 1
+107 0
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 1
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 1
+123 0
+124 1
+125 0
+126 1
+127 0
+128 1
+129 0
+130 1
+131 0
+132 1
+133 0
+134 1
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 1
+142 1
diff --git a/evidence/allen-omega-L694/L756/contextnote-mutant.log b/evidence/allen-omega-L694/L756/contextnote-mutant.log
new file mode 100644
index 00000000..b5c08759
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/contextnote-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 1
+38 1
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 1
+47 0
+48 1
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L756/courier.log b/evidence/allen-omega-L694/L756/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L756/crc-mutant.log b/evidence/allen-omega-L694/L756/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L756/edges.log b/evidence/allen-omega-L694/L756/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L756/framecheck-mutant.log b/evidence/allen-omega-L694/L756/framecheck-mutant.log
new file mode 100644
index 00000000..d5454577
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/framecheck-mutant.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 1
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L756/full.exit b/evidence/allen-omega-L694/L756/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L756/full.log b/evidence/allen-omega-L694/L756/full.log
new file mode 100644
index 00000000..1fd32bb3
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/full.log
@@ -0,0 +1,46 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+presentation compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=1
+framecheck mutant compile=0 rejected-exit=1
+staleview mutant compile=0 rejected-exit=1
+inputtail mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L756/green.exit b/evidence/allen-omega-L694/L756/green.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/green.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L756/green.log b/evidence/allen-omega-L694/L756/green.log
new file mode 100644
index 00000000..d664fe1a
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/green.log
@@ -0,0 +1,65 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
diff --git a/evidence/allen-omega-L694/L756/green2.exit b/evidence/allen-omega-L694/L756/green2.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/green2.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L756/green2.log b/evidence/allen-omega-L694/L756/green2.log
new file mode 100644
index 00000000..84fd2470
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/green2.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L756/hash-mutant.log b/evidence/allen-omega-L694/L756/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L756/independent-review/inventory.json b/evidence/allen-omega-L694/L756/independent-review/inventory.json
new file mode 100644
index 00000000..33670e68
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/inventory.json
@@ -0,0 +1,23 @@
+{
+ "parent-presentation.log": "c70283fce8aed93e379bc19bafb276f22205243190cb31fd3ce69305d5d6d1e4",
+ "parent-verification.json": "d06ab9c173583e8d4e2188572a9868dfbe63a7e1f8cf2c3955b8dfc5ad12da38",
+ "presentation-raw-baseline.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "presentation-raw-baseline.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7",
+ "presentation-raw-builds.sha256": "ba65b36145c57d39a184d0e0860d25c63d68af724f615e49278f1e894fd02f52",
+ "presentation-raw-compiler.sha256": "41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4",
+ "presentation-raw-git.paths": "937afa12f2100e3238411dd137f39bbe440a9f1a757d409c7df1f301c92079b4",
+ "presentation-raw-independent.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "presentation-raw-independent.log": "c70283fce8aed93e379bc19bafb276f22205243190cb31fd3ce69305d5d6d1e4",
+ "presentation-raw-inputs.sha256": "8b311896eb65a4b6e21cf4cbcb34cb0f12c6607659e1dd927dae071873262454",
+ "presentation-raw-membership.diff": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "presentation-raw-pins.txt": "f620e0ce2e30efb3aad74ea72692f513d4fb2089750d3cd8e587f8cab6f7f36b",
+ "presentation-raw-release.paths": "937afa12f2100e3238411dd137f39bbe440a9f1a757d409c7df1f301c92079b4",
+ "presentation-raw-report.sha256": "7031f47e4e4053ecaddbd93fb08c2549856e43d0aa3727130d9960a7b898c6f5",
+ "presentation-raw-test.elf.txt": "a743f4617cce0d3fb232ecb7550031547ac6a27a68e66aa13770b067e880713b",
+ "presentation-raw-unchanged-components.txt": "9489025413baa12b849ef9d4929418ce641e81ac6b54674a26fc7cd48a62cb8f",
+ "probes/core.om": "65db52e4ec165ae64b71b7a2c68c6263890ecf6fc9cc9f27db68e2374dcfcbf0",
+ "probes/presentation-independent-test.om": "f61bbfb08538a90a7581c557bd269d978c181f36d9baed20b3c489b284e52bf6",
+ "probes/presentation-independent.om": "ee622283ade68902f510791723276401659d8b71f8e9d9ac63c5feadb5a842d8",
+ "probes/presentation-test.om": "96bd651b8ba1f63ea982e41028a52c52940edd0037f28b953b6c7ba7363de683",
+ "report.md": "5b5c647c0a2e787078910173ef1cb7da47285a0cecf189e7b53f5464ed3bc1ee"
+}
diff --git a/evidence/allen-omega-L694/L756/independent-review/parent-presentation.log b/evidence/allen-omega-L694/L756/independent-review/parent-presentation.log
new file mode 100644
index 00000000..038ad8e4
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/parent-presentation.log
@@ -0,0 +1,23 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
diff --git a/evidence/allen-omega-L694/L756/independent-review/parent-verification.json b/evidence/allen-omega-L694/L756/independent-review/parent-verification.json
new file mode 100644
index 00000000..89a7a954
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/parent-verification.json
@@ -0,0 +1,34 @@
+{
+ "source_closures": [
+ {
+ "pin": "43eae848f0a44604b42378d9ea3170278b5f3f8f",
+ "files": 51,
+ "core_sha256": "f5984ce7290b7853446ca2bc2d192d76dfd13bd90dad2c97c5acfd5720f95ba5"
+ },
+ {
+ "pin": "4c7888f65dca209a1e2b859ba695ae308657c03e",
+ "files": 55,
+ "core_sha256": "65db52e4ec165ae64b71b7a2c68c6263890ecf6fc9cc9f27db68e2374dcfcbf0"
+ }
+ ],
+ "provider_review_checks": {
+ "provider-core.log": 100,
+ "provider-normal.check.log": 292,
+ "provider-fragment.check.log": 292,
+ "provider-boundary-final.log": 26,
+ "provider-semantic-check.log": 38,
+ "provider-partial-write-check-final.log": 83,
+ "short-1.check.log": 5,
+ "short-2.check.log": 5,
+ "short-3.check.log": 5,
+ "short-4.check.log": 5,
+ "short-5.check.log": 5,
+ "short-6.check.log": 17
+ },
+ "presentation_review_checks": 98,
+ "parent_provider_sha256": "c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd",
+ "parent_presentation_sha256": "24285077f8ff55875bac7834cb711f28b116ee11b5dd055fdd12bbfb7756c8aa",
+ "parent_presentation_checks": 23,
+ "report_sha256": "5b5c647c0a2e787078910173ef1cb7da47285a0cecf189e7b53f5464ed3bc1ee",
+ "scope": "Host only; no correctness findings; original raw failures and scope limits retained."
+}
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.exit b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.log b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.log
new file mode 100644
index 00000000..84fd2470
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-builds.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-builds.sha256
new file mode 100644
index 00000000..abef6ce6
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-builds.sha256
@@ -0,0 +1,2 @@
+749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40 /home/drakestapleton/handoffs/L753-review/presentation-build/presentation-test
+24285077f8ff55875bac7834cb711f28b116ee11b5dd055fdd12bbfb7756c8aa /home/drakestapleton/handoffs/L753-review/presentation-build/presentation-independent-test
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-compiler.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-compiler.sha256
new file mode 100644
index 00000000..50e79ea9
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-compiler.sha256
@@ -0,0 +1 @@
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-git.paths b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-git.paths
new file mode 100644
index 00000000..77755a9c
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-git.paths
@@ -0,0 +1,55 @@
+native/omega/allen/application.om
+native/omega/allen/base.om
+native/omega/allen/build-one.sh
+native/omega/allen/code.om
+native/omega/allen/context.om
+native/omega/allen/courier.om
+native/omega/allen/gate.sh
+native/omega/allen/golden.sh
+native/omega/allen/intent.om
+native/omega/allen/main.om
+native/omega/allen/memory.om
+native/omega/allen/paint.om
+native/omega/allen/PRESENTATION.md
+native/omega/allen/presentation.om
+native/omega/allen/provider-core.om
+native/omega/allen/PROVIDER.md
+native/omega/allen/provider.om
+native/omega/allen/README.md
+native/omega/allen/reply.om
+native/omega/allen/runtime.om
+native/omega/allen/scene-input.om
+native/omega/allen/scene.om
+native/omega/allen/scheduler.om
+native/omega/allen/tests/application.om
+native/omega/allen/tests/check.om
+native/omega/allen/tests/code.om
+native/omega/allen/tests/context.om
+native/omega/allen/tests/courier.om
+native/omega/allen/tests/edges.om
+native/omega/allen/tests/fixture.om
+native/omega/allen/tests/golden.om
+native/omega/allen/tests/intent.om
+native/omega/allen/tests/memory.om
+native/omega/allen/tests/paint.om
+native/omega/allen/tests/presentation-mutants.om
+native/omega/allen/tests/presentation.om
+native/omega/allen/tests/probe.om
+native/omega/allen/tests/provider-core.om
+native/omega/allen/tests/provider-input.om
+native/omega/allen/tests/provider-mutants.om
+native/omega/allen/tests/provider-output.om
+native/omega/allen/tests/provider-process.om
+native/omega/allen/tests/render.om
+native/omega/allen/tests/reply.om
+native/omega/allen/tests/runtime.om
+native/omega/allen/tests/scene-input.om
+native/omega/allen/tests/scene.om
+native/omega/allen/tests/scheduler.om
+native/omega/allen/tests/stdio-overflow.om
+native/omega/allen/tests/view.om
+native/omega/allen/vendor/OMEGA-LICENSE
+native/omega/allen/vendor/PROVENANCE.md
+native/omega/allen/vendor/sha256-core.om
+native/omega/allen/vendor/sha256.om
+native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.exit b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.log b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.log
new file mode 100644
index 00000000..038ad8e4
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.log
@@ -0,0 +1,23 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-inputs.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-inputs.sha256
new file mode 100644
index 00000000..2fda5321
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-inputs.sha256
@@ -0,0 +1,21 @@
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/base.om
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/vendor/sha256-core.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/runtime.om
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/courier.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/scheduler.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/memory.om
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/intent.om
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/reply.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/view.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/scene.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/paint.om
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/application.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/scene-input.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/context.om
+330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/provider-core.om
+d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/presentation.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/tests/check.om
+b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/tests/presentation.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/build-one.sh
+ee622283ade68902f510791723276401659d8b71f8e9d9ac63c5feadb5a842d8 /home/drakestapleton/handoffs/L753-review/presentation-build/presentation-independent.om
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-membership.diff b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-membership.diff
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-pins.txt b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-pins.txt
new file mode 100644
index 00000000..c1707f88
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-pins.txt
@@ -0,0 +1,2 @@
+pin=4c7888f65dca209a1e2b859ba695ae308657c03e
+base=43eae848f0a44604b42378d9ea3170278b5f3f8f
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-release.paths b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-release.paths
new file mode 100644
index 00000000..77755a9c
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-release.paths
@@ -0,0 +1,55 @@
+native/omega/allen/application.om
+native/omega/allen/base.om
+native/omega/allen/build-one.sh
+native/omega/allen/code.om
+native/omega/allen/context.om
+native/omega/allen/courier.om
+native/omega/allen/gate.sh
+native/omega/allen/golden.sh
+native/omega/allen/intent.om
+native/omega/allen/main.om
+native/omega/allen/memory.om
+native/omega/allen/paint.om
+native/omega/allen/PRESENTATION.md
+native/omega/allen/presentation.om
+native/omega/allen/provider-core.om
+native/omega/allen/PROVIDER.md
+native/omega/allen/provider.om
+native/omega/allen/README.md
+native/omega/allen/reply.om
+native/omega/allen/runtime.om
+native/omega/allen/scene-input.om
+native/omega/allen/scene.om
+native/omega/allen/scheduler.om
+native/omega/allen/tests/application.om
+native/omega/allen/tests/check.om
+native/omega/allen/tests/code.om
+native/omega/allen/tests/context.om
+native/omega/allen/tests/courier.om
+native/omega/allen/tests/edges.om
+native/omega/allen/tests/fixture.om
+native/omega/allen/tests/golden.om
+native/omega/allen/tests/intent.om
+native/omega/allen/tests/memory.om
+native/omega/allen/tests/paint.om
+native/omega/allen/tests/presentation-mutants.om
+native/omega/allen/tests/presentation.om
+native/omega/allen/tests/probe.om
+native/omega/allen/tests/provider-core.om
+native/omega/allen/tests/provider-input.om
+native/omega/allen/tests/provider-mutants.om
+native/omega/allen/tests/provider-output.om
+native/omega/allen/tests/provider-process.om
+native/omega/allen/tests/render.om
+native/omega/allen/tests/reply.om
+native/omega/allen/tests/runtime.om
+native/omega/allen/tests/scene-input.om
+native/omega/allen/tests/scene.om
+native/omega/allen/tests/scheduler.om
+native/omega/allen/tests/stdio-overflow.om
+native/omega/allen/tests/view.om
+native/omega/allen/vendor/OMEGA-LICENSE
+native/omega/allen/vendor/PROVENANCE.md
+native/omega/allen/vendor/sha256-core.om
+native/omega/allen/vendor/sha256.om
+native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-report.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-report.sha256
new file mode 100644
index 00000000..b4759630
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-report.sha256
@@ -0,0 +1 @@
+5b5c647c0a2e787078910173ef1cb7da47285a0cecf189e7b53f5464ed3bc1ee /home/drakestapleton/handoffs/L753-review/presentation-report.md
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-test.elf.txt b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-test.elf.txt
new file mode 100644
index 00000000..edfa8ba8
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-test.elf.txt
@@ -0,0 +1,30 @@
+ELF Header:
+ Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
+ Class: ELF64
+ Data: 2's complement, little endian
+ Version: 1 (current)
+ OS/ABI: UNIX - System V
+ ABI Version: 0
+ Type: EXEC (Executable file)
+ Machine: AArch64
+ Version: 0x1
+ Entry point address: 0x4000b0
+ Start of program headers: 64 (bytes into file)
+ Start of section headers: 0 (bytes into file)
+ Flags: 0x0
+ Size of this header: 64 (bytes)
+ Size of program headers: 56 (bytes)
+ Number of program headers: 2
+ Size of section headers: 0 (bytes)
+ Number of section headers: 0
+ Section header string table index: 0
+
+Program Headers:
+ Type Offset VirtAddr PhysAddr
+ FileSiz MemSiz Flags Align
+ LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000
+ 0x00000000000163b4 0x00000000000163b4 R E 0x1000
+ LOAD 0x0000000000000000 0x0000000010000000 0x0000000010000000
+ 0x0000000000000000 0x00000000008aa550 RW 0x1000
+
+There is no dynamic section in this file.
diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-unchanged-components.txt b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-unchanged-components.txt
new file mode 100644
index 00000000..0898f52d
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-unchanged-components.txt
@@ -0,0 +1,9 @@
+provider-core.om f76cc2b90b2873e6ca2fc69bdcdb2c18a0db642f
+provider.om afa9bfc5ee8a9aea618bd487f75c19f7bd0c81ad
+application.om 734efeeb803de5e962a8f33e1df54286ea4a30a8
+scene.om 376fd36150c85bd2e9774e8e7a1ef7204911457d
+view.om c221d15800df5edebba013ea50d8d57354898a6d
+code.om 059c85c946b1423c67d236ed5fd00b87378e3986
+scheduler.om a36dda950acb551e347be4af19223bbae92229cb
+context.om 401d4185ee2e13a614c0da788e8b8b64a013fb30
+memory.om 08342ab6636b54dc9870cdd51d0d56266ecf98ae
diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/core.om b/evidence/allen-omega-L694/L756/independent-review/probes/core.om
new file mode 100644
index 00000000..f1bfd2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/probes/core.om
@@ -0,0 +1,3816 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent-test.om b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent-test.om
new file mode 100644
index 00000000..1989fa31
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent-test.om
@@ -0,0 +1,3940 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+fn ptest ok bool to void
+check ok add get Checks 0 1
+end
+fn main to int
+dreset
+for i ulong 2304
+put Dtext i 81
+end
+for i ulong 32768
+put Dcode i 90
+end
+for i ulong 4096
+put Dstart i 1
+put Dlen i 2
+put Dline i 3
+end
+for i ulong 8192
+put Din i 65
+put In i 66
+end
+put Dm 0 1
+put Dm 1 1
+put Dm 2 42
+put Dsay 0 81
+put Dview 0 1
+put Dview 1 2
+put Dview 2 3
+put Ds 0 9
+put Dt 0 8
+put Inlen 0 1
+put A 0 1
+put A 2 0
+put R 8 0
+ptest not dpresent
+ptest eq get Dm 2 42
+ptest eq get Dtext 0 81
+ptest eq get Dcode 0 90
+put A 2 1
+put R 8 160
+ptest not dpresent
+ptest eq get Dtext 0 81
+ptest eq get Dcode 0 90
+put R 8 0
+ptest not dpresent
+ptest eq get Dm 0 1
+ptest eq get Dm 1 1
+ptest eq get Dm 2 42
+ptest eq get Dsay 0 81
+dreset
+ptest eq get Dm 0 0
+ptest eq get Dm 1 0
+ptest eq get Dm 2 0
+ptest eq get Dsay 0 0
+same = true
+for i ulong 3
+if ne get Dview i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 8
+if ne get Ds i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 64
+if ne get Dt i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 2304
+if ne get Dtext i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 32768
+if ne get Dcode i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 4096
+if ne or or get Dstart i get Dlen i get Dline i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 8192
+if ne get Din i 0
+same = false
+end
+end
+ptest same
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent.om b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent.om
new file mode 100644
index 00000000..72084f7d
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent.om
@@ -0,0 +1,107 @@
+fn ptest ok bool to void
+check ok add get Checks 0 1
+end
+fn main to int
+dreset
+for i ulong 2304
+put Dtext i 81
+end
+for i ulong 32768
+put Dcode i 90
+end
+for i ulong 4096
+put Dstart i 1
+put Dlen i 2
+put Dline i 3
+end
+for i ulong 8192
+put Din i 65
+put In i 66
+end
+put Dm 0 1
+put Dm 1 1
+put Dm 2 42
+put Dsay 0 81
+put Dview 0 1
+put Dview 1 2
+put Dview 2 3
+put Ds 0 9
+put Dt 0 8
+put Inlen 0 1
+put A 0 1
+put A 2 0
+put R 8 0
+ptest not dpresent
+ptest eq get Dm 2 42
+ptest eq get Dtext 0 81
+ptest eq get Dcode 0 90
+put A 2 1
+put R 8 160
+ptest not dpresent
+ptest eq get Dtext 0 81
+ptest eq get Dcode 0 90
+put R 8 0
+ptest not dpresent
+ptest eq get Dm 0 1
+ptest eq get Dm 1 1
+ptest eq get Dm 2 42
+ptest eq get Dsay 0 81
+dreset
+ptest eq get Dm 0 0
+ptest eq get Dm 1 0
+ptest eq get Dm 2 0
+ptest eq get Dsay 0 0
+same = true
+for i ulong 3
+if ne get Dview i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 8
+if ne get Ds i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 64
+if ne get Dt i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 2304
+if ne get Dtext i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 32768
+if ne get Dcode i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 4096
+if ne or or get Dstart i get Dlen i get Dline i 0
+same = false
+end
+end
+ptest same
+same = true
+for i ulong 8192
+if ne get Din i 0
+same = false
+end
+end
+ptest same
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/presentation-test.om b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-test.om
new file mode 100644
index 00000000..c8c700af
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-test.om
@@ -0,0 +1,4071 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Prompt1 "hello"
+text Leak "LEAK"
+text Scene1 "SAY 1 1/1 note left: Heading | Body"
+text Hidden1 "private"
+text Badscene "number: nope"
+text Prompt2 "write a calculator"
+text Code2 "CODE 2 1/1 2 d8932aac text hi"
+text Done2 "SAY 2 1/1 Done."
+global Saved uchar 8192
+global Keep ulong 2
+global Before uchar 8192
+global Wire uchar 8192
+fn test ok bool to void
+put Keep 0 get Outlen 0
+put Keep 1 get Err 0
+for i ulong get Outlen 0
+put Saved i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Keep 0
+put Outb i get Saved i
+end
+put Outlen 0 get Keep 0
+put Err 0 get Keep 1
+end
+fn inbound part ulong to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Before i get Outb i
+end
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put In i get Outb i
+end
+put Inlen 0 size
+for i ulong n
+put Outb i get Before i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn main to int
+test not dpresent
+test appinit 77 0
+put Inlen 0 len Prompt1
+for i ulong len Prompt1
+put In i get Prompt1 i
+end
+test dask 1
+test eq get R 0 1
+test eq get Dm 0 0
+test apppoll 1 true
+n = get Outlen 0
+for i ulong n
+put Wire i get Outb i
+end
+for i ulong len Scene1
+put In i get Scene1 i
+end
+put Inlen 0 len Scene1
+inbound 1
+size = get Inlen 0
+for i ulong size
+put Before i get In i
+end
+test drecv 2
+test eq get A 2 1
+test eq get Dm 0 1
+test eq get Dm 2 1
+test eq get Ds 3 1
+test eq get Dt 0 1
+test eq get Dt 1 1
+test eq get Dtext get Dt 7 72
+test eq get Dtext get Dt 8 66
+test eq get Outlen 0 n
+same = true
+for i ulong n
+if ne get Outb i get Wire i
+same = false
+end
+end
+test same
+test eq get T 10 5
+note appreceive replaces In with its payload; only dpresent must preserve that.
+size = get Inlen 0
+for i ulong size
+put Before i get In i
+end
+test dpresent
+test eq get Inlen 0 size
+same = true
+for i ulong size
+if ne get Before i get In i
+same = false
+end
+end
+test same
+note Even bytes outside current Inlen survive decoder scratch expansion.
+for i ulong 8192
+put In i 165
+put Before i 165
+end
+put Inlen 0 1
+test dpresent
+test eq get Inlen 0 1
+same = true
+for i ulong 8192
+if ne get In i get Before i
+same = false
+end
+end
+test same
+put Inlen 0 8193
+test not dpresent
+put Inlen 0 1
+note Hidden or invalid scene text cannot erase the last admitted presentation.
+for i ulong len Hidden1
+put Answer i get Hidden1 i
+end
+put R 8 len Hidden1
+test not dpresent
+test eq get Ds 3 1
+test eq get Dtext get Dt 7 72
+for i ulong len Badscene
+put Answer i get Badscene i
+end
+put R 8 len Badscene
+test not dpresent
+test eq get Ds 3 1
+put A 2 0
+test not dpresent
+put A 2 1
+put R 8 160
+test not dpresent
+put R 8 0
+test not dpresent
+note Refused receive cannot publish a stale event1.
+for i ulong len Leak
+put Answer i get Leak i
+end
+put R 8 len Leak
+put Inlen 0 1
+put In 0 88
+test not drecv 2
+test eq get Ds 3 1
+test appsent 2 true
+test apppoll 2 true
+test appsent 2 true
+put Inlen 0 len Prompt2
+for i ulong len Prompt2
+put In i get Prompt2 i
+end
+test dask 3
+test eq get R 0 2
+test eq get Ds 2 1
+test eq get Dtext get Dsay 0 73
+for i ulong len Code2
+put In i get Code2 i
+end
+put Inlen 0 len Code2
+inbound 1
+test drecv 4
+test eq get Dm 1 0
+test apppoll 4 true
+test appsent 4 true
+for i ulong len Done2
+put In i get Done2 i
+end
+put Inlen 0 len Done2
+inbound 2
+test drecv 5
+test eq get Dm 1 1
+test eq get Dm 2 2
+test eq get Dview 0 1
+test eq get Dview 1 0
+test eq get Dview 2 2
+test eq get Dstart 0 0
+test eq get Dlen 0 2
+test eq get Dline 0 1
+test eq get Dcode 0 104
+test eq get Dcode 1 105
+test eq get Dtext get Dsay 0 68
+note Code completion does not require a nonempty closing sentence.
+put R 8 0
+test dpresent
+test eq get Dm 1 1
+test eq get Dcode 0 104
+put Code 0 88
+test not dpresent
+test eq get Dcode 0 104
+test eq get Dlen 0 2
+put Code 0 104
+note Later assembly may reuse Code; the displayed snapshot cannot alias it.
+codebeg 3
+put Code 0 88
+test eq get Dcode 0 104
+put A 2 0
+test not dpresent
+test eq get Dm 1 1
+put Dtext 2303 88
+put Dcode 32767 88
+put Dstart 4095 88
+put Dlen 4095 88
+put Dline 4095 88
+dreset
+test eq get Dm 0 0
+test eq get Dm 1 0
+test eq get Dview 0 0
+test eq get R 0 2
+test eq get Q 1 2
+same = true
+for i ulong 2304
+if ne get Dtext i 0
+same = false
+end
+end
+test same
+same = true
+for i ulong 32768
+if ne get Dcode i 0
+same = false
+end
+end
+test same
+same = true
+for i ulong 4096
+if ne or or get Dstart i get Dlen i get Dline i 0
+same = false
+end
+end
+test same
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L756/independent-review/report.md b/evidence/allen-omega-L694/L756/independent-review/report.md
new file mode 100644
index 00000000..ade803ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/independent-review/report.md
@@ -0,0 +1,27 @@
+# L753 additive presentation review — exact 4c7888f
+
+**Verdict:** No correctness finding in the presentation-wrapper/snapshot addition at `4c7888f65dca209a1e2b859ba695ae308657c03e`. This report is separate from the original exact-`43eae848` provider report. It reviews the additive Omega wrapper and its small gate/docs integration; it is not renderer, device, or live-transport qualification.
+
+## Exact pin and source closure
+
+- Exact pin: `4c7888f65dca209a1e2b859ba695ae308657c03e`; base: `43eae848f0a44604b42378d9ea3170278b5f3f8f`.
+- Exported with `git archive` to `~/handoffs/L753-review/presentation-source/`. The L756 manifest has 55 `native/omega/allen` paths, exact membership with the pin's tracked paths; each recorded hash matches `git show :`.
+- Verified unchanged Git blob identities between the two pins for `provider-core.om`, `provider.om`, `application.om`, `scene.om`, `view.om`, `code.om`, `scheduler.om`, `context.om`, and `memory.om`; identities are retained in `presentation-raw-unchanged-components.txt`. The production change is limited to `PRESENTATION.md`, README/gate additions, `presentation.om`, and its two seeded-Omega tests/mutant builder.
+- Pinned compiler SHA-256 remains `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. `presentation-test` is a nonempty static AArch64 ELF EXEC and its SHA-256 `749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40` matches the L756 source summary's presentation binary identity.
+
+## Findings
+
+None. `dask`/`drecv` preserve the application admission result and project only after success; `dpresent` checks the accepted event before reading Answer/R/A. The scene path snapshots/restores all `In` bytes and `Inlen` around decoder scratch use; invalid or hidden scenes do not replace the prior scene. Completed code and row layout are copied into separate bounded snapshots, so later `Code` assembly cannot alias the displayed completion. `dreset` clears the retained presentation arrays and metadata while preserving the underlying application reset-counter contract. The provider entry intentionally does not call these wrappers.
+
+## Focused independent replay
+
+- Rebuilt the exact-pinned presentation module and committed Omega integration test from the archived source with `build-one.sh`; **75 assertions, exit 0**. This reproduced the exact binary hash recorded by L756.
+- Added a separate handwritten Omega probe for stale/non-event publication refusal, invalid/empty projection preserving retained snapshots, and full retained-buffer reset; **23 assertions, exit 0**.
+- Total for this additive scope: **98 passing assertions**. No L756 full gate or 17-mutant set was rerun; I inspected its exact-pin summary/README receipts (2289 total assertions, 17 compiled-rejected mutants) and confined independent execution to the presentation addition.
+- Input hashes are in `presentation-raw-inputs.sha256`; executable hashes in `presentation-raw-builds.sha256`; ELF evidence in `presentation-raw-test.elf.txt`; assertion logs/statuses in `presentation-raw-baseline.log`, `presentation-raw-baseline.exit`, `presentation-raw-independent.log`, and `presentation-raw-independent.exit`. The Omega source for the new probe is `presentation-build/presentation-independent.om`.
+
+## Limits
+
+- These tests exercise the native application-to-presentation state binding only. They do not render pixels, use a display device, prove multiline scene transport, exercise a live model/provider, or qualify iMac/device behavior.
+- L756’s own scope says the provider stream remains unchanged and does not call the wrappers; this review makes no claim that production callers have integrated or deployed them.
+- The original provider review remains at `~/handoffs/L753-review/report.md` with its own exact-`43eae848` scope and receipts. No production files were modified and no ledger item was closed.
diff --git a/evidence/allen-omega-L694/L756/inputtail-mutant.log b/evidence/allen-omega-L694/L756/inputtail-mutant.log
new file mode 100644
index 00000000..c0415908
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/inputtail-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 1
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L756/intent.log b/evidence/allen-omega-L694/L756/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L756/inventory.json b/evidence/allen-omega-L694/L756/inventory.json
new file mode 100644
index 00000000..c1ceaa25
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/inventory.json
@@ -0,0 +1,73 @@
+{
+ "README.md": "3af85f455088feee54893867df2061923d2b85872c90b4281c8ce268112fffb6",
+ "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433",
+ "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1",
+ "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a",
+ "autosent-mutant.log": "fd09242df722583c7e04568d177eed33aeec3b4fbc67f8d1cba666941a81bf08",
+ "binaries.sha256": "ea7e21652f6f405049a8b29d0bfaf4d80ace81e7d6e1ee9b699adfe1d4f08a0a",
+ "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390",
+ "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0",
+ "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b",
+ "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5",
+ "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1",
+ "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835",
+ "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed",
+ "framecheck-mutant.log": "80857ef43f4767086a5154d915825e2d9ab8e1dacf7382cd9cec20a6c9e945eb",
+ "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "full.log": "316629efd55843b4facbe993fef0930bf14a0ad1fbf7da992d6bd19369abeded",
+ "green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "green.log": "f2a7a54115f2652ea4547486f56911b780a44157dceac220fa01ada10071d0b0",
+ "green2.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "green2.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7",
+ "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e",
+ "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67",
+ "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345",
+ "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e",
+ "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508",
+ "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15",
+ "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a",
+ "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657",
+ "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7",
+ "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4",
+ "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b",
+ "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05",
+ "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a",
+ "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646",
+ "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435",
+ "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b",
+ "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04",
+ "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9",
+ "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61",
+ "red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "red.log": "77315e876d465fff4e3328337c194f4bb6622dc187248f55366a72a1b8c4960f",
+ "red.om": "66faf4500c325c0e5509ef205838c01d202f222f37dbae3b8a465fba12058b8b",
+ "red2.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "red2.log": "6921c98a35fc5835daf3b8fcb54490b1874985a280d2b089bc82cf48c987d0bc",
+ "red2.om": "9a5159c3f7b7bab69b66e54da2e9fcec4a7a4df0350d7d67eef97c4026fbc85e",
+ "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162",
+ "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51",
+ "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9",
+ "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8",
+ "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d",
+ "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948",
+ "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2",
+ "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2",
+ "source.sha256": "e526a6e9693b501237f22e38fc626f1492f868bf79fe73c8645299f6ebebb7e3",
+ "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b",
+ "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b",
+ "summary.json": "1e4d6ad6014bc880c49d6e5bccaf76b3b04db09c294536a25cca9b56c5ca713e",
+ "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474",
+ "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e"
+}
diff --git a/evidence/allen-omega-L694/L756/keepalive-mutant.log b/evidence/allen-omega-L694/L756/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L756/long.log b/evidence/allen-omega-L694/L756/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L756/memory.log b/evidence/allen-omega-L694/L756/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L756/paint.log b/evidence/allen-omega-L694/L756/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L756/pendingwire-mutant.log b/evidence/allen-omega-L694/L756/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L756/presentation.log b/evidence/allen-omega-L694/L756/presentation.log
new file mode 100644
index 00000000..84fd2470
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/presentation.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-1.log b/evidence/allen-omega-L694/L756/provider-bad-1.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-1.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-1.receipt b/evidence/allen-omega-L694/L756/provider-bad-1.receipt
new file mode 100644
index 00000000..2b29860a
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-1.receipt
@@ -0,0 +1,4 @@
+1
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-2.log b/evidence/allen-omega-L694/L756/provider-bad-2.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-2.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-2.receipt b/evidence/allen-omega-L694/L756/provider-bad-2.receipt
new file mode 100644
index 00000000..9ba12cca
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-2.receipt
@@ -0,0 +1,4 @@
+2
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-3.log b/evidence/allen-omega-L694/L756/provider-bad-3.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-3.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-3.receipt b/evidence/allen-omega-L694/L756/provider-bad-3.receipt
new file mode 100644
index 00000000..199cc204
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-3.receipt
@@ -0,0 +1,4 @@
+3
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-4.log b/evidence/allen-omega-L694/L756/provider-bad-4.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-4.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-4.receipt b/evidence/allen-omega-L694/L756/provider-bad-4.receipt
new file mode 100644
index 00000000..26a81c4a
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-4.receipt
@@ -0,0 +1,4 @@
+4
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-5.log b/evidence/allen-omega-L694/L756/provider-bad-5.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-5.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-5.receipt b/evidence/allen-omega-L694/L756/provider-bad-5.receipt
new file mode 100644
index 00000000..d79f5995
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-5.receipt
@@ -0,0 +1,4 @@
+5
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-6.log b/evidence/allen-omega-L694/L756/provider-bad-6.log
new file mode 100644
index 00000000..3f9cc45d
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-bad-6.log
@@ -0,0 +1,17 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
diff --git a/evidence/allen-omega-L694/L756/provider-bad-6.receipt b/evidence/allen-omega-L694/L756/provider-bad-6.receipt
new file mode 100644
index 00000000..d0b7cd17
Binary files /dev/null and b/evidence/allen-omega-L694/L756/provider-bad-6.receipt differ
diff --git a/evidence/allen-omega-L694/L756/provider-consumer.log b/evidence/allen-omega-L694/L756/provider-consumer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-consumer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L756/provider-consumer.receipt b/evidence/allen-omega-L694/L756/provider-consumer.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L756/provider-consumer.receipt differ
diff --git a/evidence/allen-omega-L694/L756/provider-core.log b/evidence/allen-omega-L694/L756/provider-core.log
new file mode 100644
index 00000000..88d1b135
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-core.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L756/provider-fragment.log b/evidence/allen-omega-L694/L756/provider-fragment.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-fragment.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L756/provider-process.log b/evidence/allen-omega-L694/L756/provider-process.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-process.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L756/provider-process.receipt b/evidence/allen-omega-L694/L756/provider-process.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L756/provider-process.receipt differ
diff --git a/evidence/allen-omega-L694/L756/provider-producer.log b/evidence/allen-omega-L694/L756/provider-producer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-producer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L756/provider-producer.receipt b/evidence/allen-omega-L694/L756/provider-producer.receipt
new file mode 100644
index 00000000..0967800c
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-producer.receipt
@@ -0,0 +1,4 @@
+7
+0
+0
+0
diff --git a/evidence/allen-omega-L694/L756/provider-stream.log b/evidence/allen-omega-L694/L756/provider-stream.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/provider-stream.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L756/readback-mutant.log b/evidence/allen-omega-L694/L756/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L756/red.exit b/evidence/allen-omega-L694/L756/red.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/red.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L756/red.log b/evidence/allen-omega-L694/L756/red.log
new file mode 100644
index 00000000..7b4863e4
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/red.log
@@ -0,0 +1,65 @@
+1 0
+2 0
+3 1
+4 1
+5 0
+6 0
+7 1
+8 1
+9 1
+10 1
+11 1
+12 1
+13 1
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 0
+21 0
+22 0
+23 1
+24 1
+25 0
+26 1
+27 0
+28 0
+29 0
+30 0
+31 1
+32 0
+33 1
+34 1
+35 1
+36 1
+37 1
+38 1
+39 1
+40 0
+41 1
+42 1
+43 1
+44 1
+45 1
+46 1
+47 0
+48 1
+49 0
+50 1
+51 1
+52 1
+53 1
+54 1
+55 1
+56 0
+57 1
+58 0
+59 0
+60 0
+61 1
+62 1
+63 1
+64 1
+65 1
diff --git a/evidence/allen-omega-L694/L756/red.om b/evidence/allen-omega-L694/L756/red.om
new file mode 100644
index 00000000..d47cdd71
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/red.om
@@ -0,0 +1,3927 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dpresent to bool
+ret false
+end
+fn dask now ulong to bool
+ret false
+end
+fn drecv now ulong to bool
+ret false
+end
+fn dreset to void
+ret
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Prompt1 "hello"
+text Scene1 "SAY 1 1/1 note left: Heading | Body"
+text Hidden1 "private"
+text Badscene "number: nope"
+text Prompt2 "write a calculator"
+text Code2 "CODE 2 1/1 2 d8932aac text hi"
+text Done2 "SAY 2 1/1 Done."
+global Saved uchar 8192
+global Keep ulong 2
+global Before uchar 8192
+global Wire uchar 8192
+fn test ok bool to void
+put Keep 0 get Outlen 0
+put Keep 1 get Err 0
+for i ulong get Outlen 0
+put Saved i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Keep 0
+put Outb i get Saved i
+end
+put Outlen 0 get Keep 0
+put Err 0 get Keep 1
+end
+fn inbound part ulong to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Before i get Outb i
+end
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put In i get Outb i
+end
+put Inlen 0 size
+for i ulong n
+put Outb i get Before i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn main to int
+test not dpresent
+test appinit 77 0
+put Inlen 0 len Prompt1
+for i ulong len Prompt1
+put In i get Prompt1 i
+end
+test dask 1
+test eq get R 0 1
+test eq get Dm 0 0
+test apppoll 1 true
+n = get Outlen 0
+for i ulong n
+put Wire i get Outb i
+end
+for i ulong len Scene1
+put In i get Scene1 i
+end
+put Inlen 0 len Scene1
+inbound 1
+size = get Inlen 0
+for i ulong size
+put Before i get In i
+end
+test drecv 2
+test eq get A 2 1
+test eq get Dm 0 1
+test eq get Dm 2 1
+test eq get Ds 3 1
+test eq get Dt 0 1
+test eq get Dt 1 1
+test eq get Dtext get Dt 7 72
+test eq get Dtext get Dt 8 66
+test eq get Outlen 0 n
+same = true
+for i ulong n
+if ne get Outb i get Wire i
+same = false
+end
+end
+test same
+test eq get T 10 5
+note appreceive replaces In with its payload; only dpresent must preserve that.
+size = get Inlen 0
+for i ulong size
+put Before i get In i
+end
+test dpresent
+test eq get Inlen 0 size
+same = true
+for i ulong size
+if ne get Before i get In i
+same = false
+end
+end
+test same
+note Hidden or invalid scene text cannot erase the last admitted presentation.
+for i ulong len Hidden1
+put Answer i get Hidden1 i
+end
+put R 8 len Hidden1
+test not dpresent
+test eq get Ds 3 1
+test eq get Dtext get Dt 7 72
+for i ulong len Badscene
+put Answer i get Badscene i
+end
+put R 8 len Badscene
+test not dpresent
+test eq get Ds 3 1
+put A 2 0
+test not dpresent
+put A 2 1
+put R 8 160
+test not dpresent
+put R 8 0
+test not dpresent
+note Refused receive cannot publish a stale event1.
+put Inlen 0 1
+put In 0 88
+test not drecv 2
+test eq get Ds 3 1
+test appsent 2 true
+test apppoll 2 true
+test appsent 2 true
+put Inlen 0 len Prompt2
+for i ulong len Prompt2
+put In i get Prompt2 i
+end
+test dask 3
+test eq get R 0 2
+test eq get Ds 2 1
+test eq get Dtext get Dsay 0 73
+for i ulong len Code2
+put In i get Code2 i
+end
+put Inlen 0 len Code2
+inbound 1
+test drecv 4
+test eq get Dm 1 0
+test apppoll 4 true
+test appsent 4 true
+for i ulong len Done2
+put In i get Done2 i
+end
+put Inlen 0 len Done2
+inbound 2
+test drecv 5
+test eq get Dm 1 1
+test eq get Dm 2 2
+test eq get Dview 0 1
+test eq get Dview 1 0
+test eq get Dview 2 2
+test eq get Dstart 0 0
+test eq get Dlen 0 2
+test eq get Dline 0 1
+test eq get Dcode 0 104
+test eq get Dcode 1 105
+test eq get Dtext get Dsay 0 68
+note Later assembly may reuse Code; the displayed snapshot cannot alias it.
+codebeg 3
+put Code 0 88
+test eq get Dcode 0 104
+put A 2 0
+test not dpresent
+test eq get Dm 1 1
+put Dtext 2303 88
+put Dcode 32767 88
+put Dstart 4095 88
+put Dlen 4095 88
+put Dline 4095 88
+dreset
+test eq get Dm 0 0
+test eq get Dm 1 0
+test eq get Dview 0 0
+test eq get R 0 2
+test eq get Q 1 2
+same = true
+for i ulong 2304
+if ne get Dtext i 0
+same = false
+end
+end
+test same
+same = true
+for i ulong 32768
+if ne get Dcode i 0
+same = false
+end
+end
+test same
+same = true
+for i ulong 4096
+if ne or or get Dstart i get Dlen i get Dline i 0
+same = false
+end
+end
+test same
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L756/red2.exit b/evidence/allen-omega-L694/L756/red2.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/red2.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L756/red2.log b/evidence/allen-omega-L694/L756/red2.log
new file mode 100644
index 00000000..c6cb8075
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/red2.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 1
+4 1
+5 0
+6 0
+7 1
+8 1
+9 1
+10 1
+11 1
+12 1
+13 1
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 0
+21 0
+22 1
+23 0
+24 0
+25 0
+26 0
+27 1
+28 1
+29 0
+30 1
+31 0
+32 0
+33 0
+34 0
+35 1
+36 0
+37 1
+38 1
+39 1
+40 1
+41 1
+42 1
+43 1
+44 0
+45 1
+46 1
+47 1
+48 1
+49 1
+50 1
+51 0
+52 1
+53 0
+54 1
+55 1
+56 1
+57 1
+58 1
+59 1
+60 1
+61 1
+62 0
+63 1
+64 1
+65 1
+66 0
+67 1
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 1
diff --git a/evidence/allen-omega-L694/L756/red2.om b/evidence/allen-omega-L694/L756/red2.om
new file mode 100644
index 00000000..8da83552
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/red2.om
@@ -0,0 +1,3960 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dpresent to bool
+ret false
+end
+fn dask now ulong to bool
+ret false
+end
+fn drecv now ulong to bool
+ret false
+end
+fn dreset to void
+ret
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Prompt1 "hello"
+text Leak "LEAK"
+text Scene1 "SAY 1 1/1 note left: Heading | Body"
+text Hidden1 "private"
+text Badscene "number: nope"
+text Prompt2 "write a calculator"
+text Code2 "CODE 2 1/1 2 d8932aac text hi"
+text Done2 "SAY 2 1/1 Done."
+global Saved uchar 8192
+global Keep ulong 2
+global Before uchar 8192
+global Wire uchar 8192
+fn test ok bool to void
+put Keep 0 get Outlen 0
+put Keep 1 get Err 0
+for i ulong get Outlen 0
+put Saved i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Keep 0
+put Outb i get Saved i
+end
+put Outlen 0 get Keep 0
+put Err 0 get Keep 1
+end
+fn inbound part ulong to void
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Before i get Outb i
+end
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put In i get Outb i
+end
+put Inlen 0 size
+for i ulong n
+put Outb i get Before i
+end
+put Outlen 0 n
+put Err 0 e
+end
+fn main to int
+test not dpresent
+test appinit 77 0
+put Inlen 0 len Prompt1
+for i ulong len Prompt1
+put In i get Prompt1 i
+end
+test dask 1
+test eq get R 0 1
+test eq get Dm 0 0
+test apppoll 1 true
+n = get Outlen 0
+for i ulong n
+put Wire i get Outb i
+end
+for i ulong len Scene1
+put In i get Scene1 i
+end
+put Inlen 0 len Scene1
+inbound 1
+size = get Inlen 0
+for i ulong size
+put Before i get In i
+end
+test drecv 2
+test eq get A 2 1
+test eq get Dm 0 1
+test eq get Dm 2 1
+test eq get Ds 3 1
+test eq get Dt 0 1
+test eq get Dt 1 1
+test eq get Dtext get Dt 7 72
+test eq get Dtext get Dt 8 66
+test eq get Outlen 0 n
+same = true
+for i ulong n
+if ne get Outb i get Wire i
+same = false
+end
+end
+test same
+test eq get T 10 5
+note appreceive replaces In with its payload; only dpresent must preserve that.
+size = get Inlen 0
+for i ulong size
+put Before i get In i
+end
+test dpresent
+test eq get Inlen 0 size
+same = true
+for i ulong size
+if ne get Before i get In i
+same = false
+end
+end
+test same
+note Even bytes outside current Inlen survive decoder scratch expansion.
+for i ulong 8192
+put In i 165
+put Before i 165
+end
+put Inlen 0 1
+test dpresent
+test eq get Inlen 0 1
+same = true
+for i ulong 8192
+if ne get In i get Before i
+same = false
+end
+end
+test same
+put Inlen 0 8193
+test not dpresent
+put Inlen 0 1
+note Hidden or invalid scene text cannot erase the last admitted presentation.
+for i ulong len Hidden1
+put Answer i get Hidden1 i
+end
+put R 8 len Hidden1
+test not dpresent
+test eq get Ds 3 1
+test eq get Dtext get Dt 7 72
+for i ulong len Badscene
+put Answer i get Badscene i
+end
+put R 8 len Badscene
+test not dpresent
+test eq get Ds 3 1
+put A 2 0
+test not dpresent
+put A 2 1
+put R 8 160
+test not dpresent
+put R 8 0
+test not dpresent
+note Refused receive cannot publish a stale event1.
+for i ulong len Leak
+put Answer i get Leak i
+end
+put R 8 len Leak
+put Inlen 0 1
+put In 0 88
+test not drecv 2
+test eq get Ds 3 1
+test appsent 2 true
+test apppoll 2 true
+test appsent 2 true
+put Inlen 0 len Prompt2
+for i ulong len Prompt2
+put In i get Prompt2 i
+end
+test dask 3
+test eq get R 0 2
+test eq get Ds 2 1
+test eq get Dtext get Dsay 0 73
+for i ulong len Code2
+put In i get Code2 i
+end
+put Inlen 0 len Code2
+inbound 1
+test drecv 4
+test eq get Dm 1 0
+test apppoll 4 true
+test appsent 4 true
+for i ulong len Done2
+put In i get Done2 i
+end
+put Inlen 0 len Done2
+inbound 2
+test drecv 5
+test eq get Dm 1 1
+test eq get Dm 2 2
+test eq get Dview 0 1
+test eq get Dview 1 0
+test eq get Dview 2 2
+test eq get Dstart 0 0
+test eq get Dlen 0 2
+test eq get Dline 0 1
+test eq get Dcode 0 104
+test eq get Dcode 1 105
+test eq get Dtext get Dsay 0 68
+note Code completion does not require a nonempty closing sentence.
+put R 8 0
+test dpresent
+test eq get Dm 1 1
+test eq get Dcode 0 104
+put Code 0 88
+test not dpresent
+test eq get Dcode 0 104
+test eq get Dlen 0 2
+put Code 0 104
+note Later assembly may reuse Code; the displayed snapshot cannot alias it.
+codebeg 3
+put Code 0 88
+test eq get Dcode 0 104
+put A 2 0
+test not dpresent
+test eq get Dm 1 1
+put Dtext 2303 88
+put Dcode 32767 88
+put Dstart 4095 88
+put Dlen 4095 88
+put Dline 4095 88
+dreset
+test eq get Dm 0 0
+test eq get Dm 1 0
+test eq get Dview 0 0
+test eq get R 0 2
+test eq get Q 1 2
+same = true
+for i ulong 2304
+if ne get Dtext i 0
+same = false
+end
+end
+test same
+same = true
+for i ulong 32768
+if ne get Dcode i 0
+same = false
+end
+end
+test same
+same = true
+for i ulong 4096
+if ne or or get Dstart i get Dlen i get Dline i 0
+same = false
+end
+end
+test same
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L756/reply.log b/evidence/allen-omega-L694/L756/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L756/runtime.log b/evidence/allen-omega-L694/L756/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L756/scene-input.log b/evidence/allen-omega-L694/L756/scene-input.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/scene-input.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L756/scene.log b/evidence/allen-omega-L694/L756/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L756/scenecap-mutant.log b/evidence/allen-omega-L694/L756/scenecap-mutant.log
new file mode 100644
index 00000000..502843ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/scenecap-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L756/scheduler.log b/evidence/allen-omega-L694/L756/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L756/session-mutant.log b/evidence/allen-omega-L694/L756/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L756/short.log b/evidence/allen-omega-L694/L756/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L756/source.sha256 b/evidence/allen-omega-L694/L756/source.sha256
new file mode 100644
index 00000000..5b5bc9f7
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/source.sha256
@@ -0,0 +1,55 @@
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+cd39998b357096c5e628c40e6ffc53cb3674d78b6307e1e9a0b901ebaabd292f native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md
+d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om
+330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om
+258b9c1f6a7447540c9a8b8cbf2176165ab3e5d80e9528e0b06c37ea745490c1 native/omega/allen/PROVIDER.md
+ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om
+068a3b978c1e79a6ded18696d6fb034f52b90e16a676ce180a8cd260d4c66a2f native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om
+b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe native/omega/allen/tests/provider-core.om
+b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om
+37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om
+d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om
+8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L756/stale-mutant.log b/evidence/allen-omega-L694/L756/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L756/staleview-mutant.log b/evidence/allen-omega-L694/L756/staleview-mutant.log
new file mode 100644
index 00000000..c0c96c65
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/staleview-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 1
+35 1
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L756/summary.json b/evidence/allen-omega-L694/L756/summary.json
new file mode 100644
index 00000000..887a8640
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/summary.json
@@ -0,0 +1,57 @@
+{
+ "base": "43eae848f0a44604b42378d9ea3170278b5f3f8f",
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "provider-core": 100,
+ "memory": 79,
+ "context": 142,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "scene-input": 63,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292,
+ "provider-stream": 292,
+ "provider-fragment": 292,
+ "provider-process": 3,
+ "provider-consumer": 3,
+ "provider-producer": 3,
+ "provider-bad-1": 5,
+ "provider-bad-2": 5,
+ "provider-bad-3": 5,
+ "provider-bad-4": 5,
+ "provider-bad-5": 5,
+ "provider-bad-6": 17,
+ "presentation": 75
+ },
+ "total_checks": 2289,
+ "compiled_rejected_mutants": {
+ "inputtail-mutant": 1,
+ "session-mutant": 1,
+ "appcode-mutant": 3,
+ "contextjob-mutant": 36,
+ "readback-mutant": 7,
+ "staleview-mutant": 2,
+ "hash-mutant": 2,
+ "contextnote-mutant": 5,
+ "autosent-mutant": 8,
+ "thinking-mutant": 6,
+ "pendingwire-mutant": 1,
+ "scenecap-mutant": 3,
+ "crc-mutant": 2,
+ "ackstop-mutant": 27,
+ "stale-mutant": 3,
+ "framecheck-mutant": 4,
+ "keepalive-mutant": 40
+ },
+ "presentation_binary_sha256": "749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40",
+ "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9",
+ "scope": "Host application-to-scene/code snapshots; raw provider entry unchanged; pixel renderer/display/live/hardware NOT_RUN"
+}
diff --git a/evidence/allen-omega-L694/L756/thinking-mutant.log b/evidence/allen-omega-L694/L756/thinking-mutant.log
new file mode 100644
index 00000000..74b41a12
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/thinking-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L756/view.log b/evidence/allen-omega-L694/L756/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L756/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L758/README.md b/evidence/allen-omega-L694/L758/README.md
new file mode 100644
index 00000000..c5c94d9f
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/README.md
@@ -0,0 +1,31 @@
+# L758 handwritten native Allen font
+
+font.om implements integer geometry, segment generation and antialiased masks in
+seeded Omega. font-data.om retains the existing95 printable ASCII designs and91
+sine samples; the collector checked exact declarative transcription. No compiler,
+translator or foreign runtime constructs or executes the Omega font.
+
+The native combined gate passed. summary.json counts actual test rows and compiled
+behavioral mutant failures.294 native glyph records, including3 size/weight pairs
+and unsupported-byte fallback cases, match436341 frozen external-oracle bytes.
+The oracle was the unmodified legacy allen_font.c compiled into a separate host
+shared library only for reference collection. Its source hash, command and output
+hash are in oracle.json; collection script is retained as external reference text.
+The native gate consumes those frozen bytes, not C/Python font execution.
+
+Reproduce: `quiet-build native/omega/allen/gate.sh /absolute/fresh/private/output`.
+This builds font-output and font-render with the pinned seed. The final native
+specimen was visually inspected: all printable characters recognizable and no
+obvious clipping. PNG is lossless format conversion of the actual Omega PPM;
+there is no generated imagery, font substitution or invented star field.
+
+Preserved development failures: weight parameter collided with existing weight
+function; register-budget expressions were split into helpers without loosening
+assertions. The initial oracle stream stopped after its64-byte space record with
+exit105: negative long->ulong conversion is checked, not a bitcast. Output encoding
+now explicitly forms two-complement fields via complement of magnitude-minus-one.
+The old stream/source are retained as native-font.bin and output.om; corrected
+native output matches the frozen oracle exactly. RED4/RED5 are meaningful stub
+failures, separate from compiler setup errors. New tests use fixed nonzero failure
+status. This does not implement scene layout, animation, framebuffer drivers,
+live model/device interfaces or physical iMac execution. Font review is pending.
diff --git a/evidence/allen-omega-L694/L758/ackstop-mutant.log b/evidence/allen-omega-L694/L758/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L758/appcode-mutant.log b/evidence/allen-omega-L694/L758/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L758/application.log b/evidence/allen-omega-L694/L758/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L758/autosent-mutant.log b/evidence/allen-omega-L694/L758/autosent-mutant.log
new file mode 100644
index 00000000..2aed7f8a
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/autosent-mutant.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 1
+48 0
+49 0
+50 1
+51 1
+52 0
+53 1
+54 0
+55 1
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 1
+70 0
+71 0
+72 0
+73 0
+74 1
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L758/binaries.sha256 b/evidence/allen-omega-L694/L758/binaries.sha256
new file mode 100644
index 00000000..41244974
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/binaries.sha256
@@ -0,0 +1,50 @@
+7329673aba95f27f3461a39a44a40ac08b1323c359a4e7c2ee37edb3c2fab80d /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-core
+2a098c5dd21eb61aa1d90928db1513e38b5c7fa6fcb0aa0b56e4d21d784c0228 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scheduler
+878c8f24c1fadc7e24e0cf80552a05636afe46561c619744e77abed4b06e7f10 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/readback-mutant
+f6f332f8578a9b586dd33d21d64096e5240b5bfb7bfd1a8a56eeb3a73e33257e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font-render
+10ffbc3d3a5790c520b98a4439e8be8dd2a025fca7399ab40cae795a3234448c /home/drakestapleton/handoffs/allen-omega-L694/L758/full/view
+dfb84d98ad2d5ac9e001cddaaeec549bc89407410eb47895a659dd3bceca139d /home/drakestapleton/handoffs/allen-omega-L694/L758/full/contextnote-mutant
+71043853f991d69e84e32edefb3063a1276e7c7c4517ca712f8bdf0aa03c9eac /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font
+bca049b7bd4c09752c3c024908154e48f7deb6c9b1341204491c67bcf223c622 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/allen
+837b3ea1d2cf1494d924802c461ade7e323156cd509bd6215250cd39e87d7415 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/reply
+881b4d359aa2e24c2d26b6acc2c3c8f7ce75dc11943138ea0a51489014e12d0e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/thinking-mutant
+6030b378595b43558ef3a4e0c00f3fe8a73776172c5f65f450c858bfae58dc21 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/inputtail-mutant
+a3959f13a3fea28a6f5dbe9555c7d80bdc3e0245cf0dcb298bb4404b28c657f2 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/ackstop-mutant
+8140c7533f9aaa5d4832260c7aee7249303ac5f82102f0f01a42bb2fd6615876 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/hash-mutant
+df4e5cdc23d2153b3ebb65d1830e7f472b191bb1f88ee357e02f022d9090884e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/golden
+0efc3f7805910f6cfa3710a5def58d37bc93c9eff20e670e60ca569c556096d3 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/session-mutant
+ad752b259a96dbad15c0c40bbac38c2c30d555ed1d4940cb688a04ad0699bbe8 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scene-input
+c6cecd5fcd2ffd79da7319116cc92e4ab3d09cb511c3a3e9db15b60a6d495bde /home/drakestapleton/handoffs/allen-omega-L694/L758/full/intent
+9134b9f6e337374d7ea78c2fe0585cae2e9a4d6a415b3fd84289d4fdbce68611 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-input
+34c901cfb34adcbba1212045f9209a5fb3f385b9011c116be8bf8be9ed173f41 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font-mutants
+1aa9709b2c362b714671c11aa4c3e266129d93cd0ab10513cf1797c14e2c5cf4 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/fixture
+c0ce92c97f1ebb29e7505057c3adb3dac817a1929d2a460576b76a2964586bb4 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider
+32ce3036c67adc963120c2050f9303d55d4418a6a2aedb2916104a4a7ac97290 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/context
+f24f15cdb086fae0fa03edd76830844421a75c1b7153e6dad9c7fd384e6e09a9 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/staleview-mutant
+4502b918d86d4f143b5055092a1a761bfa416b8c621bd2ae31e989984ae30779 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/runtime
+0380c6c510bb299a9163c0d87d0a5e139190535ff3fa91f56218b6213cc8af35 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/code
+52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-mutants
+e77f29c8d8f37d7bef65e01bd63587395f9aef75f4f3afde4d4fca8f423dc299 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/edges
+a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/presentation-mutants
+684eafb9429e7535130762bda579d408a11a0d0a97c6aedaebde20a191ed048d /home/drakestapleton/handoffs/allen-omega-L694/L758/full/appcode-mutant
+c1b9e8fc825891855f0c0e6ab88456279f944fa92a0a0d273316db80fb3eb24c /home/drakestapleton/handoffs/allen-omega-L694/L758/full/render
+63faf7ed9384ca227c0528f95301b79f52e3858583fc19e4bf03cb79de23aaff /home/drakestapleton/handoffs/allen-omega-L694/L758/full/stale-mutant
+64dd677c0e22e2a28e76ce4e96d78444eb494f1807307d3608aa18a914c3650f /home/drakestapleton/handoffs/allen-omega-L694/L758/full/courier
+f5f191eb6dec5ae630451fa6e74c4e708812073b5910cd3e648c0dba0f2d18f8 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scene
+0ebbaf039756ad1b1bb065ac6c4ef33bc1f3864dcb529154153536006e51e978 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/presentation
+60b944dc113979199146253103407910bd1b1ea49d3906eb2fc657041ac587c5 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/pendingwire-mutant
+31cf1b10ed7d15b848954abf55253287d769937efe21c38f81defa9488027697 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font-output
+7cd0be2c811ee6a0596401f35d65e3658d2175c642742523e8104430d4f2a08e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/framecheck-mutant
+295e36a5fc5c21f1e62b21ae5538a9482e26f86633b20e0842314ea7f33e9ac6 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scenecap-mutant
+8482fb8686b5e55a338f3cc07d806924fe2d3ff4c1566e6730b713b57b06bd2a /home/drakestapleton/handoffs/allen-omega-L694/L758/full/fontroot-mutant
+60b9826dd3e7ef145cb015be7a49bec6e38313da8c03f885262b465e46d11742 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/contextjob-mutant
+2cdcf74961aa2a14f5a7a2669e28e2d94f390d24ac1bd1656360d28b59a42774 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/paint
+fc8b69c140c01f3b48e2be32910fb315a1a9926a6e2573e9fdf4ad7a395c888c /home/drakestapleton/handoffs/allen-omega-L694/L758/full/crc-mutant
+0e19c774b4ba42b5fab9917ccb8175ad088a1c84d5505d7f50d989f498376bdd /home/drakestapleton/handoffs/allen-omega-L694/L758/full/autosent-mutant
+79a01c55d9ee840c537c965f92d6f104600af4316ae91a7e5b9eada656ca4800 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-output
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/stdio-overflow-input
+9dd95114e84ef9ceaa7489d28768767344ee359e6e586f9c03daa2b920fe07b1 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/keepalive-mutant
+ade800d8f3924094ee95cd864ba4081aa27d89a808a10066e4d9a8e0c87ad2ad /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-process
+17bfe1c52a607b17b96485dafdbcdaa7155ba2c179c47d7fb46fd980abd95805 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/memory
+5546806fbfdce3c49a76b8737a0b8d32902c56a18af6bee18cf7a2d225b8393f /home/drakestapleton/handoffs/allen-omega-L694/L758/full/fontalpha-mutant
+9d3d40bd0db31b9fc246e32c4c9c0472207548306921c177a2be3a73fe3c3fd6 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/application
diff --git a/evidence/allen-omega-L694/L758/code.log b/evidence/allen-omega-L694/L758/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L758/context.log b/evidence/allen-omega-L694/L758/context.log
new file mode 100644
index 00000000..df62cddb
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/context.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L758/contextjob-mutant.log b/evidence/allen-omega-L694/L758/contextjob-mutant.log
new file mode 100644
index 00000000..3432d4b2
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/contextjob-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 0
+78 0
+79 1
+80 1
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 1
+89 0
+90 1
+91 0
+92 1
+93 0
+94 1
+95 0
+96 1
+97 0
+98 1
+99 0
+100 1
+101 0
+102 1
+103 0
+104 1
+105 0
+106 1
+107 0
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 1
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 1
+123 0
+124 1
+125 0
+126 1
+127 0
+128 1
+129 0
+130 1
+131 0
+132 1
+133 0
+134 1
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 1
+142 1
diff --git a/evidence/allen-omega-L694/L758/contextnote-mutant.log b/evidence/allen-omega-L694/L758/contextnote-mutant.log
new file mode 100644
index 00000000..b5c08759
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/contextnote-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 1
+38 1
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 1
+47 0
+48 1
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L758/courier.log b/evidence/allen-omega-L694/L758/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L758/crc-mutant.log b/evidence/allen-omega-L694/L758/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L758/edges.log b/evidence/allen-omega-L694/L758/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L758/font-specimen.png b/evidence/allen-omega-L694/L758/font-specimen.png
new file mode 100644
index 00000000..e66b4aca
Binary files /dev/null and b/evidence/allen-omega-L694/L758/font-specimen.png differ
diff --git a/evidence/allen-omega-L694/L758/font-specimen.ppm b/evidence/allen-omega-L694/L758/font-specimen.ppm
new file mode 100644
index 00000000..537204de
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/font-specimen.ppm
@@ -0,0 +1,31 @@
+P6
+768 384
+255
+?BL½À̽ÀÌ?BL½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ7:Dor}7:Dacnacn‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—47A{~‰ÏÒÞìðüìðüÏÒÞ}€‹35?‰Œ—ÏÒÞ‰Œ—7:Dìðüìðüìðü.0;”—¢ìðüìðü•˜£?BL½À̽ÀÌ?BLNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[')3¢¥°ìðüìðüìðüìðüìðüìðüìðüìðü £®)+5&QT_QT_'%'2[^i%'2FHS[^iFHSNP[ìðüìðüìðüNP[¿ÃÏìðüìðüìðü[^iÏÒÞìðüìðüìðübep½ÀÌìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iMOZâåñìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüàäðNP[x{†ìðüìðüìðüìðüx{†&(3âæòìðüâæò%'2nq|ßãïìðüìðüìðüÞâînq|[^iìðüìðüìðü[^iz}ˆìðüìðüìðüÛßë(}�Œìðüìðüìðüàäð!<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—ADNìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüCEPsv�ìðüìðüìðüìðüìðüìðüsv�•˜£ìðüìðüìðü[^i�”Ÿìðüìðüìðüìðüìðüìðüìðü�”Ÿ[^iìðüìðüìðü[^i'æêöìðüìðüìðüSV`±´Àìðüìðüìðü€ƒŽ‰Œ—ÏÒÞ‰Œ—’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i½ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[ ÅÈÔìðüìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðüìðüÇÊÖ #&0ìðüìðüìðüìðüìðüìðüìðüìðü#&0<>Iìðüìðüìðüìðü%'2ilvìðüìðüìðüìðüìðüìðüìðüìðüìðüilv[^iìðüìðüìðü[^i}€‹ìðüìðüìðüœŸ«69CìðüìðüìðüéíùNP[ìðüìðüìðüNP[çë÷ìðüìðüèìø[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÝáíìðüìðüÅÈÔknyìðüìðüìðüRU`nq|ìðüìðüìðüØÛç46@ÏÒÞìðüìðüÏÒÞ58BÙÝéìðüìðüìðüWYdvy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„¬°»ìðüìðüìðü€ƒŽ
áåðìðüìðüìðü¦©µ_bl§ª¶ìðüìðüìðüßãï
[^iìðüìðüìðü[^iÏÒÞìðüìðüìðü02=—š¥ìðüìðüìðücfq[^iìðüìðüìðü[^igjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iìðüìðüìðü«¯º…ˆ“ìðüìðüìðü9;FÈÌØìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞLNYìðüìðüìðü;=H®²½ìðüìðüìðü*,6*-7ìðüìðüìðü±¼RU`ìðüìðüìðüÙÜèbdoìðüìðüìðü«®¹«®¹ìðüìðüìðüacn[^iìðüìðüìðü[^iJMWìðüìðüìðüª¹>AKìðüìðüìðüµ¹Ä‰Œ—ÏÒÞ��›%'2[^iìðüìðüìðü[^i%'2��›ÏÒÞ‰Œ—½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i+.8ìðüìðüìðü’•¡ž¡ìðüìðüìðü!++.8ìðüìðüìðü±´ÀÏÒÞìðüìðüÏÒÞY\g•˜£XZeÊÎÚìðüìðüÖÚå×ÛæìðüìðüÉÍÙÃÇÒìðüìðüìðüjlwž¡ìðüìðüìðü?BLADNìðüìðüìðüž¡[^iìðüìðüìðü[^iˆ‹—ìðüìðüìðüXZeÃÇÒìðüìðüìðü%NP[ìðüìðüìðüìðü��›[^iìðüìðüìðü[^i��›ìðüìðüìðüìðüNP[<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iEGRìðüìðüìðüx{†·»ÆìðüìðüëïûJMWìðüìðüìðütw‚ÏÒÞìðüìðüÏÒÞÉÍÙìðüìðü×ÛæÖÚåìðüìðüÊÎÚilvìðüìðüìðüÃÇÒÂÆÑìðüìðüãçóäèôìðüìðüÁÅÐ[^iìðüìðüìðü[^iÅÈÔìðüìðüìðüƒ†‘ìðüìðüìðüUXbNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i^akìðüìðüìðü_blÐÔàìðüìðüÑÕáWYdìðüìðüìðüacnÏÒÞìðüìðüÏÒÞ±¼ìðüìðüìðü*-7*,6ìðüìðüìðü®²½ÙÜèìðüìðüìðüSV`ÌÐÛìðüìðüÒÖâÒÖâìðüìðüÌÐÛ[^iìðüìðüìðü[^i(ìðüìðüìðüµ¹ÄFITìðüìðüìðü��›‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—çë÷ìðüìðüèìø[^iìðüìðüìðü[^i%'2âæòìðüâæò%'2%'2âæòìðüâæò%'2x{†ìðüìðüìðüFHSêîúìðüìðü¸¼ÇOR]ìðüìðüìðüwz…ÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„‚�ìðüìðüìðü¬°»¿ÃÏìðüìðüãçóâæòìðüìðü¿ÃÏ%'2âæòìðüâæò%'2CEPìðüìðüìðüƒ†‘ìðüìðüìðü´¸Ä%'2��›ìðüìðüìðüìðüìðüìðüìðüìðüìðü��›%'2%'2[^i%'2gjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i%'2[^i%'2%'2[^i%'2‘• ìðüìðüìðü,/9!+ìðüìðüìðüŸ¢®%'2ìðüìðüìðü³¶ÂÏÒÞìðüìðüÏÒÞ#&0ìðüìðüìðüìðüìðüìðüìðüìðü#&0&(3ìðüìðüìðüìðü<>Išž©ìðüìðüìðü@CM?BLìðüìðüìðü›Ÿª%'2[^i%'2ilvìðüìðüìðü[^iÍÑÜìðüìðüÛßë%'2��›ìðüìðüìðüìðüìðüìðüìðüìðüìðü��›%'2%'2âæòìðüâæò%'2½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^i?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞ‰Œ—ÇÊÖìðüìðüìðüILVÏÒÞìðüìðüÏÒÞsv�ìðüìðüìðüìðüìðüìðüsv�•˜£ìðüìðüìðü–™¤`bmìðüìðüìðütv�
±´Àìðüìðüìðüacn�“žìðüìðüìðü46@¦©µìðüìðüìðü(‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—[^iìðüìðüìðü[^i<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[tv�ìðüìðüìðüØÛç8:EÏÒÞìðüìðüÏÒÞx{†ìðüìðüìðüìðüx{†<>Iìðüìðüìðüìðü&(3ÑÕáìðüìðü;=H ±¼ìðüìðüìðüÜà좦±ìðüìðüìðü$‹Ž™ìðüìðüìðü02=NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[[^iìðüìðüìðü[^i’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[ËÏÚìðüìðüìðüìðütw‚ÏÒÞìðüìðüÏÒÞ'QT_QT_&¬°»ìðüìðüìðü€ƒŽ%'2âæòìðüâæò24>ª¹ìðüìðüìðüìðüknyµ¹Äìðüìðüëïûx{†ìðüìðüìðüCEPNP[ìðüìðüìðüìðü��›[^iìðüìðüìðü[^i��›ìðüìðüìðüìðüNP[[^iìðüìðüìðü[^içë÷ìðüìðüèìø[^iìðüìðüìðü[^i?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞ‰Œ—=@JìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ}€‹35?RU`ìðüìðüìðüÙÜè[^iìðüìðüìðüÅÈÔìðüìðüìðüìðütv�ÇÊÖìðüìðüØÛçehsìðüìðüìðüSV`‰Œ—ÏÒÞ��›%'2[^iìðüìðüìðü[^i%'2��›ÏÒÞ‰Œ—[^iìðüìðüìðü[^igjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i+.8ìðüìðüìðü’•¡ž¡ìðüìðüìðü!+HKUãçóìðüìðüìðüìðüìðüìðüìðüìðüìðü¢¥°)+5ÃÇÒìðüìðüìðüjlw%'2äèôìðüìðüìðüìðüìðüìðüvy„%'2[^i%'2ÇË×ìðüìðüÖÚåbepìðüìðüìðüTWa[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^iEGRìðüìðüìðüx{†·»Æìðüìðüëïû')3£§²ìðüìðüìðüìðüìðüìðüìðüìðüìðüâåñILVilvìðüìðüìðüÃÇÒRU`ìðüìðüìðüìðüìðüz}ˆ%'2âæòìðüâæò%'2ÈÌØìðüìðüÕÙåbdoìðüìðüìðüUXbNP[ìðüìðüìðüNP[[^iìðüìðüìðü[^i<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i^akìðüìðüìðü_blÐÔàìðüìðüÑÕá46@{~‰ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðü>AKÙÜèìðüìðüìðüSV`œŸ«ìðüìðüìðüìðüìðübep‰Œ—ìðüìðüìðü[^iÇÊÖìðüìðüÙÜèfitìðüìðüìðüTWa‰Œ—ÏÒÞ‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^ix{†ìðüìðüìðüFHSêîúìðüìðü¸¼ÇÏÒÞìðüìðüÏÒÞsv�êîúìðüìðüìðüÉÍÙ‚�ìðüìðüìðü¬°»&QT_QT_'™œ§ìðüìðüìðüìðüìðüìðüìðüBDO)ìðüìðüìðüìðü%'2µ¹Äìðüìðüìðüwz…ìðüìðüìðüBDO½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌNP[[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i%'2çë÷ìðüìðüèìø[^iìðüìðüìðü[^i‘• ìðüìðüìðü,/9!+ìðüìðüìðüŸ¢®ÏÒÞìðüìðüÏÒÞ8:EÙÜèìðüìðüìðüsv�&(3ìðüìðüìðüìðü<>Ix{†ìðüìðüìðüìðüx{†–™¤ìðüìðüìðüìðü´·ÃìðüìðüìðüÕÙå!$.�„�ìðüìðüìðü‘• ¤¨³ìðüìðüìðü"‰Œ—ìðüìðüìðü13>½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̉Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâæò%'2gjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüÇËו˜£ìðüìðüìðü–™¤sv�ìðüìðüìðüìðüìðüìðüsv�’•¡ìðüìðüìðüìðüˆ‹—!$.ÔØäìðüìðüìðü´·Ã!åéõìðüìðüìðü-0:Ž‘œìðüìðüìðü58B§ª¶ìðüìðüìðü(?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü[^i½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^iNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ³¶Âìðüìðüìðü$&1<>Iìðüìðüìðüìðü&(3#&0ìðüìðüìðüìðüìðüìðüìðüìðü#&0NP[ìðüìðüìðüìðü‹Ž™BDOìðüìðüìðüìðü“–¢ìðüìðüìðü™�¨ilvìðüìðüìðüZ]hÍÑÜìðüìðüÛßë[^iìðüìðüìðü[^i‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâæò%'2<>Iìðüìðüìðü½ÀÌNP[ìðüìðüìðüNP[NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞwz…ìðüìðüìðüNP[¬°»ìðüìðüìðü€ƒŽvy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„NP[ìðüìðüìðü�’�bepìðüìðüìðüìðüìðüìðüìðü58BDFQìðüìðüìðü€ƒŽìðüìðüìðüµ¹Ä[^iìðüìðüìðü[^iNP[[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i%'2’•¡ìðüìðüìðühkv‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞacnìðüìðüìðüXZeRU`ìðüìðüìðüÙÜ讲½ìðüìðüìðü*,6*-7ìðüìðüìðü±¼[^iìðüìðüìðü\_jƒ†‘ìðüìðüìðüìðüìðü¢¥° *ìðüìðüìðü¶ºÅFITìðüìðüìðü�’�[^iìðüìðüìðü[^içë÷ìðüìðüèìø+.8ìðüìðüìðü’•¡ž¡ìðüìðüìðü!+ÏÒÞìðüìðüÏÒÞsv�ìðüìðüìðüJMWÃÇÒìðüìðüìðüjlwÊÎÚìðüìðüÖÚå×ÛæìðüìðüÉÍÙNP[ìðüìðüìðüloz£§²ìðüìðüìðüìðü=@JÄÇÓìðüìðüìðü€ƒŽìðüìðüìðüTWa[^iìðüìðüìðü[^igjuìðüìðüìðü’•¡EGRìðüìðüìðüx{†·»ÆìðüìðüëïûXZe•˜£Y\gÏÒÞìðüìðüÏÒÞ¯³¾ìðüìðüìðü*,6ilvìðüìðüìðüÃÇÒÉÍÙìðüìðü×ÛæÖÚåìðüìðüÊÎÚ/1<ìðüìðüìðüœŸ«ilvìðüìðüìðüìðüÅÈÔ‰Œ—ìðüìðüìðüY\gÆÉÕìðüìðüìðü&[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü=?I^akìðüìðüìðü_blÐÔàìðüìðüÑÕá;=HìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞLNYìðüìðüìðüËÏÚÙÜèìðüìðüìðüSV`±¼ìðüìðüìðü*-7*,6ìðüìðüìðü®²½Üàììðüìðüêîú'ÍÑÜìðüìðüìðüìðüìðü£§²GJTìðüìðüìðü©¬¸=@Jìðüìðüìðü´·Ã[^iìðüìðüìðü[^i<>Iìðüìðüìðü½ÀÌx{†ìðüìðüìðüFHSêîúìðüìðü¸¼ÇWYdìðüìðüìðüØÛç46@ÏÒÞìðüìðüÏÒÞ58BÙÝéìðüìðüìðümp{‚�ìðüìðüìðü¬°»vy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„“–¢ìðüìðüìðü”—¢`bmìðüìðüìðüìðüìðüìðüìðüƒ†‘ÐÔàìðüìðüìðü24>™œ§ìðüìðüìðücfq%'2âæòìðüâæò%'2%'2[^i%'2’•¡ìðüìðüìðühkv‘• ìðüìðüìðü,/9!+ìðüìðüìðüŸ¢® ÅÈÔìðüìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðüìðüÇÊÖ %'2ìðüìðüìðüìðü<>I#&0ìðüìðüìðüìðüìðüìðüìðüìðü#&002=ìðüìðüìðüìðü�”Ÿ'(ÄÇÓìðüìðüìðüsv�ìðüìðüìðüìðübep‚�ìðüìðüìðü›Ÿª46@ìðüìðüìðüéíù %'2[^i%'2%'2âæòìðüâæò%'2çë÷ìðüìðüèìø‰Œ—ÏÒÞ‰Œ—«®¹ìðüìðüìðü8:Eìðüìðüìðü†‰”ADNìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüCEP[^iìðüìðüìðü–™¤sv�ìðüìðüìðüìðüìðüìðüsv�}�ŒìðüìðüìðüìðüìðüÔØäìðüìðüìðüìðüº½É“–¢ìðüìðüìðüìðüBDO%æêöìðüìðüìðüVXc´¸Äìðüìðüìðü‚�jlwìðüìðüìðü[^i‰Œ—ÏÒÞ‰Œ—gjuìðüìðüìðü’•¡NP[ìðüìðüìðüNP[ÄÇÓìðüìðüÞâîQT_ìðüìðüìðüknyMOZâåñìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüàäðNP[%'2âæòìðüâæò&(3x{†ìðüìðüìðüìðüx{†œŸ«ìðüìðüìðüìðüìðüìðüìðüìðüìðüWYd´·Ãìðüìðüìðü½ÀÌ}�ŒìðüìðüìðüÛßë(}�Œìðüìðüìðüãçó#¢¥°ìðüìðüìðü24>NP[ìðüìðüìðüNP[½ÀÌìðüìðüìðü=?INP[ìðüìðüìðüNP[½ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[')3¢¥°ìðüìðüìðüìðüìðüìðüìðüìðü £®)+5%'2[^i%'2'QT_QT_&ƒ†‘ìðüìðüìðüìðüìðüìðüìðü‡‹–!$.ÔØäìðüìðü½À̽ÀÌìðüìðüìðü[^iÏÒÞìðüìðüìðü_blÙÜèìðüìðüÙÝéNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̉Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—47A{~‰ÏÒÞìðüìðüÏÒÞ}€‹35?/1<‚…�½ÀÌËÏÚ·»Æ„‡’47A?BL½À̽ÀÌ?BL7:Dìðüìðüìðü.0;”—¢ìðüìðü•˜£13>ìðüìðüìðü¢¥°‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞ7:Dor}7:Dacnacnjlwìðüìðüìðükmx½ÀÌìðüìðü½ÀÌ¢¥°ìðüìðüìðü24>?BL½À̽ÀÌ?BLÏÒÞìðüìðüÙÝ鉌—ìðüìðü‰Œ—NP[NP[ wz…®²½ÏÒÞ¯³¾wz… BDO½À̽ÀÌ?BLKNXŽ‘œ¾ÂÎÊÎÚº½É“–¢JMW
Y\g˜›¦ÂÆÑÇË×¾ÂΛŸªY\g
+?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL13>‚…�º½ÉÏÒÞº½Éƒ†‘13>OQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\
+X[f˜›¦ÂÆÑÉÍÙ¾ÁÍœŸ«Y\g
+VXcãçóìðüìðüìðüìðüìðüãçóVXcfitìðüìðüìðü½ÀÌ;=H½ÀÌìðüìðüìðüìðüìðüìðüìðüµ¹ÄADNilvØÛçìðüìðüìðüìðüìðüìðüìðüÖÚåilvÇË×ìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÇË×ìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ„‡’ìðüìðüìðüìðüìðüìðüìðü„‡’;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>IgjuÙÜèìðüìðüìðüìðüìðüìðüìðüÖÚåilvehsìðüìðüìðüìðüìðüìðüìðüìðüìðüehsŠ�˜ìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüacn—š¥ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüœŸ«‚…�ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ€ƒŽìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ� ¬ìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k™œ§ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü›ŸªEGRìðüìðüìðüìðüìðüÔØäìðüìðüìðüìðüìðüEGR!+¯³¾ìðüìðüìðüìðüìðüÏÒÞNP[ìðüìðüìðüìðüìðüìðüÕÙåëïûìðüìðüìðüìðüìðüOR]˜›¦ìðüìðüìðüìðüìðüèìøÖÚåèìøìðüìðüìðüìðüìðü›Ÿª=?IìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL:Iìðüìðüìðüèìø![^iìðüìðüìðü¬°»«®¹ìðüìðüìðüX[f/1<ìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ(*4ëïûìðüìðüìðü]`k†‰”ìðüìðüìðüehsÜàììðüìðüêîú''êîúìðüìðüÛßëëïûìðüìðüìðü;=H;=Hìðüìðüìðüêîú^akìðüìðüìðü±¼«®¹ìðüìðüìðüX[fOR]ìðüìðüìðü±´À±´ÀìðüìðüìðüOR]NP[ìðüìðüìðüìðüÓ×ãCEPÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðü’•¡•˜£ìðüìðüìðüXZeTWaìðüìðüìðüEGRDFQìðüìðüìðüœŸ«¬°»ìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¤¨³ìðüìðüìðü¤¨³ÑÕáìðüìðüìðü%/1<ìðüìðüìðüœŸ«� ¬ìðüìðüìðü.0;\_jìðüìðüìðü“–¢“–¢ìðüìðüìðü[^i˜›¦ìðüìðüìðüFHSDFQìðüìðüìðü›Ÿª”—¢ìðüìðüìðüVXcWYdìðüìðüìðü“–¢NP[ìðüìðüìðü¯³¾!+ÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðü@CMEGRìðüìðüìðü‘• ƒ†‘ÀÄÏwz…çë÷ìðüìðü½ÀÌfitìðüìðüìðüãçóÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüëïû(*4EGRìðüìðüìðü§ª¶NP[ìðüìðüìðülozmp{ìðüìðüìðüMOZ�“žìðüìðüìðüCEPDFQìðüìðüìðü�’�±¼ìðüìðüâæòêîúìðüìðü¼¿ËØÛçìðüìðüåéõ
+åéõìðüìðü×Ûæ‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞ€ƒŽ½ÀÌtw‚
ìðüìðüìðüµ¹ÄÓ×ãìðüìðüÊÎÚ!$.âæòìðüìðüìðügjuÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ#ÙÜèìðüìðüìðünq|�”Ÿìðüìðüìðü[^i[^iìðüìðüìðü]`k]`kìðüìðüìðü[^iº½Éìðüìðüìðü
ìðüìðüìðü¹½ÈOQ\½À̽ÀÌ?BL?BL½À̽ÀÌOQ\JMWÝáíìðüsv�Ó×ãìðüìðüÊÎÚ+.8ìðüìðüìðü¢¥°¢¦±ìðüìðüìðü+.8ÏÒÞìðüìðüÏÒÞ×ÛæìðüìðüÇÊÖèìøìðüìðüÂÆÑž¡ìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ’•¡ìðüìðüìðü¶ºÅÝáíìðüìðüèìøMOZìðüìðüìðümp{lozìðüìðüìðüNP[ÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØ')3ž¡ìðüìðüìðü½À̽ÀÌìðüìðüìðüž¡')3èìøìðüìðüÂÆÑ[^iìðüìðüìðüps~qtìðüìðüìðüZ]hÏÒÞìðüìðüÏÒÞÔØäìðüìðüÌÐÛGJTìðüìðüìðü™œ§X[fìðüìðüìðüìðü/1<ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüìðü:AK€ƒŽìðüìðüìðüìðüìðüìðüìðüìðü¹½È<>IèìøìðüìðüÞâî“–¢ìðüìðüìðü“–¢“–¢ìðüìðüìðü“–¢�’�ìðüìðüìðüDFQCEPìðüìðüìðü�“žNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[')3ž¡ìðüìðüìðüìðüìðüìðüuxƒuxƒìðüìðüìðüìðüìðüìðüž¡')3…ˆ“ìðüìðüìðüÙÜè
+¸¼Çìðüìðüëïûìðüìðüìðü¸¼ÇÏÒÞìðüìðüÏÒÞ”—¢ìðüìðüìðüZ]hFIT®²½ìðüìðüìðüìðügjuKNXìðüìðüìðüìðü=?IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðübdo]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kZ]hìðüìðüìðü‘• 02=ìðüìðüìðüìðü�”Ÿ''�”Ÿìðüìðüìðüìðü02=[^iìðüìðüìðü“–¢(*4âæòìðüìðüìðü\_jNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[uxƒìðüìðüìðüìðüìðüìðü� ¬')3')3� ¬ìðüìðüìðüìðüìðüìðüuxƒFIT®²½ìðüìðüìðüìðügjuÂÆÑìðüìðüÜàìÝáíìðüìðüÁÅÐÏÒÞìðüìðüÏÒÞ8:Eìðüìðüìðüæêö‰Œ—ÑÕáåéõìðüìðüìðüìðüìðü™œ§ÇË×ìðüìðüìðüƒ†‘ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÓ×ãéíùìðüìðüìðüìðüìðüSV`QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_§ª¶ìðüìðüìðüEGR‚�ìðüìðüìðüìðüìðüÑÕáìðüìðüìðüìðüìðü‚�êîúìðüìðüìðü;=H¤¨³ìðüìðüìðüëïû‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—OQ\ÆÉÕìðüìðüìðüìðüìðüÅÈÔNP[?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLNP[ÅÈÔìðüìðüìðüìðüìðüÆÉÕOQ\‰Œ—ÑÕáåéõìðüìðüìðüìðüìðü™œ§ËÏÚìðüìðüÓ×ãÔØäìðüìðüÊÎÚÏÒÞìðüìðüÏÒÞ!#-ÐÓßìðüìðüìðüˆ‹—NP[ìðüìðüìðüìðüìðüìðüìðü˜›¦‚…�ìðüìðüìðüÈÌØÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüÙÜè`bm
^ak×ÛæìðüìðüìðüØÛç"'ØÛçìðüìðüìðüÙÝé`bm
`bmÙÜèìðüìðüìðü×Ûæ'%ìðüìðüìðüÒÖâ� ¬ìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬…ˆ“ìðüìðüìðüÇË×"%/]`kìðüìðüìðüìðü†‰”')3ž¡ìðüìðüìðüìðüìðüìðüuxƒ½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌuxƒìðüìðüìðüìðüìðüìðüž¡')3NP[ìðüìðüìðüìðüìðüìðüìðü˜›¦ÊÎÚìðüìðüÔØäÓ×ãìðüìðüËÏÚÏÒÞìðüìðüÏÒÞ
+¸¼ÇìðüìðüìðüÛßë NP[ìðüìðüìðüìðüìðüìðüìðü—š¥=?IìðüìðüìðüìðüKNXÏÒÞìðüìðüÏÒÞ\_jtv�(!$.ÉÍÙìðüìðüìðü†Š•†‰”ìðüìðüìðüìðü]`k"%/ÇË×ìðüìðüìðü…ˆ“ehsìðüìðüìðü†‰”—š¥ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü—š¥'×ÛæìðüìðüìðüÙÜè`bm
`bmÙÝéìðüìðüìðüØÛç'uxƒìðüìðüìðüìðüìðüìðü� ¬')3½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ')3� ¬ìðüìðüìðüìðüìðüìðüuxƒ[^iìðüìðüìðüìðüìðüÙÝédgrÁÅÐìðüìðüÝáíÜàììðüìðüÂÆÑÏÒÞìðüìðüÏÒÞ¢¦±ìðüìðüìðüìðüILV‰Œ—ÐÓßäèôìðüìðüìðüìðüìðü—š¥º½Éìðüìðüìðü�”ŸÏÒÞìðüìðüÏÒÞ;=Hìðüìðüìðüçë÷!ëïûìðüìðüìðü¤¨³;=Hìðüìðüìðüêîú±´Àìðüìðüìðü:I¹½Èìðüìðüìðüìðüìðüìðüìðüìðü€ƒŽ½ÀÌìðüìðüìðüìðüìðüuxƒuxƒìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i€ƒŽìðüìðüìðüADN@CMìðüìðüìðü�„�ÏÒÞìðüìðüÏÒÞ^akìðüìðüìðüìðüŽ‘œ®²½ìðüìðüìðüY\g¬°»ìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ—
ìðüìðüìðüµ¹Äº½Éìðüìðüìðü
ìðüìðüìðü¹½È¼¿Ëìðüìðüìðü/1<^akìðüìðüìðü®²½®²½ìðüìðüìðü^akOQ\�“ž¼¿ËÏÒÞìðüìðüìðüÇË×?BLÅÈÔìðüìðüìðüìðüìðüÆÉÕOQ\OQ\ÆÉÕìðüìðüìðüìðüìðüÅÈÔ?BL[^iìðüìðüìðü[^iZ]hìðüìðüìðüqtps~ìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞGJTìðüìðüìðüìðü¤¨³ILVìðüìðüìðü—š¥NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[×ÛæìðüìðüÇÊÖÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØ.0;ìðüìðüìðü½À̘›¦ìðüìðüìðüFITGJTìðüìðüìðü—š¥:ßãïìðüìðüìðü»¾Ê
çë÷ìðüìðüÁÅÐNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[ÔØäìðüìðüÌÐÛÈÌØìðüìðüÙÜèØÛçìðüìðüÉÍÙ{~‰ìðüìðüìðüqt¾ÂÎìðüìðüäèôåéõìðüìðü¾ÁͶºÅìðüìðüìðü’•¡')3� ¬ìðüìðüìðüìðüìðüìðüuxƒ‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—uxƒìðüìðüìðüìðüìðüìðü� ¬')3NP[ìðüìðüìðüNP[×Ûæìðüìðüåéõ
+ åéõìðüìðüØÛçÏÒÞìðüìðüÏÒÞ'ÈÌØìðüìðüìðüÑÕá#&0ÔØäìðüìðüÊÎÚ‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ—€ƒŽ½ÀÌtw‚ ìðüìðüìðüµ¹Ä¹½Èìðüìðüìðü
ìðüìðüìðüº½ÉÇË×ìðüìðüìðü$&1ÏÒÞìðüìðüÐÔàÐÔàìðüìðüÏÒÞnq|ìðüìðüìðüÙÜè#NP[ÅÈÔìðüìðüìðüìðüìðüÆÉÕOQ\ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞOQ\ÆÉÕìðüìðüìðüìðüìðüÅÈÔNP[‰Œ—ÏÒÞ‰Œ—“–¢ìðüìðüìðüWYdVXcìðüìðüìðü”—¢ÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðüéíù:NP[ìðüìðüìðüNP[VXcãçóìðüìðüìðüìðüìðüãçóVXc½ÀÌìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌkmx×ÛæìðüìðüìðüìðüìðüìðüìðüÖÚåkmx½ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¶ºÅ=?I<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HNP[ìðüìðüìðüOR]ehsÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêdgr½ÀÌìðüìðüÇË×NP[ìðüìðüìðüNP[ÙÜèìðüìðüÙÝéNP[ìðüìðüìðüNP[ wz…¯³¾ÏÒÞ®²½wz… ?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL
+X[f™�¨ÀÄÏÇË׿ÃÏ™œ§XZe
+?BL½À̽ÀÌ?BLGJT�”Ÿ¾ÂÎÈÌØ»¾Ê’•¡GJTOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\‰Œ—ÏÒÞ‰Œ—^ak˜›¦¾ÂÎÏÒÞ¾ÁÍ—š¥^ak?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—13>ìðüìðüìðü¢¥°‰Œ—ÏÒÞ‰Œ—jlwìðüìðüìðükmx¢¥°ìðüìðüìðü24>ÏÒÞìðüìðüÙÝ鉌—ìðüìðü‰Œ—NP[NP[?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ£§²acn
+SV`›Ÿª·»ÆÏÒÞ¸¼Ç›ŸªSV` ?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ®²½‹Ž™ILV?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL SV`›Ÿª¸¼ÇÏÒÞ·»Æ›ŸªSV`
+?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLHKUŠ�˜±¼ÆÉÕÆÉÕ®²½‹Ž™ILV½ÀÌìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÇË×>AKehsÛßëìðüìðüìðüìðüìðüìðüìðüÜàìehs½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌehsÜàììðüìðüìðüìðüìðüìðüìðüÛßëehs½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̇‹–ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðüÄÇÓÄÇÓìðüìðü½À̽ÀÌìðüìðüÅÈÔ½ÀÌìðüìðü½ÀÌnq|ÙÜèìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|"%/ìðüìðüìðüìðü!$.ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüILV¨«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½Ą̀«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞy|‡ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðümp{mp{ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞ8:EÅÈÔìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:E!^akž¡¸¼ÇÏÒÞ¹½È £®]`k%dgrìðüìðüìðüìðücfqÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÜàììðüìðüìðüìðüÞâî ",(¾ÁÍìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðü¾ÁÍ'ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÜàììðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL'¾ÁÍìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðü¾ÁÍ(ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞkmxìðüìðüìðüìðü•˜£ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüàäð#$àäðìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüÝáíÜàììðüìðüìðüìðüìðüìðüìðü]`k
~�Œìðüìðüìðüìðüìðüìðüìðüìðüêîú}�Œ¦©µìðüìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞOR]ÖÚåìðüìðüìðü—𥬰»ìðüìðüìðüìðü®²½KNX JMW®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞSV`ª¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðüìðü®²½JMW KNX®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüìðü£§²ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüŠ�˜Š�˜ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüª¹SV`SV`ª¹ìðüìðüìðüìðüìðüSV`9;FÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙ9;Féíùìðüìðüìðüìðüéíù
ÏÒÞìðüìðüÏÒÞ69Cìðüìðüìðüìðü%'2†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü²µÁ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü47A47AìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ47AìðüìðüìðüìðüÛßëOR]OR]Ûßëìðüìðüìðüìðü47AKNXìðüìðüìðüìðüìðüìðüëïûÑÕáéíùìðüìðüìðüìðüìðüìðüILVOQ\ìðüìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ‚…�ìðüìðüìðünq|7:Dìðüìðüìðüìðüjlwkmxìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü¶ºÅÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ7:Dìðüìðüìðüìðükmxjlwìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ@CMëïûìðüìðüìðüÀÄÏ"ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü¦©µ§ª¶ìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞ·»ÆìðüìðüìðüÊÎÚ$&1$&1ÊÎÚìðüìðüìðü¶ºÅ7:Dãçóìðüìðüìðüìðü—š¥@CM@CM™œ§ìðüìðüìðüìðüäèô:ÜàììðüìðüìðüÎÑÝ$&1ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüàäðìðüìðüìðüQT_QT_ìðüìðüìðüàäðìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞps~ìðüìðüìðüÞâî,/9,/9Þâîìðüìðüìðüps~ÂÆÑìðüìðüìðüÝáíKNXMOZÛßëìðüìðüìðü¿ÃÏÒÖâìðüìðüéíùéíùìðüìðüÒÖâÏÒÞìðüìðüÏÒÞàäðìðüìðüÁÅÐ24>ìðüìðüìðüÜàì":ÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÕÙåÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ24>ìðüìðüìðüÜàì#:ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ#&0ÎÑÝìðüìðüìðüÜàì24>ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüÄÇÓÄÇÓìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ ÖÚåìðüìðüìðü\_j\_jìðüìðüìðüÕÙå}€‹ìðüìðüìðüãçó58B8:Eâæòìðüìðüìðü‚�8:Eìðüìðüìðü¦©µ¦©µìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞÐÔàìðüìðüÏÒÞ��›ìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞª¹ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ"ÀÄÏìðüìðüìðüëïû@CMÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüìðümp{mp{ìðüìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞkmxìðüìðüìðü©¬¸ª¹ìðüìðüìðükmx%ëïûìðüìðüìðüQT_SV`ìðüìðüìðüéíù%{~‰ìðüìðüìðücfqdgrìðüìðüìðüz}ˆÏÒÞìðüìðüÏÒÞßãïìðüìðüÂÆÑÐÔàìðüìðüìðü&ÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÐÓßìðüìðüìðü'ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ²µÁìðüìðüìðüìðüOQ\ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüàäð#$àäðìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüDFQDFQìðüìðüìðü´·Ãx{†ìðüìðüìðü–™¤•˜£ìðüìðüìðü{~‰½ÀÌìðüìðüìðü!$."%/ìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ/1<ìðüìðüìðü £®35?ìðüìðüìðüª¹ÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü ",ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ35?ìðüìðüìðüª¹ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ£§²ìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüŠ�˜Š�˜ìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞ!#-ìðüìðüìðüÆÉÕÆÉÕìðüìðüìðü ",ÉÍÙìðüìðüìðü46@
+sv�·»ÆÏÒÞ·»Æsv�?BL½À̽ÀÌ?BL35?ìðüìðüìðüÈÌØ"%/ìðüìðüìðü½À̽ÀÌìðüìðüìðü!$.ÏÒÞìðüìðüÏÒÞ‚…�ìðüìðüìðünq|cfqìðüìðüìðüilvÏÒÞìðüìðüÏÒÞ}�ŒìðüìðüìðüUXbÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞcfqìðüìðüìðüjlwÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ•˜£ìðüìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ47Aìðüìðüìðüìðü47A47Aìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞVXcìðüìðüìðü}€‹}�ŒìðüìðüìðüUXb13>ìðüìðüìðü¯³¾=?IÏÒÞìðüìðüìðüìðüìðüÏÒÞìðüìðü½À̰³¿ìðüìðüìðü46@dgrìðüìðüìðüz}ˆ{~‰ìðüìðüìðücfqÏÒÞìðüìðüÏÒÞ69Cìðüìðüìðüìðü%'2Š�˜ìðüìðüìðü:IìðüìðüìðüìðüHKUHKUìðüìðüìðüìðüÏÒÞìðüìðüìðü´·ÃOQ\ìðüìðüìðü�“ž�”ŸìðüìðüìðüNP[ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü„‡’ÉÍÙìðüìðüÖÚåÏÒÞìðüìðüÏÒÞØÛçìðüìðüÈÌØÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÈÌØìðüìðü×ÛæNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðü£§²ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüìðümp{mp{ìðüìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞÉÍÙìðüìðü×ÛæØÛçìðüìðüÈÌØÀÄÏìðüìðüßãï�„�ìðüìðüìðüor}ps~ìðüìðüìðüÏÒÞÞâîìðüìðüÂÆÑ�”ŸìðüìðüìðüNP[OQ\ìðüìðüìðü�“žÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬ÈÌØìðüìðü×ÛæÏÒÞìðüìðüÏÒÞ×ÛæìðüìðüÉÍÙÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÉÍÙìðüìðüÖÚåNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÈÌØÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü²µÁ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüàäð#$àäðìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞÈÌØìðüìðüØÛç×ÛæìðüìðüÉÍÙÌÐÛìðüìðüÓ×ã±´Àìðüìðüìðü((ìðüìðüìðüÏÒÞÐÓßìðüìðüÏÒÞÒÖâìðüìðüéíù
éíùìðüìðüÒÖâÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÐÔàìðüìðüìðüìðüìðü‚�¼¿ËìðüìðüãçóÏÒÞìðüìðüÏÒÞåéõìðüìðü»¾ÊÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL½ÀÌìðüìðüâæò‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞãçóìðüìðü¼¿ËÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÀÄÏ"ILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüŠ�˜Š�˜ìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞº½Éìðüìðüæêöåéõìðüìðü»¾ÊÂÆÑìðüìðüÞâîÉÍÙìðüìðü×ÛæØÛçìðüìðüÏÒÞ‰Œ—ìðüìðü‰Œ—8:Eìðüìðüìðü¦©µ[^i[^i[^i[^i[^i[^i¦©µìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞ'�”Ÿìðüìðüìðüìðü02=¯³¾ìðüìðüìðü ÏÒÞìðüìðüÏÒÞ(ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¯³¾ìðüìðüìðü ìðüìðüìðü¯³¾ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüÎÑÝ$&1‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ47Aìðüìðüìðüìðüìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞ«¯ºìðüìðüìðü((ìðüìðüìðü«¯º±´Àìðüìðüìðü
+ÈÌØìðüìðüØÛç×ÛæìðüìðüÏÒÞNP[NP[‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞ“–¢ìðüìðüìðü“–¢‰Œ—ìðüìðüìðü;=HÏÒÞìðüìðüÏÒÞFITìðüìðüìðü‚…�ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðü: ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðüìðüìðüìðüŠ�˜ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ�„�ìðüìðüìðüGJTFITìðüìðüìðü‚…�”—¢ìðüìðüìðü7:D°³¿ìðüìðüìðü((ìðüìðüìðüÏÒÞ?BL½À̽ÀÌ?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ'êîúìðüìðüÛßëcfqìðüìðüìðüjlwÏÒÞìðüìðüÏÒÞ}€‹ìðüìðüìðüVXcÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞcfqìðüìðüìðüilvjlwìðüìðüìðücfqÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ$àäðìðüìðüìðüìðüàäð#ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞUXbìðüìðüìðü}�Œ}€‹ìðüìðüìðüVXcdgrìðüìðüìðügju�„�ìðüìðüìðüps~or}ìðüìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌ"%/ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü!$.ÏÒÞìðüìðüÏÒÞ� ¬ìðüìðüìðü.0;35?ìðüìðüìðüª¹ÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü!#-ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ35?ìðüìðüìðüª¹ª¹ìðüìðüìðü35?ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞmp{ìðüìðüìðüìðümp{ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞ ",ìðüìðüìðüÆÉÕÆÉÕìðüìðüìðü!#-58Bìðüìðüìðü±´À<>IìðüìðüìðüìðüHKUHKUìðüìðüìðüìðüãçó&&äèôìðüìðüÇÊÖdgrìðüìðüìðüz}ˆ[^i[^i[^i[^i[^i[^i[^i[^i{~‰ìðüìðüìðücfqÏÒÞìðüìðüÏÒÞmp{ìðüìðüìðüMOZÐÓßìðüìðüìðü'ÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÐÔàìðüìðüìðü&'ìðüìðüìðüÐÓßÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÉÍÙìðüìðüÖÚåÕÙåìðüìðüÊÎÚÏÒÞìðüìðüÏÒÞ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüDFQDFQìðüìðüìðü´·ÃÈÌØìðüìðüìðü02=§ª¶ìðüìðüìðüìðüÑÕáìðüìðüìðüìðüìðüìðüäèôãçóìðüìðüìðü—𥦩µìðüìðüìðü7:D8:Eìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðü[^i��›ìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞ©¬¸ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüuxƒuxƒìðüìðüìðü��›ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i¾ÁÍìðüìðüéíùèìøìðüìðü¾ÁÍÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞkmxìðüìðüìðüª¹©¬¸ìðüìðüìðükmx{~‰ìðüìðüìðü™�¨*-7Ûßëìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü8:EéíùìðüìðüÒÖâÒÖâìðüìðüéíù
ÏÒÞìðüìðüÏÒÞlozìðüìðüìðüNP[24>ìðüìðüìðüÜàì#:ÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÖÚå ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ24>ìðüìðüìðüÜàì"#Üàììðüìðüìðü24>ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^išž©ìðüìðüìðü.0;-0:ìðüìðüìðü›ŸªÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÕÙåìðüìðüìðü\_j\_jìðüìðüìðüÖÚå 'èìøìðüìðüìðüUXb=?IÏÒÞìðüìðüìðüìðüìðüÏÒÞgjuìðüìðüìðüìðüìðüìðügjuOQ\ìðüìðüìðü�“ž�”ŸìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞœŸ«ìðüìðüìðü/1<«¯ºìðüìðüìðü��›‰Œ—ìðüìðülozÏÒÞìðüìðüÏÒÞ,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ«¯ºìðüìðüìðü��›��›ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^imp{ìðüìðüìðümp{lozìðüìðüìðünq|ÏÒÞìðüìðüÏÒÞ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÏÒÞìðüìðüÏÒÞps~ìðüìðüìðüÞâî,/9,/9Þâîìðüìðüìðüps~}�ŒìðüìðüìðüÝáí8:E
+sv�·»ÆÏÒÞ·»Æsv�
+8:E—š¥ÇÊÖÇË×—š¥8:E�”ŸìðüìðüìðüNP[OQ\ìðüìðüìðü�“žÏÒÞìðüìðüÏÒÞ'êîúìðüìðüÜàì7:Dìðüìðüìðüìðükmxjlwìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ7:Dìðüìðüìðüìðüjlwkmxìðüìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i02=ìðüìðüìðüÄÇÓÃÇÒìðüìðüìðü02=ÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüìðüìðüÏÒÞ¶ºÅìðüìðüìðüÊÎÚ$&1$&1ÊÎÚìðüìðüìðü·»Æ¾ÂÎìðüìðüìðüÙÝéMOZFIT £®‚�ÒÖâìðüìðüéíù
éíùìðüìðüÒÖâÏÒÞìðüìðüÏÒÞ“–¢ìðüìðüìðü“–¢†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i¶ºÅìðüìðüìðüsv�ru€ìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðüìðüÏÒÞ47AìðüìðüìðüìðüÛßëOR]OR]Ûßëìðüìðüìðüìðü47A9;Féíùìðüìðüìðüìðü™�¨=?I?BL–™¤ìðüìðüìðüwz…8:Eìðüìðüìðü¦©µ¦©µìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞ'�”Ÿìðüìðüìðüìðü02=¬°»ìðüìðüìðüìðü®²½JMW KNX®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞSV`ª¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðüìðü®²½KNX JMW®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iTWaìðüìðüìðüìðüknyknyìðüìðüìðüìðüUXbÏÒÞìðüìðüÏÒÞ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡ìðüìðüìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüª¹SV`SV`ª¹ìðüìðüìðüìðüìðüSV`GJTìðüìðüìðüìðüìðüìðüäèôØÛçëïûìðüìðüìðüìðüìðü�’�{~‰ìðüìðüìðücfqdgrìðüìðüìðüz}ˆÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÑÕáìðüìðüìðüìðüìðü‚�'¾ÁÍìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðü¾ÁÍ(ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÝáíìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞ(¾ÁÍìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðü¾ÁÍ'ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i¢¦±ìðüìðüìðüìðüßãïàäðìðüìðüìðüìðü£§²ÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüÜàìÝáíìðüìðüìðüìðüìðüìðüìðü]`k>AKÆÉÕìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÍÑÜ02=½ÀÌìðüìðüìðü!$."%/ìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬¨«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ¨«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i ÁÅÐìðüìðüìðüìðüìðüìðüìðüìðüÁÅÐ!ÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÏÒÞ8:EÅÈÔìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:E
�„�åéõìðüìðüìðüìðüìðüìðüìðüìðü}€‹½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü„‡’ehsÜàììðüìðüìðüìðüìðüìðüìðüÛßëehs½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðü½ÀÌehsÛßëìðüìðüìðüìðüìðüìðüìðüÜàìehs½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[#§ª¶ìðüìðüìðüìðüìðüìðü§ª¶#½ÀÌìðüìðü½ÀÌ ÊÎÚìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌÆÉÕìðüìðü½ÀÌnq|ÙÜèìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|"_bl™œ§¼¿ËÈÌØ»¾Êšž©`bm?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞº½É‚…�13> SV`›Ÿª¸¼ÇÏÒÞ·»Æ›ŸªSV`
+?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ±¼Š�˜HKU?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL
+SV`›Ÿª·»ÆÏÒÞ¸¼Ç›ŸªSV` ?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—QT_Ÿ¢®ÅÈÔÄÇÓŸ¢®QT_?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLILV‹Ž™®²½ÆÉÕÆÉÕ±¼Š�˜HKU%'2[^i[^i[^i[^i[^i[^i[^i%'2NP[[^i[^i[^i[^i[^i[^iNP[%'2âæòìðüìðüìðüìðüìðüìðüìðüâæò%'2‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÇËײµÁ}€‹35?HKUŠ�˜±¼ÆÉÕÆÉÕ®²½‹Ž™ILV?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÇËײµÁ}€‹35?47A{~‰±¼ÊÎÚÇË׬°»}€‹35?‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL[^iìðüìðüìðüìðüìðüìðüìðüìðüìðü[^i?BL½À̽ÀÌ?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¢¥°)+5nq|ÙÜèìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¢¥°)+5')3¢¥°ìðüìðüìðüìðüìðüìðüìðüìðü £®)+5NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüOQ\OR]ìðüìðüìðüNP[NP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[½ÀÌìðüìðüÅÈÔÅÈÔìðüìðü½ÀÌNP[ìðüìðüìðümp{mp{ìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðüìðüìðüìðüìðüìðüâæò%'2½ÀÌìðüìðü½À̉Œ—ìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞNP[NP[ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâåñLNY8:EÅÈÔìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâåñLNYMOZâåñìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüàäðNP[NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðü›ŸªœŸ«ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[½ÀÌìðüìðüìðüuxƒuxƒìðüìðüìðü½ÀÌNP[ìðüìðüìðüìðü47A47AìðüìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^i[^i[^i[^i%'2½ÀÌìðüìðüìðü<>INP[[^i[^i[^i[^iÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÜèìðüìðüìðüìðüìðüìðü>AK]`kìðüìðüìðüìðüìðüìðüìðüÝáíÜàììðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÜèìðüìðüìðüìðüìðüìðü>AKADNìðüìðüìðüìðüìðüìðüÖÚåÖÚåìðüìðüìðüìðüìðüìðüCEP‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÞâîìðüìðüèìøèìøìðüìðüÝáí"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü¾Á;ÁÍìðüìðüìðü!OQ\ìðüìðüìðüìðü')3')3ìðüìðüìðüìðüOQ\¥©´ìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü¥©´?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞ47Aìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞ!+sv�êîúìðüìðüìðüÇË×SV`ìðüìðüìðüìðüìðüª¹SV`SV`ª¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞ!+sv�êîúìðüìðüìðüÇË× ÅÈÔìðüìðüìðüìðüuxƒ!$.!$.vy„ìðüìðüìðüìðüÇÊÖ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ‘• ìðüìðüìðüZ]h[^iìðüìðüìðü�”Ÿ¾ÁÍìðüìðüìðü!"ìðüìðüìðüìðüìðü!"ìðüìðüìðü¾ÁÍž¡ìðüìðüìðü� ¬� ¬ìðüìðüìðüž¡!$.ßãïìðüìðüìðü€ƒŽ€ƒŽìðüìðüìðüÞâî!$.� ¬ìðüìðüìðüž¡[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~47AìðüìðüìðüìðüÛßëOR]OR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~nq|ìðüìðüìðüØÛç46@58BÙÝéìðüìðüìðüWYdÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞEGRìðüìðüìðü§ª¶§ª¶ìðüìðüìðüEGR†Š•ìðüìðüìðüNP[NP[ìðüìðüìðüìðüìðüNP[NP[ìðüìðüìðü†‰”')3ìðüìðüìðüìðüNP[NP[ìðüìðüìðüìðü')3Z]hìðüìðüìðüìðüFITGJTìðüìðüìðüìðüZ]hNP[ìðüìðüìðüìðü')3[^iìðüìðüìðü[^i’•¡ìðüìðüìðügjuÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüÉÍÙ·»ÆìðüìðüìðüÊÎÚ$&1$&1ÊÎÚìðüìðüìðü¶ºÅÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüÉÍÙÈÌØìðüìðüìðüNP[LNYìðüìðüìðü;=HÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÒÖâìðüìðüìðü%%ìðüìðüìðüÑÕáNP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[uxƒìðüìðüìðüÅÈÔÅÈÔìðüìðüìðüuxƒ“–¢ìðüìðüìðüÌÐÛÌÐÛìðüìðüìðü’•¡ÅÈÔìðüìðüìðüuxƒ[^iìðüìðüìðü[^i=?Iìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüìðüìðüìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðü')3ps~ìðüìðüìðüÞâî,/9,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðü')3+.8ìðüìðüìðü±´ÀY\g•˜£XZeÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ†‰”ìðüìðüìðüehsehsìðüìðüìðü†‰”"ìðüìðüìðü¾Á;ÁÍìðüìðüìðüìðüìðü¾Á;ÁÍìðüìðüìðü!ÆÉÕìðüìðüìðüuxƒuxƒìðüìðüìðüÆÉÕÌÐÛìðüìðüìðü’•¡“–¢ìðüìðüìðüÌÐÛuxƒìðüìðüìðüÆÉÕ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü<>IÏÒÞìðüìðüÏÒÞmp{ìðüìðüìðüÄÇÓÄÇÓìðüìðüìðümp{ÏÒÞìðüìðüÏÒÞtw‚ìðüìðüìðüJMW ÖÚåìðüìðüìðü\_j\_jìðüìðüìðüÕÙåÏÒÞìðüìðüÏÒÞtw‚ìðüìðüìðüJMWJMWìðüìðüìðütw‚ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ:IÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüàäð#$àäðìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~‚…�ìðüìðüìðüFITGJTìðüìðüìðü�„�ÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~tv�ìðüìðüìðüØÛç8:EÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞqtìðüìðüìðü{~‰|Šìðüìðüìðüps~†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”OQ\ìðüìðüìðüìðüìðüìðüìðüìðüOQ\¥©´ìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü¥©´')3ìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðüìðümp{mp{ìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ ",tv�êîúìðüìðüìðüÈÌØ«¯ºìðüìðüìðü((ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞ ",tv�êîúìðüìðüìðüÈÌØËÏÚìðüìðüìðüìðütw‚!#-ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ$&1ìðüìðüìðüÇË×ÇË×ìðüìðüìðü#&0NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[ž¡ìðüìðüìðüìðüìðüìðüž¡!$.ßãïìðüìðüìðüìðüìðüìðüÞâî!$.� ¬ìðüìðüìðüž¡[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðüÄÇÓÄÇÓìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÝéìðüìðüìðüìðüìðüìðü?BL»¾Êìðüìðüåéõæêöìðüìðüº½ÉÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÝéìðüìðüìðüìðüìðüìðü?BL=@JìðüìðüìðüìðüìðüìðüÛßëÇËײµÁ}€‹35?ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðü:IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÇÊÖ²µÁ}€‹35?º½Éìðüìðüæêöåéõìðüìðü»¾ÊÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüìðü35?46@{~‰±´ÀÆÉÕÙÜèìðüìðüìðüìðüìðüìðü>AKÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüEGREGRìðüìðüìðü§ª¶NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[')3ìðüìðüìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ«¯ºìðüìðüìðü((ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞž¡ìðüìðüìðü� ¬!+sv�êîúìðüìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü�”Ÿ‘• ìðüìðüìðüZ]h"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!� ¬ìðüìðüìðüìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞ� ¬ìðüìðüìðüž¡[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�„�ìðüìðüìðüGJTFITìðüìðüìðü‚…�ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[8:EÙÜèìðüìðüìðüsv�ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞèìøìðüìðüÝáíÞâîìðüìðüèìø¾ÁÍìðüìðüìðü!"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!"ìðüìðüìðü¾ÁÍNP[ìðüìðüìðüìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüìðü')3[^iìðüìðüìðü[^i’•¡ìðüìðüìðügjuÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞUXbìðüìðüìðü}�Œ?BL½À̽ÀÌ?BL}€‹ìðüìðüìðüVXcÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔKNXìðüìðüìðüÇË×ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞœŸ«ìðüìðüìðüOQ\OR]ìðüìðüìðü›Ÿª†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”ÅÈÔìðüìðüìðüuxƒuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞÅÈÔìðüìðüìðüuxƒ[^iìðüìðüìðü[^i=?Iìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ",ìðüìðüìðüÆÉÕ½ÀÌìðüìðüØÛç(*4ÆÉÕìðüìðüìðü!#-ÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒ³¶Âìðüìðüìðü$&1ÏÒÞìðüìðüÏÒÞÁÅÐìðüìðüàäðáåðìðüìðüÀÄÏOR]ìðüìðüìðü›ŸªœŸ«ìðüìðüìðüOQ\NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[uxƒìðüìðüìðüÆÉÕÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÆÉÕ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü<>IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüDFQ½ÀÌìðüìðüìðü¾ÂÎDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3wz…ìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðü *!+ìðüìðüìðü«¯ºÞâîìðüìðüèìøèìøìðüìðüÝáí"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!')3ìðüìðüìðüìðüOQ\OQ\ìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞkmxìðüìðüìðüª¹ADNìðüìðüìðüìðü¥©´©¬¸ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞž¡ìðüìðüìðü� ¬acnìðüìðüìðüXZeÏÒÞìðüìðüÏÒÞ~�ŒìðüìðüìðüWYdWYdìðüìðüìðü}�Œ‘• ìðüìðüìðüZ]h[^iìðüìðüìðü�”Ÿ¾ÁÍìðüìðüìðüìðüìðüìðü¾Á;ÁÍìðüìðüìðüìðüìðüìðü¾ÁÍ� ¬ìðüìðüìðüž¡ž¡ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞ� ¬ìðüìðüìðüž¡[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÕÙåìðüìðüìðü\_jY\gìðüìðüìðüìðüŒ�šìðüìðüìðüÖÚå ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[sv�ìðüìðüìðüJMWÏÒÞìðüìðüÏÒÞHKUìðüìðüìðü¤¨³¤¨³ìðüìðüìðüHKUEGRìðüìðüìðü§ª¶§ª¶ìðüìðüìðüEGR†Š•ìðüìðüìðüìðüìðüìðü†‰”†Š•ìðüìðüìðüìðüìðüìðü†‰”NP[ìðüìðüìðüìðü')3')3ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüìðü')3[^iìðüìðüìðü[^i’•¡ìðüìðüìðügjuÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞps~ìðüìðüìðüÞâî,/9tv�ìðüìðüìðüìðüìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔXZe•˜£Y\g¯³¾ìðüìðüìðü*,6ÏÒÞìðüìðüÏÒÞÕÙåìðüìðüìðü@CMADNìðüìðüìðüÔØäÒÖâìðüìðüìðüìðüìðüìðüÑÕáNP[ìðüìðüìðüìðüìðüìðüNP[NP[ìðüìðüìðüìðüìðüìðüNP[ÅÈÔìðüìðüìðüuxƒuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞÅÈÔìðüìðüìðüuxƒ[^iìðüìðüìðü[^i=?Iìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¶ºÅìðüìðüìðüÊÎÚ$&1Œ�šìðüìðüìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒ;=HìðüìðüìðüNP[LNYìðüìðüìðüËÏÚÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÇÊÖÇË×ìðüìðüìðüuxƒ†‰”ìðüìðüìðüìðüìðüìðü†‰”"ìðüìðüìðüìðüìðüìðü!"ìðüìðüìðüìðüìðüìðü!uxƒìðüìðüìðüÆÉÕÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÆÉÕ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü<>IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ47AìðüìðüìðüìðüÛßëOR]OR]ÛßëìðüìðüìðüìðüADNÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3WYdìðüìðüìðüØÛç46@58BÙÝéìðüìðüìðümp{ÏÒÞìðüìðüÏÒÞ
+ÔØäìðüìðüìðüµ¹Ä!$.!$.µ¹ÄìðüìðüìðüÔØä
+:I½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I=@J·»Æìðüìðüìðüìðüìðüìðüìðü·»Æ?BL;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>IÏÒÞìðüìðüÏÒÞ<>I¸¼Çìðüìðüìðüìðüìðüìðüìðü¼¿Ë9;F½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞdgrÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêehsNP[ìðüìðüìðüNP[½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ%'2³¶ÂìðüìðüìðüNP[[^iìðüìðüìðü[^i½ÀÌìðüìðü½ÀÌèìøìðüìðüìðüìðüìðüìðüèìøps~or}èìøìðüìðüìðüìðüìðüìðüèìøps~½ÀÌìðüìðü½ÀÌdgrÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêehs;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^ak]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü—š¥[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ÛßëìðüìðüìðüìðüNP[[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’��’�ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�ÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü—š¥]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_NP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNYQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüéíùÓ×ãìðüìðüìðüìðüìðüìðüQT_?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüåéõÐÔàäèôìðüìðüìðüìðüìðü—š¥[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüìðüìðüŠ�˜[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüìðüìðüÙÝéÙÜèìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÝéÙÜèìðüìðüìðüìðüìðüor}ÏÒÞìðüìðüìðüìðüìðüìðüìðüåéõÐÔàäèôìðüìðüìðüìðüìðü—š¥QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_'ØÛçìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðü×Ûæ'!ÛßëìðüìðüìðüÖÚå\_j
+]`kÔØäìðüìðüìðüÛßë'ØÛçìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞ"ØÛçìðüìðüìðüÙÜè_bl
`bmÚÞêìðüìðüìðüØÛç'[^iìðüìðüìðü[^i'ØÛçìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü®²½GJTFIT®²½ìðüìðüìðüìðüdgr[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŸ¢®ìðüìðüìðüìðüìðübdo[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðü£§²47A47A£§²ìðüìðüìðüìðüìðüìðü£§²47A47A£§²ìðüìðüìðüèìø%ÏÒÞìðüìðüìðüìðüìðü®²½GJTFIT®²½ìðüìðüìðüìðüdgr'ØÛçìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðü×Ûæ'†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“Š�˜ìðüìðüìðüÉÍÙ$&1$&1ÊÎÚìðüìðüìðü(†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞ†Š•ìðüìðüìðüÉÍÙ"%/"%/ÇË×ìðüìðüìðü†‰”[^iìðüìðüìðü[^i†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü‚…�‚…�ìðüìðüìðüÚÞê[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ9;FÇÊÖìðüìðüìðüìðüÇÊÖ9;F[^iìðüìðüìðü[^iÏÒÞìðüìðüìðü£§²£§²ìðüìðüìðüìðü£§²£§²ìðüìðüìðüps~ÏÒÞìðüìðüìðüìðü‚…�‚…�ìðüìðüìðüÚÞꆉ”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“ëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüêîúæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™ëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞ êîúìðüìðüìðü;=H;=Hìðüìðüìðüëïû[^iìðüìðüìðü[^iëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü®²½®²½ìðüìðüìðü^ak[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüŸ¢®[^iìðüìðüìðü[^iÏÒÞìðüìðüìðü47A47Aìðüìðüìðüìðü47A47Aìðüìðüìðüª¹ÏÒÞìðüìðüìðü®²½®²½ìðüìðüìðü^akëïûìðüìðüìðü;=H;=Hìðüìðüìðüêîú\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü[^iY\gìðüìðüìðü•˜£$\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞXZeìðüìðüìðü•˜£“–¢ìðüìðüìðü\_j[^iìðüìðüìðü[^i\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüFITGJTìðüìðüìðü—š¥[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðüìðüìðüuxƒ[^iìðüìðüìðü[^iÏÒÞìðüìðüÙÜèÙÝéìðüìðüÙÜèÙÝéìðüìðüÇÊÖÏÒÞìðüìðüìðüFITGJTìðüìðüìðü—š¥\_jìðüìðüìðü“–¢“–¢ìðüìðüìðü[^i�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüCEPDFQìðüìðüìðü�’�“–¢ìðüìðüìðüBDO�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞ�“žìðüìðüìðüEGRCEPìðüìðüìðü�“ž[^iìðüìðüìðü[^i�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüäèôåéõìðüìðü¾ÁÍ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ³¶ÂìðüìðüìðüìðüÛßëNP[[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüäèôåéõìðüìðü¾ÁÍ�“žìðüìðüìðüCEPDFQìðüìðüìðü�’�º½Éìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü
ìðüìðüìðü¹½È´¸Äìðüìðüìðü
+º½Éìðüìðüìðü
ìðüìðüìðüÏÒÞ¶ºÅìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüº½É[^iìðüìðüìðü[^iº½Éìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÛßëìðüìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞº½Éìðüìðüìðü
ìðüìðüìðü¹½ÈÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüØÛçÙÜèìðüìðüÈÌØÉÍÙìðüìðüÔØäÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙ[^iìðüìðüìðü[^iÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüÙÜèØÛçìðüìðüÉÍÙÇË×ìðüìðüÖÚåÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^iÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÈÌØìðüìðüÙÜèØÛçìðüìðüÉÍÙ¹½Èìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü
ìðüìðüìðüº½É´¸Äìðüìðüìðü
¹½Èìðüìðüìðü
ìðüìðüìðüÏÒÞ´·ÃìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL[^iìðüìðüìðü[^i¹½Èìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüÇÊÖ9;F?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¹½Èìðüìðüìðü
ìðüìðüìðüº½É�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüDFQCEPìðüìðüìðü�“ž”—¢ìðüìðüìðüDFQ�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞ‘• ìðüìðüìðüADN[^iìðüìðüìðü[^i�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�’�ìðüìðüìðüDFQCEPìðüìðüìðü�“ž[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü\_jXZeìðüìðüìðü•˜£$[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞZ]hìðüìðüìðü”—¢$[^iìðüìðüìðü[^i[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü“–¢“–¢ìðüìðüìðü\_jêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüëïûæêöìðüìðüìðü9;F7:DÓ×ãìðü‹Ž™êîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™[^iìðüìðüìðü[^iêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞêîúìðüìðüìðü;=H;=Hìðüìðüìðüëïû…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”Š�˜ìðüìðüìðüÉÍÙ$&1$&1ÉÍÙìðüìðüìðü(…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞˆ‹—ìðüìðüìðüÇË×$&1$&1ÊÎÚìðüìðüìðü([^iìðüìðüìðü[^i…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”'×ÛæìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüØÛç'!ÙÜèìðüìðüìðüÔØä]`k
+
\_jÖÚåìðüìðüìðüÛßë'×ÛæìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞ"Üàììðüìðüìðü×Ûæ_bl
+]`kÔØäìðüìðüìðüÛßë[^iìðüìðüìðü[^i'×ÛæìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ'×ÛæìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüØÛç'QT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_OR]ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüNP[QT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞNP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNY[^iìðüìðüìðü[^iQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k^akìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü\_j]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^ak[^iìðüìðüìðü[^i]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H?BL·»Æìðüìðüìðüìðüìðüìðüìðü·»Æ=@J<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H½ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü·»Æ?BLNP[ìðüìðüìðüNP[<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌ?BLâæòìðüìðü½ÀÌNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\GJT’•¡¼¿ËÇË×¾ÂÎ�”ŸGJTOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\?BL½À̽ÀÌ?BLFIT�”Ÿ¾ÂÎÇË×¼¿Ë’•¡GJT‰Œ—ÏÒÞ‰Œ—OQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\ÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÙÜèìðüìðüÇË××ÛæìðüìðüÉÍÙ!"!+ìðüìðüìðü²µÁìðüìðüìðü¶ºÅehsìðüìðühkvtw‚ìðüìðüìðü}€‹SV`ìðüìðüìðüŠ�˜ÈÌØìðüìðüìðü47A7:Dìðüìðüìðüìðü35?µ¹ÄìðüìðüìðüJMW¤¨³ìðüìðüìðüÖÚåMOZILVÚÞêìðüìðüìðü£§²OR]OR]†‰”ìðüìðüìðüÊÎÚ$&1âåñìðüìðüìðüìðü²µÁvy„bdovy„´¸Äìðüìðüìðüìðüãçó(*4Š�˜ìðüìðü´¸Äknykmxµ¹ÄìðüìðüìðüìðüacnKNXìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüJMWÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðü™�¨?BLÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüËÏÚ=?Iˆ‹—ìðüìðüìðüìðüìðüìðüìðüìðü›Ÿª or}ÇË×ìðüìðüìðüìðüìðüÅÈÔtv�`bmËÏÚìðüìðüìðüìðüÊÎÚcfq*,6JMWVXcOR]&(347AUXbQT_02=NP[NP[%'2[^i%'2NP[NP[Y\gÀÄÏìðüìðü‰Œ—%'2âæòìðüâæò%'2‰Œ—ìðüìðüÀÄÏY\g?BLÀÄÏìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüÀÄÏ?BL½ÀÌìðüìðüìðüìðüìðü‰Œ—[^iìðüìðüìðü[^i‰Œ—ìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðü¿ÃÏX[f[^iìðüìðüìðü[^iX[f¿ÃÏìðüìðüìðüÏÒÞ‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BLOQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\OQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL\_j—š¥¿ÃÏÍÑܾÁÍ—š¥\_jbep›ŸªÀÄÏËÏÚ¾ÂΛŸªbep?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌ;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌehsÚÞêìðüìðüìðüìðüìðüìðüìðü›ŸªlozÞâîìðüìðüìðüìðüìðüìðüìðüàäðloz½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü¾Á;ÁÍìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðüÕÙå$&1$&1ÕÙåìðüìðü½À̽ÀÌìðüìðü¾Á;ÁÍìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ?BLâæòìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüâæò?BLÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüÝáí��›ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðüìðüADNADNìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü½À̽ÀÌìðüìðüìðüADNBDOìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ?BLâæòìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüâæò?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüæêöÓ×ãäèôìðüìðü�’�lozìðüìðüìðüìðüìðüâæòÒÖâåéõìðüìðüìðüìðüìðüfit?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞdgrìðüìðüìðüšž©šž©ìðüìðüìðüdgrtv�ìðüìðüìðütv�tv�ìðüìðüìðüìðütv�tv�ìðüìðüìðütv�BDOìðüìðüìðüìðüšž©šž©ìðüìðüìðüìðüBDOdgrìðüìðüìðüšž©›Ÿªìðüìðüìðüdgr?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüìðüBDO?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðüâæò?BLÏÒÞìðüìðüìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðü×Ûæ''ØÛçìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü®²½GJT>AKFITÛßëìðüìðüìðü¨«·@CMADN¨«·ìðüìðüìðü…ˆ“[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞáåðìðüìðüìðü) *ìðüìðüìðüáåð
*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7_blìðüìðüìðüìðü}€‹}€‹ìðüìðüìðüìðü_bláåðìðüìðüìðü) ",ìðüìðüìðüßãï
+}€‹ìðüìðüìðüìðü_bl½ÀÌìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðü½ÀÌ%'2[^i%'2ÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü‚…�BDOìðüìðüìðü¦©µšž©ìðüÒÖâ.0;[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞˆ‹—ìðüìðüìðüvy„vy„ìðüìðüìðü‡‹–½ÀÌìðüìðüìðü*-7*-7ìðüìðüìðüìðüìðüìðü*-7*-7ìðüìðüìðü½ÀÌ}€‹ìðüìðüìðüìðü_bl_blìðüìðüìðüìðü}€‹ˆ‹—ìðüìðüìðüvy„z}ˆìðüìðüìðü†‰”_blìðüìðüìðüìðü}€‹½ÀÌìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðü½ÀÌilvéíùìðüæêö[^iÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüêîúëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü®²½XZeìðüìðüìðü`bm ",[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ/1<ìðüìðüìðüÏÒÞÐÓßìðüìðüìðü/1<tv�ìðüìðüìðütv�tv�ìðüìðüìðüìðüìðüìðütv�tv�ìðüìðüìðütv�šž©ìðüìðüìðüìðüADNADNìðüìðüìðüìðüšž©/1<ìðüìðüìðüÏÒÞÓ×ãìðüìðüìðü,/9ADNìðüìðüìðüìðüšž©?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðüâæò?BL)+5©¬¸ìðüìðüìðüìðüìðüŠ�˜HKU½À̽ÀÌ?BLÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü[^i\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüFITDFQìðüìðüìðü£§²[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðüSV`SV`ìðüìðüìðü«¯º*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7¸¼ÇìðüìðüìðüÕÙå$&1ÕÙåìðüìðüìðü¸¼Ç¬°»ìðüìðüìðüSV`X[fìðüìðüìðü¨«·$&1ÕÙåìðüìðüìðü¸¼Ç?BLâæòìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüâæò?BLilvéíùìðüìðüìðüìðüìðüìðüìðü¸¼Ç.0; ‰Œ—ìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüCEPDFQìðüìðüìðü�’��“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüäèô
+Üàììðüìðüìðü«®¹>AK[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðü«¯º¬°»ìðüìðüìðüSV`½ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½ÀÌ$&1ÖÚåìðüìðüìðü¸¼ÇìðüìðüìðüÖÚå$&1SV`ìðüìðüìðü«¯º²µÁìðüìðüìðüNP[¸¼ÇìðüìðüìðüÖÚå$&1?BLâæòìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüâæò?BL‰Œ—ìðüìðüìðüìðüìðü¸¼Çìðüìðüìðüìðüæêö[^iÉÍÙìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðü
ìðüìðüìðü¹½Èº½Éìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüÐÓßps~ìðüìðüìðüìðüìðüäèôÐÔàÂÆÑ� ¬`bm
[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÐÓßìðüìðüìðü/1</1<ìðüìðüìðüÏÒÞtv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�BDOìðüìðüìðüìðüìðüìðüìðüBDOÐÓßìðüìðüìðü/1<69CìðüìðüìðüÉÍÙšž©ìðüìðüìðüìðüBDOÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüêîújlwŠ�˜ìðüìðüìðüìðüìðüìðüìðüìðüìðüÊÎÚ?BLÏÒÞìðüìðüØÛçÙÜèìðüìðüÈÌØÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüìðüìðüìðüìðüìðüìðüÞâîhkv[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðü‡‹–ˆ‹—ìðüìðüìðüvy„*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7_blìðüìðüìðüìðüìðü_blvy„ìðüìðüìðü‡‹–�”Ÿìðüìðüìðüor}}€‹ìðüìðüìðüìðü_blÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðü©¬¸)+5[^iæêöìðüìðüìðüìðüìðüìðü‰Œ— ÏÒÞìðüìðüÙÜèØÛçìðüìðüÉÍÙÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞilvÞâîìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ *ìðüìðüìðüáåð
áåðìðüìðüìðü)½ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½ÀÌ_blìðüìðüìðüìðüìðü_bl *ìðüìðüìðüáåð
"êîúìðüìðüêîú"_blìðüìðüìðüìðü}€‹ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞNP[NP[-0:¸¼ÇìðüìðüìðüÊÎÚILVÏÒÞìðüìðüìðü
ìðüìðüìðüº½É¹½Èìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ
_bl›ŸªÀÄÏÐÓßäèôìðüìðüìðüìðüìðüps~[^iìðüìðüìðü[^iÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞšž©ìðüìðüìðüdgrdgrìðüìðüìðüšž©tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�ADNìðüìðüìðüìðüìðüìðüìðüADNšž©ìðüìðüìðüdgrnq|ìðüìðüìðü‘• ADNìðüìðüìðüìðüšž©ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ‰Œ—ÏÒÞ‰Œ— ÏÒÞìðüìðüìðüDFQCEPìðüìðüìðü�“ž�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ>AK«®¹ìðüìðüìðüÝáí[^iìðüìðüìðü[^i¾ÂÎìðüìðüäèôåéõìðüìðüÏÒÞADNìðüìðüìðü¾Á;ÁÍìðüìðüìðüADN*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7$&1ÕÙåìðüìðüìðü¸¼ÇìðüìðüìðüÕÙå$&1ADNìðüìðüìðü¾ÁÍÈÌØìðüìðüìðü7:D$&1ÕÙåìðüìðüìðü¸¼ÇÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü\_j[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¥©´ìðüìðüìðüFHS[^iìðüìðüìðü[^i˜›¦ìðüìðüìðüFITGJTìðüìðüìðüÏÒÞ¾ÁÍìðüìðüìðüADNìðüìðüìðü¾ÁͽÀÌìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðü½À̸¼ÇìðüìðüìðüÖÚå$&1ÖÚåìðüìðüìðü¸¼Ç¾ÁÍìðüìðüìðüMOZìðüìðüìðü³¶Â¸¼ÇìðüìðüìðüÖÚå$&1ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüëïûêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ",acnìðüìðüìðüY\g[^iìðüìðüìðü]`k^akìðüìðüìðü®²½®²½ìðüìðüìðüÏÒÞdgrìðüìðüìðüšž©ìðüìðüìðüdgrtv�ìðüìðüìðüìðüìðüìðütv�tv�ìðüìðüìðüìðüìðüìðütv�šž©ìðüìðüìðüìðüBDOBDOìðüìðüìðüìðüšž©dgrìðüìðüìðü§ª¶ìðüìðüìðüY\gšž©ìðüìðüìðüìðüBDOÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ.0;ÒÖâìðüšž©¦©µìðüìðüìðüCEPILVìðüìðüìðü��›ADNtw‚58BÚÞêìðüìðüìðü‚…�‚…�ìðüìðüìðüìðüÏÒÞáåðìðüìðüìðüìðüìðüáåð
*-7ìðüìðüìðüìðüìðüìðü*-7*-7ìðüìðüìðüìðüìðüìðü*-7}€‹ìðüìðüìðüìðü_bl_blìðüìðüìðüìðü}€‹áåðìðüìðüìðüìðüìðüÔØä}€‹ìðüìðüìðüìðü_blÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüØÛç''×ÛæìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ…ˆ“ìðüìðüìðü¨«·@CMADN¨«·ìðüìðüìðüÞâî!ìðüìðüìðüìðü`bm_blìðüìðüëïû$&1ehsìðüìðüìðüìðü®²½GJTFIT®²½ìðüìðüìðüìðüìðüÏÒÞˆ‹—ìðüìðüìðüìðüìðü‡‹–½ÀÌìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðü½ÀÌ_blìðüìðüìðüìðü}€‹}€‹ìðüìðüìðüìðü_blˆ‹—ìðüìðüìðüìðüìðü{~‰_blìðüìðüìðüìðü}€‹ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_QT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞfitìðüìðüìðüìðüìðüâæòÒÖâåéõìðüìðüìðüìðüìðüloz‘• ìðüìðüìðüìðüÞâîÛßëìðüìðüìðüìðüOQ\—š¥ìðüìðüìðüìðüìðüåéõÐÔàäèôìðüìðüìðüìðüìðüìðüìðüÏÒÞ/1<ìðüìðüìðüìðüìðü/1<tv�ìðüìðüìðüìðütv�tv�ìðüìðüìðüìðütv�ADNìðüìðüìðüìðüšž©šž©ìðüìðüìðüìðüADN/1<ìðüìðüìðüìðüìðü!#-ADNìðüìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�"ÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüÈÌØ—š¥ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðü«¯º*-7ìðüìðüìðüìðü*-7*-7ìðüìðüìðüìðü*-7½ÀÌìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü½À̬°»ìðüìðüìðüœŸ«½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüÀÄÏY\g[^iìðüìðüìðü[^iY\gÀÄÏìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌlozÞâîìðüìðüìðüìðüìðüìðüìðüàäðloz%'2¶ºÅìðüìðüìðüìðüìðüìðü´·Ã%'2dgrÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêehs½ÀÌìðüìðü½ÀÌSV`ìðüìðüìðüSV`½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðüÖÚå$&1$&1ÖÚåìðüìðü½À̾ÁÍìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðü‰Œ—[^iìðüìðüìðü[^i‰Œ—ìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\OQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\ÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BLbep›ŸªÀÄÏËÏÚ¾ÂΛŸªbepX[f¢¥°ÈÌØÈÌØ¢¦±[^i^ak—š¥¾ÁÍÏÒÞ¾ÂΘ›¦^ak?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLBDOìðüìðüìðü¾ÂÎ?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL¿ÃÏìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðü¿ÃÏ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ›ŸªìðüìðüìðüdgrX[f¿ÃÏìðüìðü‰Œ—[^iìðüìðüìðü[^i‰Œ—ìðüìðü¿ÃÏX[fÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ",ìðüìðüìðüßãï
+NP[NP[[^iìðüìðüìðü[^iNP[NP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞz}ˆìðüìðüìðü†‰”[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÓ×ãìðüìðüìðü,/9%'2âæòìðüâæò%'2ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞX[fìðüìðüìðü¨«·%'2[^i%'2ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ69CìðüìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�”Ÿìðüìðüìðüor}ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüêîú"‰Œ—ìðüìðü‰Œ—‰Œ—ìðüìðü‰Œ—‰Œ—ìðüìðü‰Œ—NP[NP[NP[NP[NP[NP[
\ No newline at end of file
diff --git a/evidence/allen-omega-L694/L758/font.log b/evidence/allen-omega-L694/L758/font.log
new file mode 100644
index 00000000..1f885320
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/font.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
diff --git a/evidence/allen-omega-L694/L758/fontalpha-mutant.log b/evidence/allen-omega-L694/L758/fontalpha-mutant.log
new file mode 100644
index 00000000..4dba5479
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/fontalpha-mutant.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 1
+414 0
+415 0
+416 0
+417 0
+418 0
+419 1
+420 0
+421 0
diff --git a/evidence/allen-omega-L694/L758/fontroot-mutant.log b/evidence/allen-omega-L694/L758/fontroot-mutant.log
new file mode 100644
index 00000000..326cd397
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/fontroot-mutant.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 1
+11 1
+12 1
+13 1
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 1
+415 1
+416 1
+417 1
+418 1
+419 0
+420 1
+421 1
diff --git a/evidence/allen-omega-L694/L758/framecheck-mutant.log b/evidence/allen-omega-L694/L758/framecheck-mutant.log
new file mode 100644
index 00000000..d5454577
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/framecheck-mutant.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 1
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L758/full.exit b/evidence/allen-omega-L694/L758/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L758/full.log b/evidence/allen-omega-L694/L758/full.log
new file mode 100644
index 00000000..ddd49563
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/full.log
@@ -0,0 +1,52 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+presentation compile=0 native-exit=0
+font compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+font-output compile=0 native-exit=0
+font-render compile=0 native-exit=0
+font native masks match frozen external legacy oracle
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=1
+framecheck mutant compile=0 rejected-exit=1
+staleview mutant compile=0 rejected-exit=1
+inputtail mutant compile=0 rejected-exit=1
+fontroot mutant compile=0 rejected-exit=1
+fontalpha mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L758/green2.exit b/evidence/allen-omega-L694/L758/green2.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/green2.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L758/green2.log b/evidence/allen-omega-L694/L758/green2.log
new file mode 100644
index 00000000..5e5ba97d
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/green2.log
@@ -0,0 +1,412 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
diff --git a/evidence/allen-omega-L694/L758/hash-mutant.log b/evidence/allen-omega-L694/L758/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L758/independent-review/inventory.json b/evidence/allen-omega-L694/L758/independent-review/inventory.json
new file mode 100644
index 00000000..edc31098
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/inventory.json
@@ -0,0 +1,27 @@
+{
+ "parent-boundary.log": "f1213f3c6bc539ee37f85581502cf6e52cc7236ac3604b924992150e13724901",
+ "parent-verification.json": "8a8c6fc627ecd5135d4c386a0c8f01020fc77c8c3e535f612767ac4594fce33f",
+ "probes/font-boundary.om": "d59c6611798c7fd922c51be697b72c92c9b47d41cf194ed59c0421184433851c",
+ "receipt-disposition.md": "5d123ee877c380b3b921b3f7b924056804aa4aed207da92335241b629ac9558d",
+ "receipts/boundary-build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "receipts/boundary-build2.log": "d94b9498f6a6c50ebc8c0a393344f85412452d873468eea2670fd1f73da86c8a",
+ "receipts/boundary-final-build.log": "1862f1fb98c86018fe59b2da091eee9d110aa2d85e106da84a88438ccbd8cc58",
+ "receipts/boundary-final.log": "94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380",
+ "receipts/boundary-final.sha256": "a9f7f67c5dc83d5e9eed6f5725fe9ea8c3a93c9a0dbac28eecdf07a396190b3a",
+ "receipts/boundary-final2-build.log": "54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c",
+ "receipts/boundary-verified-build.log": "54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c",
+ "receipts/boundary.log": "94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380",
+ "receipts/boundary.sha256": "c9e6e1e5ade70e701259790679eff88fe8ee94f3dc697b741d4374c53590107d",
+ "receipts/closure.log": "9f3d4ebee0f50d33b4b77994279aa6ec9704f878dec6eefe1acdf9c49bf66aa1",
+ "receipts/failure-and-receipt-hashes.sha256": "f7eb35d3abf8eb67b761c39aa5974d8874e43f8dd37fb18d60ed1a13d136653d",
+ "receipts/focused-build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "receipts/focused-font.log": "1717fc2d53d03151502581b646ecfe8a8f55620641d4d99bc46c28a4eb7842b5",
+ "receipts/focused-font.om": "ac3f9e5eee125754df0d97822e10f050ff0a25cd41a5f528e590081e25422789",
+ "receipts/focused.sha256": "1055393d4b2fef379e486371f39f7d4cb364c2205666d4ce03a25451a19b7b53",
+ "receipts/font-boundary-final.om": "cc9b844bf8cdf7e238c8f0a8af0d3024573e94972e66748eca6b8c34d1a6e30c",
+ "receipts/font-boundary-final2.om": "cc9b844bf8cdf7e238c8f0a8af0d3024573e94972e66748eca6b8c34d1a6e30c",
+ "receipts/font-boundary-verified.om": "23aec065f06644635f4a6fdab451e1845212905a0a3bddf881e3f34c42bf1135",
+ "receipts/font-boundary.om": "5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf",
+ "receipts/font-core.om": "90ad35ebb9d78c71bcce41fcd9b005e060f7b417ad9d4894a464b4cf1e0b57b1",
+ "report.md": "d28a44e2141507a8a7151ab2ea4d6b3b117ca61b6b33bb786b213e082f20a637"
+}
diff --git a/evidence/allen-omega-L694/L758/independent-review/parent-boundary.log b/evidence/allen-omega-L694/L758/independent-review/parent-boundary.log
new file mode 100644
index 00000000..4b5a2436
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/parent-boundary.log
@@ -0,0 +1,308 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
diff --git a/evidence/allen-omega-L694/L758/independent-review/parent-verification.json b/evidence/allen-omega-L694/L758/independent-review/parent-verification.json
new file mode 100644
index 00000000..30fcedf7
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/parent-verification.json
@@ -0,0 +1,12 @@
+{
+ "pin": "61ef587ee5d24bf862705f51bffb8039c9a2ed01",
+ "declared_source_files": 26,
+ "baseline_checks": 421,
+ "independent_checks": 308,
+ "parent_replay_checks": 308,
+ "parent_binary_sha256": "4fb63b921aac869ce370b03365b609fe24a3ea7fecb2903924b8303d167e500c",
+ "source_concat_sha256": "5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf",
+ "report_sha256": "d28a44e2141507a8a7151ab2ea4d6b3b117ca61b6b33bb786b213e082f20a637",
+ "findings": "none in scoped font component",
+ "scope": "native host only"
+}
diff --git a/evidence/allen-omega-L694/L758/independent-review/probes/font-boundary.om b/evidence/allen-omega-L694/L758/independent-review/probes/font-boundary.om
new file mode 100644
index 00000000..f8735daa
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/probes/font-boundary.om
@@ -0,0 +1,61 @@
+note Independent L762 boundary probe; handwritten Omega assertions.
+global SnapAf ulong 6
+global SnapAb long 4
+fn probe ok bool to void
+check ok add get Checks 0 1
+end
+fn main to int
+probe not afinit 0 1
+probe not afinit 65 2500
+probe not afinit 1 0
+probe not afinit 1 2501
+probe afinit 1 1
+probe eq get Af 0 12
+probe eq get Af 1 0
+probe afglyph 32
+probe eq get Af 3 0
+probe eq get Af 4 1
+probe afinit 64 2500
+probe eq get Af 0 819
+probe eq get Af 1 2047
+for c ulong 95
+probe afglyph uchar add c 32
+probe le mul get Af 3 get Af 4 65536
+probe le get Af 2 160
+end
+probe afglyph 63
+for i ulong 6
+put SnapAf i get Af i
+end
+for i ulong 4
+put SnapAb i get Ab i
+end
+put Alpha 0 77
+probe not afinit 0 2500
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+if ne get Alpha 0 77
+same = false
+end
+probe same
+probe afglyph 0
+probe afglyph 63
+probe eq get Af 3 get SnapAf 3
+probe afglyph 127
+probe eq get Af 3 get SnapAf 3
+probe afglyph 255
+probe eq get Af 3 get SnapAf 3
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipt-disposition.md b/evidence/allen-omega-L694/L758/independent-review/receipt-disposition.md
new file mode 100644
index 00000000..2dbf6bae
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipt-disposition.md
@@ -0,0 +1,12 @@
+The canonical boundary.sha256 matches the final standalone probe,
+receipts/font-boundary.om, font-boundary3.elf and308-row boundary.log. Parent
+reconstructed that exact source closure from61ef587 Git objects, rebuilt a
+byte-identical executable and reproduced all308 passing rows. focused.sha256
+and failure-and-receipt-hashes.sha256 also match their original artifacts.
+
+The separately named boundary-final.sha256 is a stale developmental receipt:
+font-boundary-final.om was subsequently overwritten by a failed oversized-scratch
+probe variant, so that one source hash no longer matches. This variant and its
+original manifest are retained, not accepted as current qualification. The
+canonical boundary.sha256 and parent replay above are the accepted evidence.
+No product correction or gate relaxation was required. Original report retained.
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build.log
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build2.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build2.log
new file mode 100644
index 00000000..71a3984b
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build2.log
@@ -0,0 +1 @@
+omc: line 4151: error 3
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final-build.log
new file mode 100644
index 00000000..555ceb80
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final-build.log
@@ -0,0 +1 @@
+fresh output required
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.log
new file mode 100644
index 00000000..83fc6994
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.log
@@ -0,0 +1,309 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+exit=0
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.sha256
new file mode 100644
index 00000000..26fdbcba
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.sha256
@@ -0,0 +1,4 @@
+d59c6611798c7fd922c51be697b72c92c9b47d41cf194ed59c0421184433851c /home/drakestapleton/handoffs/L762-review/probes/font-boundary.om
+5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf /home/drakestapleton/handoffs/L762-review/receipts/font-boundary-final.om
+4fb63b921aac869ce370b03365b609fe24a3ea7fecb2903924b8303d167e500c /home/drakestapleton/handoffs/L762-review/receipts/font-boundary-final.elf
+94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380 /home/drakestapleton/handoffs/L762-review/receipts/boundary-final.log
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final2-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final2-build.log
new file mode 100644
index 00000000..a5699089
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final2-build.log
@@ -0,0 +1 @@
+omc: line 4167: error 13
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-verified-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-verified-build.log
new file mode 100644
index 00000000..a5699089
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-verified-build.log
@@ -0,0 +1 @@
+omc: line 4167: error 13
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.log
new file mode 100644
index 00000000..83fc6994
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.log
@@ -0,0 +1,309 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+exit=0
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.sha256
new file mode 100644
index 00000000..86d0ce74
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.sha256
@@ -0,0 +1,4 @@
+d59c6611798c7fd922c51be697b72c92c9b47d41cf194ed59c0421184433851c /home/drakestapleton/handoffs/L762-review/probes/font-boundary.om
+5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf /home/drakestapleton/handoffs/L762-review/receipts/font-boundary.om
+4fb63b921aac869ce370b03365b609fe24a3ea7fecb2903924b8303d167e500c /home/drakestapleton/handoffs/L762-review/receipts/font-boundary3.elf
+94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380 /home/drakestapleton/handoffs/L762-review/receipts/boundary.log
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/closure.log b/evidence/allen-omega-L694/L758/independent-review/receipts/closure.log
new file mode 100644
index 00000000..2af6a150
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/closure.log
@@ -0,0 +1,36 @@
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om
+d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om
+f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om
+c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om
+7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om
+a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8 native/omega/allen/tests/font-render.om
+b861dbdc9ef3a29157c10500767de69d2a1f5478d0bcdbbfd767bd5d69e587e2 native/omega/allen/gate.sh
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md
+CLOSURE_OK files=26 pin=61ef587ee5d24bf862705f51bffb8039c9a2ed01 worktree=clean
+92d7157386e65351325d80d5036565e406145230dfb696c9804ec80888d26904 native/kernel/ui/allen_font.c
+0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69 evidence/allen-omega-L694/L758/legacy-font.bin
+8a9adeeace1aa3e577a61c220d5fc66afd0c5959263f18736303432d0b44f6bb evidence/allen-omega-L694/L758/native-font.bin
+dec95182af5faa01ed739336ed32dcadd5168e6be35bef310042fe032113ee7f evidence/allen-omega-L694/L758/font-specimen.ppm
+e4e6800797c0ab91d415ce1fe5837d57def56b2246e2f9f0762feb3294f08893 evidence/allen-omega-L694/L758/font-specimen.png
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc
+ Class: ELF64
+ Type: EXEC (Executable file)
+ Machine: AArch64
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/failure-and-receipt-hashes.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/failure-and-receipt-hashes.sha256
new file mode 100644
index 00000000..42e92f80
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/failure-and-receipt-hashes.sha256
@@ -0,0 +1,5 @@
+9f3d4ebee0f50d33b4b77994279aa6ec9704f878dec6eefe1acdf9c49bf66aa1 /home/drakestapleton/handoffs/L762-review/receipts/closure.log
+d94b9498f6a6c50ebc8c0a393344f85412452d873468eea2670fd1f73da86c8a /home/drakestapleton/handoffs/L762-review/receipts/boundary-build2.log
+54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c /home/drakestapleton/handoffs/L762-review/receipts/boundary-final2-build.log
+54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c /home/drakestapleton/handoffs/L762-review/receipts/boundary-verified-build.log
+1055393d4b2fef379e486371f39f7d4cb364c2205666d4ce03a25451a19b7b53 /home/drakestapleton/handoffs/L762-review/receipts/focused.sha256
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-build.log
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.log b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.log
new file mode 100644
index 00000000..fc67b3a8
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.log
@@ -0,0 +1,422 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+focused_exit=0
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.om b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.om
new file mode 100644
index 00000000..62dc06df
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.om
@@ -0,0 +1,4277 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Oldmask uchar 65536
+global Oldmeta ulong 6
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn asym to bool
+w = get Af 3
+for y ulong get Af 4
+at = mul y w
+for x ulong w
+a = long get Alpha add at x
+mirror = add at sub sub w 1 x
+b = long get Alpha mirror
+d = sub a b
+if gt d 40
+ret false
+end
+if lt d -40
+ret false
+end
+end
+end
+ret true
+end
+fn main to int
+test not afglyph 65
+test not afinit 0 1250
+test not afinit 65 1250
+test not afinit 30 0
+test not afinit 30 2501
+test afinit 30 1250
+test eq get Af 0 384
+test eq get Af 1 480
+test eq afsqrt 0 0
+test eq afsqrt 15 3
+test eq afsqrt 16 4
+test eq afsqrt 18446744073709551615 4294967295
+test eq afsqrt mul ulong 1000000007 1000000007 1000000007
+test eq afsin 0 0
+test eq afsin 90 16384
+test eq afsin -90 -16384
+test eq afsin 450 16384
+test eq afcos 180 -16384
+for c ulong 95
+test afglyph uchar add c 32
+test gt get Af 5 0
+test le mul get Af 3 get Af 4 len Alpha
+if eq c 0
+test eq get Af 3 0
+test eq get Af 4 1
+else
+ink = ulong 0
+for i ulong mul get Af 3 get Af 4
+if gt get Alpha i 128
+ink = add ink 1
+end
+end
+test ge ink 4
+end
+end
+test afglyph 111
+test asym
+test afglyph 63
+for i ulong mul get Af 3 get Af 4
+put Oldmask i get Alpha i
+end
+for i ulong 6
+put Oldmeta i get Af i
+end
+test afglyph 0
+same = true
+for i ulong 6
+if ne get Oldmeta i get Af i
+same = false
+end
+end
+for i ulong mul get Af 3 get Af 4
+if ne get Oldmask i get Alpha i
+same = false
+end
+end
+test same
+test not afinit 999 1250
+test eq get Af 0 get Oldmeta 0
+test eq get Af 3 get Oldmeta 3
+test afinit 64 2500
+test afglyph 87
+test le mul get Af 3 get Af 4 len Alpha
+test afinit 1 1
+test afglyph 65
+note Independent analytic coverage for round-capped strokes and zero-length dots.
+put Af 2 1
+put Af 1 128
+put Ag 0 0
+put Ag 1 0
+put Ag 2 512
+put Ag 3 0
+test eq afalpha 256 0 255
+test eq afalpha 256 128 127
+test eq afalpha 256 256 0
+test eq afalpha 768 0 0
+test eq afalpha -128 0 127
+put Ag 0 512
+put Ag 2 0
+test eq afalpha 256 128 127
+put Ag 0 0
+test eq afalpha 0 0 255
+test eq afalpha 0 128 127
+test eq afalpha 0 256 0
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/focused.sha256
new file mode 100644
index 00000000..79d84b07
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/focused.sha256
@@ -0,0 +1,4 @@
+90ad35ebb9d78c71bcce41fcd9b005e060f7b417ad9d4894a464b4cf1e0b57b1 /home/drakestapleton/handoffs/L762-review/receipts/font-core.om
+ac3f9e5eee125754df0d97822e10f050ff0a25cd41a5f528e590081e25422789 /home/drakestapleton/handoffs/L762-review/receipts/focused-font.om
+71043853f991d69e84e32edefb3063a1276e7c7c4517ca712f8bdf0aa03c9eac /home/drakestapleton/handoffs/L762-review/receipts/focused-font.elf
+1717fc2d53d03151502581b646ecfe8a8f55620641d4d99bc46c28a4eb7842b5 /home/drakestapleton/handoffs/L762-review/receipts/focused-font.log
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final.om
new file mode 100644
index 00000000..1a0e2fe7
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final.om
@@ -0,0 +1,4248 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L762 boundary probe; handwritten Omega assertions.
+global SnapAf ulong 6
+global SnapAb long 4
+global FallbackMask uchar 65536
+fn probe ok bool to void
+check ok add get Checks 0 1
+end
+fn main to int
+probe not afinit 0 1
+probe not afinit 65 2500
+probe not afinit 1 0
+probe not afinit 1 2501
+probe afinit 1 1
+probe eq get Af 0 12
+probe eq get Af 1 0
+probe afglyph 32
+probe eq get Af 3 0
+probe eq get Af 4 1
+probe afinit 64 2500
+probe eq get Af 0 819
+probe eq get Af 1 2047
+for c ulong 95
+probe afglyph uchar add c 32
+probe le mul get Af 3 get Af 4 65536
+probe le get Af 2 160
+end
+probe afglyph 63
+for i ulong 65536
+put FallbackMask i get Alpha i
+end
+for i ulong 6
+put SnapAf i get Af i
+end
+for i ulong 4
+put SnapAb i get Ab i
+end
+put Alpha 0 77
+probe not afinit 0 2500
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+if ne get Alpha 0 77
+same = false
+end
+probe same
+for bad ulong 3
+c = ulong 0
+if eq bad 1
+c = 127
+end
+if eq bad 2
+c = 255
+end
+probe afglyph uchar c
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+for i ulong 65536
+if ne get Alpha i get FallbackMask i
+same = false
+end
+end
+probe same
+end
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final2.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final2.om
new file mode 100644
index 00000000..1a0e2fe7
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final2.om
@@ -0,0 +1,4248 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L762 boundary probe; handwritten Omega assertions.
+global SnapAf ulong 6
+global SnapAb long 4
+global FallbackMask uchar 65536
+fn probe ok bool to void
+check ok add get Checks 0 1
+end
+fn main to int
+probe not afinit 0 1
+probe not afinit 65 2500
+probe not afinit 1 0
+probe not afinit 1 2501
+probe afinit 1 1
+probe eq get Af 0 12
+probe eq get Af 1 0
+probe afglyph 32
+probe eq get Af 3 0
+probe eq get Af 4 1
+probe afinit 64 2500
+probe eq get Af 0 819
+probe eq get Af 1 2047
+for c ulong 95
+probe afglyph uchar add c 32
+probe le mul get Af 3 get Af 4 65536
+probe le get Af 2 160
+end
+probe afglyph 63
+for i ulong 65536
+put FallbackMask i get Alpha i
+end
+for i ulong 6
+put SnapAf i get Af i
+end
+for i ulong 4
+put SnapAb i get Ab i
+end
+put Alpha 0 77
+probe not afinit 0 2500
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+if ne get Alpha 0 77
+same = false
+end
+probe same
+for bad ulong 3
+c = ulong 0
+if eq bad 1
+c = 127
+end
+if eq bad 2
+c = 255
+end
+probe afglyph uchar c
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+for i ulong 65536
+if ne get Alpha i get FallbackMask i
+same = false
+end
+end
+probe same
+end
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-verified.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-verified.om
new file mode 100644
index 00000000..b42a5535
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-verified.om
@@ -0,0 +1,4248 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L762 boundary probe; handwritten Omega assertions.
+global SnapAf ulong 6
+global SnapAb long 4
+global FallbackMask uchar 4096
+fn probe ok bool to void
+check ok add get Checks 0 1
+end
+fn main to int
+probe not afinit 0 1
+probe not afinit 65 2500
+probe not afinit 1 0
+probe not afinit 1 2501
+probe afinit 1 1
+probe eq get Af 0 12
+probe eq get Af 1 0
+probe afglyph 32
+probe eq get Af 3 0
+probe eq get Af 4 1
+probe afinit 64 2500
+probe eq get Af 0 819
+probe eq get Af 1 2047
+for c ulong 95
+probe afglyph uchar add c 32
+probe le mul get Af 3 get Af 4 65536
+probe le get Af 2 160
+end
+probe afglyph 63
+for i ulong mul get Af 3 get Af 4
+put FallbackMask i get Alpha i
+end
+for i ulong 6
+put SnapAf i get Af i
+end
+for i ulong 4
+put SnapAb i get Ab i
+end
+put Alpha 0 77
+probe not afinit 0 2500
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+if ne get Alpha 0 77
+same = false
+end
+probe same
+for bad ulong 3
+c = ulong 0
+if eq bad 1
+c = 127
+end
+if eq bad 2
+c = 255
+end
+probe afglyph uchar c
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+for i ulong mul get Af 3 get Af 4
+if ne get Alpha i get FallbackMask i
+same = false
+end
+end
+probe same
+end
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary.om
new file mode 100644
index 00000000..0f27a91b
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary.om
@@ -0,0 +1,4224 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Independent L762 boundary probe; handwritten Omega assertions.
+global SnapAf ulong 6
+global SnapAb long 4
+fn probe ok bool to void
+check ok add get Checks 0 1
+end
+fn main to int
+probe not afinit 0 1
+probe not afinit 65 2500
+probe not afinit 1 0
+probe not afinit 1 2501
+probe afinit 1 1
+probe eq get Af 0 12
+probe eq get Af 1 0
+probe afglyph 32
+probe eq get Af 3 0
+probe eq get Af 4 1
+probe afinit 64 2500
+probe eq get Af 0 819
+probe eq get Af 1 2047
+for c ulong 95
+probe afglyph uchar add c 32
+probe le mul get Af 3 get Af 4 65536
+probe le get Af 2 160
+end
+probe afglyph 63
+for i ulong 6
+put SnapAf i get Af i
+end
+for i ulong 4
+put SnapAb i get Ab i
+end
+put Alpha 0 77
+probe not afinit 0 2500
+same = true
+for i ulong 6
+if ne get Af i get SnapAf i
+same = false
+end
+end
+for i ulong 4
+if ne get Ab i get SnapAb i
+same = false
+end
+end
+if ne get Alpha 0 77
+same = false
+end
+probe same
+probe afglyph 0
+probe afglyph 63
+probe eq get Af 3 get SnapAf 3
+probe afglyph 127
+probe eq get Af 3 get SnapAf 3
+probe afglyph 255
+probe eq get Af 3 get SnapAf 3
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-core.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-core.om
new file mode 100644
index 00000000..b1e69161
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-core.om
@@ -0,0 +1,4146 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
diff --git a/evidence/allen-omega-L694/L758/independent-review/report.md b/evidence/allen-omega-L694/L758/independent-review/report.md
new file mode 100644
index 00000000..ad4dcbe9
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/independent-review/report.md
@@ -0,0 +1,38 @@
+# L758 handwritten Omega font review
+
+**Verdict:** no font-component defect found in the reviewed pin. This is a static-source and native-host test review, not UI/device acceptance.
+
+## Scope and immutable source closure
+
+Reviewed `native/omega/allen/font.om`, `font-data.om`, `FONT.md`, the focused font tests/output/render fixture and the small gate/build integration at `61ef587ee5d24bf862705f51bffb8039c9a2ed01` (base `4c7888f65dca209a1e2b859ba695ae308657c03e`). At closure verification, HEAD was the pin and the worktree was clean. All 26 declared compiler/test/integration sources were byte-equal to `git show :`; their SHA-256 values and the check are in `receipts/closure.log` (`CLOSURE_OK files=26`). The separate legacy reference source hash is `92d7157386e65351325d80d5036565e406145230dfb696c9804ec80888d26904`; frozen oracle hash is `0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69` (436341 bytes, 294 records). This supports external-reference provenance; the C oracle is not a native construction/runtime backend.
+
+Pinned compiler: `~/handoffs/allen-omega-L694/omc`, SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Focused ELF is verified ELF64, AArch64, static EXEC, with no INTERP/NEEDED. Its hash and tool details appear in `receipts/closure.log` / `receipts/focused.sha256`.
+
+## Verification
+
+Executed the focused test build through `quiet-build` and the exact-pin `native/omega/allen/build-one.sh`, then ran its ELF: **421 emitted assertions, all `0`, exit 0**. Recounted emitted lines rather than relying on the parent summary.
+
+Added `probes/font-boundary.om`, handwritten seeded Omega, and compiled/run it with the same pinned build path: **308 emitted assertions, all `0`, exit 0**. It exercises the four inclusive/exclusive cap/weight boundary failures, valid extreme cap/weight settings, all 95 printable glyphs at maximum size/weight with mask-area and segment-count limits, zero-area space behavior, invalid `afinit` preserving all Af/Ab fields and a mask sentinel, and unsupported-byte fallback metric behavior. Raw probe source, concatenated executable input, ELF, output, and SHA-256s are retained under `probes/` and `receipts/`.
+
+Source review: invalid `afinit` inputs return before modifying state (`font.om:46-51`); valid setup uses fixed globals and initializes the 91-entry table (`:53-70`). The segment writer rejects counts at 160 (`:121-135`), mask bounds are checked against the 65536-byte alpha buffer (`:215-235`), and unsupported input maps to `?` (`:72-90`). Existing focused tests also cover full-width integer sqrt, signed trig, printable glyph rendering, maximum settings, fallback and invalid-init state preservation (`tests/font.om`). Parent evidence records exact native/oracle stream equivalence and specimen inspection; those are cited as prior evidence, not re-run as a UI acceptance claim.
+
+**Findings:** none, within this component scope. I did not independently compare every fallback mask byte to `?`; the parent’s frozen-oracle evidence and focused suite cover the broader mask equivalence claims.
+
+## Commands and receipts
+
+From `/home/drakestapleton/workspace/aienos-allen-omega-L694` on Spark:
+
+```sh
+quiet-build native/omega/allen/build-one.sh ~/handoffs/L762-review/receipts/focused-font.om ~/handoffs/L762-review/receipts/focused-font.elf
+~/handoffs/L762-review/receipts/focused-font.elf > ~/handoffs/L762-review/receipts/focused-font.log
+quiet-build native/omega/allen/build-one.sh ~/handoffs/L762-review/receipts/font-boundary.om ~/handoffs/L762-review/receipts/font-boundary3.elf
+~/handoffs/L762-review/receipts/font-boundary3.elf > ~/handoffs/L762-review/receipts/boundary.log
+```
+
+The exact build concatenations are preserved as `receipts/focused-font.om` and `receipts/font-boundary.om`; command output/hashes are in `receipts/focused-build.log`, `focused-font.log`, `focused.sha256`, `boundary-build.log`, `boundary.log`, and `boundary.sha256`. Source/object membership receipts: `receipts/closure.log`.
+
+Probe authoring had two compiler-fixture corrections, not product failures: an initial concatenation placed the check helper after the probe (`boundary-build2.log`, compiler error 3), then oversized extra global scratch arrays exceeded compiler storage (`boundary-final2-build.log`, error 13; corrected in final probe). Raw failed compile receipts are retained. The production worktree was untouched by this review; a later status check observed an unrelated concurrent modification to `native/omega/allen/tests/provider-core.om`, which was not inspected or changed.
+
+## Limits
+
+No full suite, 19-mutant rerun, provider/presentation re-review, deployment, service/agent restart, live transport, complete scene/layout, framebuffer/device, or physical iMac acceptance was performed.
diff --git a/evidence/allen-omega-L694/L758/inputtail-mutant.log b/evidence/allen-omega-L694/L758/inputtail-mutant.log
new file mode 100644
index 00000000..c0415908
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/inputtail-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 1
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L758/intent.log b/evidence/allen-omega-L694/L758/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L758/inventory.json b/evidence/allen-omega-L694/L758/inventory.json
new file mode 100644
index 00000000..a11ed201
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/inventory.json
@@ -0,0 +1,81 @@
+{
+ "README.md": "01e4a8de1efc0e51aa672e34133d4714eb3dd29ae3eb6b9f342f98e6d22b6097",
+ "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433",
+ "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1",
+ "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a",
+ "autosent-mutant.log": "fd09242df722583c7e04568d177eed33aeec3b4fbc67f8d1cba666941a81bf08",
+ "binaries.sha256": "9729f5f5b123f81bc4bd8550de25b57d334f13a94ddb9f6c8eafc0f755f90bee",
+ "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390",
+ "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0",
+ "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b",
+ "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5",
+ "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1",
+ "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835",
+ "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed",
+ "font-specimen.png": "e4e6800797c0ab91d415ce1fe5837d57def56b2246e2f9f0762feb3294f08893",
+ "font-specimen.ppm": "dec95182af5faa01ed739336ed32dcadd5168e6be35bef310042fe032113ee7f",
+ "font.log": "e740379ab582a55deec96e1e2cc0ad550b217409e78ea906b415765b522c028d",
+ "fontalpha-mutant.log": "4a9357c64f7baaff5d6ccce7396f34ae76c40d22b2df4e0262df3c90ba8b77f3",
+ "fontroot-mutant.log": "877fce5a15491776440a7318117a847f974aea016b3a2f162c8644302d02d0fc",
+ "framecheck-mutant.log": "80857ef43f4767086a5154d915825e2d9ab8e1dacf7382cd9cec20a6c9e945eb",
+ "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "full.log": "d170c10744417686fd9a248330a3f12cce4bd025e8b3bfcc8a34499bbbe5722d",
+ "green2.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "green2.log": "b104283bfe230886524bfa28392b62a558f2023ac3b4284b3670b6fe6f5f1757",
+ "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e",
+ "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67",
+ "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345",
+ "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e",
+ "legacy-font.bin": "0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69",
+ "legacy-oracle-collection.txt": "5f4223786948d65becb6fe0769af293d66f70a96b89ea3bfb96c3e5ec2330975",
+ "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508",
+ "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15",
+ "native-font.bin": "8a9adeeace1aa3e577a61c220d5fc66afd0c5959263f18736303432d0b44f6bb",
+ "oracle.json": "cdcace13b1b026ff645e1beb296f3a52bc03debcf6fc5b8e542afdcff59fedfa",
+ "output.om": "cc333e6cdefd18638bbe199128314f4f94bb478710ce6e53bd5e141e58f9b541",
+ "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a",
+ "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657",
+ "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7",
+ "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4",
+ "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b",
+ "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05",
+ "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a",
+ "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646",
+ "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435",
+ "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b",
+ "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04",
+ "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9",
+ "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61",
+ "red4.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "red4.log": "96201abb9793b4223e41a726757a220185b8113a9b95af58f4181c93c15bf3f8",
+ "red4.om": "4cbe50c32ea043232fb903e74d82a4b33cbb915d18324627ff25133f93dad915",
+ "red5.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "red5.log": "c0d1e14ae78c8834a3eaaf674c30e793a469a7f9f8881edeae79bc1ef684a5a5",
+ "red5.om": "a7030339452dc6ddfcb8de3ed40aa2072c73e2144c1b904c4612570d00e91060",
+ "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162",
+ "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51",
+ "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9",
+ "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8",
+ "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d",
+ "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948",
+ "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2",
+ "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2",
+ "source.sha256": "b6de68f80a404e082bb3a3959d5121e426fc9a8e96cead004350554dc4a2cc58",
+ "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b",
+ "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b",
+ "summary.json": "53839be69f24b5f8ee5e31f3bdf408f109fd800d0b7173a8f434eb3c122ad59b",
+ "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474",
+ "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e"
+}
diff --git a/evidence/allen-omega-L694/L758/keepalive-mutant.log b/evidence/allen-omega-L694/L758/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L758/legacy-font.bin b/evidence/allen-omega-L694/L758/legacy-font.bin
new file mode 100644
index 00000000..03ec1365
Binary files /dev/null and b/evidence/allen-omega-L694/L758/legacy-font.bin differ
diff --git a/evidence/allen-omega-L694/L758/legacy-oracle-collection.txt b/evidence/allen-omega-L694/L758/legacy-oracle-collection.txt
new file mode 100644
index 00000000..a6e85067
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/legacy-oracle-collection.txt
@@ -0,0 +1,35 @@
+# External collection of unmodified legacy C oracle bytes, never Omega runtime.
+from pathlib import Path
+import ctypes as C, hashlib, json, re, struct, subprocess
+h=Path.home(); w=h/'workspace/aienos-allen-omega-L694'; d=h/'handoffs/allen-omega-L694/L758'; p=w/'native/kernel/ui'
+source=(p/'allen_font.c').read_text(); data=(w/'native/omega/allen/font-data.om').read_text()
+block=source.split('glyphs[CK_AF_COUNT] = {',1)[1].split('};',1)[0]
+glyphs=re.findall(r'/\*[^\n]*?\*/\s*"([^"\n]*)"',block)
+omega=re.search(r'text Afdata "(.*)"',data).group(1).split('|')[:-1]
+if len(glyphs)!=95 or glyphs!=omega: raise RuntimeError('glyph design transcription mismatch')
+sine=source.split('sin_q[91] = {',1)[1].split('};',1)[0]
+a=[int(x) for x in re.findall(r'\d+',sine)]
+b=[int(x) for x in re.search(r'text Afsines "(.*)"',data).group(1).split()]
+if len(a)!=91 or a!=b: raise RuntimeError('sine transcription mismatch')
+lib=d/'legacy-font-reference.so'
+subprocess.run(['cc','-shared','-fPIC','-O2',str(p/'allen_font.c'),'-o',str(lib)],check=True)
+class Glyph(C.Structure):
+ _fields_=[('alpha',C.POINTER(C.c_uint8)),('w',C.c_uint16),('h',C.c_uint16),('ox',C.c_int16),('oy',C.c_int16)]
+class Face(C.Structure):
+ _fields_=[('s256',C.c_uint32),('hw256',C.c_uint32),('pool',C.POINTER(C.c_uint8)),('pool_len',C.c_size_t),('pool_used',C.c_size_t),('g',Glyph*95)]
+f=C.CDLL(str(lib)); f.ck_af_face_init.argtypes=[C.POINTER(Face),C.c_uint,C.c_uint,C.POINTER(C.c_uint8),C.c_size_t]
+f.ck_af_glyph_get.argtypes=[C.POINTER(Face),C.c_char]; f.ck_af_glyph_get.restype=C.POINTER(Glyph)
+f.ck_af_advance.argtypes=[C.POINTER(Face),C.c_char]; f.ck_af_advance.restype=C.c_uint32
+count=0
+with (d/'legacy-font.bin').open('wb') as out:
+ for cap,wt in [(14,900),(30,1250),(64,2500)]:
+ face=Face(); pool=(C.c_uint8*(4<<20))(); f.ck_af_face_init(C.byref(face),cap,wt,pool,len(pool))
+ for code in [*range(32,127),0,127,255]:
+ c=bytes([code]); g=f.ck_af_glyph_get(C.byref(face),c)
+ if not g: raise RuntimeError('reference pool unexpectedly full')
+ g=g.contents; adv=f.ck_af_advance(C.byref(face),c)
+ out.write(struct.pack('<5Q2qQ',cap,wt,code,g.w,g.h,g.ox,g.oy,adv))
+ if g.w*g.h: out.write(C.string_at(g.alpha,g.w*g.h))
+ count+=1
+manifest={'reference_only':True,'records':count,'glyph_designs':len(glyphs),'sine_samples':len(a),'source_sha256':hashlib.sha256((p/'allen_font.c').read_bytes()).hexdigest(),'reference_sha256':hashlib.sha256((d/'legacy-font.bin').read_bytes()).hexdigest(),'reference_bytes':(d/'legacy-font.bin').stat().st_size,'command':'cc -shared -fPIC -O2 native/kernel/ui/allen_font.c -o /legacy-font-reference.so','scope':'Legacy external oracle only. Omega source/data handwritten; no foreign code in native construction/runtime.'}
+(d/'oracle.json').write_text(json.dumps(manifest,indent=2)+'\n'); print(json.dumps(manifest,indent=2))
diff --git a/evidence/allen-omega-L694/L758/long.log b/evidence/allen-omega-L694/L758/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L758/memory.log b/evidence/allen-omega-L694/L758/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L758/native-font.bin b/evidence/allen-omega-L694/L758/native-font.bin
new file mode 100644
index 00000000..05747f0c
Binary files /dev/null and b/evidence/allen-omega-L694/L758/native-font.bin differ
diff --git a/evidence/allen-omega-L694/L758/oracle.json b/evidence/allen-omega-L694/L758/oracle.json
new file mode 100644
index 00000000..85f6679c
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/oracle.json
@@ -0,0 +1,11 @@
+{
+ "reference_only": true,
+ "records": 294,
+ "glyph_designs": 95,
+ "sine_samples": 91,
+ "source_sha256": "92d7157386e65351325d80d5036565e406145230dfb696c9804ec80888d26904",
+ "reference_sha256": "0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69",
+ "reference_bytes": 436341,
+ "command": "cc -shared -fPIC -O2 native/kernel/ui/allen_font.c -o /legacy-font-reference.so",
+ "scope": "Legacy external oracle only. Omega source/data handwritten; no foreign code in native construction/runtime."
+}
diff --git a/evidence/allen-omega-L694/L758/output.om b/evidence/allen-omega-L694/L758/output.om
new file mode 100644
index 00000000..6d178e67
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/output.om
@@ -0,0 +1,4222 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+note Native glyph stream for byte comparison with the external legacy oracle.
+fn afword v ulong to void
+for i ulong 8
+emitb uchar and shr v mul i 8 255
+end
+end
+fn afhead to bool
+p = ulong 0
+while lt p get Outlen 0
+n = write 1 Outb p sub get Outlen 0 p
+if le n 0
+ret false
+end
+p = add p ulong n
+end
+ret true
+end
+fn afemit cap ulong wt ulong c uchar to bool
+if not afglyph c
+ret false
+end
+outreset
+afword cap
+afword wt
+afword ulong c
+afword get Af 3
+afword get Af 4
+afword ulong get Ab 0
+afword ulong get Ab 1
+afword get Af 5
+if not afhead
+ret false
+end
+size = mul get Af 3 get Af 4
+p = ulong 0
+while lt p size
+n = write 1 Alpha p sub size p
+if le n 0
+ret false
+end
+p = add p ulong n
+end
+ret true
+end
+fn main to int
+for mode ulong 3
+cap = ulong 14
+wt = ulong 900
+if eq mode 1
+cap = 30
+wt = 1250
+end
+if eq mode 2
+cap = 64
+wt = 2500
+end
+if not afinit cap wt
+ret 1
+end
+for i ulong 95
+if not afemit cap wt uchar add i 32
+ret 1
+end
+end
+if not afemit cap wt 0
+ret 1
+end
+if not afemit cap wt 127
+ret 1
+end
+if not afemit cap wt 255
+ret 1
+end
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/paint.log b/evidence/allen-omega-L694/L758/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L758/pendingwire-mutant.log b/evidence/allen-omega-L694/L758/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L758/presentation.log b/evidence/allen-omega-L694/L758/presentation.log
new file mode 100644
index 00000000..84fd2470
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/presentation.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-1.log b/evidence/allen-omega-L694/L758/provider-bad-1.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-1.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-1.receipt b/evidence/allen-omega-L694/L758/provider-bad-1.receipt
new file mode 100644
index 00000000..2b29860a
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-1.receipt
@@ -0,0 +1,4 @@
+1
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-2.log b/evidence/allen-omega-L694/L758/provider-bad-2.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-2.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-2.receipt b/evidence/allen-omega-L694/L758/provider-bad-2.receipt
new file mode 100644
index 00000000..9ba12cca
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-2.receipt
@@ -0,0 +1,4 @@
+2
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-3.log b/evidence/allen-omega-L694/L758/provider-bad-3.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-3.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-3.receipt b/evidence/allen-omega-L694/L758/provider-bad-3.receipt
new file mode 100644
index 00000000..199cc204
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-3.receipt
@@ -0,0 +1,4 @@
+3
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-4.log b/evidence/allen-omega-L694/L758/provider-bad-4.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-4.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-4.receipt b/evidence/allen-omega-L694/L758/provider-bad-4.receipt
new file mode 100644
index 00000000..26a81c4a
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-4.receipt
@@ -0,0 +1,4 @@
+4
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-5.log b/evidence/allen-omega-L694/L758/provider-bad-5.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-5.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-5.receipt b/evidence/allen-omega-L694/L758/provider-bad-5.receipt
new file mode 100644
index 00000000..d79f5995
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-5.receipt
@@ -0,0 +1,4 @@
+5
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-6.log b/evidence/allen-omega-L694/L758/provider-bad-6.log
new file mode 100644
index 00000000..3f9cc45d
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-bad-6.log
@@ -0,0 +1,17 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
diff --git a/evidence/allen-omega-L694/L758/provider-bad-6.receipt b/evidence/allen-omega-L694/L758/provider-bad-6.receipt
new file mode 100644
index 00000000..d0b7cd17
Binary files /dev/null and b/evidence/allen-omega-L694/L758/provider-bad-6.receipt differ
diff --git a/evidence/allen-omega-L694/L758/provider-consumer.log b/evidence/allen-omega-L694/L758/provider-consumer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-consumer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L758/provider-consumer.receipt b/evidence/allen-omega-L694/L758/provider-consumer.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L758/provider-consumer.receipt differ
diff --git a/evidence/allen-omega-L694/L758/provider-core.log b/evidence/allen-omega-L694/L758/provider-core.log
new file mode 100644
index 00000000..88d1b135
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-core.log
@@ -0,0 +1,100 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
diff --git a/evidence/allen-omega-L694/L758/provider-fragment.log b/evidence/allen-omega-L694/L758/provider-fragment.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-fragment.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L758/provider-process.log b/evidence/allen-omega-L694/L758/provider-process.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-process.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L758/provider-process.receipt b/evidence/allen-omega-L694/L758/provider-process.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L758/provider-process.receipt differ
diff --git a/evidence/allen-omega-L694/L758/provider-producer.log b/evidence/allen-omega-L694/L758/provider-producer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-producer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L758/provider-producer.receipt b/evidence/allen-omega-L694/L758/provider-producer.receipt
new file mode 100644
index 00000000..0967800c
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-producer.receipt
@@ -0,0 +1,4 @@
+7
+0
+0
+0
diff --git a/evidence/allen-omega-L694/L758/provider-stream.log b/evidence/allen-omega-L694/L758/provider-stream.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/provider-stream.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L758/readback-mutant.log b/evidence/allen-omega-L694/L758/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L758/red4.exit b/evidence/allen-omega-L694/L758/red4.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/red4.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L758/red4.log b/evidence/allen-omega-L694/L758/red4.log
new file mode 100644
index 00000000..9baad483
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/red4.log
@@ -0,0 +1,412 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 1
+11 1
+12 1
+13 1
+14 0
+15 1
+16 1
+17 1
+18 1
+19 1
+20 1
+21 0
+22 0
+23 1
+24 1
+25 1
+26 0
+27 1
+28 1
+29 1
+30 0
+31 1
+32 1
+33 1
+34 0
+35 1
+36 1
+37 1
+38 0
+39 1
+40 1
+41 1
+42 0
+43 1
+44 1
+45 1
+46 0
+47 1
+48 1
+49 1
+50 0
+51 1
+52 1
+53 1
+54 0
+55 1
+56 1
+57 1
+58 0
+59 1
+60 1
+61 1
+62 0
+63 1
+64 1
+65 1
+66 0
+67 1
+68 1
+69 1
+70 0
+71 1
+72 1
+73 1
+74 0
+75 1
+76 1
+77 1
+78 0
+79 1
+80 1
+81 1
+82 0
+83 1
+84 1
+85 1
+86 0
+87 1
+88 1
+89 1
+90 0
+91 1
+92 1
+93 1
+94 0
+95 1
+96 1
+97 1
+98 0
+99 1
+100 1
+101 1
+102 0
+103 1
+104 1
+105 1
+106 0
+107 1
+108 1
+109 1
+110 0
+111 1
+112 1
+113 1
+114 0
+115 1
+116 1
+117 1
+118 0
+119 1
+120 1
+121 1
+122 0
+123 1
+124 1
+125 1
+126 0
+127 1
+128 1
+129 1
+130 0
+131 1
+132 1
+133 1
+134 0
+135 1
+136 1
+137 1
+138 0
+139 1
+140 1
+141 1
+142 0
+143 1
+144 1
+145 1
+146 0
+147 1
+148 1
+149 1
+150 0
+151 1
+152 1
+153 1
+154 0
+155 1
+156 1
+157 1
+158 0
+159 1
+160 1
+161 1
+162 0
+163 1
+164 1
+165 1
+166 0
+167 1
+168 1
+169 1
+170 0
+171 1
+172 1
+173 1
+174 0
+175 1
+176 1
+177 1
+178 0
+179 1
+180 1
+181 1
+182 0
+183 1
+184 1
+185 1
+186 0
+187 1
+188 1
+189 1
+190 0
+191 1
+192 1
+193 1
+194 0
+195 1
+196 1
+197 1
+198 0
+199 1
+200 1
+201 1
+202 0
+203 1
+204 1
+205 1
+206 0
+207 1
+208 1
+209 1
+210 0
+211 1
+212 1
+213 1
+214 0
+215 1
+216 1
+217 1
+218 0
+219 1
+220 1
+221 1
+222 0
+223 1
+224 1
+225 1
+226 0
+227 1
+228 1
+229 1
+230 0
+231 1
+232 1
+233 1
+234 0
+235 1
+236 1
+237 1
+238 0
+239 1
+240 1
+241 1
+242 0
+243 1
+244 1
+245 1
+246 0
+247 1
+248 1
+249 1
+250 0
+251 1
+252 1
+253 1
+254 0
+255 1
+256 1
+257 1
+258 0
+259 1
+260 1
+261 1
+262 0
+263 1
+264 1
+265 1
+266 0
+267 1
+268 1
+269 1
+270 0
+271 1
+272 1
+273 1
+274 0
+275 1
+276 1
+277 1
+278 0
+279 1
+280 1
+281 1
+282 0
+283 1
+284 1
+285 1
+286 0
+287 1
+288 1
+289 1
+290 0
+291 1
+292 1
+293 1
+294 0
+295 1
+296 1
+297 1
+298 0
+299 1
+300 1
+301 1
+302 0
+303 1
+304 1
+305 1
+306 0
+307 1
+308 1
+309 1
+310 0
+311 1
+312 1
+313 1
+314 0
+315 1
+316 1
+317 1
+318 0
+319 1
+320 1
+321 1
+322 0
+323 1
+324 1
+325 1
+326 0
+327 1
+328 1
+329 1
+330 0
+331 1
+332 1
+333 1
+334 0
+335 1
+336 1
+337 1
+338 0
+339 1
+340 1
+341 1
+342 0
+343 1
+344 1
+345 1
+346 0
+347 1
+348 1
+349 1
+350 0
+351 1
+352 1
+353 1
+354 0
+355 1
+356 1
+357 1
+358 0
+359 1
+360 1
+361 1
+362 0
+363 1
+364 1
+365 1
+366 0
+367 1
+368 1
+369 1
+370 0
+371 1
+372 1
+373 1
+374 0
+375 1
+376 1
+377 1
+378 0
+379 1
+380 1
+381 1
+382 0
+383 1
+384 1
+385 1
+386 0
+387 1
+388 1
+389 1
+390 0
+391 1
+392 1
+393 1
+394 0
+395 1
+396 1
+397 1
+398 0
+399 1
+400 1
+401 0
+402 1
+403 1
+404 0
+405 0
+406 0
+407 0
+408 1
+409 1
+410 0
+411 1
+412 1
diff --git a/evidence/allen-omega-L694/L758/red4.om b/evidence/allen-omega-L694/L758/red4.om
new file mode 100644
index 00000000..25f581d5
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/red4.om
@@ -0,0 +1,3955 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+ret 0
+end
+fn afsin deg long to long
+ret 0
+end
+fn afcos deg long to long
+ret 0
+end
+fn afinit cap ulong wt ulong to bool
+ret false
+end
+fn afglyph c uchar to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Oldmask uchar 65536
+global Oldmeta ulong 6
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn asym to bool
+w = get Af 3
+for y ulong get Af 4
+at = mul y w
+for x ulong w
+a = long get Alpha add at x
+mirror = add at sub sub w 1 x
+b = long get Alpha mirror
+d = sub a b
+if gt d 40
+ret false
+end
+if lt d -40
+ret false
+end
+end
+end
+ret true
+end
+fn main to int
+test not afglyph 65
+test not afinit 0 1250
+test not afinit 65 1250
+test not afinit 30 0
+test not afinit 30 2501
+test afinit 30 1250
+test eq get Af 0 384
+test eq get Af 1 480
+test eq afsqrt 0 0
+test eq afsqrt 15 3
+test eq afsqrt 16 4
+test eq afsqrt 18446744073709551615 4294967295
+test eq afsqrt mul ulong 1000000007 1000000007 1000000007
+test eq afsin 0 0
+test eq afsin 90 16384
+test eq afsin -90 -16384
+test eq afsin 450 16384
+test eq afcos 180 -16384
+for c ulong 95
+test afglyph uchar add c 32
+test gt get Af 5 0
+test le mul get Af 3 get Af 4 len Alpha
+if eq c 0
+test eq get Af 3 0
+test eq get Af 4 1
+else
+ink = ulong 0
+for i ulong mul get Af 3 get Af 4
+if gt get Alpha i 128
+ink = add ink 1
+end
+end
+test ge ink 4
+end
+end
+test afglyph 111
+test asym
+test afglyph 63
+for i ulong mul get Af 3 get Af 4
+put Oldmask i get Alpha i
+end
+for i ulong 6
+put Oldmeta i get Af i
+end
+test afglyph 0
+same = true
+for i ulong 6
+if ne get Oldmeta i get Af i
+same = false
+end
+end
+for i ulong mul get Af 3 get Af 4
+if ne get Oldmask i get Alpha i
+same = false
+end
+end
+test same
+test not afinit 999 1250
+test eq get Af 0 get Oldmeta 0
+test eq get Af 3 get Oldmeta 3
+test afinit 64 2500
+test afglyph 87
+test le mul get Af 3 get Af 4 len Alpha
+test afinit 1 1
+test afglyph 65
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/red5.exit b/evidence/allen-omega-L694/L758/red5.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/red5.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L758/red5.log b/evidence/allen-omega-L694/L758/red5.log
new file mode 100644
index 00000000..40744aef
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/red5.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 1
+11 1
+12 1
+13 1
+14 0
+15 1
+16 1
+17 1
+18 1
+19 1
+20 1
+21 0
+22 0
+23 1
+24 1
+25 1
+26 0
+27 1
+28 1
+29 1
+30 0
+31 1
+32 1
+33 1
+34 0
+35 1
+36 1
+37 1
+38 0
+39 1
+40 1
+41 1
+42 0
+43 1
+44 1
+45 1
+46 0
+47 1
+48 1
+49 1
+50 0
+51 1
+52 1
+53 1
+54 0
+55 1
+56 1
+57 1
+58 0
+59 1
+60 1
+61 1
+62 0
+63 1
+64 1
+65 1
+66 0
+67 1
+68 1
+69 1
+70 0
+71 1
+72 1
+73 1
+74 0
+75 1
+76 1
+77 1
+78 0
+79 1
+80 1
+81 1
+82 0
+83 1
+84 1
+85 1
+86 0
+87 1
+88 1
+89 1
+90 0
+91 1
+92 1
+93 1
+94 0
+95 1
+96 1
+97 1
+98 0
+99 1
+100 1
+101 1
+102 0
+103 1
+104 1
+105 1
+106 0
+107 1
+108 1
+109 1
+110 0
+111 1
+112 1
+113 1
+114 0
+115 1
+116 1
+117 1
+118 0
+119 1
+120 1
+121 1
+122 0
+123 1
+124 1
+125 1
+126 0
+127 1
+128 1
+129 1
+130 0
+131 1
+132 1
+133 1
+134 0
+135 1
+136 1
+137 1
+138 0
+139 1
+140 1
+141 1
+142 0
+143 1
+144 1
+145 1
+146 0
+147 1
+148 1
+149 1
+150 0
+151 1
+152 1
+153 1
+154 0
+155 1
+156 1
+157 1
+158 0
+159 1
+160 1
+161 1
+162 0
+163 1
+164 1
+165 1
+166 0
+167 1
+168 1
+169 1
+170 0
+171 1
+172 1
+173 1
+174 0
+175 1
+176 1
+177 1
+178 0
+179 1
+180 1
+181 1
+182 0
+183 1
+184 1
+185 1
+186 0
+187 1
+188 1
+189 1
+190 0
+191 1
+192 1
+193 1
+194 0
+195 1
+196 1
+197 1
+198 0
+199 1
+200 1
+201 1
+202 0
+203 1
+204 1
+205 1
+206 0
+207 1
+208 1
+209 1
+210 0
+211 1
+212 1
+213 1
+214 0
+215 1
+216 1
+217 1
+218 0
+219 1
+220 1
+221 1
+222 0
+223 1
+224 1
+225 1
+226 0
+227 1
+228 1
+229 1
+230 0
+231 1
+232 1
+233 1
+234 0
+235 1
+236 1
+237 1
+238 0
+239 1
+240 1
+241 1
+242 0
+243 1
+244 1
+245 1
+246 0
+247 1
+248 1
+249 1
+250 0
+251 1
+252 1
+253 1
+254 0
+255 1
+256 1
+257 1
+258 0
+259 1
+260 1
+261 1
+262 0
+263 1
+264 1
+265 1
+266 0
+267 1
+268 1
+269 1
+270 0
+271 1
+272 1
+273 1
+274 0
+275 1
+276 1
+277 1
+278 0
+279 1
+280 1
+281 1
+282 0
+283 1
+284 1
+285 1
+286 0
+287 1
+288 1
+289 1
+290 0
+291 1
+292 1
+293 1
+294 0
+295 1
+296 1
+297 1
+298 0
+299 1
+300 1
+301 1
+302 0
+303 1
+304 1
+305 1
+306 0
+307 1
+308 1
+309 1
+310 0
+311 1
+312 1
+313 1
+314 0
+315 1
+316 1
+317 1
+318 0
+319 1
+320 1
+321 1
+322 0
+323 1
+324 1
+325 1
+326 0
+327 1
+328 1
+329 1
+330 0
+331 1
+332 1
+333 1
+334 0
+335 1
+336 1
+337 1
+338 0
+339 1
+340 1
+341 1
+342 0
+343 1
+344 1
+345 1
+346 0
+347 1
+348 1
+349 1
+350 0
+351 1
+352 1
+353 1
+354 0
+355 1
+356 1
+357 1
+358 0
+359 1
+360 1
+361 1
+362 0
+363 1
+364 1
+365 1
+366 0
+367 1
+368 1
+369 1
+370 0
+371 1
+372 1
+373 1
+374 0
+375 1
+376 1
+377 1
+378 0
+379 1
+380 1
+381 1
+382 0
+383 1
+384 1
+385 1
+386 0
+387 1
+388 1
+389 1
+390 0
+391 1
+392 1
+393 1
+394 0
+395 1
+396 1
+397 1
+398 0
+399 1
+400 1
+401 0
+402 1
+403 1
+404 0
+405 0
+406 0
+407 0
+408 1
+409 1
+410 0
+411 1
+412 1
+413 1
+414 1
+415 0
+416 0
+417 1
+418 1
+419 1
+420 1
+421 0
diff --git a/evidence/allen-omega-L694/L758/red5.om b/evidence/allen-omega-L694/L758/red5.om
new file mode 100644
index 00000000..5891021e
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/red5.om
@@ -0,0 +1,3977 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+ret 0
+end
+fn afsin deg long to long
+ret 0
+end
+fn afcos deg long to long
+ret 0
+end
+fn afinit cap ulong wt ulong to bool
+ret false
+end
+fn afglyph c uchar to bool
+ret false
+end
+fn afalpha px long py long to uchar
+ret 0
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Oldmask uchar 65536
+global Oldmeta ulong 6
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn asym to bool
+w = get Af 3
+for y ulong get Af 4
+at = mul y w
+for x ulong w
+a = long get Alpha add at x
+mirror = add at sub sub w 1 x
+b = long get Alpha mirror
+d = sub a b
+if gt d 40
+ret false
+end
+if lt d -40
+ret false
+end
+end
+end
+ret true
+end
+fn main to int
+test not afglyph 65
+test not afinit 0 1250
+test not afinit 65 1250
+test not afinit 30 0
+test not afinit 30 2501
+test afinit 30 1250
+test eq get Af 0 384
+test eq get Af 1 480
+test eq afsqrt 0 0
+test eq afsqrt 15 3
+test eq afsqrt 16 4
+test eq afsqrt 18446744073709551615 4294967295
+test eq afsqrt mul ulong 1000000007 1000000007 1000000007
+test eq afsin 0 0
+test eq afsin 90 16384
+test eq afsin -90 -16384
+test eq afsin 450 16384
+test eq afcos 180 -16384
+for c ulong 95
+test afglyph uchar add c 32
+test gt get Af 5 0
+test le mul get Af 3 get Af 4 len Alpha
+if eq c 0
+test eq get Af 3 0
+test eq get Af 4 1
+else
+ink = ulong 0
+for i ulong mul get Af 3 get Af 4
+if gt get Alpha i 128
+ink = add ink 1
+end
+end
+test ge ink 4
+end
+end
+test afglyph 111
+test asym
+test afglyph 63
+for i ulong mul get Af 3 get Af 4
+put Oldmask i get Alpha i
+end
+for i ulong 6
+put Oldmeta i get Af i
+end
+test afglyph 0
+same = true
+for i ulong 6
+if ne get Oldmeta i get Af i
+same = false
+end
+end
+for i ulong mul get Af 3 get Af 4
+if ne get Oldmask i get Alpha i
+same = false
+end
+end
+test same
+test not afinit 999 1250
+test eq get Af 0 get Oldmeta 0
+test eq get Af 3 get Oldmeta 3
+test afinit 64 2500
+test afglyph 87
+test le mul get Af 3 get Af 4 len Alpha
+test afinit 1 1
+test afglyph 65
+note Independent analytic coverage for round-capped strokes and zero-length dots.
+put Af 2 1
+put Af 1 128
+put Ag 0 0
+put Ag 1 0
+put Ag 2 512
+put Ag 3 0
+test eq afalpha 256 0 255
+test eq afalpha 256 128 127
+test eq afalpha 256 256 0
+test eq afalpha 768 0 0
+test eq afalpha -128 0 127
+put Ag 0 512
+put Ag 2 0
+test eq afalpha 256 128 127
+put Ag 0 0
+test eq afalpha 0 0 255
+test eq afalpha 0 128 127
+test eq afalpha 0 256 0
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L758/reply.log b/evidence/allen-omega-L694/L758/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L758/runtime.log b/evidence/allen-omega-L694/L758/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L758/scene-input.log b/evidence/allen-omega-L694/L758/scene-input.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/scene-input.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L758/scene.log b/evidence/allen-omega-L694/L758/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L758/scenecap-mutant.log b/evidence/allen-omega-L694/L758/scenecap-mutant.log
new file mode 100644
index 00000000..502843ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/scenecap-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L758/scheduler.log b/evidence/allen-omega-L694/L758/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L758/session-mutant.log b/evidence/allen-omega-L694/L758/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L758/short.log b/evidence/allen-omega-L694/L758/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L758/source.sha256 b/evidence/allen-omega-L694/L758/source.sha256
new file mode 100644
index 00000000..0ae53003
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/source.sha256
@@ -0,0 +1,62 @@
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om
+79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md
+c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om
+b861dbdc9ef3a29157c10500767de69d2a1f5478d0bcdbbfd767bd5d69e587e2 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md
+d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om
+330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om
+258b9c1f6a7447540c9a8b8cbf2176165ab3e5d80e9528e0b06c37ea745490c1 native/omega/allen/PROVIDER.md
+ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om
+9d1603537e0c39cbc0949d724144168daa32875c2cfee435e64633fb7483ab4b native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc native/omega/allen/tests/font-mutants.om
+cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om
+7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om
+a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8 native/omega/allen/tests/font-render.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om
+b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe native/omega/allen/tests/provider-core.om
+b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om
+37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om
+d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om
+8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L758/stale-mutant.log b/evidence/allen-omega-L694/L758/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L758/staleview-mutant.log b/evidence/allen-omega-L694/L758/staleview-mutant.log
new file mode 100644
index 00000000..c0c96c65
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/staleview-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 1
+35 1
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L758/summary.json b/evidence/allen-omega-L694/L758/summary.json
new file mode 100644
index 00000000..521809be
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/summary.json
@@ -0,0 +1,63 @@
+{
+ "base": "4c7888f65dca209a1e2b859ba695ae308657c03e",
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "provider-core": 100,
+ "memory": 79,
+ "context": 142,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "scene-input": 63,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292,
+ "provider-stream": 292,
+ "provider-fragment": 292,
+ "provider-process": 3,
+ "provider-consumer": 3,
+ "provider-producer": 3,
+ "provider-bad-1": 5,
+ "provider-bad-2": 5,
+ "provider-bad-3": 5,
+ "provider-bad-4": 5,
+ "provider-bad-5": 5,
+ "provider-bad-6": 17,
+ "presentation": 75,
+ "font": 421
+ },
+ "total_checks": 2710,
+ "compiled_rejected_mutants": {
+ "inputtail-mutant": 1,
+ "session-mutant": 1,
+ "appcode-mutant": 3,
+ "contextjob-mutant": 36,
+ "readback-mutant": 7,
+ "staleview-mutant": 2,
+ "fontroot-mutant": 11,
+ "fontalpha-mutant": 2,
+ "hash-mutant": 2,
+ "contextnote-mutant": 5,
+ "autosent-mutant": 8,
+ "thinking-mutant": 6,
+ "pendingwire-mutant": 1,
+ "scenecap-mutant": 3,
+ "crc-mutant": 2,
+ "ackstop-mutant": 27,
+ "stale-mutant": 3,
+ "framecheck-mutant": 4,
+ "keepalive-mutant": 40
+ },
+ "font_records": 294,
+ "font_bytes": 436341,
+ "font_sha256": "0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69",
+ "specimen_ppm_sha256": "dec95182af5faa01ed739336ed32dcadd5168e6be35bef310042fe032113ee7f",
+ "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9",
+ "scope": "Native host font component; full UI/layout/device/live/iMac NOT_RUN"
+}
diff --git a/evidence/allen-omega-L694/L758/thinking-mutant.log b/evidence/allen-omega-L694/L758/thinking-mutant.log
new file mode 100644
index 00000000..74b41a12
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/thinking-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L758/view.log b/evidence/allen-omega-L694/L758/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L758/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L763/README.md b/evidence/allen-omega-L694/L763/README.md
new file mode 100644
index 00000000..0459d4db
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/README.md
@@ -0,0 +1,17 @@
+# L763 executable provider/presentation attachment
+
+ASK/RECV/RESET now call dask/drecv/dreset. Presentation definitions precede the
+provider in the seed concatenation. Input/output framing remains version1 and
+byte-identical to L758's real normal and fragmented entry runs. New native prdo
+assertions expose retained scene/code state, malformed and semantic refusal
+isolation, pending-wire preservation and reset. Unchanged provider:24 failures
+among136 assertions,exit1. Three-call attachment:136/136. All combined native
+gates and22 compiled mutants pass; exact row counts are in summary.json. The
+three new Omega-constructed mutants individually bypass ASK,RECV or RESET.
+
+Reproduce with `quiet-build native/omega/allen/gate.sh /absolute/fresh/output`.
+Host orchestration compiles, wires and compares; new behavioral assertions and
+mutation construction are Omega. The renderer still must consume D* buffers:
+this change supplies neither pixels nor actual device/network/storage backends.
+Independent review of this attachment is pending. The separate font review is
+published under L758/independent-review and does not certify this new dispatch.
diff --git a/evidence/allen-omega-L694/L763/ackstop-mutant.log b/evidence/allen-omega-L694/L763/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L763/appcode-mutant.log b/evidence/allen-omega-L694/L763/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L763/application.log b/evidence/allen-omega-L694/L763/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L763/autosent-mutant.log b/evidence/allen-omega-L694/L763/autosent-mutant.log
new file mode 100644
index 00000000..6b9b9f3a
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/autosent-mutant.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 1
+51 0
+52 0
+53 1
+54 1
+55 0
+56 1
+57 0
+58 1
+59 0
+60 0
+61 0
+62 1
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 1
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/binaries.sha256 b/evidence/allen-omega-L694/L763/binaries.sha256
new file mode 100644
index 00000000..074f6355
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/binaries.sha256
@@ -0,0 +1,54 @@
+1ec8ee3cae7f12c5bc6c70e7db8620b5c0e35a995badd6ed5127dfcd2bcd1a34 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-display-mutants
+ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-core
+8df1aa6f0286d1676d8a8f1862586c94c08d092f56ccf0aa623e1769626ccdbc /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scheduler
+71a2937774ff546659cff960d47f54319e86ff779ad9910ea02fb00fda050823 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/readback-mutant
+c61300f3dab3af927a83e725cf98b77dd10a2f7743c08952d7e02a9879faedf7 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font-render
+8bf7269290ffc0127996ab465f9c1054d3c1dafe6ec392f1154a10184551a5db /home/drakestapleton/handoffs/allen-omega-L694/L763/full/view
+25fd37be15b3ec92c9257f4123f953524a43a0be5f86983a5283646a6911b11a /home/drakestapleton/handoffs/allen-omega-L694/L763/full/contextnote-mutant
+f423950efbb8ef94a93c858bb19491a9522105f486c4bd2b9d933a32bc6682f8 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font
+b0d00466da64cba6b5ac71ae8dd9a599acb1c03ddbd66c8c732e1be0f34867d6 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/allen
+61c64aaf5aabb89a116e55f4105bb2e991aebb328dcdb58298fae6a5af35592d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/reply
+c14e68cb12ccf18879b9d61cd4c2d5ed2fb4eaa45b9069d9ad0da102d7e5dde9 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/thinking-mutant
+53f05625250617f62c6df5b5f6c6773375e1cf470f7b4077741ebe985bf33d9f /home/drakestapleton/handoffs/allen-omega-L694/L763/full/inputtail-mutant
+3e00b01a876f0033dc1b8cbc70e62835fd4cac7ffef48d78903d4f35659d3e42 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/ackstop-mutant
+6f4e108fc12db3e95b069670c0bc606c73438d8162bf1eaf1e6a758a12565eb8 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/hash-mutant
+dd2c6b0fe146386a43d350de94206be7e806e578b8e2e582f594765738d75e91 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/golden
+c5477e4898070cc29cb2ec41df3b435c99eeec149327bb714ce8b0e4f9475aa6 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/session-mutant
+ef499aa5d7bd0afb25ee742de319a90f1e9e414e9bb75eed1fc8fb26df0f8aac /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scene-input
+5f60d27d81afd48f83a1dd803986676e8cb8be363af7c6d21bf1e184e9f4c9f7 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/intent
+72985ec83bad7aed1c1593ac1379154b34965765b9888502a16dd996115f294e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-input
+aafc97eda7823f4653518db7b5a568a7b3d7fa58c6259293af934827ea50082a /home/drakestapleton/handoffs/allen-omega-L694/L763/full/rawask-mutant
+34c901cfb34adcbba1212045f9209a5fb3f385b9011c116be8bf8be9ed173f41 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font-mutants
+5e232b22df0b515b7fc96bcd9e85ab1011b1778ec43439942b0d78e3bd782519 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/fixture
+4021dd66d7ec338426210bf2f0d139c1225e3cc2e3207fbfd4b0e1bbba9fa8ca /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider
+7885d6dffd0b6810c197c2ec35bbd8c311e5579fe0db98442220e0966d147b60 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/context
+0251c5ea72fc5e24c102a9d64a3651913e5a2e15c6464c3844df1044892ffca5 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/staleview-mutant
+322432e423eb8a6e77299833fb74ad1ad88b55343d84efa718f9139d2cbee32d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/runtime
+6c2e4af2a56193428b18860ad837998e97ef7630412dc4c3d0b43fc40f443d77 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/code
+52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-mutants
+8077cc463bf73f332679736412a1ddf1fd400f3905a5ea98fbe858db8601291e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/edges
+a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/presentation-mutants
+d9a547d7307fb68081dce6e9a28914dba9876acf3882be598db4c35e425ae38f /home/drakestapleton/handoffs/allen-omega-L694/L763/full/appcode-mutant
+ce57ddf83634a696cc5992db397609fd34d25e76ccf11c511f9507b015ccc5b2 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/render
+154cea536c380b71913a6f11a18a0b572c4cca7b62146a16f722b4b650008a8e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/rawrecv-mutant
+0be61adc5267f441504ee254d02df7b7b81a3fa41ccf6b39eeb409ff63cbc422 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/stale-mutant
+b44d34cb7967d3268b6329a8ff28fdea0ffa3d8828ec10aecbe6d3747091d2b6 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/courier
+3f2a500a3f1ed557d8d85909989239d92aeac640d83979cdbdba8f8d84229ab5 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scene
+8f034c096fe64c9126f2b56102725ffbe744ee2c3f034aae018a8a0031236256 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/presentation
+e56682a4e44021d5e4a067661fc8487caf6bf3385ff7281e277dae9e32f90504 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/pendingwire-mutant
+c0b59bf542e138bab5ebdefbcd3ed1c847651d4c245f717c73ac7464e52b483e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font-output
+b10b181d5b8ed7b5e5fd1aa9130df2984555ad61cea089d21af467900da8dc2e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/framecheck-mutant
+ff6ad15f3c5ecf8324b84de510796a5e4dd5f52fcd6127138528b5db8dbdc240 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scenecap-mutant
+642848f0927421b4a0e81ad93e9183a1fbeec0ddd44f8d44dd1b37f132331efd /home/drakestapleton/handoffs/allen-omega-L694/L763/full/fontroot-mutant
+595b1c61db6f56ae228db770b4ff806905156ddca37951e009674c9e9f7c395d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/contextjob-mutant
+ab17527c65b822c0b0bb8fd2874b5932adb67d6c3fe05de6edc6850f04789121 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/paint
+7b3e0f79b27550418b3a8599cdc75c748b73f8188791cb6637b4fc620c32ab6d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/crc-mutant
+c28b1df1974c032a70fd56a22eca3cceea0987840f7531f5589e308ad9d10119 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/autosent-mutant
+a4bb2c03c3b161776d47962b015381c761c46bd55d3ba8eb18ba63a713abaf6d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-output
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/stdio-overflow-input
+cbc5606e902084c44352e3012dfac569e49d999502fb3e257e16263f3ddb5fc3 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/keepalive-mutant
+0c6789d6a8ff1be8a44d603ad4c99ff95eae1c1f32a4544f9ebff676beed3d73 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-process
+d58ba602764de22eddc69f93660e3523f20563c03338f80ca268f0a015043848 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/memory
+4ecc21031c9035e61bbfd1f50f405bc5ef23a67e57d19adcc458089dc68f05bb /home/drakestapleton/handoffs/allen-omega-L694/L763/full/fontalpha-mutant
+d51d367e98d402e99884ea89962508abbaa2b35bf8f38d9521b3f51dfaf68b05 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/application
+925064aa966d2823e4f8deb4a3e7ec5208a31f4cf581628120121e5364c70f3a /home/drakestapleton/handoffs/allen-omega-L694/L763/full/rawreset-mutant
diff --git a/evidence/allen-omega-L694/L763/code.log b/evidence/allen-omega-L694/L763/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L763/context.log b/evidence/allen-omega-L694/L763/context.log
new file mode 100644
index 00000000..df62cddb
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/context.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L763/contextjob-mutant.log b/evidence/allen-omega-L694/L763/contextjob-mutant.log
new file mode 100644
index 00000000..3432d4b2
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/contextjob-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 0
+78 0
+79 1
+80 1
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 1
+89 0
+90 1
+91 0
+92 1
+93 0
+94 1
+95 0
+96 1
+97 0
+98 1
+99 0
+100 1
+101 0
+102 1
+103 0
+104 1
+105 0
+106 1
+107 0
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 1
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 1
+123 0
+124 1
+125 0
+126 1
+127 0
+128 1
+129 0
+130 1
+131 0
+132 1
+133 0
+134 1
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 1
+142 1
diff --git a/evidence/allen-omega-L694/L763/contextnote-mutant.log b/evidence/allen-omega-L694/L763/contextnote-mutant.log
new file mode 100644
index 00000000..b5c08759
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/contextnote-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 1
+38 1
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 1
+47 0
+48 1
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L763/courier.log b/evidence/allen-omega-L694/L763/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L763/crc-mutant.log b/evidence/allen-omega-L694/L763/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L763/edges.log b/evidence/allen-omega-L694/L763/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L763/font.log b/evidence/allen-omega-L694/L763/font.log
new file mode 100644
index 00000000..1f885320
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/font.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
diff --git a/evidence/allen-omega-L694/L763/fontalpha-mutant.log b/evidence/allen-omega-L694/L763/fontalpha-mutant.log
new file mode 100644
index 00000000..4dba5479
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/fontalpha-mutant.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 1
+414 0
+415 0
+416 0
+417 0
+418 0
+419 1
+420 0
+421 0
diff --git a/evidence/allen-omega-L694/L763/fontroot-mutant.log b/evidence/allen-omega-L694/L763/fontroot-mutant.log
new file mode 100644
index 00000000..326cd397
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/fontroot-mutant.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 1
+11 1
+12 1
+13 1
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 1
+415 1
+416 1
+417 1
+418 1
+419 0
+420 1
+421 1
diff --git a/evidence/allen-omega-L694/L763/framecheck-mutant.log b/evidence/allen-omega-L694/L763/framecheck-mutant.log
new file mode 100644
index 00000000..2849aedb
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/framecheck-mutant.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 1
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/full.exit b/evidence/allen-omega-L694/L763/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L763/full.log b/evidence/allen-omega-L694/L763/full.log
new file mode 100644
index 00000000..1dca57a3
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/full.log
@@ -0,0 +1,55 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+presentation compile=0 native-exit=0
+font compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+font-output compile=0 native-exit=0
+font-render compile=0 native-exit=0
+font native masks match frozen external legacy oracle
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=1
+framecheck mutant compile=0 rejected-exit=1
+staleview mutant compile=0 rejected-exit=1
+inputtail mutant compile=0 rejected-exit=1
+fontroot mutant compile=0 rejected-exit=1
+fontalpha mutant compile=0 rejected-exit=1
+rawask mutant compile=0 rejected-exit=1
+rawrecv mutant compile=0 rejected-exit=1
+rawreset mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L763/green.exit b/evidence/allen-omega-L694/L763/green.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/green.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L763/green.log b/evidence/allen-omega-L694/L763/green.log
new file mode 100644
index 00000000..1f06fc57
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/green.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/hash-mutant.log b/evidence/allen-omega-L694/L763/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L763/independent-review/closure-membership.status b/evidence/allen-omega-L694/L763/independent-review/closure-membership.status
new file mode 100644
index 00000000..3e2ebeca
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/closure-membership.status
@@ -0,0 +1 @@
+tracked_om_sh=57 manifest_om_sh=63 missing=0 extra=6
diff --git a/evidence/allen-omega-L694/L763/independent-review/closure.log b/evidence/allen-omega-L694/L763/independent-review/closure.log
new file mode 100644
index 00000000..8b4133ba
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/closure.log
@@ -0,0 +1,67 @@
+pin=92b405477cfdff40dda25c5afcac5b65cb04122a
+base=61ef587ee5d24bf862705f51bffb8039c9a2ed01
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc
+OK native/omega/allen/application.om 56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095
+OK native/omega/allen/base.om 184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9
+OK native/omega/allen/build-one.sh 795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b
+OK native/omega/allen/code.om 4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b
+OK native/omega/allen/context.om 75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4
+OK native/omega/allen/courier.om 76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d
+OK native/omega/allen/font-data.om f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5
+OK native/omega/allen/FONT.md 79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6
+OK native/omega/allen/font.om c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915
+OK native/omega/allen/gate.sh 58afa9d254f16e3840857001d804c68b7e29b528ef562f1c8bf0341861b425df
+OK native/omega/allen/golden.sh 9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8
+OK native/omega/allen/intent.om 06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35
+OK native/omega/allen/main.om 4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4
+OK native/omega/allen/memory.om 068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7
+OK native/omega/allen/paint.om b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04
+OK native/omega/allen/PRESENTATION.md 6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3
+OK native/omega/allen/presentation.om d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41
+OK native/omega/allen/provider-core.om c8a04b1d5f95c36500e7b2f475e169148c6ac76a677b1ca3da38f217fe2a501e
+OK native/omega/allen/PROVIDER.md f96b8b9074b4802b1cb52545db7ced1b5a64bf75ad756d532a8fc4e16c7107cd
+OK native/omega/allen/provider.om ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba
+OK native/omega/allen/README.md 259c4a50465c0932955e86f5d5c0fbf6c1f863097ea499a91aa583fa01eaf003
+OK native/omega/allen/reply.om e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc
+OK native/omega/allen/runtime.om 5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed
+OK native/omega/allen/scene-input.om c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002
+OK native/omega/allen/scene.om c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3
+OK native/omega/allen/scheduler.om 615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df
+OK native/omega/allen/tests/application.om f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f
+OK native/omega/allen/tests/check.om f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536
+OK native/omega/allen/tests/code.om b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42
+OK native/omega/allen/tests/context.om c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc
+OK native/omega/allen/tests/courier.om 98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373
+OK native/omega/allen/tests/edges.om f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3
+OK native/omega/allen/tests/fixture.om a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af
+OK native/omega/allen/tests/font-mutants.om 9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc
+OK native/omega/allen/tests/font.om cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a
+OK native/omega/allen/tests/font-output.om 7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb
+OK native/omega/allen/tests/font-render.om a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8
+OK native/omega/allen/tests/golden.om c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198
+OK native/omega/allen/tests/intent.om 8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564
+OK native/omega/allen/tests/memory.om 861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b
+OK native/omega/allen/tests/paint.om 13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5
+OK native/omega/allen/tests/presentation-mutants.om a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba
+OK native/omega/allen/tests/presentation.om b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641
+OK native/omega/allen/tests/probe.om e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a
+OK native/omega/allen/tests/provider-core.om ebc300f5c8737543acec6397bf7a82000594e13c424df20e203ea7ab09da46c4
+OK native/omega/allen/tests/provider-display-mutants.om 0c611ef5d6fe9c5d951fa8886e6425a4cb538c308d99f2723634f253d755cbbb
+OK native/omega/allen/tests/provider-input.om b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc
+OK native/omega/allen/tests/provider-mutants.om 37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c
+OK native/omega/allen/tests/provider-output.om d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed
+OK native/omega/allen/tests/provider-process.om 8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962
+OK native/omega/allen/tests/render.om 8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df
+OK native/omega/allen/tests/reply.om 094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8
+OK native/omega/allen/tests/runtime.om bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62
+OK native/omega/allen/tests/scene-input.om c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4
+OK native/omega/allen/tests/scene.om b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f
+OK native/omega/allen/tests/scheduler.om bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94
+OK native/omega/allen/tests/stdio-overflow.om 521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007
+OK native/omega/allen/tests/view.om 89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c
+OK native/omega/allen/vendor/OMEGA-LICENSE 0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0
+OK native/omega/allen/vendor/PROVENANCE.md b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc
+OK native/omega/allen/vendor/sha256-core.om 992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097
+OK native/omega/allen/vendor/sha256.om 0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041
+OK native/omega/allen/view.om abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac
+closure_files=63 closure_rc=0
diff --git a/evidence/allen-omega-L694/L763/independent-review/final-receipts.sha256 b/evidence/allen-omega-L694/L763/independent-review/final-receipts.sha256
new file mode 100644
index 00000000..192c38bc
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/final-receipts.sha256
@@ -0,0 +1,16 @@
+36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b report.md
+aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba lifecycle-v3.om
+db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222 run/provider-focus.om
+ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f run/provider-focus
+7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3 run/provider-focus.build.log
+3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408 run/provider-focus.log
+5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4 run/lifecycle-v3.om
+c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64 run/lifecycle-v3
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 run/lifecycle-v3.build.log
+8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c run/lifecycle-v3.log
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa run/lifecycle-v3.exit
+acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0 closure.log
+3c77337e62de279a74cab288aa5760dba52a16e92143c60c9052e865c7211b23 closure-membership.status
+903e98ff244024c7eeb589dae5f237be9e9e0ef8155c5b97629a499c38cbb880 lifecycle-v3.status
+305b12af3f8e5d1087778b7fe423221c30f7be784eaa348536d9563d6935e230 source-hashes.sha256
+0df81acc47911c4b91a63cb12fdc0ab770b1eb59f40f9edd135f1c6aafffcf3a lifecycle-v3.sha256
diff --git a/evidence/allen-omega-L694/L763/independent-review/inventory.json b/evidence/allen-omega-L694/L763/independent-review/inventory.json
new file mode 100644
index 00000000..bdb0ee0f
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/inventory.json
@@ -0,0 +1,29 @@
+{
+ "closure-membership.status": "3c77337e62de279a74cab288aa5760dba52a16e92143c60c9052e865c7211b23",
+ "closure.log": "acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0",
+ "final-receipts.sha256": "9f679e79d7955c61a34ca78851aa85f1e87c1f11d6a59233f17119da258774c4",
+ "lifecycle-v2.om": "11050bfc0e21df08db82ca8cab6e250b4caa1101e9af995867defbef7dca367a",
+ "lifecycle-v3-membership-attempt.status": "23e1f780abe26af21a8df0306803216eb2e21952475948f6c60afabeb57c0522",
+ "lifecycle-v3.om": "aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba",
+ "lifecycle-v3.sha256": "0df81acc47911c4b91a63cb12fdc0ab770b1eb59f40f9edd135f1c6aafffcf3a",
+ "lifecycle-v3.status": "903e98ff244024c7eeb589dae5f237be9e9e0ef8155c5b97629a499c38cbb880",
+ "lifecycle.om": "c63a7f914e441d4f9922a1791504fa97f042796193f501b2cb55fb442cc7e95c",
+ "parent-lifecycle.log": "bb85bc20bd2cc8180cef56ceb8dcc6d3813ab1961ab1e1a392615a0267e250b5",
+ "parent-verification.json": "9b24679773d6d6f46099484053d335f22cc8003fef6cff68c725adbc4193ef89",
+ "report.md": "36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b",
+ "report.sha256": "79763adf7a65bacb3d450a55e0caf514ed8da0f7171b30775cf8d5b23082ebcc",
+ "run/core-v3.om": "378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9",
+ "run/core.om": "378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9",
+ "run/lifecycle-v3.build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "run/lifecycle-v3.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "run/lifecycle-v3.log": "8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c",
+ "run/lifecycle-v3.om": "5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4",
+ "run/lifecycle.build.log": "7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3",
+ "run/lifecycle.log": "e5e6b0de629ec0aba4bed6a6cbe49d12138a9270be027189ba82bc75ea4af186",
+ "run/lifecycle.om": "71a4550da9c7556d613f2703b0885a29048d0fdd0e28dea959082300ab1546f8",
+ "run/provider-focus.build.log": "7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3",
+ "run/provider-focus.log": "3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408",
+ "run/provider-focus.om": "db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222",
+ "run.sha256": "dda63c506c55fe0300da967fcf505eeb4c5ad856ead6a77e5e55353f1b03b91b",
+ "source-hashes.sha256": "305b12af3f8e5d1087778b7fe423221c30f7be784eaa348536d9563d6935e230"
+}
diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v2.om b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v2.om
new file mode 100644
index 00000000..af317ce9
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v2.om
@@ -0,0 +1,117 @@
+note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions.
+text Lmagic "ALNPRV01"
+text Lhi "hi"
+text Lreply "SAY 1 1/1 hello"
+global Lchecks ulong 1
+global Lfails ulong 1
+global Lheld uchar 8192
+fn lcheck ok bool to void
+put Lchecks 0 add get Lchecks 0 1
+if not ok
+put Lfails 0 add get Lfails 0 1
+end
+end
+fn lhword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn lframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Lmagic i
+end
+lhword 8 op
+lhword 16 now
+lhword 24 arg
+lhword 32 size
+end
+fn lstatus to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add 16 i mul i 8
+end
+ret v
+end
+fn lreceive part ulong size ulong to void
+note Construct an actual courier LINE payload through existing packet logic.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Lheld i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Lheld i
+end
+put Outlen 0 n
+put Err 0 e
+lframe 5 4294967297 0 size
+end
+fn main to int
+lframe 1 4294967296 77 0
+lcheck prdo
+lcheck eq lstatus 1
+lframe 2 4294967297 0 len Lhi
+for i ulong len Lhi
+put Pb i get Lhi i
+end
+lcheck prdo
+lcheck eq lstatus 1
+lframe 3 4294967297 1 0
+lcheck prdo
+lcheck eq lstatus 3
+lframe 4 4294967297 1 0
+lcheck prdo
+for i ulong len Lreply
+put In i get Lreply i
+end
+lreceive 1 len Lreply
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 6 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 1 4294967296 88 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 2 1
+lframe 3 4294967296 1 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 0 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 7 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 0
+lcheck eq get Dm 1 0
+lcheck eq get Dm 2 0
+lcheck eq get Dtext get Dsay 0 0
+if ne get Lfails 0 0
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 1
+end
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3-membership-attempt.status b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3-membership-attempt.status
new file mode 100644
index 00000000..03434830
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3-membership-attempt.status
@@ -0,0 +1,3 @@
+module_build=0 module_exit=0
+source_membership_missing=57
+source_membership_extra=0
diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.om b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.om
new file mode 100644
index 00000000..ccfbefc9
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.om
@@ -0,0 +1,125 @@
+note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions.
+text Lmagic "ALNPRV01"
+text Lhi "hi"
+text Lreply "SAY 1 1/1 hello"
+global Lchecks ulong 1
+global Lfails ulong 1
+global Lheld uchar 8192
+fn lcheck ok bool to void
+put Lchecks 0 add get Lchecks 0 1
+if not ok
+put Lfails 0 add get Lfails 0 1
+end
+end
+fn lhword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn lframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Lmagic i
+end
+lhword 8 op
+lhword 16 now
+lhword 24 arg
+lhword 32 size
+end
+fn lstatus to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add 16 i mul i 8
+end
+ret v
+end
+fn lreceive part ulong size ulong to void
+note Construct an actual courier LINE payload through existing packet logic.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Lheld i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Lheld i
+end
+put Outlen 0 n
+put Err 0 e
+lframe 5 4294967297 0 size
+end
+fn main to int
+lframe 1 4294967296 77 0
+lcheck prdo
+lcheck eq lstatus 1
+lframe 2 4294967297 0 len Lhi
+for i ulong len Lhi
+put Pb i get Lhi i
+end
+lcheck prdo
+lcheck eq lstatus 1
+lframe 3 4294967297 1 0
+lcheck prdo
+lcheck eq lstatus 3
+lframe 4 4294967297 1 0
+lcheck prdo
+for i ulong len Lreply
+put In i get Lreply i
+end
+lreceive 1 len Lreply
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 6 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 1 4294967296 88 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 2 1
+lframe 3 4294967296 1 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 0 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 5 4294967297 0 65
+for i ulong 65
+put Pb i 0
+end
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 7 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 0
+lcheck eq get Dm 1 0
+lcheck eq get Dm 2 0
+lcheck eq get Dtext get Dsay 0 0
+if ne get Lfails 0 0
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 1
+end
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.sha256 b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.sha256
new file mode 100644
index 00000000..6583fbc9
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.sha256
@@ -0,0 +1,9 @@
+aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba /home/drakestapleton/handoffs/L764-review/lifecycle-v3.om
+5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4 /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.om
+c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64 /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.build.log
+8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.log
+9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.exit
+acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0 /home/drakestapleton/handoffs/L764-review/closure.log
+357bf1e00c1964d3a7aefd9efd47b75984803f5847d60e8749af0d523ef19360 /home/drakestapleton/handoffs/L764-review/closure-missing.txt
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L764-review/closure-extra.txt
diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.status b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.status
new file mode 100644
index 00000000..d4c1f3a0
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.status
@@ -0,0 +1,3 @@
+module_build=0 module_exit=0
+focused_build=0 focused_exec=0 assertions=136 failures=0
+source_membership=57/57 tracked_om_sh_present manifest_entries=63/63 git_and_export_hashes_match extra_manifest_non_om_sh=6
diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle.om b/evidence/allen-omega-L694/L763/independent-review/lifecycle.om
new file mode 100644
index 00000000..c39370c5
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle.om
@@ -0,0 +1,105 @@
+note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions.
+text Lmagic "ALNPRV01"
+text Lhi "hi"
+text Lreply "SAY 1 1/1 hello"
+global Lchecks ulong 1
+global Lfails ulong 1
+global Lheld uchar 8192
+fn lcheck ok bool to void
+put Lchecks 0 add get Lchecks 0 1
+if not ok
+put Lfails 0 add get Lfails 0 1
+end
+end
+fn lhword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn lframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Lmagic i
+end
+lhword 8 op
+lhword 16 now
+lhword 24 arg
+lhword 32 size
+end
+fn lstatus to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add 16 i mul i 8
+end
+ret v
+end
+fn lreceive part ulong size ulong to void
+note Construct an actual courier LINE payload through existing packet logic.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Lheld i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Lheld i
+end
+put Outlen 0 n
+put Err 0 e
+lframe 5 4294967297 0 size
+end
+fn main to int
+lframe 1 4294967296 77 0
+lcheck prdo
+lcheck eq lstatus 1
+lframe 2 4294967297 0 len Lhi
+for i ulong len Lhi
+put Pb i get Lhi i
+end
+lcheck prdo
+lcheck eq lstatus 1
+lframe 3 4294967297 1 0
+lcheck prdo
+lcheck eq lstatus 3
+lframe 4 4294967297 1 0
+lcheck prdo
+for i ulong len Lreply
+put In i get Lreply i
+end
+lreceive 1 len Lreply
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 6 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 1 4294967296 88 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 2 1
+lframe 3 4294967296 1 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 0 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 7 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 0
+lcheck eq get Dm 1 0
+lcheck eq get Dm 2 0
+lcheck eq get Dtext get Dsay 0 0
+if ne get Lfails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/parent-lifecycle.log b/evidence/allen-omega-L694/L763/independent-review/parent-lifecycle.log
new file mode 100644
index 00000000..cce2b75b
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/parent-lifecycle.log
@@ -0,0 +1 @@
+34 0
diff --git a/evidence/allen-omega-L694/L763/independent-review/parent-verification.json b/evidence/allen-omega-L694/L763/independent-review/parent-verification.json
new file mode 100644
index 00000000..fa848be2
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/parent-verification.json
@@ -0,0 +1,10 @@
+{
+ "pin": "92b405477cfdff40dda25c5afcac5b65cb04122a",
+ "source_files": 63,
+ "focused_checks": 136,
+ "independent_checks": 34,
+ "parent_binary_sha256": "c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64",
+ "report_sha256": "36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b",
+ "findings": "none in scoped provider/presentation attachment",
+ "scope": "host only"
+}
diff --git a/evidence/allen-omega-L694/L763/independent-review/report.md b/evidence/allen-omega-L694/L763/independent-review/report.md
new file mode 100644
index 00000000..ff285540
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/report.md
@@ -0,0 +1,29 @@
+# L764 independent provider/presentation review
+
+**Verdict: no scoped source defect found.** Review is against exact HEAD `92b405477cfdff40dda25c5afcac5b65cb04122a` with base `61ef587ee5d24bf862705f51bffb8039c9a2ed01`. The production checkout remained clean and unchanged.
+
+## Source review
+
+- Reviewed the narrow six-file delta: `PROVIDER.md`, `README.md`, `gate.sh`, `provider-core.om`, `tests/provider-core.om`, and `tests/provider-display-mutants.om`. `git diff --check` is clean.
+- `provider-core.om:205-211` keeps CANCEL on `appcancel`, uses `dreset` for RESET; `:213-214` refuses invalid clock before stateful dispatch; `:231-243` selects `dask` for ASK and `drecv` for RECV, returning refusal before `prevent`/accepted status when either call refuses. The call order preserves the existing provider frame and output semantics.
+- `gate.sh:10-14` places `presentation.om` before `provider-core.om` for seed definition-before-use. Gate additions at `:138-153` create three separate Omega mutants, each bypassing one attachment call.
+- Read `PROVIDER.md` and `PRESENTATION.md`. The expected contract is retained D* projection only on admitted events; CANCEL retains state, RESET clears it, and code snapshots are independent of reusable assembly storage. No new wire operation/record or pixel/device claim is introduced.
+
+## Independent verification
+
+- Exported `native/omega/allen` from the exact Git object into `~/handoffs/L764-review/export`. Recomputed all 63 entries in the L763 source manifest from Git blobs and the export. All hashes match. Membership comparison confirms all 57 tracked `.om`/`.sh` source/build files under the component tree are in the manifest; six remaining manifest entries are other file types. Source receipt: `closure.log`.
+- Rebuilt the focused provider-core Omega test from the exported source using the exact pinned compiler (SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`). Build returned 0; produced nonempty AArch64 ELF64 `EXEC`; executed 136 assertions, 0 failures, exit 0.
+- Authored and ran a separate seeded-Omega lifecycle probe. It covers BOOT/ASK/POLL/SENT/RECV display projection, CANCEL retention, duplicate BOOT refusal, clock refusal, malformed RECV refusal with last-good display retained, and RESET clearing retained metadata/text. Build returned 0; produced nonempty AArch64 ELF64 `EXEC`; probe output `34 0`, exit 0.
+
+## Raw receipts and hashes
+
+All paths below are under `~/handoffs/L764-review/` on Spark.
+
+- Closure: `closure.log` SHA-256 `acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0`; per-input source digests: `source-hashes.sha256` SHA-256 `305b12af3f8e5d1087778b7fe423221c30f7be784eaa348536d9563d6935e230`.
+- Focused provider: source `run/provider-focus.om` SHA-256 `db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222`; ELF `run/provider-focus` SHA-256 `ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f`; build log `run/provider-focus.build.log` SHA-256 `7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3`; raw result `run/provider-focus.log` SHA-256 `3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408`.
+- Lifecycle probe: immutable input `lifecycle-v3.om` SHA-256 `aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba`; combined source `run/lifecycle-v3.om` SHA-256 `5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4`; ELF `run/lifecycle-v3` SHA-256 `c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64`; raw result `run/lifecycle-v3.log` SHA-256 `8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c`; exit receipt `run/lifecycle-v3.exit` SHA-256 `9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa`.
+- Combined final probe hash inventory: `lifecycle-v3.sha256` SHA-256 `0df81acc47911c4b91a63cb12fdc0ab770b1eb59f40f9edd135f1c6aafffcf3a`.
+
+## Scope and issues
+
+This verifies source closure, focused native provider behavior, and the bounded lifecycle/refusal probe only. It does not replay the full native suite/mutants, nor qualify pixels, live sockets/disk, x86/EFI, QEMU, device behavior, or physical iMac acceptance. No source finding is being reported. Two host-orchestration attempts failed before behavioral execution (a relative build path from the wrong cwd and an unsupported shell process-substitution/quoting form); both were corrected, and the final build/probe receipts above are from successful executions. An earlier independent probe draft is preserved separately as `lifecycle-v2.om`; it is not the final probe receipt.
diff --git a/evidence/allen-omega-L694/L763/independent-review/report.sha256 b/evidence/allen-omega-L694/L763/independent-review/report.sha256
new file mode 100644
index 00000000..277fcc74
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/report.sha256
@@ -0,0 +1 @@
+36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b report.md
diff --git a/evidence/allen-omega-L694/L763/independent-review/run.sha256 b/evidence/allen-omega-L694/L763/independent-review/run.sha256
new file mode 100644
index 00000000..efb9501f
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run.sha256
@@ -0,0 +1,10 @@
+378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9 /home/drakestapleton/handoffs/L764-review/run/core.om
+db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222 /home/drakestapleton/handoffs/L764-review/run/provider-focus.om
+ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f /home/drakestapleton/handoffs/L764-review/run/provider-focus
+7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3 /home/drakestapleton/handoffs/L764-review/run/provider-focus.build.log
+3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408 /home/drakestapleton/handoffs/L764-review/run/provider-focus.log
+11050bfc0e21df08db82ca8cab6e250b4caa1101e9af995867defbef7dca367a /home/drakestapleton/handoffs/L764-review/lifecycle-v2.om
+71a4550da9c7556d613f2703b0885a29048d0fdd0e28dea959082300ab1546f8 /home/drakestapleton/handoffs/L764-review/run/lifecycle.om
+0dc710e5d1f82510cb773b8e443c5c5b9e896c4a004634aa00c5f9e3dda2bd6b /home/drakestapleton/handoffs/L764-review/run/lifecycle
+7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3 /home/drakestapleton/handoffs/L764-review/run/lifecycle.build.log
+e5e6b0de629ec0aba4bed6a6cbe49d12138a9270be027189ba82bc75ea4af186 /home/drakestapleton/handoffs/L764-review/run/lifecycle.log
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/core-v3.om b/evidence/allen-omega-L694/L763/independent-review/run/core-v3.om
new file mode 100644
index 00000000..2f2a4040
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/core-v3.om
@@ -0,0 +1,4146 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/core.om b/evidence/allen-omega-L694/L763/independent-review/run/core.om
new file mode 100644
index 00000000..2f2a4040
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/core.om
@@ -0,0 +1,4146 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.build.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.build.log
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.exit b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.log
new file mode 100644
index 00000000..de812932
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.log
@@ -0,0 +1,2 @@
+34 0
+exit=0
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.om b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.om
new file mode 100644
index 00000000..13fdde36
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.om
@@ -0,0 +1,4271 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions.
+text Lmagic "ALNPRV01"
+text Lhi "hi"
+text Lreply "SAY 1 1/1 hello"
+global Lchecks ulong 1
+global Lfails ulong 1
+global Lheld uchar 8192
+fn lcheck ok bool to void
+put Lchecks 0 add get Lchecks 0 1
+if not ok
+put Lfails 0 add get Lfails 0 1
+end
+end
+fn lhword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn lframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Lmagic i
+end
+lhword 8 op
+lhword 16 now
+lhword 24 arg
+lhword 32 size
+end
+fn lstatus to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add 16 i mul i 8
+end
+ret v
+end
+fn lreceive part ulong size ulong to void
+note Construct an actual courier LINE payload through existing packet logic.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Lheld i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Lheld i
+end
+put Outlen 0 n
+put Err 0 e
+lframe 5 4294967297 0 size
+end
+fn main to int
+lframe 1 4294967296 77 0
+lcheck prdo
+lcheck eq lstatus 1
+lframe 2 4294967297 0 len Lhi
+for i ulong len Lhi
+put Pb i get Lhi i
+end
+lcheck prdo
+lcheck eq lstatus 1
+lframe 3 4294967297 1 0
+lcheck prdo
+lcheck eq lstatus 3
+lframe 4 4294967297 1 0
+lcheck prdo
+for i ulong len Lreply
+put In i get Lreply i
+end
+lreceive 1 len Lreply
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 6 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 1 4294967296 88 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 2 1
+lframe 3 4294967296 1 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 0 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 5 4294967297 0 65
+for i ulong 65
+put Pb i 0
+end
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 7 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 0
+lcheck eq get Dm 1 0
+lcheck eq get Dm 2 0
+lcheck eq get Dtext get Dsay 0 0
+if ne get Lfails 0 0
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 1
+end
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.build.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.build.log
new file mode 100644
index 00000000..b8804b87
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.build.log
@@ -0,0 +1 @@
+build_rc=0
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.log
new file mode 100644
index 00000000..50cc3099
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.log
@@ -0,0 +1,2 @@
+30 0
+exit=0
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.om b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.om
new file mode 100644
index 00000000..2dbc3afc
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.om
@@ -0,0 +1,4263 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions.
+text Lmagic "ALNPRV01"
+text Lhi "hi"
+text Lreply "SAY 1 1/1 hello"
+global Lchecks ulong 1
+global Lfails ulong 1
+global Lheld uchar 8192
+fn lcheck ok bool to void
+put Lchecks 0 add get Lchecks 0 1
+if not ok
+put Lfails 0 add get Lfails 0 1
+end
+end
+fn lhword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn lframe op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Lmagic i
+end
+lhword 8 op
+lhword 16 now
+lhword 24 arg
+lhword 32 size
+end
+fn lstatus to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add 16 i mul i 8
+end
+ret v
+end
+fn lreceive part ulong size ulong to void
+note Construct an actual courier LINE payload through existing packet logic.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Lheld i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Lheld i
+end
+put Outlen 0 n
+put Err 0 e
+lframe 5 4294967297 0 size
+end
+fn main to int
+lframe 1 4294967296 77 0
+lcheck prdo
+lcheck eq lstatus 1
+lframe 2 4294967297 0 len Lhi
+for i ulong len Lhi
+put Pb i get Lhi i
+end
+lcheck prdo
+lcheck eq lstatus 1
+lframe 3 4294967297 1 0
+lcheck prdo
+lcheck eq lstatus 3
+lframe 4 4294967297 1 0
+lcheck prdo
+for i ulong len Lreply
+put In i get Lreply i
+end
+lreceive 1 len Lreply
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 6 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 1
+lcheck eq get Dm 2 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 1 4294967296 88 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 2 1
+lframe 3 4294967296 1 0
+lcheck prdo
+lcheck eq lstatus 0
+lcheck eq get Dm 0 1
+lcheck eq get Dtext get Dsay 0 104
+lframe 7 0 0 0
+lcheck prdo
+lcheck eq lstatus 1
+lcheck eq get Dm 0 0
+lcheck eq get Dm 1 0
+lcheck eq get Dm 2 0
+lcheck eq get Dtext get Dsay 0 0
+if ne get Lfails 0 0
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 1
+end
+outreset
+emitn get Lchecks 0
+emitb 32
+emitn get Lfails 0
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.build.log b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.build.log
new file mode 100644
index 00000000..b8804b87
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.build.log
@@ -0,0 +1 @@
+build_rc=0
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.log b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.log
new file mode 100644
index 00000000..9b32fe05
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.log
@@ -0,0 +1,137 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+exit=0
diff --git a/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.om b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.om
new file mode 100644
index 00000000..1e269178
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.om
@@ -0,0 +1,4469 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fmagic "ALNPRV01"
+text Hi "hi"
+text Leak "LEAK"
+text Reply "SAY 1 1/1 hello"
+text Askcode "write a calculator"
+text Tinycode "CODE 2 1/1 2 d8932aac text hi"
+text Done "SAY 2 1/1 Done."
+global Held uchar 8192
+global Holdn ulong 2
+global Before uchar 8192
+fn test ok bool to void
+note Direct write logger would clobber the very datagram being tested.
+put Holdn 0 get Outlen 0
+put Holdn 1 get Err 0
+for i ulong get Outlen 0
+put Held i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Holdn 0
+put Outb i get Held i
+end
+put Outlen 0 get Holdn 0
+put Err 0 get Holdn 1
+end
+fn hword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn frame op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Fmagic i
+end
+hword 8 op
+hword 16 now
+hword 24 arg
+hword 32 size
+end
+fn oword off ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add off i mul i 8
+end
+ret v
+end
+fn receive part ulong size ulong to void
+note Caller placed LINE payload in In; packet overwrites Outb, so preserve it.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Held i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Held i
+end
+put Outlen 0 n
+put Err 0 e
+frame 5 4294967297 0 size
+end
+fn main to int
+frame 1 4294967296 77 0
+test prparse
+test eq get Pv 0 1
+test eq get Pv 1 4294967296
+test eq get Pv 2 77
+put Ph 0 88
+test not prparse
+frame 11 0 0 0
+test not prparse
+frame 1 0 77 1
+test not prparse
+frame 3 0 2 0
+test not prparse
+frame 2 0 0 160
+test not prparse
+frame 10 0 0 0
+test prdo
+test eq oword 16 1
+test eq get Pc 0 1
+mset32 0 3
+mset32 36 1
+test memenc 10
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 8 0 1 4096
+test prdo
+test eq oword 16 1
+test eq get St 0 10
+test prdo
+test eq oword 16 0
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+for i ulong 4096
+put Pb i 0
+end
+frame 8 0 0 4096
+test prdo
+test eq oword 16 2
+test eq get Pc 0 2
+test eq get St 0 10
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+put Ns 0 2
+put Ns 1 0
+put Ns 2 3
+put Ns 3 0
+put Note 0 78
+put Note 1 48
+test noteenc
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 9 0 1 4096
+test prdo
+test eq oword 16 0
+frame 9 0 0 4096
+test prdo
+test eq oword 16 1
+test eq get Pc 0 3
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 1
+test eq get A 0 1
+test eq get Dm 0 0
+test eq get Dm 1 0
+test prdo
+test eq oword 16 0
+frame 10 0 0 0
+test prdo
+test eq oword 16 0
+test eq mem32 0 3
+frame 2 4294967297 0 len Hi
+for i ulong len Hi
+put Pb i get Hi i
+end
+test prdo
+test eq oword 16 1
+test eq get R 0 1
+test eq get Dm 0 0
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq oword 32 get Outlen 0
+test eq get T 10 5
+same = true
+for i ulong get Outlen 0
+if ne get Pout add i 40 get Outb i
+same = false
+end
+end
+test same
+test prdo
+test eq oword 16 1
+test eq get T 10 5
+frame 4 4294967297 0 0
+test prdo
+test eq get T 3 0
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+frame 4 4294967297 1 0
+test prdo
+test eq get T 3 1
+frame 3 4294967297 1 0
+test prdo
+test eq get T 10 1
+for i ulong len Reply
+put In i get Reply i
+end
+receive 1 len Reply
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Before i get Outb i
+end
+test prdo
+test eq get Outlen 0 n
+test eq get Err 0 e
+same = true
+for i ulong n
+if ne get Outb i get Before i
+same = false
+end
+end
+test same
+test eq oword 16 1
+test eq oword 24 1
+test eq oword 32 5
+test eq get Pout 40 104
+test eq get Dm 0 1
+test eq get Dm 2 1
+test eq get Ds 2 1
+test eq get Dtext get Dsay 0 104
+test eq get R 1 0
+test eq get T 10 1
+test eq get Outb 0 65
+note A stale visible event must not be projected by a rejected provider frame.
+for i ulong len Leak
+put Answer i get Leak i
+end
+put R 8 len Leak
+frame 5 4294967297 0 65
+put Ph 0 88
+test not prdo
+test eq get Dtext get Dsay 0 104
+frame 5 4294967297 0 65
+for i ulong 65
+put Pb i 0
+end
+test prdo
+test eq oword 16 0
+test eq get Dtext get Dsay 0 104
+test eq get Dm 2 1
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq get T 10 3
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 1
+test eq oword 32 0
+frame 2 4294967297 0 len Askcode
+for i ulong len Askcode
+put Pb i get Askcode i
+end
+test prdo
+test eq oword 24 1
+test eq oword 32 len Ack
+test eq get Dm 0 1
+test eq get Dm 2 2
+test eq get Dtext get Dsay 0 73
+for i ulong len Tinycode
+put In i get Tinycode i
+end
+receive 1 len Tinycode
+test prdo
+test eq oword 24 0
+test eq get Dm 1 0
+frame 3 4294967297 1 0
+test prdo
+frame 4 4294967297 1 0
+test prdo
+for i ulong len Done
+put In i get Done i
+end
+receive 2 len Done
+test prdo
+test eq oword 24 1
+test eq oword 32 5
+off = ulong 45
+test eq oword add off 8 11
+test eq oword add off 32 2
+test eq get Pout add off 40 104
+test eq get Pout add off 41 105
+test eq get Pn 0 add off 42
+test eq get Dm 1 1
+test eq get Dm 2 2
+test eq get Dview 0 1
+test eq get Dview 2 2
+test eq get Dlen 0 2
+test eq get Dcode 0 104
+test eq get Dcode 1 105
+test eq get Dtext get Dsay 0 68
+note Snapshot stays independent of later assembly and refused clock.
+put Code 0 88
+test eq get Dcode 0 104
+frame 3 4294967296 1 0
+test prdo
+test eq oword 16 0
+test eq oword 24 0
+test eq get Dcode 0 104
+test eq get Dtext get Dsay 0 68
+put Dtext 2303 88
+put Dcode 32767 88
+put Dlen 4095 88
+frame 7 0 0 0
+test prdo
+test eq get Dm 0 0
+test eq get Dm 1 0
+test eq get Dm 2 0
+test eq get Dview 0 0
+test eq get Dview 2 0
+test eq get Dtext 2303 0
+test eq get Dcode 32767 0
+test eq get Dlen 4095 0
+test eq get R 9 0
+test eq get R 0 2
+test eq get Q 1 2
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L763/independent-review/source-hashes.sha256 b/evidence/allen-omega-L694/L763/independent-review/source-hashes.sha256
new file mode 100644
index 00000000..a6028e3a
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/independent-review/source-hashes.sha256
@@ -0,0 +1,3 @@
+378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9 /home/drakestapleton/handoffs/L764-review/run/core.om
+db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222 /home/drakestapleton/handoffs/L764-review/run/provider-focus.om
+11050bfc0e21df08db82ca8cab6e250b4caa1101e9af995867defbef7dca367a /home/drakestapleton/handoffs/L764-review/lifecycle-v2.om
diff --git a/evidence/allen-omega-L694/L763/inputtail-mutant.log b/evidence/allen-omega-L694/L763/inputtail-mutant.log
new file mode 100644
index 00000000..c0415908
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/inputtail-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 1
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L763/intent.log b/evidence/allen-omega-L694/L763/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L763/inventory.json b/evidence/allen-omega-L694/L763/inventory.json
new file mode 100644
index 00000000..f5da77ff
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/inventory.json
@@ -0,0 +1,74 @@
+{
+ "README.md": "7143b8f2b86a2dd443a7b723113a6dbf9b7ac36a087b8e928db70f7e15994753",
+ "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433",
+ "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1",
+ "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a",
+ "autosent-mutant.log": "0a87e6bc447a7f5a73b519e4894331584138c0efa69baa3d66af99b4cadd5f2a",
+ "binaries.sha256": "8f7740e07603eddfbd55f244040246a57e32b63d541bef25120ad2ea0ef33328",
+ "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390",
+ "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0",
+ "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b",
+ "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5",
+ "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1",
+ "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835",
+ "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed",
+ "font.log": "e740379ab582a55deec96e1e2cc0ad550b217409e78ea906b415765b522c028d",
+ "fontalpha-mutant.log": "4a9357c64f7baaff5d6ccce7396f34ae76c40d22b2df4e0262df3c90ba8b77f3",
+ "fontroot-mutant.log": "877fce5a15491776440a7318117a847f974aea016b3a2f162c8644302d02d0fc",
+ "framecheck-mutant.log": "925e213d1b31b91996ca57bcdddfd12c33f5a302d9e2176a11ccedd04f6ae58b",
+ "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "full.log": "2d783008f9635f01ef89110deb9c49f34a71a05763322ddd67eb8df45a1d83f2",
+ "green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "green.log": "568cc8e9e1f6233e1f3b2e5fa07fafa4ac21f9cab5b006841eff0c2ba429c9fb",
+ "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e",
+ "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67",
+ "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345",
+ "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e",
+ "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508",
+ "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15",
+ "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a",
+ "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657",
+ "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7",
+ "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4",
+ "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b",
+ "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05",
+ "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a",
+ "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646",
+ "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435",
+ "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b",
+ "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-core.log": "568cc8e9e1f6233e1f3b2e5fa07fafa4ac21f9cab5b006841eff0c2ba429c9fb",
+ "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9",
+ "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "rawask-mutant.log": "148f8896f9220cbbecb641a6fe49c137260bf437bec937d1f09afbd46b5451fb",
+ "rawrecv-mutant.log": "2e45054213301b34842645a40bc5e0e19498c1a26653b7bde451b4c36a4e6fb1",
+ "rawreset-mutant.log": "2acccf216cb9aaf9b5864661973daccbab733c0f1eef5cc37f7b386e55926826",
+ "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61",
+ "red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "red.log": "58a0648bb6f395125e97fb3787f3b60a725cb0ca7a0d27f36112ba023cbcf9ad",
+ "red.om": "0bba98de9e3925db8f3ea4d3c04a94f7bd02758e095d65c9cdf2063a70aca19b",
+ "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162",
+ "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51",
+ "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9",
+ "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8",
+ "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d",
+ "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948",
+ "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2",
+ "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2",
+ "source.sha256": "dd9bdc76bc690a3303c6d66d1ad30ebc54ff2ab70f4b9aee07159d284d6c85fa",
+ "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b",
+ "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b",
+ "summary.json": "bf272391d502b317bb72f14e4b713d32e2bf8ade17cc14afdbc2ca0d59268ba6",
+ "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474",
+ "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e"
+}
diff --git a/evidence/allen-omega-L694/L763/keepalive-mutant.log b/evidence/allen-omega-L694/L763/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L763/long.log b/evidence/allen-omega-L694/L763/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L763/memory.log b/evidence/allen-omega-L694/L763/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L763/paint.log b/evidence/allen-omega-L694/L763/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L763/pendingwire-mutant.log b/evidence/allen-omega-L694/L763/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L763/presentation.log b/evidence/allen-omega-L694/L763/presentation.log
new file mode 100644
index 00000000..84fd2470
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/presentation.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-1.log b/evidence/allen-omega-L694/L763/provider-bad-1.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-1.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-1.receipt b/evidence/allen-omega-L694/L763/provider-bad-1.receipt
new file mode 100644
index 00000000..2b29860a
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-1.receipt
@@ -0,0 +1,4 @@
+1
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-2.log b/evidence/allen-omega-L694/L763/provider-bad-2.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-2.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-2.receipt b/evidence/allen-omega-L694/L763/provider-bad-2.receipt
new file mode 100644
index 00000000..9ba12cca
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-2.receipt
@@ -0,0 +1,4 @@
+2
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-3.log b/evidence/allen-omega-L694/L763/provider-bad-3.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-3.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-3.receipt b/evidence/allen-omega-L694/L763/provider-bad-3.receipt
new file mode 100644
index 00000000..199cc204
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-3.receipt
@@ -0,0 +1,4 @@
+3
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-4.log b/evidence/allen-omega-L694/L763/provider-bad-4.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-4.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-4.receipt b/evidence/allen-omega-L694/L763/provider-bad-4.receipt
new file mode 100644
index 00000000..26a81c4a
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-4.receipt
@@ -0,0 +1,4 @@
+4
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-5.log b/evidence/allen-omega-L694/L763/provider-bad-5.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-5.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-5.receipt b/evidence/allen-omega-L694/L763/provider-bad-5.receipt
new file mode 100644
index 00000000..d79f5995
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-5.receipt
@@ -0,0 +1,4 @@
+5
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-6.log b/evidence/allen-omega-L694/L763/provider-bad-6.log
new file mode 100644
index 00000000..3f9cc45d
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-bad-6.log
@@ -0,0 +1,17 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
diff --git a/evidence/allen-omega-L694/L763/provider-bad-6.receipt b/evidence/allen-omega-L694/L763/provider-bad-6.receipt
new file mode 100644
index 00000000..d0b7cd17
Binary files /dev/null and b/evidence/allen-omega-L694/L763/provider-bad-6.receipt differ
diff --git a/evidence/allen-omega-L694/L763/provider-consumer.log b/evidence/allen-omega-L694/L763/provider-consumer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-consumer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L763/provider-consumer.receipt b/evidence/allen-omega-L694/L763/provider-consumer.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L763/provider-consumer.receipt differ
diff --git a/evidence/allen-omega-L694/L763/provider-core.log b/evidence/allen-omega-L694/L763/provider-core.log
new file mode 100644
index 00000000..1f06fc57
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-core.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/provider-fragment.log b/evidence/allen-omega-L694/L763/provider-fragment.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-fragment.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L763/provider-process.log b/evidence/allen-omega-L694/L763/provider-process.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-process.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L763/provider-process.receipt b/evidence/allen-omega-L694/L763/provider-process.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L763/provider-process.receipt differ
diff --git a/evidence/allen-omega-L694/L763/provider-producer.log b/evidence/allen-omega-L694/L763/provider-producer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-producer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L763/provider-producer.receipt b/evidence/allen-omega-L694/L763/provider-producer.receipt
new file mode 100644
index 00000000..0967800c
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-producer.receipt
@@ -0,0 +1,4 @@
+7
+0
+0
+0
diff --git a/evidence/allen-omega-L694/L763/provider-stream.log b/evidence/allen-omega-L694/L763/provider-stream.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/provider-stream.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L763/rawask-mutant.log b/evidence/allen-omega-L694/L763/rawask-mutant.log
new file mode 100644
index 00000000..a9da9338
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/rawask-mutant.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 1
+97 1
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/rawrecv-mutant.log b/evidence/allen-omega-L694/L763/rawrecv-mutant.log
new file mode 100644
index 00000000..debaa464
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/rawrecv-mutant.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 0
+76 0
+77 0
+78 0
+79 1
+80 0
+81 0
+82 1
+83 1
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 1
+112 0
+113 1
+114 1
+115 1
+116 1
+117 1
+118 1
+119 1
+120 0
+121 0
+122 0
+123 1
+124 1
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/rawreset-mutant.log b/evidence/allen-omega-L694/L763/rawreset-mutant.log
new file mode 100644
index 00000000..bbd3c7f0
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/rawreset-mutant.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 1
+127 1
+128 1
+129 1
+130 1
+131 1
+132 1
+133 1
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/readback-mutant.log b/evidence/allen-omega-L694/L763/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/L763/red.exit b/evidence/allen-omega-L694/L763/red.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/red.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L763/red.log b/evidence/allen-omega-L694/L763/red.log
new file mode 100644
index 00000000..8cce9d3c
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/red.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 0
+76 0
+77 0
+78 0
+79 1
+80 0
+81 0
+82 1
+83 1
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 1
+96 1
+97 1
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 1
+112 1
+113 1
+114 1
+115 1
+116 1
+117 1
+118 1
+119 1
+120 0
+121 0
+122 0
+123 1
+124 1
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 1
+132 1
+133 1
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L763/red.om b/evidence/allen-omega-L694/L763/red.om
new file mode 100644
index 00000000..f6e24e90
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/red.om
@@ -0,0 +1,4469 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+appreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not appask now
+ret 0
+end
+else
+if not appreceive now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Fmagic "ALNPRV01"
+text Hi "hi"
+text Leak "LEAK"
+text Reply "SAY 1 1/1 hello"
+text Askcode "write a calculator"
+text Tinycode "CODE 2 1/1 2 d8932aac text hi"
+text Done "SAY 2 1/1 Done."
+global Held uchar 8192
+global Holdn ulong 2
+global Before uchar 8192
+fn test ok bool to void
+note Direct write logger would clobber the very datagram being tested.
+put Holdn 0 get Outlen 0
+put Holdn 1 get Err 0
+for i ulong get Outlen 0
+put Held i get Outb i
+end
+check ok add get Checks 0 1
+for i ulong get Holdn 0
+put Outb i get Held i
+end
+put Outlen 0 get Holdn 0
+put Err 0 get Holdn 1
+end
+fn hword off ulong v ulong to void
+for i ulong 8
+put Ph add off i uchar and shr v mul i 8 255
+end
+end
+fn frame op ulong now ulong arg ulong size ulong to void
+for i ulong 8
+put Ph i get Fmagic i
+end
+hword 8 op
+hword 16 now
+hword 24 arg
+hword 32 size
+end
+fn oword off ulong to ulong
+v = ulong 0
+for i ulong 8
+v = or v shl ulong get Pout add off i mul i 8
+end
+ret v
+end
+fn receive part ulong size ulong to void
+note Caller placed LINE payload in In; packet overwrites Outb, so preserve it.
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Held i get Outb i
+end
+put Inlen 0 size
+b = packet 2 get Q 1 part 0 0
+size = get Outlen 0
+for i ulong size
+put Pb i get Outb i
+end
+for i ulong n
+put Outb i get Held i
+end
+put Outlen 0 n
+put Err 0 e
+frame 5 4294967297 0 size
+end
+fn main to int
+frame 1 4294967296 77 0
+test prparse
+test eq get Pv 0 1
+test eq get Pv 1 4294967296
+test eq get Pv 2 77
+put Ph 0 88
+test not prparse
+frame 11 0 0 0
+test not prparse
+frame 1 0 77 1
+test not prparse
+frame 3 0 2 0
+test not prparse
+frame 2 0 0 160
+test not prparse
+frame 10 0 0 0
+test prdo
+test eq oword 16 1
+test eq get Pc 0 1
+mset32 0 3
+mset32 36 1
+test memenc 10
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 8 0 1 4096
+test prdo
+test eq oword 16 1
+test eq get St 0 10
+test prdo
+test eq oword 16 0
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+for i ulong 4096
+put Pb i 0
+end
+frame 8 0 0 4096
+test prdo
+test eq oword 16 2
+test eq get Pc 0 2
+test eq get St 0 10
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 0
+put Ns 0 2
+put Ns 1 0
+put Ns 2 3
+put Ns 3 0
+put Note 0 78
+put Note 1 48
+test noteenc
+for i ulong 4096
+put Pb i get Enc i
+end
+frame 9 0 1 4096
+test prdo
+test eq oword 16 0
+frame 9 0 0 4096
+test prdo
+test eq oword 16 1
+test eq get Pc 0 3
+frame 1 4294967296 77 0
+test prdo
+test eq oword 16 1
+test eq get A 0 1
+test eq get Dm 0 0
+test eq get Dm 1 0
+test prdo
+test eq oword 16 0
+frame 10 0 0 0
+test prdo
+test eq oword 16 0
+test eq mem32 0 3
+frame 2 4294967297 0 len Hi
+for i ulong len Hi
+put Pb i get Hi i
+end
+test prdo
+test eq oword 16 1
+test eq get R 0 1
+test eq get Dm 0 0
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq oword 32 get Outlen 0
+test eq get T 10 5
+same = true
+for i ulong get Outlen 0
+if ne get Pout add i 40 get Outb i
+same = false
+end
+end
+test same
+test prdo
+test eq oword 16 1
+test eq get T 10 5
+frame 4 4294967297 0 0
+test prdo
+test eq get T 3 0
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+frame 4 4294967297 1 0
+test prdo
+test eq get T 3 1
+frame 3 4294967297 1 0
+test prdo
+test eq get T 10 1
+for i ulong len Reply
+put In i get Reply i
+end
+receive 1 len Reply
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Before i get Outb i
+end
+test prdo
+test eq get Outlen 0 n
+test eq get Err 0 e
+same = true
+for i ulong n
+if ne get Outb i get Before i
+same = false
+end
+end
+test same
+test eq oword 16 1
+test eq oword 24 1
+test eq oword 32 5
+test eq get Pout 40 104
+test eq get Dm 0 1
+test eq get Dm 2 1
+test eq get Ds 2 1
+test eq get Dtext get Dsay 0 104
+test eq get R 1 0
+test eq get T 10 1
+test eq get Outb 0 65
+note A stale visible event must not be projected by a rejected provider frame.
+for i ulong len Leak
+put Answer i get Leak i
+end
+put R 8 len Leak
+frame 5 4294967297 0 65
+put Ph 0 88
+test not prdo
+test eq get Dtext get Dsay 0 104
+frame 5 4294967297 0 65
+for i ulong 65
+put Pb i 0
+end
+test prdo
+test eq oword 16 0
+test eq get Dtext get Dsay 0 104
+test eq get Dm 2 1
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 3
+test eq get T 10 3
+frame 4 4294967297 1 0
+test prdo
+frame 3 4294967297 1 0
+test prdo
+test eq oword 16 1
+test eq oword 32 0
+frame 2 4294967297 0 len Askcode
+for i ulong len Askcode
+put Pb i get Askcode i
+end
+test prdo
+test eq oword 24 1
+test eq oword 32 len Ack
+test eq get Dm 0 1
+test eq get Dm 2 2
+test eq get Dtext get Dsay 0 73
+for i ulong len Tinycode
+put In i get Tinycode i
+end
+receive 1 len Tinycode
+test prdo
+test eq oword 24 0
+test eq get Dm 1 0
+frame 3 4294967297 1 0
+test prdo
+frame 4 4294967297 1 0
+test prdo
+for i ulong len Done
+put In i get Done i
+end
+receive 2 len Done
+test prdo
+test eq oword 24 1
+test eq oword 32 5
+off = ulong 45
+test eq oword add off 8 11
+test eq oword add off 32 2
+test eq get Pout add off 40 104
+test eq get Pout add off 41 105
+test eq get Pn 0 add off 42
+test eq get Dm 1 1
+test eq get Dm 2 2
+test eq get Dview 0 1
+test eq get Dview 2 2
+test eq get Dlen 0 2
+test eq get Dcode 0 104
+test eq get Dcode 1 105
+test eq get Dtext get Dsay 0 68
+note Snapshot stays independent of later assembly and refused clock.
+put Code 0 88
+test eq get Dcode 0 104
+frame 3 4294967296 1 0
+test prdo
+test eq oword 16 0
+test eq oword 24 0
+test eq get Dcode 0 104
+test eq get Dtext get Dsay 0 68
+put Dtext 2303 88
+put Dcode 32767 88
+put Dlen 4095 88
+frame 7 0 0 0
+test prdo
+test eq get Dm 0 0
+test eq get Dm 1 0
+test eq get Dm 2 0
+test eq get Dview 0 0
+test eq get Dview 2 0
+test eq get Dtext 2303 0
+test eq get Dcode 32767 0
+test eq get Dlen 4095 0
+test eq get R 9 0
+test eq get R 0 2
+test eq get Q 1 2
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L763/reply.log b/evidence/allen-omega-L694/L763/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L763/runtime.log b/evidence/allen-omega-L694/L763/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L763/scene-input.log b/evidence/allen-omega-L694/L763/scene-input.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/scene-input.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L763/scene.log b/evidence/allen-omega-L694/L763/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L763/scenecap-mutant.log b/evidence/allen-omega-L694/L763/scenecap-mutant.log
new file mode 100644
index 00000000..502843ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/scenecap-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L763/scheduler.log b/evidence/allen-omega-L694/L763/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L763/session-mutant.log b/evidence/allen-omega-L694/L763/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L763/short.log b/evidence/allen-omega-L694/L763/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L763/source.sha256 b/evidence/allen-omega-L694/L763/source.sha256
new file mode 100644
index 00000000..1ed394ce
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/source.sha256
@@ -0,0 +1,63 @@
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om
+79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md
+c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om
+58afa9d254f16e3840857001d804c68b7e29b528ef562f1c8bf0341861b425df native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md
+d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om
+c8a04b1d5f95c36500e7b2f475e169148c6ac76a677b1ca3da38f217fe2a501e native/omega/allen/provider-core.om
+f96b8b9074b4802b1cb52545db7ced1b5a64bf75ad756d532a8fc4e16c7107cd native/omega/allen/PROVIDER.md
+ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om
+259c4a50465c0932955e86f5d5c0fbf6c1f863097ea499a91aa583fa01eaf003 native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc native/omega/allen/tests/font-mutants.om
+cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om
+7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om
+a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8 native/omega/allen/tests/font-render.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om
+b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+ebc300f5c8737543acec6397bf7a82000594e13c424df20e203ea7ab09da46c4 native/omega/allen/tests/provider-core.om
+0c611ef5d6fe9c5d951fa8886e6425a4cb538c308d99f2723634f253d755cbbb native/omega/allen/tests/provider-display-mutants.om
+b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om
+37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om
+d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om
+8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L763/stale-mutant.log b/evidence/allen-omega-L694/L763/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L763/staleview-mutant.log b/evidence/allen-omega-L694/L763/staleview-mutant.log
new file mode 100644
index 00000000..c0c96c65
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/staleview-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 1
+35 1
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L763/summary.json b/evidence/allen-omega-L694/L763/summary.json
new file mode 100644
index 00000000..f9070ac8
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/summary.json
@@ -0,0 +1,68 @@
+{
+ "base": "61ef587ee5d24bf862705f51bffb8039c9a2ed01",
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "provider-core": 136,
+ "memory": 79,
+ "context": 142,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "scene-input": 63,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292,
+ "provider-stream": 292,
+ "provider-fragment": 292,
+ "provider-process": 3,
+ "provider-consumer": 3,
+ "provider-producer": 3,
+ "provider-bad-1": 5,
+ "provider-bad-2": 5,
+ "provider-bad-3": 5,
+ "provider-bad-4": 5,
+ "provider-bad-5": 5,
+ "provider-bad-6": 17,
+ "presentation": 75,
+ "font": 421
+ },
+ "total_checks": 2746,
+ "compiled_rejected_mutants": {
+ "inputtail-mutant": 1,
+ "session-mutant": 1,
+ "appcode-mutant": 3,
+ "contextjob-mutant": 36,
+ "readback-mutant": 7,
+ "staleview-mutant": 2,
+ "fontroot-mutant": 11,
+ "fontalpha-mutant": 2,
+ "hash-mutant": 2,
+ "contextnote-mutant": 5,
+ "autosent-mutant": 8,
+ "thinking-mutant": 6,
+ "pendingwire-mutant": 1,
+ "scenecap-mutant": 3,
+ "crc-mutant": 2,
+ "ackstop-mutant": 27,
+ "stale-mutant": 3,
+ "rawrecv-mutant": 17,
+ "rawreset-mutant": 8,
+ "framecheck-mutant": 4,
+ "rawask-mutant": 2,
+ "keepalive-mutant": 40
+ },
+ "red_checks": 136,
+ "red_failures": 24,
+ "focused_green": 136,
+ "wire_output_unchanged": true,
+ "provider_output_sha256": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0",
+ "provider_elf_sha256": "4021dd66d7ec338426210bf2f0d139c1225e3cc2e3207fbfd4b0e1bbba9fa8ca",
+ "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9",
+ "scope": "Provider dispatch attached to retained presentation; no pixel/device/live/iMac qualification."
+}
diff --git a/evidence/allen-omega-L694/L763/thinking-mutant.log b/evidence/allen-omega-L694/L763/thinking-mutant.log
new file mode 100644
index 00000000..74b41a12
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/thinking-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L763/view.log b/evidence/allen-omega-L694/L763/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L763/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/L765/README.md b/evidence/allen-omega-L694/L765/README.md
new file mode 100644
index 00000000..5044f7e0
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/README.md
@@ -0,0 +1,25 @@
+# L765 clipped native text surface
+
+The native surface renders retained text using the qualified Omega stroke font.
+The actual image follows provider BOOT/ASK/RECV -> retained note -> RGB pixels.
+It is a test reply, not live inference or a completed hosted application. The
+inspected PNG is a lossless conversion of the actual native P6 output; final
+full-gate pixels match the inspected specimen. Font specimen pixels and provider
+wire bytes are unchanged after sharing surface storage with the old fixture.
+
+Reproduce: `quiet-build native/omega/allen/gate.sh /absolute/fresh/output`.
+Counts and actual compiled-mutant failures are in summary.json. Native tests
+exercise blending, clipping, negative origins, fractional pen advance, maximum
+span, refusal preservation and input/wire isolation. New mutation logic is Omega.
+
+Initial stub compilation failed because parameter start collided with runtime's
+start function (error10 atline4162). Retained red.om is that construction failure,
+not behavioralRED. Renaming only that parameter to beg yielded79 assertions,
+43 failures,exit1. Expanded stub85 assertions/46 failures and final native85/85
+are retained. No assertion was weakened; no compiler implementation was changed.
+
+The public-alpha direction is native/omega/allen/ALPHA.md: sovereign local compute,
+optional user cloud or keyed Spark, free temporary hosted trial without boot,
+partition or driver modification. The current fixture neither installs an app
+nor touches devices. Target/hosted packaging and live inference remain unqualified.
+Independent surface review remains pending.
diff --git a/evidence/allen-omega-L694/L765/ackstop-mutant.log b/evidence/allen-omega-L694/L765/ackstop-mutant.log
new file mode 100644
index 00000000..5d0598cb
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/ackstop-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 1
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 1
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 0
+180 1
+181 0
+182 1
+183 0
+184 1
+185 0
+186 1
+187 0
+188 1
+189 0
+190 1
+191 0
+192 1
+193 0
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L765/appcode-mutant.log b/evidence/allen-omega-L694/L765/appcode-mutant.log
new file mode 100644
index 00000000..c9c50601
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/appcode-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 1
+76 1
+77 1
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L765/application.log b/evidence/allen-omega-L694/L765/application.log
new file mode 100644
index 00000000..2e8a428d
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/application.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L765/autosent-mutant.log b/evidence/allen-omega-L694/L765/autosent-mutant.log
new file mode 100644
index 00000000..6b9b9f3a
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/autosent-mutant.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 1
+51 0
+52 0
+53 1
+54 1
+55 0
+56 1
+57 0
+58 1
+59 0
+60 0
+61 0
+62 1
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 1
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L765/binaries.sha256 b/evidence/allen-omega-L694/L765/binaries.sha256
new file mode 100644
index 00000000..7dbbebab
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/binaries.sha256
@@ -0,0 +1,59 @@
+1ec8ee3cae7f12c5bc6c70e7db8620b5c0e35a995badd6ed5127dfcd2bcd1a34 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-display-mutants
+b2b1d530dcd471e22b624ee3e618e17c579f37a9d8536538159eb3df3265f7e6 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-core
+5df3376637df46283bfad517a35e158a2db9b404a0e18c940069f743a0fd736d /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scheduler
+a0043555cf79c2ecd4d308f778000e4d4c3ada6c4283184ca68911c59a6c4515 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/readback-mutant
+0680ae9828d4c569c483f96a2a093e2e9d4f2f694c99f7207f2d6653111b52c6 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font-render
+ef3294fd665e72167192dc07c3c4184f130dd0d9cf56bd8922eee141793cddc1 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/view
+7a8d6f74e73ab8a10a07b8d7b418bd784c51e02a6bde07c981910436dbbe28b5 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/contextnote-mutant
+db8eb2ea2815fbb84323126cc3755eaa547517b5726aec60c4e7b2e2af48bf28 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font
+277d78e5b07556c6d62fa480039f460f3f433e52e5d6d5fb539ba1d09ce064fd /home/drakestapleton/handoffs/allen-omega-L694/L765/full/allen
+bf1a0644658cc2c4a0ac55ff227a6dd8a2fdc771c8a9a2d300d30c36f4b3cfc0 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/reply
+583c208881381618716db4d8013c41951b6e6aad60d5c789acb144e09686c4e8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/thinking-mutant
+5a3a813ab4cfcef486b7920563d4b3fe615edafbf269ce6d8ed1796fb01fb230 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/surface
+3889b10935f48c606b17d2cb778ea39866d02f7976eff0292c03f6ff8d24b9a8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/inputtail-mutant
+e44ee2e0fb447a50836ee6f83e70b349469b8c6a86edfeb5425e55f71a40de83 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/ackstop-mutant
+67e1d74c0eba2c9be5b1499f21f11e0c09207ff77d2f6480b0ae3c7f166f6cae /home/drakestapleton/handoffs/allen-omega-L694/L765/full/hash-mutant
+3ea36ec2690a2276299c1a2792e083a9428663ad3f617ed17cd794ba9f4f400b /home/drakestapleton/handoffs/allen-omega-L694/L765/full/golden
+d79606e96ab36b8f4946bcba86f6ca8a28b97b22b4075a72fe388c40937296a5 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/session-mutant
+f0de7e1fd80f28d8905a29cf6f2e96ffc7b271e155b2900ab785338da9d677df /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scene-input
+b88253b534e3cc6327e5aee1c246ec043aa76e13d605bbcc20b19116dbc242e8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/intent
+dd2a504c99a5757ee195553550ee0e9e832f5d2902a02f654a795f40067e6c1f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-input
+1cf6557305554a699bbf2844466976f862a473c4f96692c84b9073c0d64ccb6f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/rawask-mutant
+3a84eb8ffde7ae9a0d181250afb66cac4b0e43fe49b2e9b76c957dd601de4152 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/surface-mutants
+34c901cfb34adcbba1212045f9209a5fb3f385b9011c116be8bf8be9ed173f41 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font-mutants
+4a15671c7565b7bb36a8c73b71469ea5a0516785aaaaf4a117d711b674172ca6 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/fixture
+7920f4faf33ee312a4e40bd059cfbd596ed6dde41a4d72e3d7b841762ab961a1 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider
+5e0805d8db84dee2a34d3ff8c1ebb0a7e21759caa03cb72a49f84af126cf7fca /home/drakestapleton/handoffs/allen-omega-L694/L765/full/context
+7170b5750d4a617400e3fb789d45ec9768e266b450b20fdc959767320bd96521 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/staleview-mutant
+227e8e308484c3ec9ee57da0f295b616e613dc7c9a1e3d096b8a9f39f7cfa709 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/runtime
+74219971e764b8ed72fb1ef00b96f90724a161160c9927d17aec52460dd08647 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/code
+52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-mutants
+da46b103d53b8bdbeb80f3bd6c7013bdbf534af103f47a1168e023fa967539f7 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/edges
+a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/presentation-mutants
+1cd67f151fd770abccd40e76084c371ed445745a50072344f043e69c60082e0b /home/drakestapleton/handoffs/allen-omega-L694/L765/full/appcode-mutant
+263e91dd6669b47100249da8583b00d5242393b57e56e8d5630ef9615f1590c4 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/render
+d1180a7492a313488f50e9dae1e4b01bbfd37695f190e1be15cb91f01fa9f1e2 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/rawrecv-mutant
+282d033f4752c79e88949736501550f4c9fc555b535df3aa52393463d8f6aae5 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/stale-mutant
+7e5737bb5acf31c3e584a6389cef5f04f2e0f61c5c421ca90c20856b3b093251 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/courier
+7ee8446a1fdb79609dd83e073cd0fa964047839915bfa780562f9cb00962837a /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scene
+960460506ca9ebddc79698fd7ec304a17046db995a4b13a15487fc6559dc802f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/presentation
+7a41e8b30b0ad60e25addd2d0c1e51408c7440dc645de92d999579849645d5e3 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/pendingwire-mutant
+7b2d070333ac2978b19e8ea078fba08935303adc216e0e4ea6d0fb82f7ef657b /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font-output
+4c8c39c05cd4480b1418f0dbd604f9d093e4d03021266b04fba65bdb2ef9b94c /home/drakestapleton/handoffs/allen-omega-L694/L765/full/clipright-mutant
+5ed8dad655d71cdf037631df85a8f6b36abf97a1e146c13267a789b46f6fa3b0 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/framecheck-mutant
+385567741d13264b90536edc4fa56ff2b20f1ed78f5f37fc5226623271c5a407 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/blendbg-mutant
+eef60330c475d018bd9ca9f697c6221062ef9ea59197b78e2bb01650d5ebea5a /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scenecap-mutant
+fa91a5ec8599c9f7ebcd55886f2d8a164ff5c7413c1347a461f37ec4cf5914e3 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/fontroot-mutant
+6209984add5473dcc9dfe774c1679147517f7ee5b9f52aa4ab4cc9674133f83e /home/drakestapleton/handoffs/allen-omega-L694/L765/full/contextjob-mutant
+1d5d8331c26baf46b32c00731286fd5b22a7f9139c22c6e43c6c898a27f12ed8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/paint
+a0fc632f29ab6bdc23d1fd0b22d2e82974ae1539e9513f5854b68ced916babb4 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/crc-mutant
+b3e567f726eb3395516e4aab5c1fca888d160e784a72ee97df4640cd943f3d25 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/autosent-mutant
+96899de9e1c586407a8f8e0455a2fa9b468e8070de4f6aafa65241cf40dfa07f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-output
+71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/stdio-overflow-input
+e4c883b182f2ae7f5e74cee9e39fbae7d6cf2892dc31bb6415a9edfb36786184 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/keepalive-mutant
+661259d4a7158df286f832fd60597d4abae7aa23a8d63bdb08cd5cc6dc554fee /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-process
+aa3663aff49c9f58f822eae8fd8a1ab58049a4db4c1fe72a007f45408b3dca12 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/memory
+9eaf7d395b86a8623307df39b95f29331ad2fb571bf2ea1b4f8fbd7f70a646a9 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/surface-render
+6dc3bc8da70430603a03bd7b5d67017a4b62a2bc4a0c535304e47214298eb3ab /home/drakestapleton/handoffs/allen-omega-L694/L765/full/fontalpha-mutant
+e28c9b84644c09a8221437f90962855bad58c6d47c087c1aa73f61b4ea442bef /home/drakestapleton/handoffs/allen-omega-L694/L765/full/application
+678c6775ae1adb7b2e330ae434df65fbfef1762f809b5e673b7fed64ae174ab1 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/rawreset-mutant
diff --git a/evidence/allen-omega-L694/L765/blendbg-mutant.log b/evidence/allen-omega-L694/L765/blendbg-mutant.log
new file mode 100644
index 00000000..40ad1f15
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/blendbg-mutant.log
@@ -0,0 +1,85 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 1
+21 1
+22 1
+23 1
+24 1
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
diff --git a/evidence/allen-omega-L694/L765/clipright-mutant.log b/evidence/allen-omega-L694/L765/clipright-mutant.log
new file mode 100644
index 00000000..a23b0e19
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/clipright-mutant.log
@@ -0,0 +1,85 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 1
+29 0
+30 1
+31 0
+32 0
+33 0
+34 0
+35 0
+36 1
+37 0
+38 0
+39 0
+40 0
+41 0
+42 1
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 1
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
diff --git a/evidence/allen-omega-L694/L765/code.log b/evidence/allen-omega-L694/L765/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L765/context.log b/evidence/allen-omega-L694/L765/context.log
new file mode 100644
index 00000000..df62cddb
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/context.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L765/contextjob-mutant.log b/evidence/allen-omega-L694/L765/contextjob-mutant.log
new file mode 100644
index 00000000..3432d4b2
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/contextjob-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 1
+72 1
+73 1
+74 1
+75 1
+76 1
+77 0
+78 0
+79 1
+80 1
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 1
+88 1
+89 0
+90 1
+91 0
+92 1
+93 0
+94 1
+95 0
+96 1
+97 0
+98 1
+99 0
+100 1
+101 0
+102 1
+103 0
+104 1
+105 0
+106 1
+107 0
+108 1
+109 1
+110 1
+111 1
+112 1
+113 1
+114 1
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 1
+123 0
+124 1
+125 0
+126 1
+127 0
+128 1
+129 0
+130 1
+131 0
+132 1
+133 0
+134 1
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 1
+142 1
diff --git a/evidence/allen-omega-L694/L765/contextnote-mutant.log b/evidence/allen-omega-L694/L765/contextnote-mutant.log
new file mode 100644
index 00000000..b5c08759
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/contextnote-mutant.log
@@ -0,0 +1,142 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 1
+38 1
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 1
+47 0
+48 1
+49 0
+50 0
+51 0
+52 0
+53 0
+54 1
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
diff --git a/evidence/allen-omega-L694/L765/courier.log b/evidence/allen-omega-L694/L765/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L765/crc-mutant.log b/evidence/allen-omega-L694/L765/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/L765/edges.log b/evidence/allen-omega-L694/L765/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/L765/font.log b/evidence/allen-omega-L694/L765/font.log
new file mode 100644
index 00000000..1f885320
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/font.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
diff --git a/evidence/allen-omega-L694/L765/fontalpha-mutant.log b/evidence/allen-omega-L694/L765/fontalpha-mutant.log
new file mode 100644
index 00000000..4dba5479
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/fontalpha-mutant.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 1
+414 0
+415 0
+416 0
+417 0
+418 0
+419 1
+420 0
+421 0
diff --git a/evidence/allen-omega-L694/L765/fontroot-mutant.log b/evidence/allen-omega-L694/L765/fontroot-mutant.log
new file mode 100644
index 00000000..326cd397
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/fontroot-mutant.log
@@ -0,0 +1,421 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 1
+11 1
+12 1
+13 1
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
+293 0
+294 0
+295 0
+296 0
+297 0
+298 0
+299 0
+300 0
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
+362 0
+363 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+380 0
+381 0
+382 0
+383 0
+384 0
+385 0
+386 0
+387 0
+388 0
+389 0
+390 0
+391 0
+392 0
+393 0
+394 0
+395 0
+396 0
+397 0
+398 0
+399 0
+400 0
+401 0
+402 0
+403 0
+404 0
+405 0
+406 0
+407 0
+408 0
+409 0
+410 0
+411 0
+412 0
+413 0
+414 1
+415 1
+416 1
+417 1
+418 1
+419 0
+420 1
+421 1
diff --git a/evidence/allen-omega-L694/L765/framecheck-mutant.log b/evidence/allen-omega-L694/L765/framecheck-mutant.log
new file mode 100644
index 00000000..2849aedb
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/framecheck-mutant.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 1
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L765/full.exit b/evidence/allen-omega-L694/L765/full.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/full.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L765/full.log b/evidence/allen-omega-L694/L765/full.log
new file mode 100644
index 00000000..de61e79f
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/full.log
@@ -0,0 +1,59 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+presentation compile=0 native-exit=0
+font compile=0 native-exit=0
+surface compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+font-output compile=0 native-exit=0
+font-render compile=0 native-exit=0
+surface-render compile=0 native-exit=0
+font native masks match frozen external legacy oracle
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=1
+framecheck mutant compile=0 rejected-exit=1
+staleview mutant compile=0 rejected-exit=1
+inputtail mutant compile=0 rejected-exit=1
+fontroot mutant compile=0 rejected-exit=1
+fontalpha mutant compile=0 rejected-exit=1
+rawask mutant compile=0 rejected-exit=1
+rawrecv mutant compile=0 rejected-exit=1
+rawreset mutant compile=0 rejected-exit=1
+clipright mutant compile=0 rejected-exit=1
+blendbg mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/L765/green.exit b/evidence/allen-omega-L694/L765/green.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/green.exit
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/L765/green.log b/evidence/allen-omega-L694/L765/green.log
new file mode 100644
index 00000000..dfd50508
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/green.log
@@ -0,0 +1,79 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
diff --git a/evidence/allen-omega-L694/L765/green2.log b/evidence/allen-omega-L694/L765/green2.log
new file mode 100644
index 00000000..b0699580
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/green2.log
@@ -0,0 +1,81 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
diff --git a/evidence/allen-omega-L694/L765/hash-mutant.log b/evidence/allen-omega-L694/L765/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L765/inputtail-mutant.log b/evidence/allen-omega-L694/L765/inputtail-mutant.log
new file mode 100644
index 00000000..c0415908
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/inputtail-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 1
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L765/intent.log b/evidence/allen-omega-L694/L765/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/L765/inventory.json b/evidence/allen-omega-L694/L765/inventory.json
new file mode 100644
index 00000000..5160987a
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/inventory.json
@@ -0,0 +1,84 @@
+{
+ "README.md": "2d46cf33dfc1bce34265358ff52ac1c3f17021051e40018fabd1e470e9f70e5d",
+ "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433",
+ "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1",
+ "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a",
+ "autosent-mutant.log": "0a87e6bc447a7f5a73b519e4894331584138c0efa69baa3d66af99b4cadd5f2a",
+ "binaries.sha256": "0021bee42f30154ff98f0a965d06e54b4db9ce397ae07e311e0b1e6b77bd53a2",
+ "blendbg-mutant.log": "89c87c87a0b7cbff1515b194ab1f6af5dd80d005fd0537f299932843b6c879d3",
+ "clipright-mutant.log": "fed1bc66f29d0878cd2a155fe8679344267fbc6806f87397bc1e3eb2983fa34c",
+ "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390",
+ "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0",
+ "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b",
+ "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5",
+ "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1",
+ "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835",
+ "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed",
+ "font.log": "e740379ab582a55deec96e1e2cc0ad550b217409e78ea906b415765b522c028d",
+ "fontalpha-mutant.log": "4a9357c64f7baaff5d6ccce7396f34ae76c40d22b2df4e0262df3c90ba8b77f3",
+ "fontroot-mutant.log": "877fce5a15491776440a7318117a847f974aea016b3a2f162c8644302d02d0fc",
+ "framecheck-mutant.log": "925e213d1b31b91996ca57bcdddfd12c33f5a302d9e2176a11ccedd04f6ae58b",
+ "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "full.log": "c6906c818676ee60a3cd8518570da28068a84e7cf47aa4b203243c13ae96a0ea",
+ "green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
+ "green.log": "3dd67e42141a43466d66f80d9718156eb2ee9a5a568daca7f271179d29d68f18",
+ "green2.log": "61c408c93c729c5a25a6d7b7f7ffd088b154f8282612074dd006c72e43bd38e6",
+ "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e",
+ "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67",
+ "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345",
+ "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e",
+ "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508",
+ "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15",
+ "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a",
+ "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657",
+ "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7",
+ "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4",
+ "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b",
+ "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05",
+ "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a",
+ "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c",
+ "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646",
+ "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435",
+ "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b",
+ "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-core.log": "568cc8e9e1f6233e1f3b2e5fa07fafa4ac21f9cab5b006841eff0c2ba429c9fb",
+ "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb",
+ "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5",
+ "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9",
+ "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3",
+ "provider-surface.png": "1b2a7fc8f6fe1287462c4833ff1012848b8a7f735affd552fba50ea5bfbd8069",
+ "provider-surface.ppm": "676f3d56de19603e07766f2b859b58a55090071cb4a43081b4e7800031872066",
+ "rawask-mutant.log": "148f8896f9220cbbecb641a6fe49c137260bf437bec937d1f09afbd46b5451fb",
+ "rawrecv-mutant.log": "2e45054213301b34842645a40bc5e0e19498c1a26653b7bde451b4c36a4e6fb1",
+ "rawreset-mutant.log": "2acccf216cb9aaf9b5864661973daccbab733c0f1eef5cc37f7b386e55926826",
+ "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61",
+ "red.om": "e9f448cf45e9b01c4e5fb016a77510dd4d0bccc413b30abca431a2e0a450d3ee",
+ "red2.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "red2.log": "326b77d7e7dceede76d198f43da9f91d4b2562f84fa6e10680f9876b58b54c15",
+ "red2.om": "0798511dba86b3b96e80e39b5df72cd7db053b114ce3fce467546c5e448edc62",
+ "red3.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
+ "red3.log": "d4f25e8194ef9b79713d4326ef2c569bb1e677eac7c02b47fef3500b10186ece",
+ "red3.om": "c74c03c173deec76d0d602a1bba01cda74c9200466906bd417d66ca6daf7b136",
+ "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162",
+ "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51",
+ "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9",
+ "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8",
+ "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d",
+ "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948",
+ "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2",
+ "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2",
+ "source.sha256": "9aefde7a15a1a04d4b9f583b04d69499e653e24d38017a278f0f1b0832a14fb2",
+ "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b",
+ "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b",
+ "summary.json": "2a7182ab93d75dd8e92c6c580fe6137b56fbad928fe4ab428acb5683bcf547e2",
+ "surface.log": "912b904b061622c26b5a727dfd46be8e1639d476d2db19086b29a0359b8b5fdd",
+ "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474",
+ "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e"
+}
diff --git a/evidence/allen-omega-L694/L765/keepalive-mutant.log b/evidence/allen-omega-L694/L765/keepalive-mutant.log
new file mode 100644
index 00000000..2e3415df
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/keepalive-mutant.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 1
+19 1
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 1
+54 1
+55 1
+56 1
+57 0
+58 0
+59 1
+60 0
+61 0
+62 0
+63 0
+64 0
+65 1
+66 0
+67 0
+68 0
+69 1
+70 1
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 1
+170 0
+171 1
+172 1
+173 0
+174 1
+175 0
+176 0
+177 0
+178 1
+179 1
+180 1
+181 1
+182 1
+183 1
+184 1
+185 1
+186 1
+187 1
+188 1
+189 1
+190 1
+191 1
+192 1
+193 1
+194 1
+195 1
+196 1
+197 1
+198 0
+199 1
+200 0
+201 0
+202 1
+203 1
+204 1
+205 0
+206 1
+207 1
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L765/long.log b/evidence/allen-omega-L694/L765/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L765/memory.log b/evidence/allen-omega-L694/L765/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/L765/paint.log b/evidence/allen-omega-L694/L765/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/L765/pendingwire-mutant.log b/evidence/allen-omega-L694/L765/pendingwire-mutant.log
new file mode 100644
index 00000000..48fb2008
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/pendingwire-mutant.log
@@ -0,0 +1,182 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 1
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
diff --git a/evidence/allen-omega-L694/L765/presentation.log b/evidence/allen-omega-L694/L765/presentation.log
new file mode 100644
index 00000000..84fd2470
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/presentation.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-1.log b/evidence/allen-omega-L694/L765/provider-bad-1.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-1.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-1.receipt b/evidence/allen-omega-L694/L765/provider-bad-1.receipt
new file mode 100644
index 00000000..2b29860a
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-1.receipt
@@ -0,0 +1,4 @@
+1
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-2.log b/evidence/allen-omega-L694/L765/provider-bad-2.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-2.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-2.receipt b/evidence/allen-omega-L694/L765/provider-bad-2.receipt
new file mode 100644
index 00000000..9ba12cca
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-2.receipt
@@ -0,0 +1,4 @@
+2
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-3.log b/evidence/allen-omega-L694/L765/provider-bad-3.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-3.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-3.receipt b/evidence/allen-omega-L694/L765/provider-bad-3.receipt
new file mode 100644
index 00000000..199cc204
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-3.receipt
@@ -0,0 +1,4 @@
+3
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-4.log b/evidence/allen-omega-L694/L765/provider-bad-4.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-4.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-4.receipt b/evidence/allen-omega-L694/L765/provider-bad-4.receipt
new file mode 100644
index 00000000..26a81c4a
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-4.receipt
@@ -0,0 +1,4 @@
+4
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-5.log b/evidence/allen-omega-L694/L765/provider-bad-5.log
new file mode 100644
index 00000000..7da8e511
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-5.log
@@ -0,0 +1,5 @@
+1 0
+2 0
+3 0
+4 0
+5 0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-5.receipt b/evidence/allen-omega-L694/L765/provider-bad-5.receipt
new file mode 100644
index 00000000..d79f5995
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-5.receipt
@@ -0,0 +1,4 @@
+5
+65
+0
+0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-6.log b/evidence/allen-omega-L694/L765/provider-bad-6.log
new file mode 100644
index 00000000..3f9cc45d
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-bad-6.log
@@ -0,0 +1,17 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
diff --git a/evidence/allen-omega-L694/L765/provider-bad-6.receipt b/evidence/allen-omega-L694/L765/provider-bad-6.receipt
new file mode 100644
index 00000000..d0b7cd17
Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-bad-6.receipt differ
diff --git a/evidence/allen-omega-L694/L765/provider-consumer.log b/evidence/allen-omega-L694/L765/provider-consumer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-consumer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L765/provider-consumer.receipt b/evidence/allen-omega-L694/L765/provider-consumer.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-consumer.receipt differ
diff --git a/evidence/allen-omega-L694/L765/provider-core.log b/evidence/allen-omega-L694/L765/provider-core.log
new file mode 100644
index 00000000..1f06fc57
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-core.log
@@ -0,0 +1,136 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
diff --git a/evidence/allen-omega-L694/L765/provider-fragment.log b/evidence/allen-omega-L694/L765/provider-fragment.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-fragment.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L765/provider-process.log b/evidence/allen-omega-L694/L765/provider-process.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-process.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L765/provider-process.receipt b/evidence/allen-omega-L694/L765/provider-process.receipt
new file mode 100644
index 00000000..31d93b9d
Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-process.receipt differ
diff --git a/evidence/allen-omega-L694/L765/provider-producer.log b/evidence/allen-omega-L694/L765/provider-producer.log
new file mode 100644
index 00000000..9c0592e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-producer.log
@@ -0,0 +1,3 @@
+1 0
+2 0
+3 0
diff --git a/evidence/allen-omega-L694/L765/provider-producer.receipt b/evidence/allen-omega-L694/L765/provider-producer.receipt
new file mode 100644
index 00000000..0967800c
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-producer.receipt
@@ -0,0 +1,4 @@
+7
+0
+0
+0
diff --git a/evidence/allen-omega-L694/L765/provider-stream.log b/evidence/allen-omega-L694/L765/provider-stream.log
new file mode 100644
index 00000000..d91084d1
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-stream.log
@@ -0,0 +1,292 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
+225 0
+226 0
+227 0
+228 0
+229 0
+230 0
+231 0
+232 0
+233 0
+234 0
+235 0
+236 0
+237 0
+238 0
+239 0
+240 0
+241 0
+242 0
+243 0
+244 0
+245 0
+246 0
+247 0
+248 0
+249 0
+250 0
+251 0
+252 0
+253 0
+254 0
+255 0
+256 0
+257 0
+258 0
+259 0
+260 0
+261 0
+262 0
+263 0
+264 0
+265 0
+266 0
+267 0
+268 0
+269 0
+270 0
+271 0
+272 0
+273 0
+274 0
+275 0
+276 0
+277 0
+278 0
+279 0
+280 0
+281 0
+282 0
+283 0
+284 0
+285 0
+286 0
+287 0
+288 0
+289 0
+290 0
+291 0
+292 0
diff --git a/evidence/allen-omega-L694/L765/provider-surface.png b/evidence/allen-omega-L694/L765/provider-surface.png
new file mode 100644
index 00000000..3f0540a3
Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-surface.png differ
diff --git a/evidence/allen-omega-L694/L765/provider-surface.ppm b/evidence/allen-omega-L694/L765/provider-surface.ppm
new file mode 100644
index 00000000..47dac85e
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/provider-surface.ppm
@@ -0,0 +1,49 @@
+P6
+768 384
+255
+?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ®²½‹Ž™ILV?BL½À̽ÀÌ?BL½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÜàììðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞSV`ª¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü¶ºÅÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÕÙåÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞª¹ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü ",ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞLNY�”Ÿº½ÉÍÑÜ»¾ÊŽ‘œNP[[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iOQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\ÏÒÞìðüìðüÏÒÞ}�ŒìðüìðüìðüUXb?BL½À̽ÀÌ?BL\_j—š¥¿ÃÏÍÑܾÁÍ—š¥\_jOQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞ‰Œ—ÏÒÞ‰Œ—LNY�”Ÿº½ÉÍÑÜ»¾ÊŽ‘œNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ<>I¸¼Çìðüìðüìðüìðüìðüìðüìðü¼¿Ë9;F[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>IÏÒÞìðüìðüÏÒÞGJTìðüìðüìðü�„�½ÀÌìðüìðü½ÀÌehsÚÞêìðüìðüìðüìðüìðüìðüìðü›Ÿª;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ%'2³¶ÂìðüìðüìðüNP[<>I¸¼Çìðüìðüìðüìðüìðüìðüìðü¼¿Ë9;FÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞ(ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüÝáí]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ÛßëìðüìðüìðüìðüNP[bdoìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüéíùÓ×ãìðüìðüìðüìðüìðüìðüQT_[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞæêöìðüìðüº½ÉÏÒÞìðüìðüìðüìðüìðüìðüìðüæêöÓ×ãäèôìðüìðü�’�QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüìðüìðüŠ�˜SV`ìðüìðüìðüìðüìðüéíùÓ×ãìðüìðüìðüìðüìðüìðüQT_ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ"ØÛçìðüìðüìðüÙÜè_bl
`bmÚÞêìðüìðüìðüØÛç'[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i'ØÛçìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðü×Ûæ'ÏÒÞìðüìðüÏÒÞØÛçìðüìðüÈÌØÏÒÞìðüìðüìðüìðüìðü®²½GJT>AKFIT'ØÛçìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŸ¢®ìðüìðüìðüìðüìðübdo"ØÛçìðüìðüìðüÙÜè_bl
`bmÚÞêìðüìðüìðüØÛç'ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ†Š•ìðüìðüìðüÉÍÙ"%/"%/ÇË×ìðüìðüìðü†‰”[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“ÏÒÞìðüìðüÏÒÞ×ÛæìðüìðüÉÍÙÏÒÞìðüìðüìðüìðü‚…�†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ9;FÇÊÖìðüìðüìðüìðüÇÊÖ9;F†Š•ìðüìðüìðüÉÍÙ"%/"%/ÇË×ìðüìðüìðü†‰”ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞ êîúìðüìðüìðü;=H;=Hìðüìðüìðüëïû[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iëïûìðüìðüìðü;=H;=HìðüìðüìðüêîúÏÒÞìðüìðüÏÒÞåéõìðüìðü»¾ÊÏÒÞìðüìðüìðü®²½ëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüŸ¢® êîúìðüìðüìðü;=H;=HìðüìðüìðüëïûÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞXZeìðüìðüìðü•˜£“–¢ìðüìðüìðü\_j[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i\_jìðüìðüìðü“–¢“–¢ìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ(ìðüìðüìðü«¯ºÏÒÞìðüìðüìðüFIT\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðüìðüìðüuxƒXZeìðüìðüìðü•˜£“–¢ìðüìðüìðü\_jÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�“žìðüìðüìðüEGRCEPìðüìðüìðü�“ž[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i�“žìðüìðüìðüCEPDFQìðüìðüìðü�’�ÏÒÞìðüìðüÏÒÞFITìðüìðüìðü‚…�ÏÒÞìðüìðüäèô�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ³¶ÂìðüìðüìðüìðüÛßëNP[�“žìðüìðüìðüEGRCEPìðüìðüìðü�“žÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¶ºÅìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüº½É[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iº½Éìðüìðüìðü
ìðüìðüìðü¹½ÈÏÒÞìðüìðüÏÒÞ}€‹ìðüìðüìðüVXcÏÒÞìðüìðüÐÓߺ½Éìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüÛßëìðüìðüìðüìðüâæò?BL¶ºÅìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüº½ÉÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü!#-ÏÒÞìðüìðüÏÒÞÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüâæò?BLÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÈÌØìðüìðüÙÜèØÛçìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüâæòìðüìðüìðüâæò?BLÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i¹½Èìðüìðüìðü
ìðüìðüìðüº½ÉÏÒÞìðüìðüÏÒÞ©¬¸ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞ¹½Èìðüìðüìðü
ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüÇÊÖ9;F?BLâæòìðüìðüìðüâæò?BL´·ÃìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ‘• ìðüìðüìðüADN[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i�’�ìðüìðüìðüDFQCEPìðüìðüìðü�“žÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÖÚå ÏÒÞìðüìðüÏÒÞ�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL‘• ìðüìðüìðüADNÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞZ]hìðüìðüìðü”—¢$[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü“–¢“–¢ìðüìðüìðü\_jÏÒÞìðüìðüÏÒÞ,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLZ]hìðüìðüìðü”—¢$ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iêîúìðüìðüìðü;=H;=HìðüìðüìðüëïûÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞˆ‹—ìðüìðüìðüÇË×$&1$&1ÊÎÚìðüìðüìðü([^iìðüìðüìðü[^i[^iìðüìðüìðü[^i…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”%'2[^i%'2ÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞ…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLˆ‹—ìðüìðüìðüÇË×$&1$&1ÊÎÚìðüìðüìðü(ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ"Üàììðüìðüìðü×Ûæ_bl
+]`kÔØäìðüìðüìðüÛßë[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i'×ÛæìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüØÛç'%'2âæòìðüâæò%'2ÏÒÞìðüìðüÏÒÞSV`ª¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞ'×ÛæìðüìðüìðüÙÜè`bm
`bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL"Üàììðüìðüìðü×Ûæ_bl
+]`kÔØäìðüìðüìðüÛßëÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNY[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_jlwìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÝáíìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLNP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNY‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^ak[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k¢¥°ìðüìðüìðü24>ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðü½ÀÌ\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^akNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü·»Æ?BLNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HÙÜèìðüìðüÙÝé½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ?BLâæòìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü·»Æ?BLNP[ìðüìðüìðüNP[?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLFIT�”Ÿ¾ÂÎÇË×¼¿Ë’•¡GJT‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—OQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\13>ìðüìðüìðü¢¥°?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ±¼Š�˜HKU?BL½À̽ÀÌ?BLOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLFIT�”Ÿ¾ÂÎÇË×¼¿Ë’•¡GJT‰Œ—ÏÒÞ‰Œ—jlwìðüìðüìðükmx¢¥°ìðüìðüìðü24>ÏÒÞìðüìðüÙÝ鉌—ìðüìðü‰Œ—NP[NP[‚‰ªœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Ê#&6Ž•¸X^w�—ºV[t?DXx~�“›¾”œ¿v}›>BVŒ”¶¨±Ø¨±Ø¨±Ø¨±Ø¨±Ø¨±ØÇÑþ¨±Ø¨±Ø¨±Ø¨±Ø¨±Ø¨±Ø)-=ÈÒÿ{�¡
+ÈÒÿx~�$'7˜ ÄÈÒÿÈÒÿ³¼å³¼åÈÒÿÈÒÿ•�Á #2~…¤ÇÑþ ÈÒÿ{�¡!8=PÄÎú59L8=PÄÎú59L
+ÈÒÿx~�!/3E¾ÇòÈÒÿkq�, .lr�ÈÒÿ¹Âí+.?~…¤ÇÑþ ÈÒÿ{�¡'ÈÒÿag�BG\ÈÒÿ?DXBG\ÈÒÿ?DX
+ÈÒÿx~�'ÈÒÿag�±»äÅÏü8=PBVÈÒÿX]v~…¤ÇÑþ ÈÒÿ{�¡BVlr�x~�x~�ÈÒÿx~�x~�x~�x~�X]vlr�@DY[a{X]vEI_jpŒ59Kio‹u|šU[snt‘>BV?DXkrŽu|š\b{ #259Kio‹u|šU[s
+ÈÒÿx~�lr�@DY;?SkrŽv}›Z_y+59Kio‹u|šU[snt‘>BVlr�@DY[a{X]vEI_jpŒlr�@DYBV59Kio‹u|šU[snt‘>BV~…¤ÇÑþ ÈÒÿ{�¡•œÀÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿflˆ,ÈÒÿgmˆ%•�ÁÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿci„´¾çÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿ‘™½|ƒ¢ÈÒÿÈÒÿÈÒÿÈÒÿ¾ÈóLQh´¾ç¾Çò(,<gmˆÈÒÿnt‘´¾çÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿ‘™½¼Æñ“›¾¼Æñµ¾è™¡Æµ¾è}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�%•�ÁÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿci„}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~� ÈÒÿ{�¡•�ÁÈÒÿÈÒÿÈÒÿÈÒÿ€‡§}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�¼Æñ“›¾¼Æñµ¾è™¡Æµ¾è ÈÒÿ{�¡•œÀÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿflˆ,ÈÒÿgmˆ ÈÒÿ{�¡•œÀÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿflˆ·Àê“›¾™¡Æ°¹â ÈÒÿ{�¡ÈÒÿÈÒÿÈÒÿÈÒÿÁÊöINdMRiÃÍùÈÒÿÈÒÿÈÒÿÈÒÿag�|ƒ¢ÈÒÿÈÒÿÈÒÿÈÒÿ¾ÈóLQh}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�~…¤ÇÑþ ÈÒÿ¥ÔÈÒÿhn‰!$38BV8BV¬µÝÈÒÿÈÒÿ¨±Ø<@S04F•œÀÈÒÿFKa‚‰ªÈÒÿ{�¡%)9DH^¬µÝÈÒÿ>BV�ˆ¨ÈÒÿ{�¡&*9CH]«´ÜÈÒÿÈÒÿx~��ˆ¨ÈÒÿ{�¡&*9CH]«´ÜÈÒÿÈÒÿx~�~…¤ÇÑþ ÈÒÿÈÒÿQVn’š½ÈÒÿ .,ÈÒÿgmˆ#ÈÒÿw~œ
+MRiBG\ÈÒÿ?DX@DYÈÒÿv}›"0»Ä葉ÕRWnÈÒÿŒ”¶59LÈÒÿ§¯× BG\ÈÒÿ?DXAEZÈÒÿU[s~…¥ÈÒÿÈÒÿxž[a{ÈÒÿ;?S@DYÈÒÿw~œ"0»ÄïÈÒÿx~�#ÈÒÿw~œ
+MRi@DYÈÒÿw~œ"0»ÄïÈÒÿx~� ÈÒÿÈÒÿQVn@DYÈÒÿw~œ"0»ÄïÈÒÿx~�AEZÈÒÿU[s~…¥ÈÒÿÈÒÿxž[a{ÈÒÿ;?S ÈÒÿÈÒÿQVn’š½ÈÒÿ .,ÈÒÿgmˆ ÈÒÿÈÒÿQVn’š½ÈÒÿ .ÄÎú‚‰©‡Ž°¾Èó ÈÒÿ´¾ç
+/2DÈÒÿÈÒÿ)-=»ÄÆ@DYÈÒÿv}›"0»Ä葉Õ@DYÈÒÿw~œ"0»ÄïÈÒÿx~�@DYÈÒÿw~œ"0»ÄïÈÒÿx~�~…¤ÇÑþ ÈÒÿ¡©Ï8=PÈÒÿZ_y,ÈÒÿgmˆÈÒÿƒŠ«BG\ÈÒÿ?DXˆ�°ÇÑþ$]c|ÈÒÿ;?SjpŒÈÒÿsz— .²»äÀÊõ+.?BG\ÈÒÿ?DX¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾èˆ�°ÈÒÿ#]c|ÈÒÿx~�ÈÒÿƒŠ«ˆ�°ÈÒÿ#]c|ÈÒÿx~� ÈÒÿ¡©Ïˆ�°ÈÒÿ#]c|ÈÒÿx~�¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾è ÈÒÿ¡©Ï8=PÈÒÿZ_y,ÈÒÿgmˆ ÈÒÿ¡©Ï8=PÈÒÿZ_y·Àê’š½˜ ıºã ÈÒÿ€‡§«´Ü¥Ô‡Ž°¾Èóˆ�°ÇÑþ$]c|ÈÒÿ;?Sˆ�°ÈÒÿ#]c|ÈÒÿx~�ˆ�°ÈÒÿ#]c|ÈÒÿx~�~…¤ÇÑþ ÈÒÿ~…¥ÈÒÿu{™,ÈÒÿgmˆ|ƒ¢ÈÒÿ‚‰©?CW*.>"BG\ÈÒÿ?DXµ¾è’š½,/@,/@,/@,/@,/@,/@,/@ÈÒÿek‡ƒŠ«ÈÒÿš¢ÇÈÒÿDH^BG\ÈÒÿ?DX~…¥ÈÒÿ)AEZÈÒÿU[s[a{ÈÒÿ;?S"0ÈÒÿxž¶¿é“›¾%)9ÈÒÿx~�|ƒ¢ÈÒÿ‚‰©?CW*.>"¶¿é“›¾%)9ÈÒÿx~� ÈÒÿ~…¥¶¿é“›¾%)9ÈÒÿx~�~…¥ÈÒÿ)AEZÈÒÿU[s[a{ÈÒÿ;?S"0ÈÒÿxž ÈÒÿ~…¥ÈÒÿu{™,ÈÒÿgmˆ ÈÒÿ~…¥ÈÒÿu{™‘™½·Àê½Æñ�•· ÈÒÿ{�¡¥®ÕŸ¨Í�ˆ¨ÄÎúµ¾è’š½,/@,/@,/@,/@,/@,/@,/@ÈÒÿek‡¶¿é“›¾%)9ÈÒÿx~�¶¿é“›¾%)9ÈÒÿx~�~…¤ÇÑþ ÈÒÿ{�¡
+ÈÒÿx~�,ÈÒÿgmˆy€ŸÈÒÿÈÒÿÈÒÿÈÒÿ�•·(,<BG\ÈÒÿ?DXÇÑþÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿw~œ›¤ÉÈÒÿ\b{BG\ÈÒÿ?DXAEZÈÒÿU[s~…¥ÈÒÿ)"0ÈÒÿxž[a{ÈÒÿ;?S ÈÒÿ|ƒ¢
ÈÒÿx~�y€ŸÈÒÿÈÒÿÈÒÿÈÒÿ�•·(,< ÈÒÿ|ƒ¢
ÈÒÿx~� ÈÒÿ{�¡ ÈÒÿ|ƒ¢
ÈÒÿx~�AEZÈÒÿU[s~…¥ÈÒÿ)"0ÈÒÿxž[a{ÈÒÿ;?S ÈÒÿ{�¡
+ÈÒÿx~�,ÈÒÿgmˆ ÈÒÿ{�¡
+ÈÒÿx~�`f€ÈÒÿ6:M<@SÈÒÿ[`z ÈÒÿ{�¡¥®ÕŸ¨Í�ˆ¨ÄÎúÇÑþÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿw~œ ÈÒÿ|ƒ¢
ÈÒÿx~� ÈÒÿ|ƒ¢
ÈÒÿx~�~…¤ÇÑþ ÈÒÿ{�¡
+ÈÒÿx~�,ÈÒÿgmˆ!/KPgY_x}„£ÈÒÿ»Äï!$3BG\ÈÒÿ?DX¼Æñ‹’´V[tV[tV[tV[tV[tV[tV[tV[t%)9gmˆÈÒÿ´¾ç¾Çò(,<BG\ÈÒÿ?DX¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾è¾Èó‹’´-ÈÒÿx~�!/KPgY_x}„£ÈÒÿ»Äï!$3¾Èó‹’´-ÈÒÿx~� ÈÒÿ{�¡¾Èó‹’´-ÈÒÿx~�¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾è ÈÒÿ{�¡
+ÈÒÿx~�,ÈÒÿgmˆ ÈÒÿ{�¡
+ÈÒÿx~�#&6ÈÒÿ†�¯Œ”¶ÈÒÿ . ÈÒÿ{�¡¥®ÕŸ¨Í�ˆ¨ÄÎú¼Æñ‹’´V[tV[tV[tV[tV[tV[tV[tV[t%)9¾Èó‹’´-ÈÒÿx~�¾Èó‹’´-ÈÒÿx~�~…¤ÇÑþ ÈÒÿ{�¡
+ÈÒÿx~�,ÈÒÿgmˆ<@SÈÒÿrx•BG\ÈÒÿ?DX•œÀ¸ÂìOTkÈÒÿŽ–¹8"
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+note Compilable surface negative control.
+global Canvas uchar 884736
+global Cv ulong 8
+global Cvpose long 2
+fn cvinit w ulong h ulong to bool
+ret false
+end
+fn cvclip x ulong y ulong w ulong h ulong to bool
+ret false
+end
+fn cvpixel x long y long a uchar color ulong to void
+end
+fn cvglyph c uchar x long y long color ulong to bool
+ret false
+end
+fn cvspan start ulong size ulong x long y long color ulong to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Surface tests: removing clipping, using constant background or bypassing drawing must fail.
+global Csave uchar 4096
+global Cmeta ulong 8
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn cvkeep to void
+for i ulong 3072
+put Csave i get Canvas i
+end
+for i ulong 8
+put Cmeta i get Cv i
+end
+end
+fn cvsame to bool
+for i ulong 3072
+if ne get Canvas i get Csave i
+ret false
+end
+end
+for i ulong 8
+if ne get Cv i get Cmeta i
+ret false
+end
+end
+ret true
+end
+fn cvrefclip to bool
+ink = ulong 0
+for y ulong 32
+for x ulong 32
+at = mul add mul y 32 x 3
+inside = and ge x 8 lt x 16
+inside = and inside and ge y 8 lt y 16
+for k ulong 3
+v = uchar 6
+if eq k 1
+v = 8
+end
+if eq k 2
+v = 18
+end
+if inside
+v = get Csave add at k
+if ne v get Canvas add at k
+ret false
+end
+if gt v 18
+ink = add ink 1
+end
+else
+if ne get Canvas add at k v
+ret false
+end
+end
+end
+end
+end
+ret gt ink 0
+end
+fn main to int
+test not cvglyph 65 0 0 15528188
+test not cvinit 0 32
+test not cvinit 32 0
+test not cvinit 769 32
+test not cvinit 32 385
+test cvinit 32 32
+test eq get Cv 0 32
+test eq get Cv 1 32
+test eq get Cv 4 32
+test eq get Cv 5 32
+test eq get Canvas 0 6
+test eq get Canvas 1 8
+test eq get Canvas 2 18
+test eq get Canvas 3071 18
+test eq get Canvas 3072 0
+test not cvglyph 65 0 0 15528188
+test afinit 20 1000
+note Exact alpha arithmetic and repeated overlap must use current destination.
+cvpixel 0 0 0 15528188
+test eq get Canvas 0 6
+cvpixel 0 0 128 15528188
+test eq get Canvas 0 121
+test eq get Canvas 1 124
+test eq get Canvas 2 135
+cvpixel 0 0 128 15528188
+test eq get Canvas 0 178
+test eq get Canvas 1 182
+test eq get Canvas 2 193
+cvpixel 0 0 255 15528188
+test eq get Canvas 0 236
+test eq get Canvas 1 240
+test eq get Canvas 2 252
+cvkeep
+cvpixel -1 0 255 0
+cvpixel 0 -1 255 0
+cvpixel 32 0 255 0
+cvpixel 0 32 255 0
+test cvsame
+test not cvinit 18446744073709551615 1
+test cvsame
+test not cvclip 33 0 0 0
+test not cvclip 0 33 0 0
+test not cvclip 0 0 33 1
+test not cvclip 0 0 1 33
+test not cvclip 1 1 18446744073709551615 1
+test cvsame
+test not cvglyph 65 -4097 0 15528188
+test not cvglyph 65 4097 0 15528188
+test not cvglyph 65 0 -4097 15528188
+test not cvglyph 65 0 4097 15528188
+test not cvglyph 65 0 0 16777216
+test cvsame
+note Independent reference crop of the already rendered glyph.
+test cvinit 32 32
+test cvglyph 65 4 24 15528188
+test gt get Cv 7 0
+cvkeep
+test cvinit 32 32
+test cvclip 8 8 8 8
+put Canvas 3072 165
+test cvglyph 65 4 24 15528188
+test cvrefclip
+test eq get Canvas 3072 165
+note Zero-area and edge clips cannot draw any pixel.
+test cvinit 32 32
+test cvclip 32 32 0 0
+cvkeep
+test cvglyph 65 -8 6 15528188
+put Cmeta 7 get Cv 7
+test cvsame
+note A negative origin that intersects the surface must draw without wrapping.
+test cvclip 0 0 32 32
+test cvglyph 65 -8 6 15528188
+ink = ulong 0
+for i ulong 3072
+if gt get Canvas i 18
+ink = add ink 1
+end
+end
+test gt ink 0
+test eq get Canvas 3072 0
+note Explicit retained-text span agrees with two separately positioned glyphs.
+put Dtext 0 65
+put Dtext 1 65
+test cvinit 32 32
+test cvspan 0 2 1 24 15528188
+advance = get Cv 7
+cvkeep
+test cvinit 32 32
+test cvglyph 65 1 24 15528188
+one = get Cv 7
+x = add long 1 long div one 256
+test cvglyph 65 x 24 15528188
+test eq advance mul one 2
+same = true
+for i ulong 3072
+if ne get Canvas i get Csave i
+same = false
+end
+end
+test same
+note Refused spans and extreme offsets preserve pixels and all surface metadata.
+cvkeep
+test not cvspan 2305 0 0 0 0
+test not cvspan 2304 1 0 0 0
+test not cvspan 1 18446744073709551615 0 0 0
+test not cvspan 0 1 0 0 18446744073709551615
+test not cvspan 0 1 -4097 0 0
+test cvsame
+test cvspan 2304 0 0 0 0
+test eq get Cv 7 0
+test eq get Dtext 0 65
+test eq get Dtext 1 65
+test cvinit 768 384
+test eq get Cv 0 768
+test eq get Cv 1 384
+test eq get Canvas 884735 18
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L765/red2.exit b/evidence/allen-omega-L694/L765/red2.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/red2.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L765/red2.log b/evidence/allen-omega-L694/L765/red2.log
new file mode 100644
index 00000000..c3b876af
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/red2.log
@@ -0,0 +1,79 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 1
+10 1
+11 1
+12 1
+13 1
+14 1
+15 0
+16 0
+17 0
+18 1
+19 1
+20 1
+21 1
+22 1
+23 1
+24 1
+25 1
+26 1
+27 1
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 1
+44 1
+45 1
+46 1
+47 1
+48 1
+49 1
+50 0
+51 1
+52 1
+53 1
+54 0
+55 1
+56 1
+57 1
+58 1
+59 1
+60 1
+61 1
+62 1
+63 1
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 1
+73 0
+74 0
+75 0
+76 1
+77 1
+78 1
+79 1
diff --git a/evidence/allen-omega-L694/L765/red2.om b/evidence/allen-omega-L694/L765/red2.om
new file mode 100644
index 00000000..d10916aa
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/red2.om
@@ -0,0 +1,4364 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+note Compilable surface negative control.
+global Canvas uchar 884736
+global Cv ulong 8
+global Cvpose long 2
+fn cvinit w ulong h ulong to bool
+ret false
+end
+fn cvclip x ulong y ulong w ulong h ulong to bool
+ret false
+end
+fn cvpixel x long y long a uchar color ulong to void
+end
+fn cvglyph c uchar x long y long color ulong to bool
+ret false
+end
+fn cvspan beg ulong size ulong x long y long color ulong to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Surface tests: removing clipping, using constant background or bypassing drawing must fail.
+global Csave uchar 4096
+global Cmeta ulong 8
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn cvkeep to void
+for i ulong 3072
+put Csave i get Canvas i
+end
+for i ulong 8
+put Cmeta i get Cv i
+end
+end
+fn cvsame to bool
+for i ulong 3072
+if ne get Canvas i get Csave i
+ret false
+end
+end
+for i ulong 8
+if ne get Cv i get Cmeta i
+ret false
+end
+end
+ret true
+end
+fn cvrefclip to bool
+ink = ulong 0
+for y ulong 32
+for x ulong 32
+at = mul add mul y 32 x 3
+inside = and ge x 8 lt x 16
+inside = and inside and ge y 8 lt y 16
+for k ulong 3
+v = uchar 6
+if eq k 1
+v = 8
+end
+if eq k 2
+v = 18
+end
+if inside
+v = get Csave add at k
+if ne v get Canvas add at k
+ret false
+end
+if gt v 18
+ink = add ink 1
+end
+else
+if ne get Canvas add at k v
+ret false
+end
+end
+end
+end
+end
+ret gt ink 0
+end
+fn main to int
+test not cvglyph 65 0 0 15528188
+test not cvinit 0 32
+test not cvinit 32 0
+test not cvinit 769 32
+test not cvinit 32 385
+test cvinit 32 32
+test eq get Cv 0 32
+test eq get Cv 1 32
+test eq get Cv 4 32
+test eq get Cv 5 32
+test eq get Canvas 0 6
+test eq get Canvas 1 8
+test eq get Canvas 2 18
+test eq get Canvas 3071 18
+test eq get Canvas 3072 0
+test not cvglyph 65 0 0 15528188
+test afinit 20 1000
+note Exact alpha arithmetic and repeated overlap must use current destination.
+cvpixel 0 0 0 15528188
+test eq get Canvas 0 6
+cvpixel 0 0 128 15528188
+test eq get Canvas 0 121
+test eq get Canvas 1 124
+test eq get Canvas 2 135
+cvpixel 0 0 128 15528188
+test eq get Canvas 0 178
+test eq get Canvas 1 182
+test eq get Canvas 2 193
+cvpixel 0 0 255 15528188
+test eq get Canvas 0 236
+test eq get Canvas 1 240
+test eq get Canvas 2 252
+cvkeep
+cvpixel -1 0 255 0
+cvpixel 0 -1 255 0
+cvpixel 32 0 255 0
+cvpixel 0 32 255 0
+test cvsame
+test not cvinit 18446744073709551615 1
+test cvsame
+test not cvclip 33 0 0 0
+test not cvclip 0 33 0 0
+test not cvclip 0 0 33 1
+test not cvclip 0 0 1 33
+test not cvclip 1 1 18446744073709551615 1
+test cvsame
+test not cvglyph 65 -4097 0 15528188
+test not cvglyph 65 4097 0 15528188
+test not cvglyph 65 0 -4097 15528188
+test not cvglyph 65 0 4097 15528188
+test not cvglyph 65 0 0 16777216
+test cvsame
+note Independent reference crop of the already rendered glyph.
+test cvinit 32 32
+test cvglyph 65 4 24 15528188
+test gt get Cv 7 0
+cvkeep
+test cvinit 32 32
+test cvclip 8 8 8 8
+put Canvas 3072 165
+test cvglyph 65 4 24 15528188
+test cvrefclip
+test eq get Canvas 3072 165
+note Zero-area and edge clips cannot draw any pixel.
+test cvinit 32 32
+test cvclip 32 32 0 0
+cvkeep
+test cvglyph 65 -8 6 15528188
+put Cmeta 7 get Cv 7
+test cvsame
+note A negative origin that intersects the surface must draw without wrapping.
+test cvclip 0 0 32 32
+test cvglyph 65 -8 6 15528188
+ink = ulong 0
+for i ulong 3072
+if gt get Canvas i 18
+ink = add ink 1
+end
+end
+test gt ink 0
+test eq get Canvas 3072 0
+note Explicit retained-text span agrees with two separately positioned glyphs.
+put Dtext 0 65
+put Dtext 1 65
+test cvinit 32 32
+test cvspan 0 2 1 24 15528188
+advance = get Cv 7
+cvkeep
+test cvinit 32 32
+test cvglyph 65 1 24 15528188
+one = get Cv 7
+x = add long 1 long div one 256
+test cvglyph 65 x 24 15528188
+test eq advance mul one 2
+same = true
+for i ulong 3072
+if ne get Canvas i get Csave i
+same = false
+end
+end
+test same
+note Refused spans and extreme offsets preserve pixels and all surface metadata.
+cvkeep
+test not cvspan 2305 0 0 0 0
+test not cvspan 2304 1 0 0 0
+test not cvspan 1 18446744073709551615 0 0 0
+test not cvspan 0 1 0 0 18446744073709551615
+test not cvspan 0 1 -4097 0 0
+test cvsame
+test cvspan 2304 0 0 0 0
+test eq get Cv 7 0
+test eq get Dtext 0 65
+test eq get Dtext 1 65
+test cvinit 768 384
+test eq get Cv 0 768
+test eq get Cv 1 384
+test eq get Canvas 884735 18
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L765/red3.exit b/evidence/allen-omega-L694/L765/red3.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/red3.exit
@@ -0,0 +1 @@
+1
diff --git a/evidence/allen-omega-L694/L765/red3.log b/evidence/allen-omega-L694/L765/red3.log
new file mode 100644
index 00000000..423c3880
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/red3.log
@@ -0,0 +1,85 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 1
+10 1
+11 1
+12 1
+13 1
+14 1
+15 0
+16 0
+17 0
+18 1
+19 1
+20 1
+21 1
+22 1
+23 1
+24 1
+25 1
+26 1
+27 1
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 1
+44 1
+45 1
+46 1
+47 1
+48 1
+49 1
+50 0
+51 1
+52 1
+53 1
+54 0
+55 1
+56 1
+57 1
+58 1
+59 1
+60 1
+61 0
+62 0
+63 1
+64 1
+65 1
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 1
+75 0
+76 0
+77 0
+78 1
+79 1
+80 1
+81 0
+82 1
+83 1
+84 1
+85 1
diff --git a/evidence/allen-omega-L694/L765/red3.om b/evidence/allen-omega-L694/L765/red3.om
new file mode 100644
index 00000000..f9b0413c
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/red3.om
@@ -0,0 +1,4410 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket.
+note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat,
+note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved.
+note Serialized API: qnext publishes one datagram; qsent records actual send result.
+note Consume Outb before another serializer; failed sends leave retries due.
+global T ulong 16
+global JobOut uchar 4096
+fn qstart run ulong now ulong to bool
+if eq run 0
+ret false
+end
+qbegin run 0
+for i ulong 16
+put T i 0
+end
+put T 0 now
+ret true
+end
+fn qready now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if eq get T 1 0
+ret false
+end
+ret lt sub now get T 2 30000
+end
+fn qsubmit now ulong to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+n = get Inlen 0
+if or eq n 0 gt n 4096
+ret false
+end
+if ge get Q 1 4294967295
+ret false
+end
+seq = add get Q 1 1
+qbegin get Q 0 seq
+for i ulong n
+c = get In i
+if or eq c 10 eq c 13
+c = uchar 32
+end
+put JobOut i c
+end
+put T 0 now
+put T 5 1
+put T 6 0
+put T 7 now
+put T 8 n
+put T 9 1
+put T 13 0
+ret true
+end
+fn qnext now ulong link bool to bool
+if or eq get Q 0 0 lt now get T 0
+ret false
+end
+if ne get T 10 0
+ret false
+end
+put T 0 now
+if not link
+ret false
+end
+if ne get T 13 0
+put Inlen 0 0
+if not packet 3 get Q 1 get T 13 0 0
+ret false
+end
+put T 10 3
+put T 11 get T 13
+ret true
+end
+delay = ulong 2000
+if qready now
+delay = ulong 10000
+end
+if or eq get T 3 0 ge sub now get T 4 delay
+put Inlen 0 0
+if not packet 5 0 0 0 0
+ret false
+end
+put T 10 5
+put T 11 0
+ret true
+end
+if or eq get T 5 0 ne get T 6 0
+ret false
+end
+part = get T 9
+if eq part 0
+if lt sub now get T 7 2000
+ret false
+end
+part = ulong 1
+end
+n = get T 8
+total = div add n 999 1000
+off = mul sub part 1 1000
+size = sub n off
+if gt size 1000
+size = ulong 1000
+end
+for i ulong size
+put In i get JobOut add off i
+end
+put Inlen 0 size
+if not packet 1 get Q 1 part total n
+ret false
+end
+put T 10 1
+put T 11 part
+ret true
+end
+fn qsent now ulong ok bool to bool
+if or eq get T 10 0 lt now get T 0
+ret false
+end
+kind = get T 10
+part = get T 11
+put T 0 now
+put T 10 0
+put T 11 0
+if not ok
+ret true
+end
+if eq kind 5
+put T 3 1
+put T 4 now
+end
+if eq kind 3
+if eq get T 13 part
+put T 13 0
+end
+end
+if eq kind 1
+if or ne get T 6 0 ge part div add get T 8 999 1000
+put T 9 0
+put T 7 now
+else
+put T 9 add part 1
+end
+end
+ret true
+end
+fn qincoming now ulong to ulong
+if or eq get Q 0 0 lt now get T 0
+ret 0
+end
+if not pkparse
+ret 0
+end
+kind = get N 0
+if eq kind 6
+if or ne get N 1 0 ne get N 2 0
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 1 1
+put T 2 now
+ret 1
+end
+if or eq get T 5 0 ne get N 1 get Q 1
+ret 0
+end
+if eq kind 4
+if or ne get N 2 0 ne get N 3 0
+ret 0
+end
+if or ne get N 4 0 ne get N 6 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+ret 1
+end
+if ne kind 2
+ret 0
+end
+if or ne get N 3 0 ne get N 4 0
+ret 0
+end
+if and ne get T 13 0 ne get T 13 get N 2
+ret 0
+end
+result = qreceive
+if eq result 0
+ret 0
+end
+put T 0 now
+put T 6 1
+put T 9 0
+put T 13 get N 2
+ret result
+end
+fn qcancel to void
+put T 5 0
+put T 6 0
+put T 8 0
+put T 9 0
+put T 10 0
+put T 11 0
+put T 13 0
+put Q 3 0
+put Q 4 0
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if or gt get Ns 1 511 gt get Ns 2 4294967295
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Nt ulong 2
+global Load ulong 1
+global Tx ulong 3
+fn txbegin to bool
+if ne get Nt 0 0
+ret false
+end
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadbeg to void
+for i ulong 3
+put St i 0
+end
+put Load 0 0
+end
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if ne and get Load 0 shl ulong 1 slot 0
+ret false
+end
+if not memvalid
+ret false
+end
+put Load 0 or get Load 0 shl ulong 1 slot
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Note transaction completes before the parent copy may publish its count.
+fn nbegin to bool
+if or ne get Nt 0 0 ne get Tx 0 0
+ret false
+end
+if not noteenc
+ret false
+end
+put Nt 1 get Ns 1
+put Nt 0 1
+ret true
+end
+fn nwrite ok bool to bool
+if ne get Nt 0 1
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 2
+ret true
+end
+fn nflush ok bool to bool
+if ne get Nt 0 2
+ret false
+end
+if not ok
+put Nt 0 0
+ret false
+end
+put Nt 0 3
+ret true
+end
+fn nread ok bool to bool
+if ne get Nt 0 3
+ret false
+end
+put Nt 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Enc i get Unit i
+end
+if ne d 0
+ret false
+end
+ret noteval get Nt 1
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+plain = listed 4 false
+if or eq plain 4 eq plain 7
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+note Native application binding: conversation state, courier lifecycle and reply/code.
+note A initialized, queued AGAIN bytes, per-call event, reserved.
+note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up,
+note 4 refused LINE payload,5 slow notice,6 silence timeout.
+note Transport acceptance is separate from payload acceptance: appreceive true
+note means envelope accepted; inspect A2 for malformed payload, never invent text.
+global A ulong 4
+global Appjob uchar 4096
+global Appwire uchar 8192
+global Askin uchar 160
+fn appinit run ulong now ulong to bool
+if or ne get A 0 0 ne get R 0 0
+ret false
+end
+if ne get Q 0 0
+ret false
+end
+if not qstart run now
+ret false
+end
+constants
+put A 0 1
+put A 1 0
+put A 2 0
+ret true
+end
+fn appclock now ulong to bool
+if eq get A 0 0
+ret false
+end
+ret and ge now get T 0 ge now get R 4
+end
+fn appask now ulong to bool
+if not appclock now
+ret false
+end
+if or ne get R 1 0 ne get A 1 0
+ret false
+end
+if or ne get T 10 0 ne get T 13 0
+ret false
+end
+if and ne get T 5 0 eq get T 6 0
+ret false
+end
+if or ge get R 0 4294967295 ge get Q 1 4294967295
+ret false
+end
+if not textok
+ret false
+end
+kind = classify
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+note Validate restored context before jobbuild reads its variable-layout names.
+if not ctxmeta 6
+ret false
+end
+if not jobbuild kind add get R 0 1
+ret false
+end
+if not ctxappend
+ret false
+end
+n = get Inlen 0
+size = get Outlen 0
+for i ulong n
+put Askin i get In i
+end
+for i ulong size
+put Appjob i get Outb i
+end
+for i ulong size
+put In i get Appjob i
+end
+put Inlen 0 size
+queued = qsubmit now
+for i ulong n
+put In i get Askin i
+end
+put Inlen 0 n
+if not queued
+ret false
+end
+note start preconditions were checked before qsubmit; no concurrent calls permitted.
+if not start kind now
+qcancel
+ret false
+end
+put A 2 0
+if gt kind 1
+codebeg get R 0
+put A 2 1
+end
+ret true
+end
+fn appcancel to void
+cancel
+qcancel
+put A 1 0
+put A 2 0
+end
+fn appreset to void
+appcancel
+reset
+end
+note First acknowledge the triggering LINE, then submit AGAIN with a new wire
+note sequence while retaining the original conversation ID in its body.
+fn appqueue now ulong to bool
+if eq get A 1 0
+ret true
+end
+if or ne get T 10 0 ne get T 13 0
+ret true
+end
+put Inlen 0 get A 1
+for i ulong get A 1
+put In i get Appjob i
+end
+if not qsubmit now
+ret false
+end
+put A 1 0
+ret true
+end
+fn apppoll now ulong link bool to bool
+if not appclock now
+ret false
+end
+put A 2 0
+put T 0 now
+status = tick now
+if eq status 1
+put A 2 5
+end
+if eq status 2
+qcancel
+put A 1 0
+put A 2 6
+end
+if not appqueue now
+appcancel
+put A 2 3
+ret false
+end
+ret qnext now link
+end
+fn appsent now ulong ok bool to bool
+if not appclock now
+ret false
+end
+if not qsent now ok
+ret false
+end
+put A 2 0
+ret true
+end
+fn appbody now ulong to bool
+if eq get R 1 0
+put A 2 4
+ret true
+end
+if ineq 0 67
+if or le get R 2 1 ne get C 0 get R 0
+put A 2 4
+ret true
+end
+if codetake
+if heard get C 0 now
+ret true
+end
+end
+put A 2 4
+ret true
+end
+if or ineq 0 83 ineq 0 87
+status = saytake now
+if eq status 1
+if eq get R 1 0
+put A 1 0
+end
+if ne get S 1 0
+put A 2 1
+end
+ret true
+end
+if eq status 2
+n = get Outlen 0
+if or eq n 0 gt n 4096
+cancel
+put A 1 0
+put A 2 3
+ret true
+end
+for i ulong n
+put Appjob i get Outb i
+end
+put A 1 n
+put A 2 2
+ret true
+end
+if eq status 3
+put A 1 0
+put A 2 3
+ret true
+end
+end
+put A 2 4
+ret true
+end
+note Reply parsing can serialize AGAIN internally. Preserve the already offered
+note datagram until the provider records its send result, including on refusal.
+fn appreceive now ulong to bool
+if not appclock now
+ret false
+end
+result = qincoming now
+if eq result 0
+ret false
+end
+put A 2 0
+if not qtake
+ret true
+end
+n = get Outlen 0
+e = get Err 0
+for i ulong n
+put Appwire i get Outb i
+end
+ok = appbody now
+for i ulong n
+put Outb i get Appwire i
+end
+put Outlen 0 n
+put Err 0 e
+ret ok
+end
+note Bounded model scene input. Existing scene stays the strict canonical parser.
+note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen,
+note invalid/overflow,plain candidate bytes,canonical line count. Input restored.
+global Nm ulong 9
+global Nraw uchar 2048
+global Nline uchar 2048
+global Nnorm uchar 2048
+global Nplain uchar 160
+text Ntags ""
+fn nlow c uchar to uchar
+if and ge c 65 le c 90
+ret add sub c 65 97
+end
+ret c
+end
+fn nalpha c uchar to bool
+v = nlow c
+ret and ge v 97 le v 122
+end
+fn nmatch at ulong off ulong size ulong to bool
+if gt add at size get Nm 4
+ret false
+end
+for i ulong size
+if ne nlow get Nline add at i get Ntags add off i
+ret false
+end
+end
+ret true
+end
+fn nemit c uchar to void
+n = get Nm 1
+if ge n 2048
+put Nm 6 1
+ret
+end
+put Nnorm n c
+put Nm 1 add n 1
+end
+fn nmark c uchar to bool
+if or eq c 45 eq c 42
+ret true
+end
+if or eq c 35 eq c 62
+ret true
+end
+ret eq c 34
+end
+fn nlead c uchar to bool
+if or eq c 32 eq c 42
+ret true
+end
+if eq c 35
+ret true
+end
+ret nalpha c
+end
+fn ndigits p ulong to ulong
+while lt p get Nm 4
+if not isdigit get Nline p
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn nspaces p ulong to ulong
+while lt p get Nm 4
+if ne get Nline p 32
+ret p
+end
+p = add p 1
+end
+ret p
+end
+fn npstep s ulong to ulong
+n = get Nm 4
+c = get Nline s
+if nmark c
+if eq add s 1 n
+ret n
+end
+if nlead get Nline add s 1
+ret add s 1
+end
+ret s
+end
+if not isdigit c
+ret s
+end
+p = ndigits s
+if ge add p 1 n
+ret s
+end
+if not or eq get Nline p 46 eq get Nline p 41
+ret s
+end
+if ne get Nline add p 1 32
+ret s
+end
+ret add p 2
+end
+fn nprefix to ulong
+s = ulong 0
+while lt s get Nm 4
+next = npstep s
+if eq next s
+ret s
+end
+put Nm 2 add get Nm 2 1
+s = nspaces next
+end
+ret s
+end
+fn nfinish to void
+n = get Nm 4
+while gt n 0
+if eq get Nline sub n 1 32
+n = sub n 1
+else
+nprocess n
+ret
+end
+end
+end
+fn nprocess n ulong to void
+put Nm 4 n
+hide = ne get Nm 0 0
+for i ulong n
+if nmatch i 0 7
+put Nm 0 1
+hide = true
+end
+if nmatch i 7 8
+put Nm 0 0
+hide = true
+end
+end
+if hide
+put Nm 3 add get Nm 3 1
+ret
+end
+if ge n 3
+if and eq get Nline 0 96 eq get Nline 1 96
+if eq get Nline 2 96
+put Nm 2 add get Nm 2 1
+ret
+end
+end
+end
+s = nprefix
+if ge s n
+ret
+end
+w = s
+while lt w n
+if nalpha get Nline w
+w = add w 1
+else
+nword s w n
+ret
+end
+end
+nword s w n
+end
+fn nword s ulong w ulong n ulong to void
+for i ulong sub w s
+put In add s i nlow get Nline add s i
+end
+word = scword s sub w s
+if gt word 10
+word = 0
+end
+r = w
+while lt r n
+c = get Nline r
+if or eq c 42 eq c 34
+r = add r 1
+put Nm 2 add get Nm 2 1
+else
+nappend s w r n word
+ret
+end
+end
+nappend s w r n word
+end
+fn nappend s ulong w ulong r ulong n ulong word ulong to void
+if lt r n
+if not or eq get Nline r 32 eq get Nline r 58
+word = 0
+end
+end
+if eq word 0
+size = sub n s
+if and eq get Nm 7 0 le size 159
+if lt get Nm 8 12
+for i ulong size
+put Nplain i get Nline add s i
+end
+put Nm 7 size
+end
+end
+for i ulong size
+nemit get Nline add s i
+end
+else
+if eq word 1
+if lt get Nm 8 12
+put Nm 5 1
+end
+end
+for i ulong sub w s
+nemit nlow get Nline add s i
+end
+head = ne word 2
+for i ulong sub n r
+c = get Nline add r i
+if eq c 58
+if ne word 1
+head = false
+end
+end
+if head
+c = nlow c
+end
+nemit c
+end
+end
+nemit 10
+put Nm 8 add get Nm 8 1
+end
+fn nclear to void
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+end
+fn scdecode to bool
+for i ulong 9
+put Nm i 0
+end
+nclear
+n = get Inlen 0
+if gt n 2048
+put Nm 6 1
+ret false
+end
+for i ulong n
+if eq get In i 0
+put Nm 6 1
+ret false
+end
+put Nraw i get In i
+end
+for i ulong n
+c = get Nraw i
+if eq c 10
+nfinish
+put Nm 4 0
+else
+if eq c 9
+c = uchar 32
+put Nm 2 add get Nm 2 1
+end
+if and ge c 32 le c 126
+p = get Nm 4
+keep = true
+if eq c 32
+if eq p 0
+keep = false
+else
+if eq get Nline sub p 1 32
+keep = false
+end
+end
+end
+if keep
+put Nline p c
+put Nm 4 add p 1
+else
+put Nm 2 add get Nm 2 1
+end
+else
+put Nm 2 add get Nm 2 1
+end
+end
+end
+nfinish
+ok = false
+if eq get Nm 6 0
+for i ulong get Nm 1
+put In i get Nnorm i
+end
+put Inlen 0 get Nm 1
+ok = scene
+if ne get Nm 5 0
+ok = true
+end
+if not ok
+if gt get Nm 7 0
+for i ulong get Nm 7
+put In i get Nplain i
+end
+put Inlen 0 get Nm 7
+ok = scsay 0 get Nm 7
+end
+end
+else
+nclear
+end
+for i ulong n
+put In i get Nraw i
+end
+put Inlen 0 n
+ret ok
+end
+note Restored note catalog and bounded model-job context. No storage provider.
+note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone.
+global Cx ulong 5
+global Ctxtext uchar 65536
+global Ctxlen ulong 512
+global Ctxgone uchar 512
+global Ctxseen uchar 512
+global Ctxstart ulong 512
+global Meta uchar 4096
+global Mx ulong 2
+global Mdigits uchar 20
+text Mtself "\tself="
+text Mtname "\tname="
+text Mtstart "\tstarts="
+text Mtfact "\tfact "
+text Mtis " is "
+text Mtare " are "
+text Mtnote "\tnote "
+fn ctxidle to bool
+if ne get R 1 0
+ret false
+end
+ret and eq get Tx 0 0 eq get Nt 0 0
+end
+fn ctxbegin to bool
+if not ctxidle
+ret false
+end
+n = mem32 36
+if gt n 512
+ret false
+end
+for i ulong 512
+put Ctxlen i 0
+put Ctxgone i 1
+put Ctxseen i 0
+put Ctxstart i 0
+end
+put Cx 0 n
+put Cx 1 0
+put Cx 2 0
+put Cx 3 0
+put Cx 4 1
+if eq n 0
+put Cx 2 1
+put Cx 4 0
+end
+ret true
+end
+note Returns0 refused without visit,1 valid record retained,2 damaged visit retained.
+fn ctxtake index ulong to ulong
+if not ctxidle
+ret 0
+end
+if or eq get Cx 4 0 ge index get Cx 0
+ret 0
+end
+if ne get Ctxseen index 0
+ret 0
+end
+status = ulong 2
+if notedec index
+n = get Ns 0
+for i ulong n
+put Ctxtext add mul index 128 i get Note i
+end
+put Ctxlen index n
+put Ctxgone index uchar get Ns 3
+put Ctxstart index get Ns 2
+status = 1
+else
+put Cx 3 add get Cx 3 1
+end
+put Ctxseen index 1
+put Cx 1 add get Cx 1 1
+if eq get Cx 1 get Cx 0
+put Cx 2 1
+put Cx 4 0
+end
+ret status
+end
+fn mtemit c uchar to void
+if ne get Mx 1 0
+ret
+end
+n = get Mx 0
+if ge n 4096
+put Mx 1 1
+ret
+end
+put Meta n c
+put Mx 0 add n 1
+end
+fn mtnum v ulong to void
+n = ulong 0
+while gt v 9
+put Mdigits n uchar rem v 10
+v = div v 10
+n = add n 1
+end
+put Mdigits n uchar v
+n = add n 1
+for i ulong n
+mtemit add uchar 48 get Mdigits sub sub n 1 i
+end
+end
+note Memory fields are length-bounded; require a terminator and printable bytes.
+fn mtfield off ulong cap ulong to bool
+for i ulong cap
+c = get Mem add off i
+if eq c 0
+if eq i 0
+put Mx 1 1
+ret false
+end
+ret true
+end
+if or lt c 32 gt c 126
+put Mx 1 1
+ret false
+end
+mtemit c
+end
+put Mx 1 1
+ret false
+end
+fn mtfacts count ulong to bool
+for k ulong count
+off = add 40 mul k 113
+for i ulong len Mtfact
+mtemit get Mtfact i
+end
+if not mtfield off 48
+ret false
+end
+are = get Mem add off 112
+if gt are 1
+put Mx 1 1
+ret false
+end
+if eq are 1
+for i ulong len Mtare
+mtemit get Mtare i
+end
+else
+for i ulong len Mtis
+mtemit get Mtis i
+end
+end
+if not mtfield add off 48 64
+ret false
+end
+end
+ret eq get Mx 1 0
+end
+fn mtnotes count ulong limit ulong to void
+given = ulong 0
+for k ulong count
+index = sub sub count 1 k
+if and eq get Ctxgone index 0 lt given limit
+for i ulong len Mtnote
+mtemit get Mtnote i
+end
+for i ulong get Ctxlen index
+mtemit get Ctxtext add mul index 128 i
+end
+given = add given 1
+end
+end
+end
+fn ctxmeta limit ulong to bool
+put Mx 0 0
+put Mx 1 1
+facts = mem32 32
+notes = mem32 36
+if or gt facts 32 gt notes 512
+ret false
+end
+if gt limit 512
+ret false
+end
+if gt notes 0
+if or eq get Cx 2 0 ne get Cx 0 notes
+ret false
+end
+end
+put Mx 1 0
+for i ulong len Mtself
+mtemit get Mtself i
+end
+off = add 40 mul facts 113
+if eq get Mem off 0
+for i ulong len Allen
+mtemit get Allen i
+end
+else
+if not mtfield off 24
+ret false
+end
+end
+if ne get Mem 8 0
+for i ulong len Mtname
+mtemit get Mtname i
+end
+if not mtfield 8 24
+ret false
+end
+end
+for i ulong len Mtstart
+mtemit get Mtstart i
+end
+mtnum mem32 0
+if not mtfacts facts
+ret false
+end
+mtnotes notes limit
+ret eq get Mx 1 0
+end
+note Publish all metadata or none; preserve outgoing bytes/length/error on refusal.
+fn ctxappend to bool
+if or ne get Mx 1 0 ne get Err 0 0
+ret false
+end
+n = get Outlen 0
+size = get Mx 0
+if or gt n 4096 gt size 4096
+ret false
+end
+if gt add n size 4096
+ret false
+end
+for i ulong size
+put Outb add n i get Meta i
+end
+put Outlen 0 add n size
+ret true
+end
+note Stable application presentation; see PRESENTATION.md for scope and ownership.
+global Ds ulong 8
+global Dt ulong 64
+global Dtext uchar 2304
+global Dsay ulong 1
+global Dm ulong 3
+global Dcode uchar 32768
+global Dstart ulong 4096
+global Dlen ulong 4096
+global Dline ulong 4096
+global Dview ulong 3
+global Din uchar 8192
+fn dscene to bool
+n = get Inlen 0
+for i ulong 8192
+put Din i get In i
+end
+for i ulong get R 8
+put In i get Answer i
+end
+put Inlen 0 get R 8
+ok = scdecode
+for i ulong 8192
+put In i get Din i
+end
+put Inlen 0 n
+if not ok
+ret false
+end
+for i ulong 8
+put Ds i get Sc i
+end
+for i ulong 64
+put Dt i get Things i
+end
+for i ulong 2304
+put Dtext i 0
+end
+for i ulong get Sc 4
+put Dtext i get Stext i
+end
+put Dsay 0 get Sw 3
+put Dm 0 1
+ret true
+end
+fn dcode to bool
+if or le get R 2 1 ne get R 1 0
+ret false
+end
+if or eq get R 6 0 ne get C 0 get R 0
+ret false
+end
+if not rows 80 4096
+ret false
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong get C 2
+put Dcode i get Code i
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong get View 0
+put Dstart i get Rowst i
+put Dlen i get Rowlen i
+put Dline i get Rowline i
+end
+put Dview 0 get View 0
+put Dview 1 0
+put Dview 2 get C 2
+put Dm 1 1
+ret true
+end
+fn dpresent to bool
+if or eq get A 0 0 ne get A 2 1
+ret false
+end
+if or gt get R 8 159 gt get Inlen 0 8192
+ret false
+end
+shown = dscene
+coded = dcode
+if or shown coded
+put Dm 2 get R 0
+ret true
+end
+ret false
+end
+fn dask now ulong to bool
+if not appask now
+ret false
+end
+b = dpresent
+ret true
+end
+fn drecv now ulong to bool
+if not appreceive now
+ret false
+end
+b = dpresent
+ret true
+end
+fn dreset to void
+appreset
+for i ulong 8
+put Ds i 0
+end
+for i ulong 64
+put Dt i 0
+end
+for i ulong 2304
+put Dtext i 0
+end
+put Dsay 0 0
+for i ulong 3
+put Dm i 0
+put Dview i 0
+end
+for i ulong 32768
+put Dcode i 0
+end
+for i ulong 4096
+put Dstart i 0
+put Dlen i 0
+put Dline i 0
+end
+for i ulong 8192
+put Din i 0
+end
+end
+note Host provider stream core. PROVIDER.md is the framing/state contract.
+global Ph uchar 40
+global Pb uchar 4096
+global Pv ulong 4
+global Pc ulong 2
+global Pe ulong 2
+global Pout uchar 65536
+global Pn ulong 1
+text Prmagic "ALNPRV01"
+fn prshape to bool
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+n = get Pv 3
+if eq op 1
+ret and gt arg 0 eq n 0
+end
+if eq op 2
+if ne arg 0
+ret false
+end
+ret and gt n 0 le n 159
+end
+if or eq op 3 eq op 4
+ret and le arg 1 eq n 0
+end
+if eq op 5
+if ne arg 0
+ret false
+end
+ret and ge n 65 le n 1200
+end
+if ne now 0
+ret false
+end
+if or eq op 6 eq op 7
+ret and eq arg 0 eq n 0
+end
+if eq op 8
+ret and le arg 1 eq n 4096
+end
+if eq op 9
+ret and le arg 511 eq n 4096
+end
+if eq op 10
+ret and eq arg 0 eq n 0
+end
+ret false
+end
+fn prparse to bool
+for i ulong 8
+if ne get Ph i get Prmagic i
+ret false
+end
+end
+for k ulong 4
+v = ulong 0
+for i ulong 8
+off = add add 8 mul k 8 i
+v = or v shl ulong get Ph off mul i 8
+end
+put Pv k v
+end
+ret prshape
+end
+fn prbyte c uchar to void
+put Pout get Pn 0 c
+put Pn 0 add get Pn 0 1
+end
+fn prword v ulong to void
+for i ulong 8
+prbyte uchar and shr v mul i 8 255
+end
+end
+fn prhead op ulong status ulong event ulong size ulong to void
+for i ulong 8
+prbyte get Prmagic i
+end
+prword op
+prword status
+prword event
+prword size
+end
+fn prreply status ulong to void
+put Pn 0 0
+kind = get Pe 1
+size = ulong 0
+if eq kind 1
+size = get Outlen 0
+end
+if eq kind 2
+size = get R 8
+end
+prhead get Pv 0 status get Pe 0 size
+for i ulong size
+if eq kind 1
+prbyte get Outb i
+else
+prbyte get Answer i
+end
+end
+if eq kind 2
+if and gt get R 2 1 eq get R 1 0
+if and ne get R 6 0 eq codestat 2
+prhead 11 1 1 get C 2
+for i ulong get C 2
+prbyte get Code i
+end
+end
+end
+end
+end
+fn prevent to void
+put Pe 0 get A 2
+if eq get A 2 1
+put Pe 1 2
+end
+end
+fn prload to ulong
+if or ne get A 0 0 not ctxidle
+ret 0
+end
+constants
+for i ulong 3692
+put Mem i 0
+end
+loadbeg
+b = ctxbegin
+put Pc 0 1
+put Pc 1 0
+ret 1
+end
+fn prcopy to ulong
+if or ne get A 0 0 ne get Pc 0 1
+ret 0
+end
+if not ctxidle
+ret 0
+end
+slot = get Pv 2
+bit = shl ulong 1 slot
+if ne and get Pc 1 bit 0
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ulong 2
+if loadcopy slot
+status = 1
+end
+put Pc 1 or get Pc 1 bit
+if eq get Pc 1 3
+if not ctxbegin
+ret 0
+end
+put Pc 0 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+end
+ret status
+end
+fn prnote to ulong
+if or ne get A 0 0 ne get Pc 0 2
+ret 0
+end
+if not ctxidle
+ret 0
+end
+for i ulong 4096
+put Unit i get Pb i
+end
+status = ctxtake get Pv 2
+if ne get Cx 2 0
+put Pc 0 3
+end
+ret status
+end
+fn prapply to ulong
+op = get Pv 0
+now = get Pv 1
+arg = get Pv 2
+if eq op 10
+ret prload
+end
+if eq op 8
+ret prcopy
+end
+if eq op 9
+ret prnote
+end
+if eq op 1
+if or eq get Pc 0 1 eq get Pc 0 2
+ret 0
+end
+if appinit arg now
+ret 1
+end
+ret 0
+end
+if eq get A 0 0
+ret 0
+end
+if eq op 6
+appcancel
+ret 1
+end
+if eq op 7
+dreset
+ret 1
+end
+if not appclock now
+ret 0
+end
+if eq op 3
+offer = apppoll now ne arg 0
+prevent
+if offer
+put Pe 1 1
+ret 3
+end
+ret 1
+end
+if eq op 4
+if appsent now ne arg 0
+ret 1
+end
+ret 0
+end
+for i ulong get Pv 3
+put In i get Pb i
+end
+put Inlen 0 get Pv 3
+if eq op 2
+if not dask now
+ret 0
+end
+else
+if not drecv now
+ret 0
+end
+end
+prevent
+ret 1
+end
+fn prdo to bool
+if not prparse
+ret false
+end
+put Pe 0 0
+put Pe 1 0
+status = prapply
+prreply status
+ret true
+end
+note Declarative Allen glyph designs and integer sine samples, retained from
+note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation.
+text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|"
+text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 "
+note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only.
+global Af ulong 6
+global Ab long 4
+global Ag long 640
+global Alpha uchar 65536
+global Asin long 91
+global Afpos ulong 2
+global Apen long 2
+global Arc long 6
+fn afsqrt value ulong to ulong
+r = ulong 0
+bit = shl ulong 1 62
+while gt bit value
+bit = shr bit 2
+end
+while ne bit 0
+if ge value add r bit
+value = sub value add r bit
+r = add shr r 1 bit
+else
+r = shr r 1
+end
+bit = shr bit 2
+end
+ret r
+end
+fn afsin deg long to long
+a = rem deg 360
+if lt a 0
+a = add a 360
+end
+if le a 90
+ret get Asin ulong a
+end
+if le a 180
+ret get Asin ulong sub long 180 a
+end
+if le a 270
+ret neg get Asin ulong sub a 180
+end
+ret neg get Asin ulong sub long 360 a
+end
+fn afcos deg long to long
+ret afsin add rem deg 360 90
+end
+fn afinit cap ulong wt ulong to bool
+if or eq cap 0 gt cap 64
+ret false
+end
+if or eq wt 0 gt wt 2500
+ret false
+end
+for i ulong 6
+put Af i 0
+end
+put Af 0 div mul cap 256 20
+put Af 1 div mul wt get Af 0 1000
+v = long 0
+slot = ulong 0
+for i ulong len Afsines
+c = get Afsines i
+if eq c 32
+put Asin slot v
+slot = add slot 1
+v = 0
+else
+v = add mul v 10 sub long c 48
+end
+end
+ret eq slot 91
+end
+fn afpick c uchar to bool
+if or lt c 32 gt c 126
+c = 63
+end
+wanted = sub ulong c 32
+slot = ulong 0
+startat = ulong 0
+for i ulong len Afdata
+if eq get Afdata i 124
+if eq slot wanted
+put Afpos 0 startat
+put Afpos 1 i
+ret true
+end
+slot = add slot 1
+startat = add i 1
+end
+end
+ret false
+end
+fn afnum to long
+p = get Afpos 0
+minus = false
+if eq get Afdata p 45
+minus = true
+p = add p 1
+end
+v = long 0
+go = true
+while and lt p get Afpos 1 go
+c = get Afdata p
+if and ge c 48 le c 57
+v = add mul v 10 sub long c 48
+p = add p 1
+else
+go = false
+end
+end
+if lt p get Afpos 1
+if eq get Afdata p 44
+p = add p 1
+end
+end
+put Afpos 0 p
+if minus
+ret neg v
+end
+ret v
+end
+fn afseg nx long ny long to bool
+n = get Af 2
+if ge n 160
+ret false
+end
+at = mul n 4
+put Ag at get Apen 0
+put Ag add at 1 get Apen 1
+put Ag add at 2 nx
+put Ag add at 3 ny
+put Apen 0 nx
+put Apen 1 ny
+put Af 2 add n 1
+ret true
+end
+fn afpoint a long first bool to bool
+s = long get Af 0
+x = mul get Arc 0 s
+x = add x div mul mul get Arc 2 s afcos a 16384
+y = mul sub get Arc 1 20 s
+y = add y div mul mul get Arc 3 s afsin a 16384
+if first
+put Apen 0 x
+put Apen 1 y
+ret true
+end
+ret afseg x y
+end
+fn afarc to bool
+for i ulong 6
+put Arc i afnum
+end
+span = sub get Arc 5 get Arc 4
+if lt span 0
+span = neg span
+end
+steps = div span 9
+if lt steps 2
+steps = 2
+end
+for k ulong ulong add steps 1
+a = sub get Arc 5 get Arc 4
+a = add get Arc 4 div mul a long k steps
+if not afpoint a eq k 0
+ret false
+end
+end
+ret true
+end
+fn afcmd cmd uchar to bool
+if eq cmd 32
+ret true
+end
+if eq cmd 119
+put Af 5 mul ulong afnum get Af 0
+ret true
+end
+if eq cmd 65
+ret afarc
+end
+x = mul afnum long get Af 0
+y = mul sub afnum 20 long get Af 0
+if or eq cmd 77 eq cmd 68
+put Apen 0 x
+put Apen 1 y
+end
+if eq cmd 77
+ret true
+end
+if or eq cmd 76 eq cmd 68
+ret afseg x y
+end
+ret false
+end
+fn affloor value long to long
+if ge value 0
+ret div value 256
+end
+ret neg div add neg value 255 256
+end
+fn afbound x long y long to void
+if lt x get Ab 0
+put Ab 0 x
+end
+if lt y get Ab 1
+put Ab 1 y
+end
+if gt x get Ab 2
+put Ab 2 x
+end
+if gt y get Ab 3
+put Ab 3 y
+end
+end
+fn afbox to bool
+put Ab 0 get Ag 0
+put Ab 2 get Ag 0
+put Ab 1 get Ag 1
+put Ab 3 get Ag 1
+for i ulong get Af 2
+at = mul i 4
+afbound get Ag at get Ag add at 1
+afbound get Ag add at 2 get Ag add at 3
+end
+pad = add long get Af 1 256
+x0 = affloor sub get Ab 0 pad
+y0 = affloor sub get Ab 1 pad
+x1 = add affloor add get Ab 2 pad 1
+y1 = add affloor add get Ab 3 pad 1
+put Ab 0 x0
+put Ab 1 y0
+put Af 3 ulong sub x1 x0
+put Af 4 ulong sub y1 y0
+ret le mul get Af 3 get Af 4 len Alpha
+end
+fn afproj qx long qy long dx long dy long to ulong
+len2 = add mul dx dx mul dy dy
+ex = qx
+ey = qy
+if ne len2 0
+t = add mul qx dx mul qy dy
+if gt t 0
+if ge t len2
+ex = sub qx dx
+ey = sub qy dy
+else
+ex = sub qx div mul dx t len2
+ey = sub qy div mul dy t len2
+end
+end
+end
+ret ulong add mul ex ex mul ey ey
+end
+fn afdist slot ulong px long py long to ulong
+at = mul slot 4
+dx = sub get Ag add at 2 get Ag at
+dy = sub get Ag add at 3 get Ag add at 1
+qx = sub px get Ag at
+qy = sub py get Ag add at 1
+ret afproj qx qy dx dy
+end
+fn afalpha px long py long to uchar
+best = ulong 18446744073709551615
+for i ulong get Af 2
+d2 = afdist i px py
+if lt d2 best
+best = d2
+end
+end
+d = long afsqrt best
+cov = sub add long get Af 1 128 d
+if le cov 0
+ret 0
+end
+if ge cov 256
+ret 255
+end
+ret uchar div mul cov 255 256
+end
+fn afrow y ulong to void
+py = add mul add get Ab 1 long y 256 128
+for x ulong get Af 3
+px = add mul add get Ab 0 long x 256 128
+at = add mul y get Af 3 x
+put Alpha at afalpha px py
+end
+end
+fn afpaint to void
+for y ulong get Af 4
+afrow y
+end
+end
+fn afglyph c uchar to bool
+if eq get Af 0 0
+ret false
+end
+if not afpick c
+ret false
+end
+for i ulong 65536
+put Alpha i 0
+end
+put Af 2 0
+put Af 3 0
+put Af 4 1
+put Af 5 0
+put Ab 0 0
+put Ab 1 0
+put Apen 0 0
+put Apen 1 0
+while lt get Afpos 0 get Afpos 1
+cmd = get Afdata get Afpos 0
+put Afpos 0 add get Afpos 0 1
+if not afcmd cmd
+ret false
+end
+end
+if eq get Af 2 0
+ret true
+end
+if not afbox
+ret false
+end
+afpaint
+ret true
+end
+note Compilable surface negative control.
+global Canvas uchar 884736
+global Cv ulong 8
+global Cvpose long 2
+fn cvinit w ulong h ulong to bool
+ret false
+end
+fn cvclip x ulong y ulong w ulong h ulong to bool
+ret false
+end
+fn cvpixel x long y long a uchar color ulong to void
+end
+fn cvglyph c uchar x long y long color ulong to bool
+ret false
+end
+fn cvspan beg ulong size ulong x long y long color ulong to bool
+ret false
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+note Surface tests: removing clipping, using constant background or bypassing drawing must fail.
+global Csave uchar 4096
+global Cmeta ulong 8
+fn test ok bool to void
+check ok add get Checks 0 1
+end
+fn cvkeep to void
+for i ulong 3072
+put Csave i get Canvas i
+end
+for i ulong 8
+put Cmeta i get Cv i
+end
+end
+fn cvsame to bool
+for i ulong 3072
+if ne get Canvas i get Csave i
+ret false
+end
+end
+for i ulong 8
+if ne get Cv i get Cmeta i
+ret false
+end
+end
+ret true
+end
+fn cvrefclip to bool
+ink = ulong 0
+for y ulong 32
+for x ulong 32
+at = mul add mul y 32 x 3
+inside = and ge x 8 lt x 16
+inside = and inside and ge y 8 lt y 16
+for k ulong 3
+v = uchar 6
+if eq k 1
+v = 8
+end
+if eq k 2
+v = 18
+end
+if inside
+v = get Csave add at k
+if ne v get Canvas add at k
+ret false
+end
+if gt v 18
+ink = add ink 1
+end
+else
+if ne get Canvas add at k v
+ret false
+end
+end
+end
+end
+end
+ret gt ink 0
+end
+fn cvfrac to bool
+b = cvinit 32 32
+b = afinit 14 900
+for i ulong 3
+put Dtext i 65
+end
+if not cvspan 0 3 -1 20 15528188
+ret false
+end
+one = get Af 5
+if ne get Cv 7 mul one 3
+ret false
+end
+cvkeep
+b = cvinit 32 32
+for i ulong 3
+x = affloor add long -256 long mul one i
+if not cvglyph 65 x 20 15528188
+ret false
+end
+end
+for i ulong 3072
+if ne get Canvas i get Csave i
+ret false
+end
+end
+ret true
+end
+fn main to int
+test not cvglyph 65 0 0 15528188
+test not cvinit 0 32
+test not cvinit 32 0
+test not cvinit 769 32
+test not cvinit 32 385
+test cvinit 32 32
+test eq get Cv 0 32
+test eq get Cv 1 32
+test eq get Cv 4 32
+test eq get Cv 5 32
+test eq get Canvas 0 6
+test eq get Canvas 1 8
+test eq get Canvas 2 18
+test eq get Canvas 3071 18
+test eq get Canvas 3072 0
+test not cvglyph 65 0 0 15528188
+test afinit 20 1000
+note Exact alpha arithmetic and repeated overlap must use current destination.
+cvpixel 0 0 0 15528188
+test eq get Canvas 0 6
+cvpixel 0 0 128 15528188
+test eq get Canvas 0 121
+test eq get Canvas 1 124
+test eq get Canvas 2 135
+cvpixel 0 0 128 15528188
+test eq get Canvas 0 178
+test eq get Canvas 1 182
+test eq get Canvas 2 193
+cvpixel 0 0 255 15528188
+test eq get Canvas 0 236
+test eq get Canvas 1 240
+test eq get Canvas 2 252
+cvkeep
+cvpixel -1 0 255 0
+cvpixel 0 -1 255 0
+cvpixel 32 0 255 0
+cvpixel 0 32 255 0
+test cvsame
+test not cvinit 18446744073709551615 1
+test cvsame
+test not cvclip 33 0 0 0
+test not cvclip 0 33 0 0
+test not cvclip 0 0 33 1
+test not cvclip 0 0 1 33
+test not cvclip 1 1 18446744073709551615 1
+test cvsame
+test not cvglyph 65 -4097 0 15528188
+test not cvglyph 65 4097 0 15528188
+test not cvglyph 65 0 -4097 15528188
+test not cvglyph 65 0 4097 15528188
+test not cvglyph 65 0 0 16777216
+test cvsame
+note Independent reference crop of the already rendered glyph.
+test cvinit 32 32
+test cvglyph 65 4 24 15528188
+test gt get Cv 7 0
+cvkeep
+test cvinit 32 32
+test cvclip 8 8 8 8
+put Canvas 3072 165
+test cvglyph 65 4 24 15528188
+test cvrefclip
+test eq get Canvas 3072 165
+note Zero-area and edge clips cannot draw any pixel.
+test cvinit 32 32
+test cvclip 32 32 0 0
+cvkeep
+test cvglyph 65 -8 6 15528188
+put Cmeta 7 get Cv 7
+test cvsame
+note A negative origin that intersects the surface must draw without wrapping.
+test cvclip 0 0 32 32
+test cvglyph 65 -8 6 15528188
+ink = ulong 0
+for i ulong 3072
+if gt get Canvas i 18
+ink = add ink 1
+end
+end
+test gt ink 0
+test eq get Canvas 3072 0
+note Explicit retained-text span agrees with two separately positioned glyphs.
+put Dtext 0 65
+put Dtext 1 65
+test cvinit 32 32
+put Outb 0 88
+put Outlen 0 1
+put Err 0 7
+put In 8191 99
+ok = cvspan 0 2 1 24 15528188
+clean = and eq get Outb 0 88 eq get Outlen 0 1
+clean = and clean eq get Err 0 7
+test ok
+test clean
+test eq get In 8191 99
+advance = get Cv 7
+cvkeep
+test cvinit 32 32
+test cvglyph 65 1 24 15528188
+one = get Cv 7
+x = add long 1 long div one 256
+test cvglyph 65 x 24 15528188
+test eq advance mul one 2
+same = true
+for i ulong 3072
+if ne get Canvas i get Csave i
+same = false
+end
+end
+test same
+note Refused spans and extreme offsets preserve pixels and all surface metadata.
+cvkeep
+test not cvspan 2305 0 0 0 0
+test not cvspan 2304 1 0 0 0
+test not cvspan 1 18446744073709551615 0 0 0
+test not cvspan 0 1 0 0 18446744073709551615
+test not cvspan 0 1 -4097 0 0
+test cvsame
+test cvspan 2304 0 0 0 0
+test eq get Cv 7 0
+test eq get Dtext 0 65
+test eq get Dtext 1 65
+test cvfrac
+for i ulong 2304
+put Dtext i 65
+end
+test cvinit 32 32
+cvkeep
+test cvspan 0 2304 4096 0 15528188
+put Cmeta 7 get Cv 7
+test cvsame
+test cvinit 768 384
+test eq get Cv 0 768
+test eq get Cv 1 384
+test eq get Canvas 884735 18
+if ne get Fails 0 0
+ret 1
+end
+ret 0
+end
diff --git a/evidence/allen-omega-L694/L765/reply.log b/evidence/allen-omega-L694/L765/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/L765/runtime.log b/evidence/allen-omega-L694/L765/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L765/scene-input.log b/evidence/allen-omega-L694/L765/scene-input.log
new file mode 100644
index 00000000..edd8e122
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/scene-input.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L765/scene.log b/evidence/allen-omega-L694/L765/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/L765/scenecap-mutant.log b/evidence/allen-omega-L694/L765/scenecap-mutant.log
new file mode 100644
index 00000000..502843ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/scenecap-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 1
+60 0
+61 0
+62 1
+63 1
diff --git a/evidence/allen-omega-L694/L765/scheduler.log b/evidence/allen-omega-L694/L765/scheduler.log
new file mode 100644
index 00000000..1d8ffd12
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/scheduler.log
@@ -0,0 +1,213 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
+86 0
+87 0
+88 0
+89 0
+90 0
+91 0
+92 0
+93 0
+94 0
+95 0
+96 0
+97 0
+98 0
+99 0
+100 0
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
+124 0
+125 0
+126 0
+127 0
+128 0
+129 0
+130 0
+131 0
+132 0
+133 0
+134 0
+135 0
+136 0
+137 0
+138 0
+139 0
+140 0
+141 0
+142 0
+143 0
+144 0
+145 0
+146 0
+147 0
+148 0
+149 0
+150 0
+151 0
+152 0
+153 0
+154 0
+155 0
+156 0
+157 0
+158 0
+159 0
+160 0
+161 0
+162 0
+163 0
+164 0
+165 0
+166 0
+167 0
+168 0
+169 0
+170 0
+171 0
+172 0
+173 0
+174 0
+175 0
+176 0
+177 0
+178 0
+179 0
+180 0
+181 0
+182 0
+183 0
+184 0
+185 0
+186 0
+187 0
+188 0
+189 0
+190 0
+191 0
+192 0
+193 0
+194 0
+195 0
+196 0
+197 0
+198 0
+199 0
+200 0
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
diff --git a/evidence/allen-omega-L694/L765/session-mutant.log b/evidence/allen-omega-L694/L765/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/L765/short.log b/evidence/allen-omega-L694/L765/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/L765/source.sha256 b/evidence/allen-omega-L694/L765/source.sha256
new file mode 100644
index 00000000..6f0c79ec
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/source.sha256
@@ -0,0 +1,69 @@
+764d02ebb584ba5331eb57b2f6823cbba027a41979eb3d125d2957c0016ab247 native/omega/allen/ALPHA.md
+56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om
+79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md
+c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om
+86c0384c6b4e2288c60f5d62a102d5a83fbade503824ee01642ed0c9b96fcb4a native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md
+d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om
+c8a04b1d5f95c36500e7b2f475e169148c6ac76a677b1ca3da38f217fe2a501e native/omega/allen/provider-core.om
+f96b8b9074b4802b1cb52545db7ced1b5a64bf75ad756d532a8fc4e16c7107cd native/omega/allen/PROVIDER.md
+ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om
+259c4a50465c0932955e86f5d5c0fbf6c1f863097ea499a91aa583fa01eaf003 native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om
+74f13b4200af0a87401b1ba4ceea71e85e38adefd5829382b84116be273ca0c5 native/omega/allen/SURFACE.md
+7bdff806421f6a07b12e17750f07e9b8e482a1ae67565a9e1bf0ff9e8237be0b native/omega/allen/surface.om
+f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc native/omega/allen/tests/font-mutants.om
+cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om
+7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om
+259a9b32c4945bdc08aa6836c666027aa5438ad11165e5c0dfdfdc695d7d3829 native/omega/allen/tests/font-render.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om
+b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+ebc300f5c8737543acec6397bf7a82000594e13c424df20e203ea7ab09da46c4 native/omega/allen/tests/provider-core.om
+0c611ef5d6fe9c5d951fa8886e6425a4cb538c308d99f2723634f253d755cbbb native/omega/allen/tests/provider-display-mutants.om
+b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om
+37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om
+d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om
+8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om
+521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om
+6e1ca3bbe22884ff29f124b04d646165532f9a5d0dc212d093a11f3bcd9c7740 native/omega/allen/tests/surface-mutants.om
+612c747d52b34c4861c5a6bfcba05d420bd2d49fe55e27017356a9cc4277178b native/omega/allen/tests/surface.om
+5f9c02c51367276ef16019d3755b41013c5055ab8bb7f0d19a138565845af54e native/omega/allen/tests/surface-render.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/L765/stale-mutant.log b/evidence/allen-omega-L694/L765/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/L765/staleview-mutant.log b/evidence/allen-omega-L694/L765/staleview-mutant.log
new file mode 100644
index 00000000..c0c96c65
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/staleview-mutant.log
@@ -0,0 +1,75 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 1
+35 1
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
diff --git a/evidence/allen-omega-L694/L765/summary.json b/evidence/allen-omega-L694/L765/summary.json
new file mode 100644
index 00000000..176320ab
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/summary.json
@@ -0,0 +1,69 @@
+{
+ "base": "92b405477cfdff40dda25c5afcac5b65cb04122a",
+ "checks": {
+ "runtime": 28,
+ "code": 23,
+ "courier": 24,
+ "scheduler": 213,
+ "application": 182,
+ "provider-core": 136,
+ "memory": 79,
+ "context": 142,
+ "intent": 8,
+ "reply": 15,
+ "view": 13,
+ "scene": 14,
+ "scene-input": 63,
+ "paint": 11,
+ "edges": 352,
+ "short": 20,
+ "long": 292,
+ "provider-stream": 292,
+ "provider-fragment": 292,
+ "provider-process": 3,
+ "provider-consumer": 3,
+ "provider-producer": 3,
+ "provider-bad-1": 5,
+ "provider-bad-2": 5,
+ "provider-bad-3": 5,
+ "provider-bad-4": 5,
+ "provider-bad-5": 5,
+ "provider-bad-6": 17,
+ "presentation": 75,
+ "font": 421,
+ "surface": 85
+ },
+ "total_checks": 2831,
+ "compiled_rejected_mutants": {
+ "inputtail-mutant": 1,
+ "session-mutant": 1,
+ "appcode-mutant": 3,
+ "contextjob-mutant": 36,
+ "readback-mutant": 7,
+ "staleview-mutant": 2,
+ "blendbg-mutant": 5,
+ "clipright-mutant": 5,
+ "fontroot-mutant": 11,
+ "fontalpha-mutant": 2,
+ "hash-mutant": 2,
+ "contextnote-mutant": 5,
+ "autosent-mutant": 8,
+ "thinking-mutant": 6,
+ "pendingwire-mutant": 1,
+ "scenecap-mutant": 3,
+ "crc-mutant": 2,
+ "ackstop-mutant": 27,
+ "stale-mutant": 3,
+ "rawrecv-mutant": 17,
+ "rawreset-mutant": 8,
+ "framecheck-mutant": 4,
+ "rawask-mutant": 2,
+ "keepalive-mutant": 40
+ },
+ "focused_checks": 85,
+ "red_failures": 46,
+ "surface_ppm_sha256": "676f3d56de19603e07766f2b859b58a55090071cb4a43081b4e7800031872066",
+ "surface_render_elf_sha256": "9eaf7d395b86a8623307df39b95f29331ad2fb571bf2ea1b4f8fbd7f70a646a9",
+ "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9",
+ "scope": "Provider fixture through retained scene to real Omega pixels; no live inference/hosted window/device qualification."
+}
diff --git a/evidence/allen-omega-L694/L765/surface.log b/evidence/allen-omega-L694/L765/surface.log
new file mode 100644
index 00000000..dd6cb9e2
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/surface.log
@@ -0,0 +1,85 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
+64 0
+65 0
+66 0
+67 0
+68 0
+69 0
+70 0
+71 0
+72 0
+73 0
+74 0
+75 0
+76 0
+77 0
+78 0
+79 0
+80 0
+81 0
+82 0
+83 0
+84 0
+85 0
diff --git a/evidence/allen-omega-L694/L765/thinking-mutant.log b/evidence/allen-omega-L694/L765/thinking-mutant.log
new file mode 100644
index 00000000..74b41a12
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/thinking-mutant.log
@@ -0,0 +1,63 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 1
+15 1
+16 0
+17 0
+18 0
+19 1
+20 1
+21 1
+22 1
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
+29 0
+30 0
+31 0
+32 0
+33 0
+34 0
+35 0
+36 0
+37 0
+38 0
+39 0
+40 0
+41 0
+42 0
+43 0
+44 0
+45 0
+46 0
+47 0
+48 0
+49 0
+50 0
+51 0
+52 0
+53 0
+54 0
+55 0
+56 0
+57 0
+58 0
+59 0
+60 0
+61 0
+62 0
+63 0
diff --git a/evidence/allen-omega-L694/L765/view.log b/evidence/allen-omega-L694/L765/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/L765/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/README.md b/evidence/allen-omega-L694/README.md
new file mode 100644
index 00000000..cb531ded
--- /dev/null
+++ b/evidence/allen-omega-L694/README.md
@@ -0,0 +1,46 @@
+# L694 native acceptance (WIP)
+
+All execution is Linux AArch64 host execution, no QEMU/iMac/physical/live claim.
+Frozen behavioral source is baseline da55660ea7337f2b6a42095fcd1fb6ddebe1cc7c.
+Native product/test sources: native/omega/allen. `accepted/` is replay5 history;
+final immutable-source replay is recorded by the later closure receipt.
+
+Current implemented acceptance: runtime28, CODE23, courier24, memory/notes79,
+intent8, reply15, code-view13, scene14, paint11, boundary/recovery352,
+legacy short fixture20 and long fixture292 =879 checks, zero failed.
+Five valid compiled mutants fail original gates: stale-ID3, CRC2, SHA2,
+readback7 and session1 failed assertions, all native exits1..99.
+Independent full4096-byte memory golden comparison passes. Native render produces
+mind-component.ppm with the actual Omega pixel loop, not a fabricated screenshot.
+Standalone stdio code exchange outputs JOB and immediate acknowledgement/fixture
+completion. Input is canned **test data**, never model output or live attachment.
+
+Exact commands:
+
+```sh
+quiet-build native/omega/allen/gate.sh target/allen-omega-L694/new-empty-output
+quiet-build env AIENOS_STRICT=1 ./scripts/verify_all.sh
+quiet-build cargo clippy --offline --all-targets -- -D warnings
+```
+
+Repository strict suite: FAIL exit101. Formatting passed; four existing
+allen-courier socket tests hit OS EPERM. verify-all.log preserves full output.
+Clippy is separately recorded in clippy.log. No assertion was skipped or waived.
+Legacy suite is compatibility evidence only, not an Omega acceptance backend.
+
+Fixtures short.wire/long.wire were emitted by the unchanged existing
+`target/release/allen-courier --split native/kernel/svc/tests/fixtures/code/{short,long}.txt`
+after `quiet-build cargo build --offline -q --release -p allen-courier --bin allen-courier`.
+Its implementation is a fixture oracle, not an execution-closure dependency.
+Full code CRC32768 x bytes is independently frozen from GNU gzip trailer:
+CRC ba3e1bc1; native boundary test checks acceptance, then CRC corruption refusal.
+Memory reference is independently assembled from layout with dd/printf, sealed
+using sha256sum and xxd, then compared byte-for-byte. No new C/Rust/Python/JS
+program or test backend exists. Shell merely constructs references/builds/runs.
+
+Original failed receipts and exact behavioral RED sources remain here. See
+[development-failures.md](development-failures.md). Receipt replay2 is invalid;
+only corrected later replays count. Source/compiler/executable hashes and native
+per-check outputs are retained. Output binaries live under target/allen-omega-L694
+and the permitted handoff tree, not in Git. Target/platform gates and remaining
+portable compatibility are listed in native/omega/allen/README.md.
diff --git a/evidence/allen-omega-L694/accepted/binaries.sha256 b/evidence/allen-omega-L694/accepted/binaries.sha256
new file mode 100644
index 00000000..f5754352
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/binaries.sha256
@@ -0,0 +1,19 @@
+da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 target/allen-omega-L694/replay5/readback-mutant
+798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 target/allen-omega-L694/replay5/view
+c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8 target/allen-omega-L694/replay5/allen
+ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef target/allen-omega-L694/replay5/reply
+f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec target/allen-omega-L694/replay5/hash-mutant
+0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 target/allen-omega-L694/replay5/golden
+d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 target/allen-omega-L694/replay5/session-mutant
+bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af target/allen-omega-L694/replay5/intent
+9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 target/allen-omega-L694/replay5/fixture
+52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 target/allen-omega-L694/replay5/runtime
+b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 target/allen-omega-L694/replay5/code
+d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 target/allen-omega-L694/replay5/edges
+87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d target/allen-omega-L694/replay5/render
+7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e target/allen-omega-L694/replay5/stale-mutant
+3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 target/allen-omega-L694/replay5/courier
+44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c target/allen-omega-L694/replay5/scene
+fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d target/allen-omega-L694/replay5/paint
+0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f target/allen-omega-L694/replay5/crc-mutant
+1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd target/allen-omega-L694/replay5/memory
diff --git a/evidence/allen-omega-L694/accepted/code.log b/evidence/allen-omega-L694/accepted/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/accepted/courier.log b/evidence/allen-omega-L694/accepted/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/accepted/crc-mutant.log b/evidence/allen-omega-L694/accepted/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/accepted/edges.log b/evidence/allen-omega-L694/accepted/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/accepted/hash-mutant.log b/evidence/allen-omega-L694/accepted/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/accepted/intent.log b/evidence/allen-omega-L694/accepted/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/accepted/long.log b/evidence/allen-omega-L694/accepted/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/accepted/memory.log b/evidence/allen-omega-L694/accepted/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/accepted/paint.log b/evidence/allen-omega-L694/accepted/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/accepted/readback-mutant.log b/evidence/allen-omega-L694/accepted/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/accepted/reply.log b/evidence/allen-omega-L694/accepted/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/accepted/runtime.log b/evidence/allen-omega-L694/accepted/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/accepted/scene.log b/evidence/allen-omega-L694/accepted/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/accepted/session-mutant.log b/evidence/allen-omega-L694/accepted/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/accepted/short.log b/evidence/allen-omega-L694/accepted/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/accepted/source.sha256 b/evidence/allen-omega-L694/accepted/source.sha256
new file mode 100644
index 00000000..61319829
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/source.sha256
@@ -0,0 +1,28 @@
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+2346077ef78cf54124f777016cf44e1034546f400bb6642e73713c8987875f0f native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
diff --git a/evidence/allen-omega-L694/accepted/stale-mutant.log b/evidence/allen-omega-L694/accepted/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/accepted/view.log b/evidence/allen-omega-L694/accepted/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/accepted/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/bootstrap.log b/evidence/allen-omega-L694/bootstrap.log
new file mode 100644
index 00000000..4b4f49ed
--- /dev/null
+++ b/evidence/allen-omega-L694/bootstrap.log
@@ -0,0 +1,3 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+PASS source-only seed bootstrap and compiler fixpoint
diff --git a/evidence/allen-omega-L694/checkpoint1.md b/evidence/allen-omega-L694/checkpoint1.md
new file mode 100644
index 00000000..610df8eb
--- /dev/null
+++ b/evidence/allen-omega-L694/checkpoint1.md
@@ -0,0 +1,14 @@
+# Checkpoint 1 WIP
+
+Compiler probe: exit0, static AArch64 ELF. Runtime behavioral stub: compiled ELF,
+exit15 (15 assertions failed). Implemented runtime: 28/28 checks, exit0.
+Intermediate implementation compile refused line224 error5 (extra operand in
+put R); corrected before execution. Failed/empty compiler output was not executed
+successfully; shell invocation refused with126, no acceptance claimed from it.
+quiet-build invoked for builds; its external ~/.local/state log is read-only in
+this sandbox and reports logging errors; compiler invocation itself succeeds.
+
+Product: typed chat/code/follow-up admission, monotonic request IDs, busy/length/
+ASCII refusal, immediate coding acknowledgment, model answer input, cancellation,
+slow-once and silence timeout, bounded transcript history and restoration entry.
+Not yet all runtime edge cases covered. No model connection, target or live claim.
diff --git a/evidence/allen-omega-L694/checkpoint1.sha256 b/evidence/allen-omega-L694/checkpoint1.sha256
new file mode 100644
index 00000000..9cdce55b
--- /dev/null
+++ b/evidence/allen-omega-L694/checkpoint1.sha256
@@ -0,0 +1,5 @@
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 target/allen-omega-L694/runtime-green
+a7b22416dc6ed824fe2888fa158c73148ab01bd3aa8586605780c0f7c5052725 target/allen-omega-L694/runtime-green.om
+ceeb5e2b7b5d7dc7883fb6c043b6da64e52f193ed7853de4c8b96452e3cc706d target/allen-omega-L694/runtime-red
+82aaecff6a33dcef7101e3c35f84b0f1121a569173984b3bb42bf023832025c6 target/allen-omega-L694/runtime-red.om
diff --git a/evidence/allen-omega-L694/clippy.log b/evidence/allen-omega-L694/clippy.log
new file mode 100644
index 00000000..dae09550
--- /dev/null
+++ b/evidence/allen-omega-L694/clippy.log
@@ -0,0 +1,43 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+ Checking typenum v1.20.1
+ Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto)
+ Checking cfg-if v1.0.5
+ Checking subtle v2.6.1
+ Checking signature v2.2.0
+ Checking zeroize v1.9.0
+ Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability)
+ Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel)
+ Checking memchr v2.8.3
+ Checking itoa v1.0.18
+ Checking aienos-infer v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-infer)
+ Checking allen-design-tokens v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-design-tokens)
+ Checking libc v0.2.189
+ Checking serde_core v1.0.229
+ Checking zmij v1.0.23
+ Checking allen-courier v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-courier)
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Checking ed25519 v2.2.3
+ Checking aienos-capability-ffi v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability-ffi)
+ Checking allen-reflex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-reflex)
+ Checking generic-array v0.14.7
+ Checking cpufeatures v0.2.17
+ Checking crypto-common v0.1.7
+ Checking block-buffer v0.10.4
+ Checking digest v0.10.7
+ Checking sha2 v0.10.9
+ Checking curve25519-dalek v4.1.3
+ Checking ed25519-dalek v2.2.0
+ Checking serde_json v1.0.151
+ Checking serde v1.0.229
+ Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Checking aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool)
+ Checking aienos-agent-state v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-agent-state)
+ Checking aienos-cortex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-cortex)
+ Checking aienos-evidence v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-evidence)
+ Checking aienos-store-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-store-tool)
+ Checking aienos-explain v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-explain)
+ Checking aienos-c1-tree v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-c1-tree)
+ Checking aienos-aegis v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-aegis)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.80s
diff --git a/evidence/allen-omega-L694/code1.txt b/evidence/allen-omega-L694/code1.txt
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/code1.txt
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/compiler.sha256 b/evidence/allen-omega-L694/compiler.sha256
new file mode 100644
index 00000000..783beb8d
--- /dev/null
+++ b/evidence/allen-omega-L694/compiler.sha256
@@ -0,0 +1,2 @@
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 target/allen-omega-L694/compiler-source/build/bootstrap/omc
diff --git a/evidence/allen-omega-L694/courier1.txt b/evidence/allen-omega-L694/courier1.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/evidence/allen-omega-L694/courier2.txt b/evidence/allen-omega-L694/courier2.txt
new file mode 100644
index 00000000..414d7e4f
--- /dev/null
+++ b/evidence/allen-omega-L694/courier2.txt
@@ -0,0 +1,24 @@
+201 1
+202 1
+203 1
+204 1
+205 1
+206 1
+207 0
+208 0
+209 1
+210 0
+211 0
+212 1
+213 1
+214 1
+215 1
+216 0
+217 1
+218 0
+219 1
+220 1
+221 0
+222 1
+223 1
+224 1
diff --git a/evidence/allen-omega-L694/courier3.txt b/evidence/allen-omega-L694/courier3.txt
new file mode 100644
index 00000000..883f77b5
--- /dev/null
+++ b/evidence/allen-omega-L694/courier3.txt
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 1
+213 1
+214 1
+215 1
+216 0
+217 1
+218 0
+219 1
+220 1
+221 0
+222 1
+223 1
+224 1
diff --git a/evidence/allen-omega-L694/courier4.txt b/evidence/allen-omega-L694/courier4.txt
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/courier4.txt
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/development-failures.md b/evidence/allen-omega-L694/development-failures.md
new file mode 100644
index 00000000..c638a185
--- /dev/null
+++ b/evidence/allen-omega-L694/development-failures.md
@@ -0,0 +1,35 @@
+# Preserved development failures
+
+These are debugging history, not accepted gates or TDD RED counts.
+
+* runtime-green first compile: extra put operand, error5; shell attempt returned126
+ on empty non-executable output. Corrected. No invalid ELF ran or earned a pass.
+* courier1: register budget error12. Split/reduced locals. courier2 exit17 and
+ courier3 exit10 exposed header offsets and a test clobbering the packet output
+ through its own check printer. courier4 and fresh replays pass.
+* intent1/2, view1, paint1: error12; simplified functions/condition temporaries.
+* scene1 native exit1: mood token indexing; corrected. scene2 passes.
+* allen1: error7, function `want` conflicted with local name; renamed jobwant.
+ allen2: error7 (write fd type); allen3: error3 (text declaration order).
+* replay1: error10 (scene parameter `start` conflicted with runtime function).
+* replay2 printed PASS with session mutant exit0: INVALID acceptance receipt.
+ Found a weak test corrupting header syntax instead of session digits and an
+ external shell AND-list missing explicit failure. Corrected both. replay3+
+ reject the session mutant with nonzero native behavioral assertion failures.
+
+Behavioral RED records (valid compiled static AArch64 ELFs): runtime stubs exit15;
+intent-edge-red exit1; load-edge-red exit2. Their exact combined Omega sources
+and native assertion output are committed here. Remaining tests were incremental
+regression development; no claim every module had a pre-implementation RED.
+
+Original quiet-build reports its ~/.local/state log cannot be written in the
+sandbox. It still runs the compiler while holding its shared lock; errors are
+preserved in bootstrap/replay/strict/clippy logs. Compiler/builder exit statuses
+are enforced in gate.sh. Empty/nonstatic/wrong-machine outputs cannot proceed.
+
+Publication attempts: git add/commit at original metadata fail with read-only
+index.lock under aienos-imac-allen/.git/worktrees/aienos-allen-omega-L694.
+`git push origin feat/allen-omega-L694` fails: cannot resolve github.com.
+No approval bypass or service/network changes attempted. Separate publication
+metadata under the permitted handoff root records this same worktree's commits;
+it is not another worktree or implementation worker.
diff --git a/evidence/allen-omega-L694/edges1.txt b/evidence/allen-omega-L694/edges1.txt
new file mode 100644
index 00000000..b8e2f521
--- /dev/null
+++ b/evidence/allen-omega-L694/edges1.txt
@@ -0,0 +1,351 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/final-replay.log b/evidence/allen-omega-L694/final-replay.log
new file mode 100644
index 00000000..29b40aa8
--- /dev/null
+++ b/evidence/allen-omega-L694/final-replay.log
@@ -0,0 +1,22 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/final/binaries.sha256 b/evidence/allen-omega-L694/final/binaries.sha256
new file mode 100644
index 00000000..00cf6c70
--- /dev/null
+++ b/evidence/allen-omega-L694/final/binaries.sha256
@@ -0,0 +1,19 @@
+da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/readback-mutant
+798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/view
+c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/allen
+ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/reply
+f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/hash-mutant
+0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/golden
+d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/session-mutant
+bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/intent
+9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/fixture
+52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/runtime
+b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/code
+d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/edges
+87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/render
+7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/stale-mutant
+3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/courier
+44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/scene
+fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/paint
+0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/crc-mutant
+1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/memory
diff --git a/evidence/allen-omega-L694/final/code.log b/evidence/allen-omega-L694/final/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/final/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/final/courier.log b/evidence/allen-omega-L694/final/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/final/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/final/crc-mutant.log b/evidence/allen-omega-L694/final/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/final/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/final/edges.log b/evidence/allen-omega-L694/final/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/final/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/final/hash-mutant.log b/evidence/allen-omega-L694/final/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/final/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/final/intent.log b/evidence/allen-omega-L694/final/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/final/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/final/long.log b/evidence/allen-omega-L694/final/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/final/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/final/memory.log b/evidence/allen-omega-L694/final/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/final/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/final/paint.log b/evidence/allen-omega-L694/final/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/final/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/final/readback-mutant.log b/evidence/allen-omega-L694/final/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/final/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/final/reply.log b/evidence/allen-omega-L694/final/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/final/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/final/runtime.log b/evidence/allen-omega-L694/final/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/final/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/final/scene.log b/evidence/allen-omega-L694/final/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/final/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/final/session-mutant.log b/evidence/allen-omega-L694/final/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/final/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/final/short.log b/evidence/allen-omega-L694/final/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/final/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/final/source.sha256 b/evidence/allen-omega-L694/final/source.sha256
new file mode 100644
index 00000000..ddeceb60
--- /dev/null
+++ b/evidence/allen-omega-L694/final/source.sha256
@@ -0,0 +1,34 @@
+46ba5562bcbbd808e6557f1f49e296e022c292ea0b718b1516312f10a9828cca native/omega/allen/README.md
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+357481ea27a68a4d452c97017dad70fe11566612951d71e947549c1de8441846 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+2346077ef78cf54124f777016cf44e1034546f400bb6642e73713c8987875f0f native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/final/stale-mutant.log b/evidence/allen-omega-L694/final/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/final/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/final/view.log b/evidence/allen-omega-L694/final/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/final/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/intent-edge-red.log b/evidence/allen-omega-L694/intent-edge-red.log
new file mode 100644
index 00000000..3f449307
--- /dev/null
+++ b/evidence/allen-omega-L694/intent-edge-red.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 1
diff --git a/evidence/allen-omega-L694/intent-edge-red.om b/evidence/allen-omega-L694/intent-edge-red.om
new file mode 100644
index 00000000..648a62ec
--- /dev/null
+++ b/evidence/allen-omega-L694/intent-edge-red.om
@@ -0,0 +1,2395 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Tx ulong 3
+fn txbegin to bool
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if not memvalid
+ret false
+end
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+if gt listed 4 false 0
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Askcode "Please make me a calculator"
+text Askpoem "Write a poem about python"
+text Askmore "Now add a square root key"
+text Expected "JOB 9 code the person asked Allen for code.\tPlease make me a calculator"
+text Nscript "script a poem"
+fn main to int
+put Inlen 0 len Askcode
+for i ulong len Askcode
+put In i get Askcode i
+end
+check eq classify 2 501
+b = jobbuild 2 9
+same = eq get Outlen 0 len Expected
+for i ulong len Expected
+if ne get Outb i get Expected i
+same = false
+end
+end
+check b 502
+check same 503
+put Inlen 0 len Askpoem
+for i ulong len Askpoem
+put In i get Askpoem i
+end
+check eq classify 1 504
+check eq jobwant 1 505
+put Inlen 0 len Askmore
+for i ulong len Askmore
+put In i get Askmore i
+end
+check eq classify 1 506
+put R 6 1
+check eq classify 3 507
+put R 6 0
+put Inlen 0 len Nscript
+for i ulong len Nscript
+put In i get Nscript i
+end
+check eq classify 1 508
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/intent3.txt b/evidence/allen-omega-L694/intent3.txt
new file mode 100644
index 00000000..5a0fec5d
--- /dev/null
+++ b/evidence/allen-omega-L694/intent3.txt
@@ -0,0 +1,7 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
diff --git a/evidence/allen-omega-L694/load-edge-red.log b/evidence/allen-omega-L694/load-edge-red.log
new file mode 100644
index 00000000..a05eed4e
--- /dev/null
+++ b/evidence/allen-omega-L694/load-edge-red.log
@@ -0,0 +1,63 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 1
+363 1
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
diff --git a/evidence/allen-omega-L694/load-edge-red.om b/evidence/allen-omega-L694/load-edge-red.om
new file mode 100644
index 00000000..30ef7ddc
--- /dev/null
+++ b/evidence/allen-omega-L694/load-edge-red.om
@@ -0,0 +1,2481 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note SPDX-License-Identifier: AGPL-3.0-or-later
+note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d.
+note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF.
+global Buf uchar 8192
+global H uint 8
+global Vv uint 8
+global W uint 64
+global K uint 64
+global Hb uchar 64
+global Hs ulong 2
+global Hash uchar 32
+global Out uchar 65
+text Hex "0123456789abcdef"
+
+fn rotate x uint n uint to uint
+ret or shr x n shl x sub 32 n
+end
+
+fn round i ulong to void
+e = get Vv 4
+a = get Vv 0
+s = xor xor rotate e 6 rotate e 11 rotate e 25
+c = xor and e get Vv 5 and not e get Vv 6
+t = add add get Vv 7 s add c add get K i get W i
+s = xor xor rotate a 2 rotate a 13 rotate a 22
+c = and a get Vv 1
+c = xor c and a get Vv 2
+c = xor c and get Vv 1 get Vv 2
+u = add s c
+put Vv 7 get Vv 6
+put Vv 6 get Vv 5
+put Vv 5 e
+put Vv 4 add get Vv 3 t
+put Vv 3 get Vv 2
+put Vv 2 get Vv 1
+put Vv 1 a
+put Vv 0 add t u
+end
+
+fn block to void
+for i ulong 16
+x = uint 0
+for j ulong 4
+x = or shl x 8 uint get Hb add mul i 4 j
+end
+put W i x
+end
+for j ulong 48
+i = add j 16
+x = get W sub i 15
+y = get W sub i 2
+s = xor xor rotate x 7 rotate x 18 shr x 3
+t = xor xor rotate y 17 rotate y 19 shr y 10
+put W i add add get W sub i 16 s add get W sub i 7 t
+end
+for i ulong 8
+put Vv i get H i
+end
+for i ulong 64
+round i
+end
+for i ulong 8
+put H i add get H i get Vv i
+end
+end
+
+fn hinit to void
+put H 0 1779033703
+put H 1 3144134277
+put H 2 1013904242
+put H 3 2773480762
+put H 4 1359893119
+put H 5 2600822924
+put H 6 528734635
+put H 7 1541459225
+put Hs 0 0
+put Hs 1 0
+end
+
+fn hbyte c uchar to void
+p = get Hs 0
+put Hb p c
+p = add p 1
+put Hs 1 add get Hs 1 1
+if eq p 64
+block
+p = 0
+end
+put Hs 0 p
+end
+
+fn update off ulong count ulong to void
+for i ulong count
+hbyte get Buf add off i
+end
+end
+
+fn finish to void
+bits = mul get Hs 1 8
+hbyte 128
+while ne get Hs 0 56
+hbyte 0
+end
+for i ulong 8
+hbyte uchar and shr bits mul sub 7 i 8 255
+end
+for i ulong 32
+x = get H div i 4
+put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255
+end
+end
+
+fn constants to void
+put K 0 1116352408
+put K 1 1899447441
+put K 2 3049323471
+put K 3 3921009573
+put K 4 961987163
+put K 5 1508970993
+put K 6 2453635748
+put K 7 2870763221
+put K 8 3624381080
+put K 9 310598401
+put K 10 607225278
+put K 11 1426881987
+put K 12 1925078388
+put K 13 2162078206
+put K 14 2614888103
+put K 15 3248222580
+put K 16 3835390401
+put K 17 4022224774
+put K 18 264347078
+put K 19 604807628
+put K 20 770255983
+put K 21 1249150122
+put K 22 1555081692
+put K 23 1996064986
+put K 24 2554220882
+put K 25 2821834349
+put K 26 2952996808
+put K 27 3210313671
+put K 28 3336571891
+put K 29 3584528711
+put K 30 113926993
+put K 31 338241895
+put K 32 666307205
+put K 33 773529912
+put K 34 1294757372
+put K 35 1396182291
+put K 36 1695183700
+put K 37 1986661051
+put K 38 2177026350
+put K 39 2456956037
+put K 40 2730485921
+put K 41 2820302411
+put K 42 3259730800
+put K 43 3345764771
+put K 44 3516065817
+put K 45 3600352804
+put K 46 4094571909
+put K 47 275423344
+put K 48 430227734
+put K 49 506948616
+put K 50 659060556
+put K 51 883997877
+put K 52 958139571
+put K 53 1322822218
+put K 54 1537002063
+put K 55 1747873779
+put K 56 1955562222
+put K 57 2024104815
+put K 58 2227730452
+put K 59 2361852424
+put K 60 2428436474
+put K 61 2756734187
+put K 62 3204031479
+put K 63 3329325298
+end
+
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn textok to bool
+n = get Inlen 0
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In i
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret true
+end
+fn histadd which ulong to void
+n = get R 9
+if eq n 32
+for i ulong 4960
+put Hist i get Hist add i 160
+end
+for i ulong 31
+put Hlen i get Hlen add i 1
+end
+n = 31
+end
+size = get R add which 7
+for i ulong size
+if eq which 0
+put Hist add mul n 160 i get Prompt i
+else
+put Hist add mul n 160 i get Answer i
+end
+end
+put Hlen n size
+put R 9 add n 1
+end
+fn start kind ulong now ulong to bool
+if or ne get R 1 0 ge get R 0 4294967295
+ret false
+end
+if or lt kind 1 gt kind 3
+ret false
+end
+if and eq kind 3 eq get R 6 0
+ret false
+end
+if not textok
+ret false
+end
+for i ulong get Inlen 0
+put Prompt i get In i
+end
+put R 7 get Inlen 0
+put R 0 add get R 0 1
+put R 1 1
+put R 2 kind
+put R 3 now
+put R 4 now
+put R 5 0
+put R 8 0
+put R 11 0
+put R 13 0
+if eq kind 2
+for i ulong len Ack
+put Answer i get Ack i
+end
+put R 8 len Ack
+end
+if eq kind 3
+for i ulong len Ackmore
+put Answer i get Ackmore i
+end
+put R 8 len Ackmore
+end
+histadd 0
+ret true
+end
+fn answer seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if or lt now get R 4 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+put R 4 now
+put R 1 0
+histadd 1
+ret true
+end
+fn cancel to void
+put R 1 0
+end
+fn heard seq ulong now ulong to bool
+if or eq get R 1 0 ne seq get R 0
+ret false
+end
+if lt now get R 4
+ret false
+end
+put R 4 now
+ret true
+end
+fn tick now ulong to ulong
+if or eq get R 1 0 lt now get R 4
+ret 0
+end
+if ge sub now get R 4 30000
+cancel
+ret 2
+end
+if and eq get R 5 0 ge sub now get R 3 20000
+put R 5 1
+ret 1
+end
+ret 0
+end
+fn reset to void
+for i ulong 9
+put R add i 1 0
+end
+end
+note Restore one externally decoded transcript line. No live job or ID reuse.
+fn restore to bool
+if or ne get R 1 0 not textok
+ret false
+end
+for i ulong get Inlen 0
+put Answer i get In i
+end
+put R 8 get Inlen 0
+histadd 1
+ret true
+end
+note CODE protocol: C seq, parts, bytes, crc, got. D parsed header.
+global C ulong 8
+global D ulong 8
+global Code uchar 32769
+global Have uchar 256
+global Piece uchar 128
+global Lang uchar 16
+global Newlang uchar 16
+fn codebeg seq ulong to void
+for i ulong 8
+put C i 0
+end
+put C 0 seq
+for i ulong 256
+put Have i 0
+end
+put Code 0 0
+end
+fn decfield slot ulong sep uchar to void
+number
+put D slot get P 1
+expect sep
+end
+fn hexread to void
+v = ulong 0
+for i ulong 8
+p = get P 0
+if ge p get Inlen 0
+put P 2 1
+ret
+end
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+put P 2 1
+ret
+end
+v = add mul v 16 d
+put P 0 add p 1
+end
+put D 4 v
+expect 32
+end
+fn codehead to bool
+put P 0 0
+put P 2 0
+expect 67
+expect 79
+expect 68
+expect 69
+expect 32
+decfield 0 32
+decfield 1 47
+decfield 2 32
+decfield 3 32
+hexread
+if ne get P 2 0
+ret false
+end
+if or ne get D 0 get C 0 eq get D 3 0
+ret false
+end
+if gt get D 3 32768
+ret false
+end
+if ne get D 2 div add get D 3 127 128
+ret false
+end
+if or lt get D 1 1 gt get D 1 get D 2
+ret false
+end
+if ne get C 1 0
+if or ne get C 1 get D 2 ne get C 2 get D 3
+ret false
+end
+if ne get C 3 get D 4
+ret false
+end
+end
+ret true
+end
+fn langread to bool
+for i ulong 16
+put Newlang i 0
+end
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if eq c 32
+if eq n 0
+ret false
+end
+put P 0 add p 1
+put D 5 n
+ret true
+end
+ok = or and ge c 97 le c 122 isdigit c
+ok = or ok or eq c 43 eq c 35
+ok = or ok or eq c 46 or eq c 95 eq c 45
+if or not ok ge n 15
+ret false
+end
+put Newlang n c
+p = add p 1
+n = add n 1
+end
+ret false
+end
+fn pieceread to ulong
+p = get P 0
+n = ulong 0
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if ge p get Inlen 0
+ret 129
+end
+c = get In p
+p = add p 1
+if eq c 110
+c = 10
+else
+if ne c 92
+ret 129
+end
+end
+else
+if or lt c 32 gt c 126
+ret 129
+end
+end
+if ge n 128
+ret 129
+end
+put Piece n c
+n = add n 1
+end
+ret n
+end
+fn codetake to bool
+if gt get Inlen 0 320
+ret false
+end
+if not codehead
+ret false
+end
+if not langread
+ret false
+end
+n = pieceread
+want = ulong 128
+if eq get D 1 get D 2
+want = sub get D 3 mul sub get D 2 1 128
+end
+if ne n want
+ret false
+end
+slot = sub get D 1 1
+off = mul slot 128
+if ne get C 1 0
+for i ulong 16
+if ne get Lang i get Newlang i
+ret false
+end
+end
+end
+if ne get Have slot 0
+for i ulong n
+if ne get Code add off i get Piece i
+ret false
+end
+end
+ret true
+end
+put C 1 get D 2
+put C 2 get D 3
+put C 3 get D 4
+for i ulong 16
+put Lang i get Newlang i
+end
+for i ulong n
+put Code add off i get Piece i
+end
+put Have slot 1
+put C 4 add get C 4 1
+ret true
+end
+fn codecrc to uint
+c = uint 4294967295
+for i ulong get C 2
+c = xor c uint get Code i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+fn codestat to ulong
+if eq get C 1 0
+ret 0
+end
+if lt get C 4 get C 1
+ret 1
+end
+if ne ulong codecrc get C 3
+ret 3
+end
+lines = ulong 0
+for i ulong get C 2
+c = get Code i
+if eq c 0
+ret 3
+end
+if eq c 10
+lines = add lines 1
+end
+end
+if ne get Code sub get C 2 1 10
+lines = add lines 1
+end
+if gt lines 800
+ret 3
+end
+put Code get C 2 0
+ret 2
+end
+fn missing to ulong
+if eq get C 1 0
+ret 1
+end
+for i ulong get C 1
+if eq get Have i 0
+ret add i 1
+end
+end
+ret 0
+end
+note Display admission is distinct from a model's closing sentence.
+fn codeshow seq ulong to bool
+if eq get R 1 0
+ret false
+end
+if or ne seq get R 0 ne seq get C 0
+ret false
+end
+if ne codestat 2
+ret false
+end
+put R 6 1
+ret true
+end
+note Pure courier datagrams. Q session, current seq, last LINE, head, count.
+global Q ulong 8
+global N ulong 8
+global Queue uchar 2560
+global Qlens ulong 8
+global Jbuf uchar 4096
+global Jhave uchar 5
+global J ulong 3
+text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes="
+text Kinds "JOBLINEGOTACKHELLOHI"
+fn keyread off ulong count ulong to void
+for i ulong count
+expect get Keys add off i
+end
+end
+fn keyemit off ulong count ulong to void
+for i ulong count
+emitb get Keys add off i
+end
+end
+fn kindoff k ulong to ulong
+if eq k 1
+ret 0
+end
+if eq k 2
+ret 3
+end
+if eq k 3
+ret 7
+end
+if eq k 4
+ret 10
+end
+if eq k 5
+ret 13
+end
+ret 18
+end
+fn kindlen k ulong to ulong
+if eq k 2
+ret 4
+end
+if eq k 5
+ret 5
+end
+if eq k 6
+ret 2
+end
+ret 3
+end
+fn qbegin run ulong seq ulong to void
+for i ulong 8
+put Q i 0
+end
+put Q 0 run
+put Q 1 seq
+for i ulong 5
+put Jhave i 0
+end
+for i ulong 3
+put J i 0
+end
+end
+note Serializer takes body In/Inlen; Outb/Outlen are published only on success.
+fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool
+if or lt k 1 gt k 6
+ret false
+end
+if gt get Inlen 0 1000
+ret false
+end
+outreset
+keyemit 0 22
+for i ulong 16
+d = and shr get Q 0 mul sub 15 i 4 15
+emitb get Digits d
+end
+keyemit 22 6
+off = kindoff k
+for i ulong kindlen k
+emitb get Kinds add off i
+end
+keyemit 28 5
+emitn seq
+keyemit 33 6
+emitn part
+emitb 47
+emitn total
+keyemit 39 7
+emitn bytes
+emitb 10
+for i ulong get Inlen 0
+emitb get In i
+end
+ret eq get Err 0 0
+end
+fn pkparse to bool
+if or gt get Inlen 0 1200 lt get Inlen 0 65
+ret false
+end
+put P 0 0
+put P 2 0
+keyread 0 22
+run = ulong 0
+for i ulong 16
+p = get P 0
+c = get In p
+d = ulong 16
+if isdigit c
+d = sub ulong c 48
+else
+if and ge c 97 le c 102
+d = sub ulong c 87
+end
+end
+if ge d 16
+ret false
+end
+run = or shl run 4 d
+put P 0 add p 1
+end
+if ne run get Q 0
+ret false
+end
+keyread 22 6
+kind = ulong 0
+for k ulong 6
+at = get P 0
+off = kindoff add k 1
+size = kindlen add k 1
+ok = true
+for i ulong size
+if not ineq add at i get Kinds add off i
+ok = false
+end
+end
+if and ok ineq add at size 32
+kind = add k 1
+end
+end
+if eq kind 0
+ret false
+end
+put N 0 kind
+put P 0 add get P 0 kindlen kind
+keyread 28 5
+number
+put N 1 get P 1
+keyread 33 6
+number
+put N 2 get P 1
+expect 47
+number
+put N 3 get P 1
+keyread 39 7
+number
+put N 4 get P 1
+expect 10
+put N 5 get P 0
+put N 6 sub get Inlen 0 get P 0
+ret eq get P 2 0
+end
+fn jobtake to ulong
+note n via N4
+note part via N2
+note total via N3
+if or eq get N 4 0 gt get N 4 4096
+ret 0
+end
+if ne get N 3 div add get N 4 999 1000
+ret 0
+end
+if or eq get N 2 0 gt get N 2 get N 3
+ret 0
+end
+want = ulong 1000
+if eq get N 2 get N 3
+want = sub get N 4 mul sub get N 3 1 1000
+end
+if ne want get N 6
+ret 0
+end
+if ne get J 0 0
+if or ne get J 0 get N 4 ne get J 1 get N 3
+ret 0
+end
+end
+slot = sub get N 2 1
+off = mul slot 1000
+if ne get Jhave slot 0
+for i ulong want
+if ne get Jbuf add off i get In add get N 5 i
+ret 0
+end
+end
+ret 2
+end
+for i ulong want
+put Jbuf add off i get In add get N 5 i
+end
+put Jhave slot 1
+put J 0 get N 4
+put J 1 get N 3
+put J 2 add get J 2 1
+ret 1
+end
+note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again.
+fn qreceive to ulong
+if not pkparse
+ret 0
+end
+if ne get N 1 get Q 1
+ret 0
+end
+kind = get N 0
+if eq kind 1
+ret jobtake
+end
+if ne kind 2
+if ne get N 6 0
+ret 0
+end
+ret 1
+end
+note part via N2
+if eq get N 2 0
+ret 0
+end
+if le get N 2 get Q 2
+ret 2
+end
+if or ne get N 2 add get Q 2 1 eq get Q 4 8
+ret 0
+end
+n = get N 6
+if or eq n 0 gt n 319
+ret 0
+end
+slot = rem add get Q 3 get Q 4 8
+for i ulong n
+put Queue add mul slot 320 i get In add get N 5 i
+end
+put Qlens slot n
+put Q 4 add get Q 4 1
+put Q 2 get N 2
+ret 1
+end
+fn qtake to bool
+if eq get Q 4 0
+ret false
+end
+slot = get Q 3
+n = get Qlens slot
+for i ulong n
+put In i get Queue add mul slot 320 i
+end
+put Inlen 0 n
+put Q 3 rem add slot 1 8
+put Q 4 sub get Q 4 1
+ret true
+end
+note Legacy application record codec; SHA is unkeyed integrity ONLY.
+global Unit uchar 4096
+global Enc uchar 4096
+global Mem uchar 3692
+global Md ulong 3
+global Note uchar 128
+global Ns ulong 4
+text Magic "AIENALM1"
+text Nmagic "AIENNOT1"
+fn get32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Unit add off i mul i 8
+end
+ret v
+end
+fn get64 off ulong to ulong
+ret or get32 off shl get32 add off 4 32
+end
+fn put32 off ulong v ulong to void
+for i ulong 4
+put Unit add off i uchar and shr v mul i 8 255
+end
+end
+fn put64 off ulong v ulong to void
+put32 off and v 4294967295
+put32 add off 4 shr v 32
+end
+fn mem32 off ulong to ulong
+v = ulong 0
+for i ulong 4
+v = or v shl ulong get Mem add off i mul i 8
+end
+ret v
+end
+fn mset32 off ulong v ulong to void
+for i ulong 4
+put Mem add off i uchar and shr v mul i 8 255
+end
+end
+fn zeroend off ulong to bool
+for i ulong sub ulong 4096 off
+if ne get Unit add off i 0
+ret false
+end
+end
+ret true
+end
+fn fieldok off ulong cap ulong name bool to bool
+n = ulong 0
+while lt n cap
+if eq get Unit add off n 0
+for j ulong sub cap n
+if ne get Unit add add off n j 0
+ret false
+end
+end
+ret true
+end
+c = get Unit add off n
+lower = and ge c 97 le c 122
+digit = isdigit c
+if name
+if eq n 0
+if not or and ge c 65 le c 90 digit
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+else
+if eq c 32
+if or eq n 0 eq n sub cap 1
+ret false
+end
+if eq get Unit add off add n 1 0
+ret false
+end
+if eq get Unit add off sub n 1 32
+ret false
+end
+else
+if not or lower digit
+ret false
+end
+end
+end
+n = add n 1
+end
+ret false
+end
+fn digest count ulong to void
+hinit
+for i ulong 32
+hbyte get Unit i
+end
+for i ulong count
+hbyte get Unit add i 64
+end
+finish
+end
+fn hashok count ulong to bool
+digest count
+d = uchar 0
+for i ulong 32
+d = or d xor get Hash i get Unit add i 32
+end
+ret eq d 0
+end
+fn seal count ulong to void
+digest count
+for i ulong 32
+put Unit add i 32 get Hash i
+end
+end
+fn memvalid to bool
+for i ulong 8
+if ne get Unit i get Magic i
+ret false
+end
+end
+ver = get32 8
+if or lt ver 2 gt ver 4
+ret false
+end
+n = get32 96
+if or gt n 32 gt get32 100 512
+ret false
+end
+size = add 40 mul n 113
+if ge ver 3
+size = add size 24
+end
+if eq ver 4
+size = add size 12
+end
+if or ne size get32 12 eq get64 16 0
+ret false
+end
+for i ulong 8
+if ne get Unit add i 24 0
+ret false
+end
+end
+if not zeroend add 64 size
+ret false
+end
+if not hashok size
+ret false
+end
+if not fieldok 72 24 true
+ret false
+end
+for i ulong n
+off = add 104 mul i 113
+if or eq get Unit off 0 eq get Unit add off 48 0
+ret false
+end
+if not fieldok off 48 false
+ret false
+end
+if not fieldok add off 48 64 false
+ret false
+end
+if gt get Unit add off 112 1
+ret false
+end
+end
+off = add 104 mul n 113
+if ge ver 3
+if not fieldok off 24 true
+ret false
+end
+end
+if eq ver 4
+if ne get Unit add off 27 0
+ret false
+end
+end
+ret true
+end
+fn memdec to bool
+if not memvalid
+ret false
+end
+size = get32 12
+for i ulong 3692
+put Mem i 0
+end
+for i ulong size
+put Mem i get Unit add i 64
+end
+put Md 0 get64 16
+put Md 1 get32 8
+put Md 2 size
+ret true
+end
+fn memenc gen ulong to bool
+n = mem32 32
+if or gt n 32 eq gen 0
+ret false
+end
+size = add 76 mul n 113
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Magic i
+end
+put32 8 4
+put32 12 size
+put64 16 gen
+for i ulong size
+put Unit add i 64 get Mem i
+end
+seal size
+if not memvalid
+ret false
+end
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+fn noteval index ulong to bool
+for i ulong 8
+if ne get Unit i get Nmagic i
+ret false
+end
+end
+n = get32 12
+if or eq n 0 ge n 128
+ret false
+end
+if or ne get32 8 1 ne get32 16 index
+ret false
+end
+if or gt get32 24 1 ne get32 28 0
+ret false
+end
+if not zeroend add n 64
+ret false
+end
+for i ulong n
+c = get Unit add i 64
+if or lt c 32 gt c 126
+ret false
+end
+end
+ret hashok n
+end
+fn notedec index ulong to bool
+if not noteval index
+ret false
+end
+n = get32 12
+for i ulong 128
+put Note i 0
+end
+for i ulong n
+put Note i get Unit add i 64
+end
+put Ns 0 n
+put Ns 1 index
+put Ns 2 get32 20
+put Ns 3 get32 24
+ret true
+end
+fn noteenc to bool
+n = get Ns 0
+if or eq n 0 ge n 128
+ret false
+end
+if gt get Ns 3 1
+ret false
+end
+for i ulong n
+c = get Note i
+if or lt c 32 gt c 126
+ret false
+end
+end
+for i ulong 4096
+put Unit i 0
+end
+for i ulong 8
+put Unit i get Nmagic i
+end
+put32 8 1
+put32 12 n
+put32 16 get Ns 1
+put32 20 get Ns 2
+put32 24 get Ns 3
+for i ulong n
+put Unit add i 64 get Note i
+end
+seal n
+for i ulong 4096
+put Enc i get Unit i
+end
+ret true
+end
+note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O.
+global St ulong 3
+global Tx ulong 3
+fn txbegin to bool
+if or ne get Tx 0 0 eq get St 0 18446744073709551615
+ret false
+end
+if not memenc add get St 0 1
+ret false
+end
+put Tx 1 0
+if ne get St 0 0
+put Tx 1 sub ulong 1 get St 1
+end
+put Tx 2 add get St 0 1
+put Tx 0 1
+ret true
+end
+fn txwrite ok bool to bool
+if ne get Tx 0 1
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 2
+ret true
+end
+fn txflush ok bool to bool
+if ne get Tx 0 2
+ret false
+end
+if not ok
+put Tx 0 0
+ret false
+end
+put Tx 0 3
+ret true
+end
+fn txread ok bool to bool
+if ne get Tx 0 3
+ret false
+end
+put Tx 0 0
+if not ok
+ret false
+end
+d = uchar 0
+for i ulong 4096
+d = or d xor get Unit i get Enc i
+end
+if ne d 0
+ret false
+end
+put St 0 get Tx 2
+put St 1 get Tx 1
+if lt get St 2 2
+put St 2 add get St 2 1
+end
+ret true
+end
+note Load each copy once into Unit. Caller resets St and calls loadcopy0,1.
+fn loadcopy slot ulong to bool
+if gt slot 1
+ret false
+end
+if not memvalid
+ret false
+end
+put St 2 add get St 2 1
+if gt get64 16 get St 0
+b = memdec
+put St 0 get Md 0
+put St 1 slot
+end
+ret true
+end
+note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
+global Fold uchar 160
+global Fn ulong 2
+text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
+fn foldin to void
+n = ulong 0
+space = false
+for i ulong get Inlen 0
+c = get In i
+if and ge c 65 le c 90
+c = add sub c 65 97
+end
+if or and ge c 97 le c 122 isdigit c
+if and space gt n 0
+put Fold n uchar 32
+n = add n 1
+end
+put Fold n c
+n = add n 1
+space = false
+else
+space = true
+end
+end
+put Fn 0 n
+put Fn 1 0
+end
+fn phrase at ulong off ulong size ulong to bool
+if gt add at size get Fn 0
+ret false
+end
+for i ulong size
+if ne get Fold add at i get Lists add off i
+ret false
+end
+end
+if lt add at size get Fn 0
+if ne get Fold add at size 32
+ret false
+end
+end
+ret true
+end
+fn inphrase off ulong size ulong anypos bool to bool
+if not anypos
+ret phrase get Fn 1 off size
+end
+count = sub get Fn 0 get Fn 1
+for i ulong count
+at = add i get Fn 1
+ok = eq at get Fn 1
+if gt at 0
+ok = or ok eq get Fold sub at 1 32
+end
+if ok
+if phrase at off size
+ret true
+end
+end
+end
+ret false
+end
+fn listed group ulong anypos bool to ulong
+g = ulong 0
+s = ulong 0
+for p ulong len Lists
+c = get Lists p
+if or eq c 124 eq c 10
+if eq g group
+if inphrase s sub p s anypos
+ret sub p s
+end
+end
+s = add p 1
+if eq c 10
+g = add g 1
+end
+end
+end
+ret 0
+end
+fn classify to ulong
+if not textok
+ret 0
+end
+foldin
+skip = listed 0 false
+while gt skip 0
+if ge add get Fn 1 skip get Fn 0
+skip = 0
+else
+put Fn 1 add add get Fn 1 skip 1
+skip = listed 0 false
+end
+end
+if and ne get R 6 0 gt listed 5 false 0
+ret 3
+end
+if gt listed 4 false 0
+ret 2
+end
+if and gt listed 3 true 0 eq listed 4 true 0
+ret 1
+end
+if and gt listed 1 false 0 gt listed 2 true 0
+ret 2
+end
+ret 1
+end
+note Ordinary want enum0chat,1make,2explain,3do.
+fn jobwant to ulong
+if gt listed 8 false 0
+ret 2
+end
+if or gt listed 6 false 0 gt listed 7 true 0
+ret 1
+end
+if gt listed 10 false 0
+ret 3
+end
+if gt listed 9 true 0
+ret 2
+end
+ret 0
+end
+text Job "JOB "
+text Codeask " asked "
+text Forcode " for code.\t"
+text Formore " to change the code just shown.\t"
+text Wantstr "chatmakeexplaindo"
+text Intro "You are the far hands of "
+text Home ", a quiet presence living in AIENOS on "
+text Comp "'s computer. You answer as "
+text Sees "; "
+text Words " sees only your words, as if "
+text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
+text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
+text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
+text Doing " asked for something to be done. "
+text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
+text Chat " said something in passing. Answer in one or two warm, plain sentences."
+text Allen "Allen"
+text Person "the person"
+fn selfemit to void
+off = add 40 mul mem32 32 113
+if eq get Mem off 0
+for i ulong len Allen
+emitb get Allen i
+end
+else
+for i ulong 24
+c = get Mem add off i
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn whoemit to void
+if eq get Mem 8 0
+for i ulong len Person
+emitb get Person i
+end
+else
+for i ulong 24
+c = get Mem add i 8
+if eq c 0
+ret
+end
+emitb c
+end
+end
+end
+fn jobbuild kind ulong seq ulong to bool
+if or lt kind 1 gt kind 3
+ret false
+end
+if or eq seq 0 gt seq 4294967295
+ret false
+end
+if not textok
+ret false
+end
+outreset
+for i ulong len Job
+emitb get Job i
+end
+emitn seq
+emitb 32
+if gt kind 1
+emitb 99
+emitb 111
+emitb 100
+emitb 101
+if eq kind 3
+emitb 45
+emitb 109
+emitb 111
+emitb 114
+emitb 101
+end
+emitb 32
+whoemit
+for i ulong len Codeask
+emitb get Codeask i
+end
+selfemit
+if eq kind 3
+for i ulong len Formore
+emitb get Formore i
+end
+else
+for i ulong len Forcode
+emitb get Forcode i
+end
+end
+else
+w = jobwant
+off = ulong 0
+size = ulong 4
+if eq w 1
+off = 4
+end
+if eq w 2
+off = 8
+size = 7
+end
+if eq w 3
+off = 15
+size = 2
+end
+for i ulong size
+emitb get Wantstr add off i
+end
+emitb 32
+for i ulong len Intro
+emitb get Intro i
+end
+selfemit
+for i ulong len Home
+emitb get Home i
+end
+whoemit
+for i ulong len Comp
+emitb get Comp i
+end
+selfemit
+for i ulong len Sees
+emitb get Sees i
+end
+whoemit
+for i ulong len Words
+emitb get Words i
+end
+selfemit
+for i ulong len Said
+emitb get Said i
+end
+whoemit
+if eq w 0
+for i ulong len Chat
+emitb get Chat i
+end
+end
+if eq w 1
+for i ulong len Make
+emitb get Make i
+end
+end
+if eq w 2
+for i ulong len Explain
+emitb get Explain i
+end
+end
+if eq w 3
+for i ulong len Doing
+emitb get Doing i
+end
+selfemit
+for i ulong len Cannot
+emitb get Cannot i
+end
+end
+emitb 9
+end
+for i ulong get Inlen 0
+emitb get In i
+end
+ret le get Outlen 0 4096
+end
+note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate.
+global Say uchar 160
+global S ulong 5
+fn sayhead to bool
+put P 0 0
+put P 2 0
+if ineq 0 87
+expect 87
+expect 65
+expect 73
+expect 84
+expect 32
+number
+put S 0 get P 1
+put S 1 0
+put S 2 0
+if ne get P 0 get Inlen 0
+ret false
+end
+ret eq get P 2 0
+end
+expect 83
+expect 65
+expect 89
+expect 32
+number
+put S 0 get P 1
+expect 32
+if ne get P 2 0
+ret false
+end
+put S 1 1
+put S 2 1
+save = get P 0
+number
+part = get P 1
+if ineq get P 0 47
+expect 47
+number
+put S 2 get P 1
+expect 32
+if or ne get P 2 0 eq part 0
+ret false
+end
+put S 1 part
+else
+put P 0 save
+put P 2 0
+end
+put S 3 get P 0
+ret eq get P 2 0
+end
+fn sayfold to bool
+n = ulong 0
+p = get S 3
+space = true
+while lt p get Inlen 0
+c = get In p
+p = add p 1
+if eq c 92
+if or ineq p 110 ineq p 116
+c = 32
+p = add p 1
+end
+end
+if or lt c 32 ge c 127
+c = 32
+end
+if eq c 32
+if not space
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+end
+space = true
+else
+if ge n 159
+ret false
+end
+put Say n c
+n = add n 1
+space = false
+end
+end
+if gt n 0
+if eq get Say sub n 1 32
+n = sub n 1
+end
+end
+put S 4 n
+ret true
+end
+note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected.
+fn saytake now ulong to ulong
+if or eq get R 1 0 gt get Inlen 0 319
+ret 0
+end
+if not sayhead
+ret 0
+end
+if or ne get S 0 get R 0 lt now get R 4
+ret 0
+end
+if eq get S 1 0
+b = heard get S 0 now
+ret 1
+end
+if not sayfold
+ret 0
+end
+if gt get R 2 1
+if eq get S 2 0
+ret 0
+end
+if ne get C 0 get R 0
+ret 0
+end
+if ne codestat 2
+if eq get R 13 0
+put R 13 1
+outreset
+emitb 65
+emitb 71
+emitb 65
+emitb 73
+emitb 78
+emitb 32
+emitn get R 0
+ret 2
+end
+cancel
+ret 3
+end
+else
+if ne get S 1 add get R 11 1
+ret 0
+end
+if and ne get S 2 0 ne get S 2 get S 1
+ret 0
+end
+end
+n = get R 8
+if or eq get S 1 1 gt get R 2 1
+n = 0
+end
+join = ulong 0
+if and gt n 0 gt get S 4 0
+join = 1
+end
+if gt add add n join get S 4 159
+ret 0
+end
+if gt get R 2 1
+if not codeshow get R 0
+ret 0
+end
+end
+if eq join 1
+put Answer n uchar 32
+n = add n 1
+end
+for i ulong get S 4
+put Answer add n i get Say i
+end
+put R 8 add n get S 4
+put R 11 get S 1
+put R 4 now
+if ne get S 2 0
+put R 1 0
+histadd 1
+end
+ret 1
+end
+note Exact legacy code row wrapping, at most4096 rows; full code retained.
+global Rowst ulong 4096
+global Rowlen ulong 4096
+global Rowline ulong 4096
+global View ulong 4
+global Vwork ulong 6
+note Vwork cols,maxrows,line,start,end.
+fn onerow s ulong first bool to ulong
+take = sub get Vwork 4 s
+cols = get Vwork 0
+if gt take cols
+take = cols
+j = cols
+while gt j div cols 2
+if eq get Code sub add s j 1 32
+take = j
+j = 0
+else
+j = sub j 1
+end
+end
+end
+slot = get View 0
+put Rowst slot s
+put Rowlen slot take
+put Rowline slot 0
+if first
+put Rowline slot get Vwork 2
+end
+put View 0 add slot 1
+ret add s take
+end
+fn rowroom pos ulong to bool
+ret and lt pos get C 2 lt get View 0 get Vwork 1
+end
+fn moreline s ulong to bool
+ret and lt s get Vwork 4 lt get View 0 get Vwork 1
+end
+fn rows cols ulong maxrows ulong to bool
+if or eq cols 0 gt maxrows 4096
+ret false
+end
+if ne codestat 2
+ret false
+end
+put Vwork 0 cols
+put Vwork 1 maxrows
+put Vwork 2 1
+put View 0 0
+put View 1 0
+pos = ulong 0
+while rowroom pos
+stop = pos
+while lt stop get C 2
+if eq get Code stop 10
+put Vwork 4 stop
+stop = get C 2
+else
+stop = add stop 1
+put Vwork 4 stop
+end
+end
+s = pos
+if lt get View 0 maxrows
+s = onerow s true
+end
+while moreline s
+s = onerow s false
+end
+pos = add get Vwork 4 1
+put Vwork 2 add get Vwork 2 1
+end
+ret true
+end
+fn scroll delta long page ulong to ulong
+last = ulong 0
+if gt get View 0 page
+last = sub get View 0 page
+end
+if gt get View 1 last
+put View 1 last
+end
+top = long get View 1
+if lt delta 0
+if lt delta neg top
+put View 1 0
+ret 0
+end
+else
+if gt ulong delta sub last get View 1
+put View 1 last
+ret last
+end
+end
+top = add top delta
+put View 1 ulong top
+ret ulong top
+end
+note Scene state: tone,water,has-say,nthings,used,lines,rejected,over.
+global Sc ulong 8
+global Things ulong 64
+global Stext uchar 2304
+global Sw ulong 4
+global Fields uchar 1536
+global Flens ulong 6
+global Soffs ulong 6
+text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|"
+fn scword beg ulong size ulong to ulong
+s = ulong 0
+word = ulong 1
+for i ulong len Vocab
+if eq get Vocab i 124
+if eq sub i s size
+same = true
+for j ulong size
+if ne get In add beg j get Vocab add s j
+same = false
+end
+end
+if same
+ret word
+end
+end
+word = add word 1
+s = add i 1
+end
+end
+ret 0
+end
+fn fieldcap kind ulong field ulong to ulong
+if eq kind 2
+if eq field 0
+ret 48
+end
+ret 64
+end
+if eq kind 1
+if eq field 0
+ret 48
+end
+ret 240
+end
+if eq kind 3
+if eq field 0
+ret 16
+end
+ret 64
+end
+if eq kind 4
+if eq field 0
+ret 220
+end
+ret 48
+end
+if eq kind 5
+if eq field 0
+ret 32
+end
+ret 200
+end
+if eq kind 6
+if eq field 0
+ret 24
+end
+ret 64
+end
+if eq field 0
+ret 120
+end
+ret 64
+end
+fn scfield slot ulong beg ulong stop ulong kind ulong to bool
+s = beg
+e = stop
+while lt s e
+if eq get In s 32
+s = add s 1
+else
+ret fieldend slot s e kind
+end
+end
+put Flens slot 0
+ret true
+end
+fn fieldend slot ulong s ulong stop ulong kind ulong to bool
+e = stop
+while gt e s
+if eq get In sub e 1 32
+e = sub e 1
+else
+n = sub e s
+if gt n fieldcap kind slot
+ret false
+end
+for i ulong n
+c = get In add s i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields add mul slot 256 i c
+end
+put Flens slot n
+ret true
+end
+end
+put Flens slot 0
+ret true
+end
+fn scfields beg ulong stop ulong kind ulong to ulong
+slot = ulong 0
+s = beg
+for i ulong sub stop beg
+p = add beg i
+if eq get In p 124
+if ge slot 5
+ret 0
+end
+if not scfield slot s p kind
+ret 0
+end
+slot = add slot 1
+s = add p 1
+end
+end
+if not scfield slot s stop kind
+ret 0
+end
+n = add slot 1
+if and ne kind 2 gt n 2
+ret 0
+end
+if eq get Flens 0 0
+ret 0
+end
+if eq kind 5
+if or lt n 2 eq get Flens 1 0
+ret 0
+end
+end
+if eq kind 3
+hasdigit = false
+for i ulong get Flens 0
+if isdigit get Fields i
+hasdigit = true
+end
+end
+if not hasdigit
+ret 0
+end
+end
+ret n
+end
+fn scput slot ulong to ulong
+off = get Sc 4
+n = get Flens slot
+for i ulong n
+put Stext add off i get Fields add mul slot 256 i
+end
+put Stext add off n 0
+put Sc 4 add add off n 1
+ret off
+end
+fn scmod word ulong base ulong to void
+if and ge word 11 le word 13
+put Things add base 1 sub word 10
+end
+if and ge word 16 le word 18
+put Things add base 2 sub word 16
+end
+if and ge word 19 le word 20
+put Things add base 3 sub word 18
+end
+if eq word 14
+put Things add base 4 1
+end
+if eq word 15
+put Things add base 5 1
+end
+end
+fn scsay beg ulong stop ulong to bool
+if ne get Sc 2 0
+ret false
+end
+n = sub stop beg
+if or eq n 0 gt n 159
+ret false
+end
+for i ulong n
+c = get In add beg i
+if or lt c 32 gt c 126
+ret false
+end
+put Fields i c
+end
+put Flens 0 n
+put Sc 2 1
+put Sw 3 scput 0
+ret true
+end
+fn scln beg ulong stop ulong to bool
+p = beg
+while lt p stop
+if or eq get In p 32 eq get In p 58
+ret scbody beg p stop
+end
+p = add p 1
+end
+ret false
+end
+fn scbody beg ulong wordend ulong stop ulong to bool
+word = scword beg sub wordend beg
+if eq word 2
+s = add wordend 1
+if lt s stop
+if eq get In s 58
+s = add s 1
+end
+end
+while lt s stop
+if eq get In s 32
+s = add s 1
+else
+ret scsay s stop
+end
+end
+ret false
+end
+if eq word 1
+s = add wordend 1
+for p ulong sub stop s
+at = add add wordend 1 p
+if eq get In at 32
+w = scword s sub at s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+s = add at 1
+end
+end
+w = scword s sub stop s
+if and ge w 21 le w 24
+put Sc 0 sub w 21
+end
+if and ge w 25 le w 27
+put Sc 1 sub w 25
+end
+ret true
+end
+if or lt word 3 gt word 10
+ret false
+end
+if ge get Sc 3 4
+put Sc 7 add get Sc 7 1
+ret false
+end
+put Sw 0 sub word 2
+colon = wordend
+while lt colon stop
+if eq get In colon 58
+put Sw 1 wordend
+put Sw 2 colon
+ret scthing add colon 1 stop
+end
+colon = add colon 1
+end
+ret false
+end
+fn scthing beg ulong stop ulong to bool
+n = scfields beg stop get Sw 0
+if eq n 0
+ret false
+end
+need = n
+for i ulong n
+need = add need get Flens i
+end
+if gt add get Sc 4 need 2304
+ret false
+end
+base = mul get Sc 3 16
+put Things base get Sw 0
+put Things add base 6 n
+s = get Sw 1
+for p ulong sub get Sw 2 s
+at = add get Sw 1 p
+if eq get In at 32
+w = scword s sub at s
+scmod w base
+s = add at 1
+end
+end
+w = scword s sub get Sw 2 s
+scmod w base
+for i ulong n
+put Things add add base 7 i scput i
+end
+put Sc 3 add get Sc 3 1
+ret true
+end
+fn scene to bool
+for i ulong 8
+put Sc i 0
+end
+for i ulong 64
+put Things i 0
+end
+put Sw 3 0
+n = get Inlen 0
+if gt n 2048
+n = 2048
+end
+s = ulong 0
+for p ulong n
+if eq get In p 10
+if gt p s
+if lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s p
+put Sc 6 add get Sc 6 1
+end
+else
+put Sc 7 add get Sc 7 1
+end
+end
+s = add p 1
+end
+end
+if and lt s n lt get Sc 5 12
+put Sc 5 add get Sc 5 1
+if not scln s n
+put Sc 6 add get Sc 6 1
+end
+end
+ret or ne get Sc 2 0 ne get Sc 3 0
+end
+note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow.
+note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI.
+global Frame uint 24576
+global G ulong 6
+global Fb uchar 73728
+fn channel c uint shift uint to uint
+ret and shr c shift 255
+end
+fn addcolor d uint c uint a uint to uint
+v = uint 0
+for i uint 3
+s = mul i 8
+n = add channel d s shr mul channel c s a 8
+if gt n 255
+n = 255
+end
+v = or v shl n s
+end
+ret v
+end
+fn scale c uint f uint to uint
+ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280
+end
+fn mix d uint c uint a uint to uint
+if ge a 256
+ret c
+end
+ret add scale d sub uint 256 a scale c a
+end
+fn distance x ulong y ulong to ulong
+dx = sub add mul long x 16 8 long get G 0
+dy = sub add mul long y 16 8 long get G 1
+ret ulong add mul dx dx mul dy dy
+end
+fn weight d2 ulong r2 ulong to ulong
+inv = div ulong 1099511627776 r2
+f = sub ulong 256 shr mul d2 inv 32
+w = shr mul shr mul f f 8 f 8
+ret shr mul w get G 4 8
+end
+fn glowpix x ulong y ulong to void
+d2 = distance x y
+r2 = mul get G 2 get G 2
+if ge d2 r2
+ret
+end
+a = uint weight d2 r2
+at = add mul y 192 x
+put Frame at addcolor get Frame at uint get G 3 a
+end
+fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool
+if or eq radius 0 gt radius 8192
+ret false
+end
+if or gt cx 8192 gt cy 8192
+ret false
+end
+if or gt color 16777215 gt alpha 512
+ret false
+end
+put G 0 cx
+put G 1 cy
+put G 2 radius
+put G 3 color
+put G 4 alpha
+for y ulong 128
+for x ulong 192
+glowpix x y
+end
+end
+ret true
+end
+fn render to void
+for i ulong 24576
+put Frame i 0
+end
+note Frozen component pose; same halo and heart colors/weights as ck_mind_draw.
+b = glow 1536 1024 1088 3951314 68
+b = glow 1536 1024 640 7363839 46
+b = glow 1536 1024 400 16765610 89
+b = glow 1536 1024 160 16772310 218
+b = glow 1536 1024 50 16775920 230
+end
+fn frameout to bool
+for i ulong 24576
+c = get Frame i
+put Fb mul i 3 uchar channel c 16
+put Fb add mul i 3 1 uchar channel c 8
+put Fb add mul i 3 2 uchar channel c 0
+end
+n = ulong 0
+while lt n len Fb
+w = write 1 Fb n sub len Fb n
+if le w 0
+ret false
+end
+n = add n ulong w
+end
+ret true
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+global Disk uchar 8192
+text Name "Allen"
+text Ntext "Meet at noon."
+fn enctounit to void
+for i ulong 4096
+put Unit i get Enc i
+end
+end
+fn diskput slot ulong count ulong to void
+for i ulong count
+put Disk add mul slot 4096 i get Enc i
+end
+end
+fn diskget slot ulong to void
+for i ulong 4096
+put Unit i get Disk add mul slot 4096 i
+end
+end
+fn main to int
+constants
+mset32 0 3
+for i ulong len Name
+put Mem add i 40 get Name i
+end
+check memenc 1 301
+check eq get32 12 76 302
+check memdec 303
+check eq get Md 0 1 304
+check eq get Mem 40 65 305
+put Unit 24 uchar 1
+check not memdec 306
+check eq get Md 0 1 307
+check eq get Mem 40 65 308
+enctounit
+put Unit 64 uchar 4
+check not memdec 309
+check eq get Mem 0 3 310
+enctounit
+put32 8 3
+put32 12 64
+seal 64
+check memdec 311
+check eq get Md 1 3 312
+check eq get Mem 40 65 313
+put32 8 2
+put32 12 40
+for i ulong 24
+put Unit add i 104 0
+end
+seal 40
+check memdec 314
+check eq get Md 1 2 315
+check eq get Mem 40 0 316
+put Mem 40 uchar 65
+check memenc 1 317
+check txbegin 318
+check eq get Tx 1 0 319
+diskput 0 4096
+check txwrite true 320
+check txflush true 321
+diskget 0
+check txread true 322
+check eq get St 0 1 323
+check eq get St 1 0 324
+mset32 0 4
+check txbegin 325
+check eq get Tx 1 1 326
+diskput 1 512
+check not txwrite false 327
+check eq get St 0 1 328
+diskget 0
+check memdec 329
+check eq get Mem 0 3 330
+mset32 0 4
+check txbegin 331
+diskput 1 4096
+check txwrite true 332
+check not txflush false 333
+check eq get St 0 1 334
+check txbegin 335
+check txwrite true 336
+check txflush true 337
+diskget 1
+put Unit 200 uchar 1
+check not txread true 338
+check eq get St 0 1 339
+check txbegin 340
+check txwrite true 341
+check txflush true 342
+check not txread false 343
+check eq get St 0 1 344
+check txbegin 345
+diskput 1 4096
+check txwrite true 346
+check txflush true 347
+diskget 1
+check txread true 348
+check eq get St 0 2 349
+check eq get St 1 1 350
+for i ulong 3
+put St i 0
+end
+diskget 1
+check loadcopy 1 351
+diskget 0
+check loadcopy 0 352
+check not loadcopy 0 362
+check eq get St 2 2 363
+check eq get St 0 2 353
+check eq get Mem 0 4 354
+put Ns 0 len Ntext
+put Ns 1 2
+put Ns 2 3
+for i ulong len Ntext
+put Note i get Ntext i
+end
+check noteenc 355
+check notedec 2 356
+check eq get Ns 0 len Ntext 357
+check not notedec 3 358
+put Unit 28 uchar 1
+check not notedec 2 359
+check eq get Ns 1 2 360
+put St 0 18446744073709551615
+check not txbegin 361
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/long-native.txt b/evidence/allen-omega-L694/long-native.txt
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/long-native.txt
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/long.wire b/evidence/allen-omega-L694/long.wire
new file mode 100644
index 00000000..40d38468
--- /dev/null
+++ b/evidence/allen-omega-L694/long.wire
@@ -0,0 +1,143 @@
+CODE 1 1/142 18056 17ab737c c /* steps.c: many small steps, each one printed. */\n#include \n\nstatic int step_1(int x)\n{\n /* step 1: multiply, add,
+CODE 1 2/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 1 + 7) % 1000003;\n}\nstatic int step_2(int x)\n{\n /* step 2: multiply, add, and
+CODE 1 3/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 2 + 14) % 1000003;\n}\nstatic int step_3(int x)\n{\n /* step 3: multiply, add, and kee
+CODE 1 4/142 18056 17ab737c c p it small \\ no tabs */\n return (x * 3 + 21) % 1000003;\n}\nstatic int step_4(int x)\n{\n /* step 4: multiply, add, and keep i
+CODE 1 5/142 18056 17ab737c c t small \\ no tabs */\n return (x * 4 + 28) % 1000003;\n}\nstatic int step_5(int x)\n{\n /* step 5: multiply, add, and keep it s
+CODE 1 6/142 18056 17ab737c c mall \\ no tabs */\n return (x * 5 + 35) % 1000003;\n}\nstatic int step_6(int x)\n{\n /* step 6: multiply, add, and keep it smal
+CODE 1 7/142 18056 17ab737c c l \\ no tabs */\n return (x * 6 + 42) % 1000003;\n}\nstatic int step_7(int x)\n{\n /* step 7: multiply, add, and keep it small \\
+CODE 1 8/142 18056 17ab737c c no tabs */\n return (x * 7 + 49) % 1000003;\n}\nstatic int step_8(int x)\n{\n /* step 8: multiply, add, and keep it small \\ no
+CODE 1 9/142 18056 17ab737c c tabs */\n return (x * 8 + 56) % 1000003;\n}\nstatic int step_9(int x)\n{\n /* step 9: multiply, add, and keep it small \\ no ta
+CODE 1 10/142 18056 17ab737c c bs */\n return (x * 9 + 63) % 1000003;\n}\nstatic int step_10(int x)\n{\n /* step 10: multiply, add, and keep it small \\ no tab
+CODE 1 11/142 18056 17ab737c c s */\n return (x * 10 + 70) % 1000003;\n}\nstatic int step_11(int x)\n{\n /* step 11: multiply, add, and keep it small \\ no tab
+CODE 1 12/142 18056 17ab737c c s */\n return (x * 11 + 77) % 1000003;\n}\nstatic int step_12(int x)\n{\n /* step 12: multiply, add, and keep it small \\ no tab
+CODE 1 13/142 18056 17ab737c c s */\n return (x * 12 + 84) % 1000003;\n}\nstatic int step_13(int x)\n{\n /* step 13: multiply, add, and keep it small \\ no tab
+CODE 1 14/142 18056 17ab737c c s */\n return (x * 13 + 91) % 1000003;\n}\nstatic int step_14(int x)\n{\n /* step 14: multiply, add, and keep it small \\ no tab
+CODE 1 15/142 18056 17ab737c c s */\n return (x * 14 + 98) % 1000003;\n}\nstatic int step_15(int x)\n{\n /* step 15: multiply, add, and keep it small \\ no tab
+CODE 1 16/142 18056 17ab737c c s */\n return (x * 15 + 105) % 1000003;\n}\nstatic int step_16(int x)\n{\n /* step 16: multiply, add, and keep it small \\ no ta
+CODE 1 17/142 18056 17ab737c c bs */\n return (x * 16 + 112) % 1000003;\n}\nstatic int step_17(int x)\n{\n /* step 17: multiply, add, and keep it small \\ no t
+CODE 1 18/142 18056 17ab737c c abs */\n return (x * 17 + 119) % 1000003;\n}\nstatic int step_18(int x)\n{\n /* step 18: multiply, add, and keep it small \\ no
+CODE 1 19/142 18056 17ab737c c tabs */\n return (x * 18 + 126) % 1000003;\n}\nstatic int step_19(int x)\n{\n /* step 19: multiply, add, and keep it small \\ no
+CODE 1 20/142 18056 17ab737c c tabs */\n return (x * 19 + 133) % 1000003;\n}\nstatic int step_20(int x)\n{\n /* step 20: multiply, add, and keep it small \\ n
+CODE 1 21/142 18056 17ab737c c o tabs */\n return (x * 20 + 140) % 1000003;\n}\nstatic int step_21(int x)\n{\n /* step 21: multiply, add, and keep it small \\
+CODE 1 22/142 18056 17ab737c c no tabs */\n return (x * 21 + 147) % 1000003;\n}\nstatic int step_22(int x)\n{\n /* step 22: multiply, add, and keep it small \\
+CODE 1 23/142 18056 17ab737c c no tabs */\n return (x * 22 + 154) % 1000003;\n}\nstatic int step_23(int x)\n{\n /* step 23: multiply, add, and keep it small
+CODE 1 24/142 18056 17ab737c c \\ no tabs */\n return (x * 23 + 161) % 1000003;\n}\nstatic int step_24(int x)\n{\n /* step 24: multiply, add, and keep it small
+CODE 1 25/142 18056 17ab737c c \\ no tabs */\n return (x * 24 + 168) % 1000003;\n}\nstatic int step_25(int x)\n{\n /* step 25: multiply, add, and keep it smal
+CODE 1 26/142 18056 17ab737c c l \\ no tabs */\n return (x * 25 + 175) % 1000003;\n}\nstatic int step_26(int x)\n{\n /* step 26: multiply, add, and keep it sma
+CODE 1 27/142 18056 17ab737c c ll \\ no tabs */\n return (x * 26 + 182) % 1000003;\n}\nstatic int step_27(int x)\n{\n /* step 27: multiply, add, and keep it sm
+CODE 1 28/142 18056 17ab737c c all \\ no tabs */\n return (x * 27 + 189) % 1000003;\n}\nstatic int step_28(int x)\n{\n /* step 28: multiply, add, and keep it s
+CODE 1 29/142 18056 17ab737c c mall \\ no tabs */\n return (x * 28 + 196) % 1000003;\n}\nstatic int step_29(int x)\n{\n /* step 29: multiply, add, and keep it
+CODE 1 30/142 18056 17ab737c c small \\ no tabs */\n return (x * 29 + 203) % 1000003;\n}\nstatic int step_30(int x)\n{\n /* step 30: multiply, add, and keep it
+CODE 1 31/142 18056 17ab737c c small \\ no tabs */\n return (x * 30 + 210) % 1000003;\n}\nstatic int step_31(int x)\n{\n /* step 31: multiply, add, and keep i
+CODE 1 32/142 18056 17ab737c c t small \\ no tabs */\n return (x * 31 + 217) % 1000003;\n}\nstatic int step_32(int x)\n{\n /* step 32: multiply, add, and keep
+CODE 1 33/142 18056 17ab737c c it small \\ no tabs */\n return (x * 32 + 224) % 1000003;\n}\nstatic int step_33(int x)\n{\n /* step 33: multiply, add, and keep
+CODE 1 34/142 18056 17ab737c c it small \\ no tabs */\n return (x * 33 + 231) % 1000003;\n}\nstatic int step_34(int x)\n{\n /* step 34: multiply, add, and kee
+CODE 1 35/142 18056 17ab737c c p it small \\ no tabs */\n return (x * 34 + 238) % 1000003;\n}\nstatic int step_35(int x)\n{\n /* step 35: multiply, add, and ke
+CODE 1 36/142 18056 17ab737c c ep it small \\ no tabs */\n return (x * 35 + 245) % 1000003;\n}\nstatic int step_36(int x)\n{\n /* step 36: multiply, add, and k
+CODE 1 37/142 18056 17ab737c c eep it small \\ no tabs */\n return (x * 36 + 252) % 1000003;\n}\nstatic int step_37(int x)\n{\n /* step 37: multiply, add, and
+CODE 1 38/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 37 + 259) % 1000003;\n}\nstatic int step_38(int x)\n{\n /* step 38: multiply, add, and
+CODE 1 39/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 38 + 266) % 1000003;\n}\nstatic int step_39(int x)\n{\n /* step 39: multiply, add, an
+CODE 1 40/142 18056 17ab737c c d keep it small \\ no tabs */\n return (x * 39 + 273) % 1000003;\n}\nstatic int step_40(int x)\n{\n /* step 40: multiply, add, a
+CODE 1 41/142 18056 17ab737c c nd keep it small \\ no tabs */\n return (x * 40 + 280) % 1000003;\n}\nstatic int step_41(int x)\n{\n /* step 41: multiply, add,
+CODE 1 42/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 41 + 287) % 1000003;\n}\nstatic int step_42(int x)\n{\n /* step 42: multiply, add,
+CODE 1 43/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 42 + 294) % 1000003;\n}\nstatic int step_43(int x)\n{\n /* step 43: multiply, add
+CODE 1 44/142 18056 17ab737c c , and keep it small \\ no tabs */\n return (x * 43 + 301) % 1000003;\n}\nstatic int step_44(int x)\n{\n /* step 44: multiply, ad
+CODE 1 45/142 18056 17ab737c c d, and keep it small \\ no tabs */\n return (x * 44 + 308) % 1000003;\n}\nstatic int step_45(int x)\n{\n /* step 45: multiply, a
+CODE 1 46/142 18056 17ab737c c dd, and keep it small \\ no tabs */\n return (x * 45 + 315) % 1000003;\n}\nstatic int step_46(int x)\n{\n /* step 46: multiply,
+CODE 1 47/142 18056 17ab737c c add, and keep it small \\ no tabs */\n return (x * 46 + 322) % 1000003;\n}\nstatic int step_47(int x)\n{\n /* step 47: multiply,
+CODE 1 48/142 18056 17ab737c c add, and keep it small \\ no tabs */\n return (x * 47 + 329) % 1000003;\n}\nstatic int step_48(int x)\n{\n /* step 48: multiply
+CODE 1 49/142 18056 17ab737c c , add, and keep it small \\ no tabs */\n return (x * 48 + 336) % 1000003;\n}\nstatic int step_49(int x)\n{\n /* step 49: multipl
+CODE 1 50/142 18056 17ab737c c y, add, and keep it small \\ no tabs */\n return (x * 49 + 343) % 1000003;\n}\nstatic int step_50(int x)\n{\n /* step 50: multip
+CODE 1 51/142 18056 17ab737c c ly, add, and keep it small \\ no tabs */\n return (x * 50 + 350) % 1000003;\n}\nstatic int step_51(int x)\n{\n /* step 51: multi
+CODE 1 52/142 18056 17ab737c c ply, add, and keep it small \\ no tabs */\n return (x * 51 + 357) % 1000003;\n}\nstatic int step_52(int x)\n{\n /* step 52: mult
+CODE 1 53/142 18056 17ab737c c iply, add, and keep it small \\ no tabs */\n return (x * 52 + 364) % 1000003;\n}\nstatic int step_53(int x)\n{\n /* step 53: mul
+CODE 1 54/142 18056 17ab737c c tiply, add, and keep it small \\ no tabs */\n return (x * 53 + 371) % 1000003;\n}\nstatic int step_54(int x)\n{\n /* step 54: mu
+CODE 1 55/142 18056 17ab737c c ltiply, add, and keep it small \\ no tabs */\n return (x * 54 + 378) % 1000003;\n}\nstatic int step_55(int x)\n{\n /* step 55: m
+CODE 1 56/142 18056 17ab737c c ultiply, add, and keep it small \\ no tabs */\n return (x * 55 + 385) % 1000003;\n}\nstatic int step_56(int x)\n{\n /* step 56:
+CODE 1 57/142 18056 17ab737c c multiply, add, and keep it small \\ no tabs */\n return (x * 56 + 392) % 1000003;\n}\nstatic int step_57(int x)\n{\n /* step 57:
+CODE 1 58/142 18056 17ab737c c multiply, add, and keep it small \\ no tabs */\n return (x * 57 + 399) % 1000003;\n}\nstatic int step_58(int x)\n{\n /* step 58
+CODE 1 59/142 18056 17ab737c c : multiply, add, and keep it small \\ no tabs */\n return (x * 58 + 406) % 1000003;\n}\nstatic int step_59(int x)\n{\n /* step 5
+CODE 1 60/142 18056 17ab737c c 9: multiply, add, and keep it small \\ no tabs */\n return (x * 59 + 413) % 1000003;\n}\nstatic int step_60(int x)\n{\n /* step
+CODE 1 61/142 18056 17ab737c c 60: multiply, add, and keep it small \\ no tabs */\n return (x * 60 + 420) % 1000003;\n}\nstatic int step_61(int x)\n{\n /* step
+CODE 1 62/142 18056 17ab737c c 61: multiply, add, and keep it small \\ no tabs */\n return (x * 61 + 427) % 1000003;\n}\nstatic int step_62(int x)\n{\n /* ste
+CODE 1 63/142 18056 17ab737c c p 62: multiply, add, and keep it small \\ no tabs */\n return (x * 62 + 434) % 1000003;\n}\nstatic int step_63(int x)\n{\n /* st
+CODE 1 64/142 18056 17ab737c c ep 63: multiply, add, and keep it small \\ no tabs */\n return (x * 63 + 441) % 1000003;\n}\nstatic int step_64(int x)\n{\n /* s
+CODE 1 65/142 18056 17ab737c c tep 64: multiply, add, and keep it small \\ no tabs */\n return (x * 64 + 448) % 1000003;\n}\nstatic int step_65(int x)\n{\n /*
+CODE 1 66/142 18056 17ab737c c step 65: multiply, add, and keep it small \\ no tabs */\n return (x * 65 + 455) % 1000003;\n}\nstatic int step_66(int x)\n{\n /*
+CODE 1 67/142 18056 17ab737c c step 66: multiply, add, and keep it small \\ no tabs */\n return (x * 66 + 462) % 1000003;\n}\nstatic int step_67(int x)\n{\n /
+CODE 1 68/142 18056 17ab737c c * step 67: multiply, add, and keep it small \\ no tabs */\n return (x * 67 + 469) % 1000003;\n}\nstatic int step_68(int x)\n{\n
+CODE 1 69/142 18056 17ab737c c /* step 68: multiply, add, and keep it small \\ no tabs */\n return (x * 68 + 476) % 1000003;\n}\nstatic int step_69(int x)\n{\n
+CODE 1 70/142 18056 17ab737c c /* step 69: multiply, add, and keep it small \\ no tabs */\n return (x * 69 + 483) % 1000003;\n}\nstatic int step_70(int x)\n{\n
+CODE 1 71/142 18056 17ab737c c /* step 70: multiply, add, and keep it small \\ no tabs */\n return (x * 70 + 490) % 1000003;\n}\nstatic int step_71(int x)\n{\n
+CODE 1 72/142 18056 17ab737c c /* step 71: multiply, add, and keep it small \\ no tabs */\n return (x * 71 + 497) % 1000003;\n}\nstatic int step_72(int x)\n{\n
+CODE 1 73/142 18056 17ab737c c /* step 72: multiply, add, and keep it small \\ no tabs */\n return (x * 72 + 504) % 1000003;\n}\nstatic int step_73(int x)\n{
+CODE 1 74/142 18056 17ab737c c \n /* step 73: multiply, add, and keep it small \\ no tabs */\n return (x * 73 + 511) % 1000003;\n}\nstatic int step_74(int x)\n
+CODE 1 75/142 18056 17ab737c c {\n /* step 74: multiply, add, and keep it small \\ no tabs */\n return (x * 74 + 518) % 1000003;\n}\nstatic int step_75(int x)
+CODE 1 76/142 18056 17ab737c c \n{\n /* step 75: multiply, add, and keep it small \\ no tabs */\n return (x * 75 + 525) % 1000003;\n}\nstatic int step_76(int x
+CODE 1 77/142 18056 17ab737c c )\n{\n /* step 76: multiply, add, and keep it small \\ no tabs */\n return (x * 76 + 532) % 1000003;\n}\nstatic int step_77(int
+CODE 1 78/142 18056 17ab737c c x)\n{\n /* step 77: multiply, add, and keep it small \\ no tabs */\n return (x * 77 + 539) % 1000003;\n}\nstatic int step_78(int
+CODE 1 79/142 18056 17ab737c c x)\n{\n /* step 78: multiply, add, and keep it small \\ no tabs */\n return (x * 78 + 546) % 1000003;\n}\nstatic int step_79(in
+CODE 1 80/142 18056 17ab737c c t x)\n{\n /* step 79: multiply, add, and keep it small \\ no tabs */\n return (x * 79 + 553) % 1000003;\n}\nstatic int step_80(i
+CODE 1 81/142 18056 17ab737c c nt x)\n{\n /* step 80: multiply, add, and keep it small \\ no tabs */\n return (x * 80 + 560) % 1000003;\n}\nstatic int step_81(
+CODE 1 82/142 18056 17ab737c c int x)\n{\n /* step 81: multiply, add, and keep it small \\ no tabs */\n return (x * 81 + 567) % 1000003;\n}\nstatic int step_82
+CODE 1 83/142 18056 17ab737c c (int x)\n{\n /* step 82: multiply, add, and keep it small \\ no tabs */\n return (x * 82 + 574) % 1000003;\n}\nstatic int step_8
+CODE 1 84/142 18056 17ab737c c 3(int x)\n{\n /* step 83: multiply, add, and keep it small \\ no tabs */\n return (x * 83 + 581) % 1000003;\n}\nstatic int step_
+CODE 1 85/142 18056 17ab737c c 84(int x)\n{\n /* step 84: multiply, add, and keep it small \\ no tabs */\n return (x * 84 + 588) % 1000003;\n}\nstatic int step
+CODE 1 86/142 18056 17ab737c c _85(int x)\n{\n /* step 85: multiply, add, and keep it small \\ no tabs */\n return (x * 85 + 595) % 1000003;\n}\nstatic int ste
+CODE 1 87/142 18056 17ab737c c p_86(int x)\n{\n /* step 86: multiply, add, and keep it small \\ no tabs */\n return (x * 86 + 602) % 1000003;\n}\nstatic int st
+CODE 1 88/142 18056 17ab737c c ep_87(int x)\n{\n /* step 87: multiply, add, and keep it small \\ no tabs */\n return (x * 87 + 609) % 1000003;\n}\nstatic int s
+CODE 1 89/142 18056 17ab737c c tep_88(int x)\n{\n /* step 88: multiply, add, and keep it small \\ no tabs */\n return (x * 88 + 616) % 1000003;\n}\nstatic int
+CODE 1 90/142 18056 17ab737c c step_89(int x)\n{\n /* step 89: multiply, add, and keep it small \\ no tabs */\n return (x * 89 + 623) % 1000003;\n}\nstatic int
+CODE 1 91/142 18056 17ab737c c step_90(int x)\n{\n /* step 90: multiply, add, and keep it small \\ no tabs */\n return (x * 90 + 630) % 1000003;\n}\nstatic in
+CODE 1 92/142 18056 17ab737c c t step_91(int x)\n{\n /* step 91: multiply, add, and keep it small \\ no tabs */\n return (x * 91 + 637) % 1000003;\n}\nstatic i
+CODE 1 93/142 18056 17ab737c c nt step_92(int x)\n{\n /* step 92: multiply, add, and keep it small \\ no tabs */\n return (x * 92 + 644) % 1000003;\n}\nstatic
+CODE 1 94/142 18056 17ab737c c int step_93(int x)\n{\n /* step 93: multiply, add, and keep it small \\ no tabs */\n return (x * 93 + 651) % 1000003;\n}\nstatic
+CODE 1 95/142 18056 17ab737c c int step_94(int x)\n{\n /* step 94: multiply, add, and keep it small \\ no tabs */\n return (x * 94 + 658) % 1000003;\n}\nstati
+CODE 1 96/142 18056 17ab737c c c int step_95(int x)\n{\n /* step 95: multiply, add, and keep it small \\ no tabs */\n return (x * 95 + 665) % 1000003;\n}\nstat
+CODE 1 97/142 18056 17ab737c c ic int step_96(int x)\n{\n /* step 96: multiply, add, and keep it small \\ no tabs */\n return (x * 96 + 672) % 1000003;\n}\nsta
+CODE 1 98/142 18056 17ab737c c tic int step_97(int x)\n{\n /* step 97: multiply, add, and keep it small \\ no tabs */\n return (x * 97 + 679) % 1000003;\n}\nst
+CODE 1 99/142 18056 17ab737c c atic int step_98(int x)\n{\n /* step 98: multiply, add, and keep it small \\ no tabs */\n return (x * 98 + 686) % 1000003;\n}\ns
+CODE 1 100/142 18056 17ab737c c tatic int step_99(int x)\n{\n /* step 99: multiply, add, and keep it small \\ no tabs */\n return (x * 99 + 693) % 1000003;\n}\n
+CODE 1 101/142 18056 17ab737c c static int step_100(int x)\n{\n /* step 100: multiply, add, and keep it small \\ no tabs */\n return (x * 100 + 700) % 1000003
+CODE 1 102/142 18056 17ab737c c ;\n}\nstatic int step_101(int x)\n{\n /* step 101: multiply, add, and keep it small \\ no tabs */\n return (x * 101 + 707) % 100
+CODE 1 103/142 18056 17ab737c c 0003;\n}\nstatic int step_102(int x)\n{\n /* step 102: multiply, add, and keep it small \\ no tabs */\n return (x * 102 + 714) %
+CODE 1 104/142 18056 17ab737c c 1000003;\n}\nstatic int step_103(int x)\n{\n /* step 103: multiply, add, and keep it small \\ no tabs */\n return (x * 103 + 72
+CODE 1 105/142 18056 17ab737c c 1) % 1000003;\n}\nstatic int step_104(int x)\n{\n /* step 104: multiply, add, and keep it small \\ no tabs */\n return (x * 104
+CODE 1 106/142 18056 17ab737c c + 728) % 1000003;\n}\nstatic int step_105(int x)\n{\n /* step 105: multiply, add, and keep it small \\ no tabs */\n return (x *
+CODE 1 107/142 18056 17ab737c c 105 + 735) % 1000003;\n}\nstatic int step_106(int x)\n{\n /* step 106: multiply, add, and keep it small \\ no tabs */\n return (
+CODE 1 108/142 18056 17ab737c c x * 106 + 742) % 1000003;\n}\nstatic int step_107(int x)\n{\n /* step 107: multiply, add, and keep it small \\ no tabs */\n retu
+CODE 1 109/142 18056 17ab737c c rn (x * 107 + 749) % 1000003;\n}\nstatic int step_108(int x)\n{\n /* step 108: multiply, add, and keep it small \\ no tabs */\n
+CODE 1 110/142 18056 17ab737c c return (x * 108 + 756) % 1000003;\n}\nstatic int step_109(int x)\n{\n /* step 109: multiply, add, and keep it small \\ no tabs */\n
+CODE 1 111/142 18056 17ab737c c return (x * 109 + 763) % 1000003;\n}\nstatic int step_110(int x)\n{\n /* step 110: multiply, add, and keep it small \\ no tabs
+CODE 1 112/142 18056 17ab737c c */\n return (x * 110 + 770) % 1000003;\n}\nstatic int step_111(int x)\n{\n /* step 111: multiply, add, and keep it small \\ no
+CODE 1 113/142 18056 17ab737c c tabs */\n return (x * 111 + 777) % 1000003;\n}\nstatic int step_112(int x)\n{\n /* step 112: multiply, add, and keep it small \\
+CODE 1 114/142 18056 17ab737c c no tabs */\n return (x * 112 + 784) % 1000003;\n}\nstatic int step_113(int x)\n{\n /* step 113: multiply, add, and keep it sma
+CODE 1 115/142 18056 17ab737c c ll \\ no tabs */\n return (x * 113 + 791) % 1000003;\n}\nstatic int step_114(int x)\n{\n /* step 114: multiply, add, and keep it
+CODE 1 116/142 18056 17ab737c c small \\ no tabs */\n return (x * 114 + 798) % 1000003;\n}\nstatic int step_115(int x)\n{\n /* step 115: multiply, add, and kee
+CODE 1 117/142 18056 17ab737c c p it small \\ no tabs */\n return (x * 115 + 805) % 1000003;\n}\nstatic int step_116(int x)\n{\n /* step 116: multiply, add, and
+CODE 1 118/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 116 + 812) % 1000003;\n}\nstatic int step_117(int x)\n{\n /* step 117: multiply, add,
+CODE 1 119/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 117 + 819) % 1000003;\n}\nstatic int step_118(int x)\n{\n /* step 118: multiply,
+CODE 1 120/142 18056 17ab737c c add, and keep it small \\ no tabs */\n return (x * 118 + 826) % 1000003;\n}\nstatic int step_119(int x)\n{\n /* step 119: multip
+CODE 1 121/142 18056 17ab737c c ly, add, and keep it small \\ no tabs */\n return (x * 119 + 833) % 1000003;\n}\nstatic int step_120(int x)\n{\n /* step 120: mu
+CODE 1 122/142 18056 17ab737c c ltiply, add, and keep it small \\ no tabs */\n return (x * 120 + 840) % 1000003;\n}\n\nint main(void)\n{\n int x = 1;\n x = ste
+CODE 1 123/142 18056 17ab737c c p_1(x);\n x = step_2(x);\n x = step_3(x);\n x = step_4(x);\n x = step_5(x);\n x = step_6(x);\n x = step_7(x);\n x
+CODE 1 124/142 18056 17ab737c c = step_8(x);\n x = step_9(x);\n x = step_10(x);\n x = step_11(x);\n x = step_12(x);\n x = step_13(x);\n x = step_14(
+CODE 1 125/142 18056 17ab737c c x);\n x = step_15(x);\n x = step_16(x);\n x = step_17(x);\n x = step_18(x);\n x = step_19(x);\n x = step_20(x);\n
+CODE 1 126/142 18056 17ab737c c x = step_21(x);\n x = step_22(x);\n x = step_23(x);\n x = step_24(x);\n x = step_25(x);\n x = step_26(x);\n x = step
+CODE 1 127/142 18056 17ab737c c _27(x);\n x = step_28(x);\n x = step_29(x);\n x = step_30(x);\n x = step_31(x);\n x = step_32(x);\n x = step_33(x);\n
+CODE 1 128/142 18056 17ab737c c x = step_34(x);\n x = step_35(x);\n x = step_36(x);\n x = step_37(x);\n x = step_38(x);\n x = step_39(x);\n x =
+CODE 1 129/142 18056 17ab737c c step_40(x);\n x = step_41(x);\n x = step_42(x);\n x = step_43(x);\n x = step_44(x);\n x = step_45(x);\n x = step_46(
+CODE 1 130/142 18056 17ab737c c x);\n x = step_47(x);\n x = step_48(x);\n x = step_49(x);\n x = step_50(x);\n x = step_51(x);\n x = step_52(x);\n
+CODE 1 131/142 18056 17ab737c c x = step_53(x);\n x = step_54(x);\n x = step_55(x);\n x = step_56(x);\n x = step_57(x);\n x = step_58(x);\n x = step
+CODE 1 132/142 18056 17ab737c c _59(x);\n x = step_60(x);\n x = step_61(x);\n x = step_62(x);\n x = step_63(x);\n x = step_64(x);\n x = step_65(x);\n
+CODE 1 133/142 18056 17ab737c c x = step_66(x);\n x = step_67(x);\n x = step_68(x);\n x = step_69(x);\n x = step_70(x);\n x = step_71(x);\n x =
+CODE 1 134/142 18056 17ab737c c step_72(x);\n x = step_73(x);\n x = step_74(x);\n x = step_75(x);\n x = step_76(x);\n x = step_77(x);\n x = step_78(
+CODE 1 135/142 18056 17ab737c c x);\n x = step_79(x);\n x = step_80(x);\n x = step_81(x);\n x = step_82(x);\n x = step_83(x);\n x = step_84(x);\n
+CODE 1 136/142 18056 17ab737c c x = step_85(x);\n x = step_86(x);\n x = step_87(x);\n x = step_88(x);\n x = step_89(x);\n x = step_90(x);\n x = step
+CODE 1 137/142 18056 17ab737c c _91(x);\n x = step_92(x);\n x = step_93(x);\n x = step_94(x);\n x = step_95(x);\n x = step_96(x);\n x = step_97(x);\n
+CODE 1 138/142 18056 17ab737c c x = step_98(x);\n x = step_99(x);\n x = step_100(x);\n x = step_101(x);\n x = step_102(x);\n x = step_103(x);\n
+CODE 1 139/142 18056 17ab737c c x = step_104(x);\n x = step_105(x);\n x = step_106(x);\n x = step_107(x);\n x = step_108(x);\n x = step_109(x);\n x
+CODE 1 140/142 18056 17ab737c c = step_110(x);\n x = step_111(x);\n x = step_112(x);\n x = step_113(x);\n x = step_114(x);\n x = step_115(x);\n x =
+CODE 1 141/142 18056 17ab737c c step_116(x);\n x = step_117(x);\n x = step_118(x);\n x = step_119(x);\n x = step_120(x);\n printf("%d\\n", x);\n retu
+CODE 1 142/142 18056 17ab737c c rn 0;\n}\n
+SAY 1 1/1 Here is a long C program with many small steps, built with cc steps.c.
diff --git a/evidence/allen-omega-L694/memory-native.bin b/evidence/allen-omega-L694/memory-native.bin
new file mode 100644
index 00000000..f7d9769d
Binary files /dev/null and b/evidence/allen-omega-L694/memory-native.bin differ
diff --git a/evidence/allen-omega-L694/memory1.txt b/evidence/allen-omega-L694/memory1.txt
new file mode 100644
index 00000000..fc84db4b
--- /dev/null
+++ b/evidence/allen-omega-L694/memory1.txt
@@ -0,0 +1,61 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+361 0
diff --git a/evidence/allen-omega-L694/mind-component.ppm b/evidence/allen-omega-L694/mind-component.ppm
new file mode 100644
index 00000000..079e3eb1
Binary files /dev/null and b/evidence/allen-omega-L694/mind-component.ppm differ
diff --git a/evidence/allen-omega-L694/native-counts.txt b/evidence/allen-omega-L694/native-counts.txt
new file mode 100644
index 00000000..27785b93
--- /dev/null
+++ b/evidence/allen-omega-L694/native-counts.txt
@@ -0,0 +1,13 @@
+ 28 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/runtime.log
+ 23 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/code.log
+ 24 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/courier.log
+ 79 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/memory.log
+ 8 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/intent.log
+ 15 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/reply.log
+ 13 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/view.log
+ 14 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/scene.log
+ 11 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/paint.log
+ 352 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/edges.log
+ 20 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/short.log
+ 292 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/long.log
+ 879 total
diff --git a/evidence/allen-omega-L694/paint2.txt b/evidence/allen-omega-L694/paint2.txt
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/paint2.txt
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/parent-replay/README.md b/evidence/allen-omega-L694/parent-replay/README.md
new file mode 100644
index 00000000..4ca3feee
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/README.md
@@ -0,0 +1,5 @@
+# Independent parent replay of 8049f5d
+
+Fresh Git archive, pinned seed compiler, full native gate exit0. Programmatically recounted879 successful checks; five compiled mutants fail3/2/2/7/1; exact memory and stdio goldens match. Standalone allen SHA256 c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8. Rendering was inspected: one soft white point and blue-violet halo on black, no visible corruption; it is a primitive, not full UI parity.
+
+Original sandbox failure preserved. Full allen-courier legacy package replay outside that worker sandbox passes26 main+3 scene tests, including all four EPERM failures. This does NOT replace the full strict repository gate: its parent replay is separately running. Independent review L719 pending. Portable compatibility, native x86/providers, iMac QEMU and hardware remain incomplete. No READY or deployment.
diff --git a/evidence/allen-omega-L694/parent-replay/binaries.sha256 b/evidence/allen-omega-L694/parent-replay/binaries.sha256
new file mode 100644
index 00000000..17e3b41f
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/binaries.sha256
@@ -0,0 +1,19 @@
+da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/readback-mutant
+798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/view
+c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/allen
+ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/reply
+f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/hash-mutant
+0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/golden
+d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/session-mutant
+bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/intent
+9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/fixture
+52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/runtime
+b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/code
+d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/edges
+87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/render
+7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/stale-mutant
+3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/courier
+44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/scene
+fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/paint
+0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/crc-mutant
+1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/memory
diff --git a/evidence/allen-omega-L694/parent-replay/code.log b/evidence/allen-omega-L694/parent-replay/code.log
new file mode 100644
index 00000000..e7e197b7
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/code.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/parent-replay/courier.log b/evidence/allen-omega-L694/parent-replay/courier.log
new file mode 100644
index 00000000..8402df49
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/courier.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 0
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/parent-replay/crc-mutant.log b/evidence/allen-omega-L694/parent-replay/crc-mutant.log
new file mode 100644
index 00000000..a0d90bd4
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/crc-mutant.log
@@ -0,0 +1,23 @@
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 1
+117 1
+118 0
+119 0
+120 0
+121 0
+122 0
+123 0
diff --git a/evidence/allen-omega-L694/parent-replay/edges.log b/evidence/allen-omega-L694/parent-replay/edges.log
new file mode 100644
index 00000000..e8d0deea
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/edges.log
@@ -0,0 +1,352 @@
+1201 0
+1202 0
+1203 0
+1204 0
+1205 0
+1206 0
+1207 0
+1208 0
+1209 0
+1210 0
+1211 0
+1212 0
+1213 0
+1214 0
+1220 0
+1221 0
+1222 0
+1223 0
+1224 0
+1225 0
+1226 0
+1227 0
+1228 0
+1229 0
+1230 0
+1231 0
+1232 0
+1233 0
+1234 0
+1235 0
+1236 0
+1237 0
+1238 0
+1239 0
+1240 0
+1241 0
+1242 0
+1243 0
+1244 0
+1245 0
+1246 0
+1247 0
+1248 0
+1249 0
+1250 0
+1251 0
+1252 0
+1253 0
+1254 0
+1255 0
+1256 0
+1257 0
+1258 0
+1259 0
+1260 0
+1261 0
+1262 0
+1301 0
+1302 0
+1303 0
+1304 0
+1305 0
+1306 0
+1310 0
+1311 0
+1312 0
+1313 0
+1314 0
+1315 0
+1316 0
+1317 0
+1318 0
+1319 0
+1320 0
+1321 0
+1322 0
+1323 0
+1324 0
+1325 0
+1326 0
+1327 0
+1328 0
+1329 0
+1330 0
+1331 0
+1332 0
+1333 0
+1334 0
+1335 0
+1336 0
+1337 0
+1338 0
+1339 0
+1340 0
+1341 0
+1342 0
+1343 0
+1344 0
+1345 0
+1346 0
+1347 0
+1348 0
+1349 0
+1350 0
+1351 0
+1352 0
+1353 0
+1354 0
+1355 0
+1356 0
+1357 0
+1358 0
+1359 0
+1360 0
+1361 0
+1362 0
+1363 0
+1364 0
+1365 0
+1366 0
+1367 0
+1368 0
+1369 0
+1370 0
+1371 0
+1372 0
+1373 0
+1374 0
+1375 0
+1376 0
+1377 0
+1378 0
+1379 0
+1380 0
+1381 0
+1382 0
+1383 0
+1384 0
+1385 0
+1386 0
+1387 0
+1388 0
+1389 0
+1390 0
+1391 0
+1392 0
+1393 0
+1394 0
+1395 0
+1396 0
+1397 0
+1398 0
+1399 0
+1400 0
+1401 0
+1402 0
+1403 0
+1404 0
+1405 0
+1406 0
+1407 0
+1408 0
+1409 0
+1410 0
+1411 0
+1412 0
+1413 0
+1414 0
+1415 0
+1416 0
+1417 0
+1418 0
+1419 0
+1420 0
+1421 0
+1422 0
+1423 0
+1424 0
+1425 0
+1426 0
+1427 0
+1428 0
+1429 0
+1430 0
+1431 0
+1432 0
+1433 0
+1434 0
+1435 0
+1436 0
+1437 0
+1438 0
+1439 0
+1440 0
+1441 0
+1442 0
+1443 0
+1444 0
+1445 0
+1446 0
+1447 0
+1448 0
+1449 0
+1450 0
+1451 0
+1452 0
+1453 0
+1454 0
+1455 0
+1456 0
+1457 0
+1458 0
+1459 0
+1460 0
+1461 0
+1462 0
+1463 0
+1464 0
+1465 0
+1466 0
+1467 0
+1468 0
+1469 0
+1470 0
+1471 0
+1472 0
+1473 0
+1474 0
+1475 0
+1476 0
+1477 0
+1478 0
+1479 0
+1480 0
+1481 0
+1482 0
+1483 0
+1484 0
+1485 0
+1486 0
+1487 0
+1488 0
+1489 0
+1490 0
+1491 0
+1492 0
+1493 0
+1494 0
+1495 0
+1496 0
+1497 0
+1498 0
+1499 0
+1500 0
+1501 0
+1502 0
+1503 0
+1504 0
+1505 0
+1506 0
+1507 0
+1508 0
+1509 0
+1510 0
+1511 0
+1512 0
+1513 0
+1514 0
+1515 0
+1516 0
+1517 0
+1518 0
+1519 0
+1520 0
+1521 0
+1522 0
+1523 0
+1524 0
+1525 0
+1526 0
+1527 0
+1528 0
+1529 0
+1530 0
+1531 0
+1532 0
+1533 0
+1534 0
+1535 0
+1536 0
+1537 0
+1538 0
+1539 0
+1540 0
+1541 0
+1542 0
+1543 0
+1544 0
+1545 0
+1546 0
+1547 0
+1548 0
+1549 0
+1550 0
+1551 0
+1552 0
+1553 0
+1554 0
+1555 0
+1556 0
+1557 0
+1558 0
+1559 0
+1560 0
+1561 0
+1562 0
+1563 0
+1564 0
+1565 0
+1570 0
+1571 0
+1572 0
+1575 0
+1573 0
+1574 0
+1600 0
+1601 0
+1602 0
+1603 0
+1604 0
+1605 0
+1606 0
+1607 0
+1610 0
+1611 0
+1612 0
+1613 0
+1614 0
+1615 0
+1616 0
+1617 0
+1701 0
+1702 0
+1703 0
+1704 0
+1705 0
+1706 0
+1707 0
+1708 0
+1709 0
+1710 0
+1711 0
diff --git a/evidence/allen-omega-L694/parent-replay/exit-code b/evidence/allen-omega-L694/parent-replay/exit-code
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/exit-code
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/parent-replay/gate.log b/evidence/allen-omega-L694/parent-replay/gate.log
new file mode 100644
index 00000000..aebe5e83
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/gate.log
@@ -0,0 +1,20 @@
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/parent-replay/hash-mutant.log b/evidence/allen-omega-L694/parent-replay/hash-mutant.log
new file mode 100644
index 00000000..c75cfefb
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/hash-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 1
+310 1
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/parent-replay/intent.log b/evidence/allen-omega-L694/parent-replay/intent.log
new file mode 100644
index 00000000..5371bd36
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/intent.log
@@ -0,0 +1,8 @@
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
diff --git a/evidence/allen-omega-L694/parent-replay/legacy-courier-tests.log b/evidence/allen-omega-L694/parent-replay/legacy-courier-tests.log
new file mode 100644
index 00000000..73b6f3a9
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/legacy-courier-tests.log
@@ -0,0 +1,42 @@
+ Finished `test` profile [unoptimized + debuginfo] target(s) in 0.06s
+ Running unittests src/main.rs (target/debug/deps/allen_courier-e491f6ef3b9d347e)
+
+running 26 tests
+test code::tests::an_unclosed_block_runs_to_the_end_and_no_block_is_none ... ok
+test code::tests::a_sentence_and_a_fenced_block_are_read ... ok
+test code::tests::crc_is_zlibs ... ok
+test code::tests::short_names_and_odd_bytes_are_made_plain ... ok
+test plain_tests::a_cut_answer_stays_within_the_room_with_its_mark ... ok
+test tests::a_busy_server_is_asked_again_with_growing_waits ... ok
+test plain_tests::typographic_marks_become_plain_ones ... ok
+test tests::a_busy_server_names_its_wait_exactly ... ok
+test tests::a_job_line_carries_the_memory_fields ... ok
+test tests::a_sentence_end_too_early_is_not_used ... ok
+test tests::datagram_heads_round_trip ... ok
+test tests::a_code_reply_becomes_pieces_and_a_closing_sentence ... ok
+test key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back ... ok
+test tests::dates_are_civil ... ok
+test tests::chunked_bodies_are_joined ... ok
+test key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so ... ok
+test key_tests::no_key_sends_no_header_and_https_is_refused_out_loud ... ok
+test tests::json_strings_round_trip ... ok
+test tests::long_answers_are_cut_at_a_sentence_end ... ok
+test tests::short_answers_pass_whole_with_whitespace_folded ... ok
+test tests::words_on_the_wire ... ok
+test tests::the_assistant_text_is_found_in_a_chat_completion ... ok
+test tests::what_was_already_said_in_parts_is_kept ... ok
+test code::tests::long_code_is_cut_at_a_line_within_the_limits ... ok
+test tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns ... ok
+test code::tests::pieces_carry_length_checksum_and_escapes ... ok
+
+test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/bin/allen-scene.rs (target/debug/deps/allen_scene-8a13abc9d8fd96a0)
+
+running 3 tests
+test tests::replies_and_numbers_are_read_from_a_completion ... ok
+test tests::the_prompt_is_plain_and_names_every_kind ... ok
+test tests::slugs_and_waits ... ok
+
+test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
diff --git a/evidence/allen-omega-L694/parent-replay/long.log b/evidence/allen-omega-L694/parent-replay/long.log
new file mode 100644
index 00000000..0a060bc8
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/long.log
@@ -0,0 +1,292 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+415 0
+416 0
+417 0
+418 0
+419 0
+420 0
+421 0
+422 0
+423 0
+424 0
+425 0
+426 0
+427 0
+428 0
+429 0
+430 0
+431 0
+432 0
+433 0
+434 0
+435 0
+436 0
+437 0
+438 0
+439 0
+440 0
+441 0
+442 0
+443 0
+444 0
+445 0
+446 0
+447 0
+448 0
+449 0
+450 0
+451 0
+452 0
+453 0
+454 0
+455 0
+456 0
+457 0
+458 0
+459 0
+460 0
+461 0
+462 0
+463 0
+464 0
+465 0
+466 0
+467 0
+468 0
+469 0
+470 0
+471 0
+472 0
+473 0
+474 0
+475 0
+476 0
+477 0
+478 0
+479 0
+480 0
+481 0
+482 0
+483 0
+484 0
+485 0
+486 0
+487 0
+488 0
+489 0
+490 0
+491 0
+492 0
+493 0
+494 0
+495 0
+496 0
+497 0
+498 0
+499 0
+500 0
+501 0
+502 0
+503 0
+504 0
+505 0
+506 0
+507 0
+508 0
+509 0
+510 0
+511 0
+512 0
+513 0
+514 0
+515 0
+516 0
+517 0
+518 0
+519 0
+520 0
+521 0
+522 0
+523 0
+524 0
+525 0
+526 0
+527 0
+528 0
+529 0
+530 0
+531 0
+532 0
+533 0
+534 0
+535 0
+536 0
+537 0
+538 0
+539 0
+540 0
+541 0
+542 0
+543 0
+544 0
+545 0
+546 0
+547 0
+548 0
+549 0
+550 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+706 0
+707 0
+708 0
+709 0
+710 0
+711 0
+712 0
+713 0
+714 0
+715 0
+716 0
+717 0
+718 0
+719 0
+720 0
+721 0
+722 0
+723 0
+724 0
+725 0
+726 0
+727 0
+728 0
+729 0
+730 0
+731 0
+732 0
+733 0
+734 0
+735 0
+736 0
+737 0
+738 0
+739 0
+740 0
+741 0
+742 0
+743 0
+744 0
+745 0
+746 0
+747 0
+748 0
+749 0
+750 0
+751 0
+752 0
+753 0
+754 0
+755 0
+756 0
+757 0
+758 0
+759 0
+760 0
+761 0
+762 0
+763 0
+764 0
+765 0
+766 0
+767 0
+768 0
+769 0
+770 0
+771 0
+772 0
+773 0
+774 0
+775 0
+776 0
+777 0
+778 0
+779 0
+780 0
+781 0
+782 0
+783 0
+784 0
+785 0
+786 0
+787 0
+788 0
+789 0
+790 0
+791 0
+792 0
+793 0
+794 0
+795 0
+796 0
+797 0
+798 0
+799 0
+800 0
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
+816 0
+817 0
+818 0
+819 0
+820 0
+821 0
+822 0
+823 0
+824 0
+825 0
+826 0
+827 0
+828 0
+829 0
+830 0
+831 0
+832 0
+833 0
+834 0
+835 0
+836 0
+837 0
+838 0
+839 0
+840 0
+841 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/parent-replay/memory.log b/evidence/allen-omega-L694/parent-replay/memory.log
new file mode 100644
index 00000000..5928102e
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/memory.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 0
+339 0
+340 0
+341 0
+342 0
+343 0
+344 0
+345 0
+346 0
+347 0
+348 0
+349 0
+350 0
+351 0
+352 0
+362 0
+363 0
+353 0
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 0
+361 0
diff --git a/evidence/allen-omega-L694/parent-replay/paint.log b/evidence/allen-omega-L694/parent-replay/paint.log
new file mode 100644
index 00000000..281a5bd2
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/paint.log
@@ -0,0 +1,11 @@
+1101 0
+1102 0
+1103 0
+1104 0
+1105 0
+1106 0
+1107 0
+1108 0
+1109 0
+1110 0
+1111 0
diff --git a/evidence/allen-omega-L694/parent-replay/readback-mutant.log b/evidence/allen-omega-L694/parent-replay/readback-mutant.log
new file mode 100644
index 00000000..268002ad
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/readback-mutant.log
@@ -0,0 +1,79 @@
+301 0
+302 0
+303 0
+304 0
+305 0
+306 0
+307 0
+308 0
+309 0
+310 0
+311 0
+312 0
+313 0
+314 0
+315 0
+316 0
+317 0
+318 0
+319 0
+320 0
+321 0
+322 0
+323 0
+324 0
+325 0
+326 0
+327 0
+328 0
+329 0
+330 0
+331 0
+332 0
+333 0
+334 0
+335 0
+336 0
+337 0
+338 1
+339 1
+340 0
+341 0
+342 0
+343 0
+344 1
+345 0
+346 0
+347 0
+348 0
+349 1
+350 1
+351 0
+352 0
+362 0
+363 0
+353 1
+354 0
+355 0
+356 0
+357 0
+358 0
+359 0
+360 0
+364 0
+365 0
+366 0
+367 0
+368 0
+369 0
+370 0
+371 0
+372 0
+373 0
+374 0
+375 0
+376 0
+377 0
+378 0
+379 1
+361 0
diff --git a/evidence/allen-omega-L694/parent-replay/reply.log b/evidence/allen-omega-L694/parent-replay/reply.log
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/reply.log
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/parent-replay/runtime.log b/evidence/allen-omega-L694/parent-replay/runtime.log
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/runtime.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/parent-replay/scene.log b/evidence/allen-omega-L694/parent-replay/scene.log
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/scene.log
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/parent-replay/session-mutant.log b/evidence/allen-omega-L694/parent-replay/session-mutant.log
new file mode 100644
index 00000000..9ce7ef78
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/session-mutant.log
@@ -0,0 +1,24 @@
+201 0
+202 0
+203 0
+204 0
+205 0
+206 0
+207 0
+208 1
+209 0
+210 0
+211 0
+212 0
+213 0
+214 0
+215 0
+216 0
+217 0
+218 0
+219 0
+220 0
+221 0
+222 0
+223 0
+224 0
diff --git a/evidence/allen-omega-L694/parent-replay/short.log b/evidence/allen-omega-L694/parent-replay/short.log
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/short.log
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/parent-replay/source.sha256 b/evidence/allen-omega-L694/parent-replay/source.sha256
new file mode 100644
index 00000000..1ed3c753
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/source.sha256
@@ -0,0 +1,34 @@
+184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om
+795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh
+4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om
+76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om
+357481ea27a68a4d452c97017dad70fe11566612951d71e947549c1de8441846 native/omega/allen/gate.sh
+9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh
+06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om
+2346077ef78cf54124f777016cf44e1034546f400bb6642e73713c8987875f0f native/omega/allen/main.om
+068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om
+b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om
+46ba5562bcbbd808e6557f1f49e296e022c292ea0b718b1516312f10a9828cca native/omega/allen/README.md
+e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om
+5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om
+c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om
+f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om
+b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om
+98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om
+f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om
+a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om
+c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om
+8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om
+861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om
+13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om
+e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om
+8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om
+094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om
+bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om
+b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om
+89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om
+0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE
+b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md
+992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om
+0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om
+abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om
diff --git a/evidence/allen-omega-L694/parent-replay/stale-mutant.log b/evidence/allen-omega-L694/parent-replay/stale-mutant.log
new file mode 100644
index 00000000..ac2e3d09
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/stale-mutant.log
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 1
+7 1
+8 1
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/parent-replay/view.log b/evidence/allen-omega-L694/parent-replay/view.log
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-replay/view.log
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-omega-L694/parent-strict/README.md b/evidence/allen-omega-L694/parent-strict/README.md
new file mode 100644
index 00000000..f6109bef
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-strict/README.md
@@ -0,0 +1,20 @@
+# Parent strict repository replay
+
+Command: `AIENOS_STRICT=1 quiet-build bash scripts/verify_all.sh`
+
+Actual subprocess exit: **0**. Final result: **VERIFY_ALL: PASS**, every step ran.
+QEMU results are emulator evidence only; physical hardware remains NOT_RUN.
+This resolves the earlier sandbox-limited broad verification attempt by running
+outside that sandbox, without skipping checks or weakening assertions.
+
+The command ran while the branch advanced through native Omega-only changes and
+published receipts. It is not an immutable whole-head qualification. Parent
+verified that no tracked source outside `native/omega/allen` and this lane's
+evidence changed since8049f5d. The native Omega implementation is qualified by its
+separate frozen-source1092-check/seven-mutant receipt and independent review.
+This broad legacy suite does not prove Omega socket/device integration or an
+Omega iMac boot. L694 remains open.
+
+Raw log SHA-256: `ad344f3a507cdaa79edc24b0cc4b4cbd31de800a73533a59b8f156ddddf2abf9`.
+Completion notification: `proc_4916b116cca8`, consumed and verified from the
+remote exit sentinel and raw final verdict. No duplicate run was launched.
diff --git a/evidence/allen-omega-L694/parent-strict/exit-code b/evidence/allen-omega-L694/parent-strict/exit-code
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-strict/exit-code
@@ -0,0 +1 @@
+0
diff --git a/evidence/allen-omega-L694/parent-strict/verify-all.log b/evidence/allen-omega-L694/parent-strict/verify-all.log
new file mode 100644
index 00000000..248426f2
--- /dev/null
+++ b/evidence/allen-omega-L694/parent-strict/verify-all.log
@@ -0,0 +1,1998 @@
+============================================================
+AIENOS Integration Verification Harness
+Host: spark-b87b | Arch: aarch64 | Kernel: 7.0.0-1019-nvidia
+Date: 2026-10-23T11:47:09Z
+Strict: 1 | Serial log dir: none
+============================================================
+
+--- [Gate 1 Verification: Config A Freeze] ---
+Config A capture verified for spark-b87b: 5 samples, mean decode 54.2 tokens/s
+M0 closable: no (recovery procedure is documented_only; native boot rollback has not been tested on Machine 1)
+PASS Gate 1 Config A reference bundle verified
+
+--- [Formatting: cargo fmt --check] ---
+PASS formatting: cargo fmt --all --check
+
+--- [Host Component Testing: Workspace Crates] ---
+ Finished `test` profile [unoptimized + debuginfo] target(s) in 0.02s
+ Running unittests src/lib.rs (target/debug/deps/aienos_accel-d25eb76ec36d0a33)
+
+running 16 tests
+test pci::tests::capability_list_absence_is_empty_not_error ... ok
+test pci::tests::decodes_bridge_header_and_window ... ok
+test pci::tests::decodes_msi_msix_and_pcie ... ok
+test pci::tests::decodes_bar_sizes_with_bounds ... ok
+test pci::tests::decodes_standard_header_and_64_bit_bar ... ok
+test pci::tests::rejects_capability_loop_and_out_of_bounds ... ok
+test pci::tests::rejects_reserved_bar_encodings ... ok
+test pci::tests::rejects_truncated_header_and_bridge_type ... ok
+test pci::tests::walks_extended_capabilities_with_loop_and_bounds_checks ... ok
+test profile::tests::match_gb10_is_property_based_not_bdf_based ... ok
+test profile::tests::profile_classifies_source_and_native_verification ... ok
+test registers::tests::ledger_is_exactly_the_two_established_offsets ... ok
+test registers::tests::ledger_renders_without_claiming_semantics ... ok
+test profile::tests::profile_renders_deterministically ... ok
+test tests::diagnostics_report_refused_opens_segments_and_bar_state ... ok
+test tests::validates_gb10_memory_bar ... ok
+
+test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/gb10_fixtures.rs (target/debug/deps/gb10_fixtures-a1e328f7018003cd)
+
+running 10 tests
+test follows_a_secondary_bus_window_to_a_downstream_gb10 ... ok
+test decodes_capabilities_from_full_config_space ... ok
+test identifies_gb10_from_properties_under_bdf_relocation ... ok
+test handles_large_bar_and_extended_space_bounds ... ok
+test profile_decodes_bar_kinds_and_keeps_sizes_unknown ... ok
+test rejects_disabled_memory_decoding_unprogrammed_and_32_bit_bar ... ok
+test rejects_malformed_capability_loops ... ok
+test rejects_wrong_vendor_and_wrong_device ... ok
+test reports_missing_msi_and_msix_as_absent_not_zero ... ok
+test selects_the_gb10_among_multiple_nvidia_devices ... ok
+
+test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_aegis-8549be8b0aa8de31)
+
+running 6 tests
+test capability::tests::filesystem_scope_rejects_sibling_and_traversal_paths ... ok
+test broker::tests::claimed_world_cannot_authorize_network_or_escaped_filesystem_effects ... ok
+test effect::tests::intent_id_distinguishes_parameter_boundaries ... ok
+test broker::tests::world_bound_write_uses_delta_and_rollback_discards_it ... ok
+test capability::tests::test_capability_attenuation_and_cascading_revocation ... ok
+test broker::tests::test_aegis_reversible_vs_irreversible_enforcement ... ok
+
+test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/phase_3_to_5_integration.rs (target/debug/deps/phase_3_to_5_integration-b5f8a680ff6a79fb)
+
+running 1 test
+test test_full_agent_epistemic_capability_and_c1_lifecycle ... ok
+
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.18s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_agent_state-158f10fde7b3594d)
+
+running 22 tests
+test history::tests::test_token_history_rolling_hash ... ok
+test id::tests::test_agent_id_determinism ... ok
+test id::tests::test_branch_id_derivation ... ok
+test lineage::tests::test_lineage_extension ... ok
+test manager::tests::re_registering_an_existing_identity_does_not_reset_its_root_branch ... ok
+test manager::tests::restore_refuses_checkpoint_without_durable_identity ... ok
+test manager::tests::test_suspend_resume_lifecycle_and_tamper_rejection ... ok
+test manager::tests::restore_rebuilds_fork_counters_without_reusing_branch_ids ... ok
+test manager::tests::restore_rejects_noncontiguous_persisted_fork_indexes ... ok
+test manager::tests::restore_rejects_duplicate_agent_identity ... ok
+test manager::tests::restore_rejects_child_id_not_derived_from_fork_index ... ok
+test manager::tests::restore_rejects_duplicate_branch_identity ... ok
+test manager::tests::restore_rejects_branch_with_missing_parent ... ok
+test manager::tests::restore_rejects_missing_root_branch ... ok
+test manager::tests::restore_rejects_branch_of_absent_agent ... ok
+test manager::tests::restore_rejects_parentless_non_root_branch ... ok
+test manager::tests::restore_round_trips_branches_and_next_fork_indexes_exactly ... ok
+test manager::tests::test_checkpoint_reboot_and_reconstruction ... ok
+test manager::tests::re_registering_keeps_forked_branches_and_fork_indexes ... ok
+test manager::tests::checkpoint_bytes_are_stable_across_restore ... ok
+test manager::tests::restore_rejects_inconsistent_lineage ... ok
+test manager::tests::restore_rejects_inconsistent_root_branch ... ok
+
+test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_artifact-cdcd8a005937d2db)
+
+running 24 tests
+test receipt_tests::decision_consistency_rules_are_enforced ... ok
+test receipt_tests::canary_failed_decision_and_status_must_agree ... ok
+test receipt_tests::layout_matches_adr_table_offsets ... ok
+test receipt_tests::arbitrary_records_never_panic_the_decoder ... ok
+test receipt_tests::golden_bytes_are_stable ... ok
+test receipt_tests::optional_fields_require_their_presence_flags ... ok
+test receipt_tests::nonce_and_verifier_identity_vectors ... ok
+test receipt_tests::pi5_tier_round_trips_with_its_label ... ok
+test receipt_tests::rejects_length_magic_version_and_sizes ... ok
+test receipt_tests::encoding_is_deterministic_and_round_trips ... ok
+test receipt_tests::rejects_unknown_enum_and_code_values ... ok
+test tests::accepts_canonical_artifact_and_exposes_exact_slices ... ok
+test tests::authority_attenuation_is_directly_checkable ... ok
+test tests::every_truncation_of_a_valid_artifact_is_rejected ... ok
+test tests::rejects_header_and_length_mutations ... ok
+test tests::rejects_section_entry_capability_resource_and_reserved_mutations ... ok
+test tests::signature_bytes_are_not_recursively_included_in_artifact_id ... ok
+test tests::payload_manifest_and_resource_changes_change_artifact_identity ... ok
+test receipt_tests::rejects_unknown_flags_and_nonzero_reserved_bytes ... ok
+test tests::ed25519_verifier_accepts_rfc8032_pure_signature_vector ... ok
+test receipt_tests::unsigned_untrusted_and_production_verification_fail_closed ... ok
+test receipt_tests::every_single_bit_change_in_the_signed_range_changes_meaning_or_is_rejected ... ok
+test tests::arbitrary_bounded_bytes_never_panic_the_parser ... ok
+test receipt_tests::signature_block_is_outside_the_digest_and_fully_authenticated ... ok
+
+test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_artifact_tool-9e56459db5557344)
+
+running 2 tests
+test tests::deterministic_pack_uses_the_shared_parser_and_id ... ok
+test receipt_cmd::tests::check_accepts_only_receipts_that_bind_the_supplied_artifact ... ok
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_boot-03c1d141b379e741)
+
+running 4 tests
+test wcslen::tests::counts_units_before_first_zero ... ok
+test wcslen::tests::empty_string_is_zero ... ok
+test wcslen::tests::stops_at_first_zero_not_slice_end ... ok
+test wcslen::tests::high_unit_values_are_not_terminators ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_c1_tree-1784af35e1503d05)
+
+running 4 tests
+test tree::tests::test_transactional_kv_reservation ... ok
+test tree::tests::test_reconstruct_branch_no_page_leak ... ok
+test tree::tests::test_concurrent_multithreaded_branching_and_reservations ... ok
+test tree::tests::test_zero_memory_increase_on_10k_tokens_fork ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_capability-7cada4be6dbd4ee3)
+
+running 13 tests
+test tests::generation_exhaustion_fails_closed ... ok
+test tests::forged_stale_subject_resource_and_rights_fail_closed ... ok
+test tests::amplification_lease_epoch_and_revoked_ancestor_fail ... ok
+test tests::ordinary_capability_cannot_administer_and_depth_stops ... ok
+test tests::generation_wrap_restarts_and_cognition_cannot_mint ... ok
+test tests::high_half_resource_is_kept ... ok
+test tests::privileged_rights_cannot_be_delegated_and_office_stays ... ok
+test tests::promote_right_cannot_be_delegated ... ok
+test tests::reclaimed_reference_stays_dead_after_restart ... ok
+test tests::recycled_slot_does_not_honour_old_reference ... ok
+test tests::unauthorized_capability_use_is_refused ... ok
+test tests::stale_reference_after_revoke_is_refused ... ok
+test tests::restart_refuses_above_an_exhausted_generation ... ok
+
+test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_capability_ffi-0df678df0840af8b)
+
+running 4 tests
+test tests::layout_matches_the_cap32_contract ... ok
+test tests::stale_and_unauthorized_use_is_refused ... ok
+test tests::generation_exhaustion_fails_closed ... ok
+test tests::reclaimed_reference_stays_dead_after_restart ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_cortex-7c4af692b3926248)
+
+running 2 tests
+test store::tests::test_epistemic_grounding_and_hallucination_rejection ... ok
+test store::tests::test_cortex_persistence_and_status_queries ... ok
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_crypto-5af790ab185ac4fb)
+
+running 10 tests
+test aes::tests::test_aes_256_fips_197_c2 ... ok
+test aes_gcm_siv::tests::public_derived_keys_are_guarded_and_redacted ... ok
+test sha256::tests::test_sha256_abc ... ok
+test aes::tests::test_constant_time_sbox_matches_fips197_table ... ok
+test sha256::tests::test_hmac_sha256_rfc4231_case_1 ... ok
+test polyval::tests::test_polyval_rfc8452_appendix_a_worked_example ... ok
+test polyval::tests::test_polyval_rfc8452_section_7_dot ... ok
+test sha256::tests::test_sha256_empty ... ok
+test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_16byte_pt_0byte_aad ... ok
+test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_8byte_pt_1byte_aad ... ok
+
+test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_evidence-d8215aee6143f1b4)
+
+running 30 tests
+test canon::tests::sealed_bundle_verifies_and_any_edit_breaks_it ... ok
+test canon::tests::key_order_and_whitespace_do_not_change_the_checksum ... ok
+test capture::tests::counts_heterogeneous_cpu_parts ... ok
+test capture::tests::reads_os_release_and_meminfo ... ok
+test http::tests::dechunks_bodies_with_extensions ... ok
+test http::tests::empty_stream_is_an_error ... ok
+test http::tests::parses_endpoints ... ok
+test http::tests::stream_timing_uses_first_content_and_usage ... ok
+test pe::tests::accepts_arm64_efi_application ... ok
+test pe::tests::rejects_wrong_machine_subsystem_and_garbage ... ok
+test rollback::tests::added_candidate_entry_outside_order_is_allowed ... ok
+test rollback::tests::duplicated_entry_changes_sequence ... ok
+test rollback::tests::empty_boot_orders_fail ... ok
+test rollback::tests::empty_pre_uuid_is_not_compared ... ok
+test rollback::tests::identical_return_passes ... ok
+test rollback::tests::python_list_repr ... ok
+test rollback::tests::missing_values_render_as_none ... ok
+test rollback::tests::read_only_root_or_changed_esp_fails ... ok
+test rollback::tests::reordered_or_changed_default_fails ... ok
+test rollback::tests::report_lines_match_former_python_rendering ... ok
+test rollback::tests::secure_boot_is_case_insensitive ... ok
+test rollback::tests::secure_boot_off_is_observed_not_blocking ... ok
+test rollback::tests::shape_rejects_values_the_verifier_cannot_use ... ok
+test rollback::tests::secure_boot_change_is_still_a_violation ... ok
+test time::tests::known_instants ... ok
+test rollback::tests::unconsumed_boot_next_fails ... ok
+test verify::tests::verified_recovery_closes_m0 ... ok
+test verify::tests::sound_capture_passes_but_m0_stays_open_until_rollback_is_tested ... ok
+test verify::tests::tampering_dirty_repos_and_toy_workloads_are_rejected ... ok
+test capture::tests::streams_file_hash_matches_one_shot_hash ... ok
+
+test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.77s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_evidence-f8f5ed62ab570014)
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_explain-79b00631214213e1)
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_explain-ee23a1331acf4114)
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/explain.rs (target/debug/deps/explain-5a1c8cb3ca31dd39)
+
+running 16 tests
+test cycle_terminates_and_is_reported ... ok
+test clarification_reads_the_same_bundle ... ok
+test contradiction_remains_visible ... ok
+test malformed_input_fails_safely ... ok
+test linear_chain_is_ordered_parents_first ... ok
+test analogy_is_isolated_from_evidence ... ok
+test branch_explanation_uses_only_what_the_branch_depended_on ... ok
+test cycle_through_imported_cortex_journal_terminates ... ok
+test branching_support_is_deterministic_regardless_of_input_order ... ok
+test missing_parent_stays_missing ... ok
+test hypothesis_is_never_rendered_as_fact ... ok
+test identical_input_gives_identical_bundle_and_text ... ok
+test token_history_never_enters_the_explanation ... ok
+test unsupported_claim_is_flagged ... ok
+test shared_parent_appears_once ... ok
+test depth_and_node_limits_bound_the_walk ... ok
+
+test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s
+
+ Running tests/rsi_and_cli.rs (target/debug/deps/rsi_and_cli-47e96ebade6cc0c5)
+
+running 4 tests
+test contradiction_disclosed_in_both_directions ... ok
+test rsi_fixture_is_pinned ... ok
+test rsi_cycle_explains_in_causal_order ... ok
+test cli_explains_fixture ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_infer-f019ca6909bea73a)
+
+running 26 tests
+test decode::rope_tests::every_head_is_rotated_independently_with_the_same_table ... ok
+test decode::rope_tests::pair_zero_rotates_by_the_position_angle ... ok
+test decode::rope_tests::score_depends_on_relative_position_only ... ok
+test decode::rope_tests::softmax_weights_are_shift_invariant_and_position_sensitive ... ok
+test dotprod::tests::q4k_hand_computed_scale_application ... ok
+test dotprod::tests::quantize_matches_q8k_round_and_sums ... ok
+test dotprod::tests::row_dot_matches_scalar_path_and_checks_lengths ... ok
+test dotprod::tests::token_only_when_flag_set ... ok
+test dotprod::tests::q4k_integer_dot_equals_f32_dot_of_rounded_activations ... ok
+test half::tests::known_values ... ok
+test math::tests::exp_matches_std ... ok
+test math::tests::ln_matches_std ... ok
+test math::tests::powf_rope_theta_scale ... ok
+test math::tests::sin_cos_matches_std_and_unit_norm ... ok
+test math::tests::sqrt_matches_std ... ok
+test quant::tests::length_checks ... ok
+test quant::tests::q4k_hand_block ... ok
+test dotprod::tests::q6k_integer_dot_equals_f32_dot_of_rounded_activations ... ok
+test quant::tests::q4k_scale_extension_bits ... ok
+test quant::tests::q6k_hand_block ... ok
+test quant::tests::q6k_scales_are_signed_and_per_16 ... ok
+test tokenizer::tests::byte_map_is_gpt2 ... ok
+test tokenizer::tests::pretokenize_cases ... ok
+test tokenizer::tests::pretokenize_covers_input ... ok
+test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q4k ... ok
+test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q6k ... ok
+
+test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/forward.rs (target/debug/deps/forward-ab44d1dd89820bae)
+
+running 5 tests
+test forward_matches_llama_cpp_q8k_emulation ... ignored, slow; run with --ignored
+test decode_round_trips_text ... ok
+test tokenization_matches_llama_cpp ... ok
+test forward_matches_llama_cpp_dotprod ... ok
+test forward_matches_llama_cpp_f32_activations has been running for over 60 seconds
+test forward_matches_llama_cpp_f32_activations ... ok
+
+test result: ok. 4 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 148.69s
+
+ Running tests/golden.rs (target/debug/deps/golden-bd0a1a22ab6375dc)
+
+running 15 tests
+test dequantize_rejects_bad_lengths_without_panic ... ok
+test dot_helpers_match_dequant_then_dot ... ok
+test absurd_counts_and_bad_fields ... ok
+test q4k_matches_ggml_bit_for_bit ... ok
+test q6k_matches_ggml_bit_for_bit ... ok
+test q4k_round_trip_error_bound ... ok
+test q6k_round_trip_error_bound ... ok
+test round_trip_exact_when_grid_aligned ... ok
+test small_good_file_parses ... ok
+test byte_flip_fuzz_never_panics ... ok
+test real_type_histogram_and_table_sanity ... ok
+test real_header_matches_known_facts ... ok
+test every_truncation_is_an_error_not_a_panic ... ok
+test real_layer0_dequantizes_to_sane_values ... ok
+test real_file_matches_hf_metadata_hash ... ok
+
+test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.24s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_kernel-d868610635245090)
+
+running 413 tests
+test abi::tests::capability_fails_closed ... ok
+test abi::tests::capability_golden ... ok
+test abi::tests::envelope_fails_closed ... ok
+test abi::tests::handle_generation_zero_fails_closed ... ok
+test abi::tests::handle_golden ... ok
+test abi::tests::envelope_golden ... ok
+test abi::tests::handle_raw_matches_syscall_packing ... ok
+test abi::tests::handle_raw_register_encoding ... ok
+test abi::tests::id_goldens ... ok
+test abi::tests::memory_region_golden ... ok
+test abi::tests::message_golden ... ok
+test abi::tests::message_reserved_fields_fail_closed ... ok
+test abi::tests::resource_id_golden ... ok
+test abi::tests::resource_id_rejects_unknown_kind_and_reserved ... ok
+test abi::tests::rights_convert_with_caps_rights ... ok
+test abi::tests::rights_golden ... ok
+test abi::tests::rights_reserved_bits_fail_closed ... ok
+test abi::tests::tags_are_distinct_and_round_trip ... ok
+test acpi::tests::extracts_gicd_and_gicr_bases ... ok
+test acpi::tests::counts_gb10_style_heterogeneous_cores_by_efficiency_class ... ok
+test acpi::tests::finds_the_boot_core_class_ignoring_mpidr_flag_bits ... ok
+test acpi::tests::mcfg_finds_the_ecam_window_for_a_segment_and_bus ... ok
+test acpi::tests::reads_xsdt_entry_addresses ... ok
+test acpi::tests::parses_iort_smmuv3_base_and_pci_stream_mapping ... ok
+test acpi::tests::spcr_selects_the_early_uart_driver ... ok
+test acpi::tests::rejects_bad_checksum_signature_and_lengths ... ok
+test acpi::tests::skips_disabled_cores_and_counts_old_entries_as_unknown ... ok
+test admission::tests::insufficient_resource_snapshot_rejects_before_authorization ... ok
+test admission::tests::policy_digest_is_canonical_and_binds_signer_allowlist ... ok
+test admission::tests::verified_but_policy_untrusted_signer_is_rejected ... ok
+test admission::tests::policy_reduces_object_range_and_operation_byte_budgets ... ok
+test admission::tests::read_is_granted_and_uses_the_existing_m3_rights_type ... ok
+test admission::tests::read_write_request_is_reduced_to_policy_read ... ok
+test admission::tests::unapproved_write_receives_no_capability ... ok
+test artifact_loader::tests::boot_policy_digest_is_the_policy_the_loader_uses ... ok
+test arch::aarch64::tests::spark_uart_uses_32_bit_16550_register_stride ... ok
+test artifact_loader::tests::candidate_lines_are_stable ... ok
+test artifact_loader::tests::code_write_needs_a_permission_fault ... ok
+test artifact_loader::tests::exec_nx_needs_a_permission_fault_inside_data_or_stack ... ok
+test artifact_loader::tests::audit_rejects_writable_code_and_writable_alias ... ok
+test artifact_loader::tests::stage_and_reason_codes_match_adr_0014_section_7_3 ... ok
+test artifact_loader::tests::staging_reservation_failure ... ok
+test artifact_loader::tests::full_scheduler_fails_closed_at_admission ... ok
+test artifact_loader::tests::kernel_root_without_free_window_is_a_mapping_failure ... ok
+test artifact_loader::tests::grant_lines_list_exactly_the_installed_grants ... ok
+test artifact_loader::tests::code_modified_during_execution_breaks_the_byte_chain ... ok
+test artifact_loader::tests::task_layout_rejects_every_bound_violation ... ok
+test block::tests::ram_disk_rejects_block_size_that_would_truncate ... ok
+test artifact_loader::tests::receipt_line_carries_digest_and_full_record ... ok
+test artifact_loader::tests::tampered_payload_is_rejected_before_any_task_frame ... ok
+test artifact_loader::tests::admitted_task_sees_exact_entry_state_and_is_fully_reclaimed ... ok
+test artifact_loader::tests::ipc_request_exceeds_policy_and_is_rejected ... ok
+test boot::tests::boot_counter_conversion_rejects_invalid_samples ... ok
+test artifact_loader::tests::scheduler_refusal_at_reservation_rolls_back ... ok
+test boot::tests::firmware_region_requires_aligned_nonoverflowing_pages ... ok
+test artifact_loader::tests::admitted_receipt_binds_identity_and_observed_outcome ... ok
+test boot::tests::early_allocator_retains_region_after_initialization ... ok
+test artifact_loader::tests::receipt_flags_follow_observations_not_expectations ... ok
+test artifact_loader::tests::empty_and_oversized_inputs_are_refused_before_staging ... ok
+test budget::tests::arithmetic_is_overflow_safe_at_u64_limits ... ok
+test artifact_loader::tests::unknown_signer_rejected_by_anchors_and_by_policy ... ok
+test boot::tests::report_lists_gpu_allocator_timing_and_liveness ... ok
+test budget::tests::each_resource_limit_is_enforced_independently ... ok
+test budget::tests::releasing_frames_restores_headroom ... ok
+test budget::tests::watchdog_pet_expiry_and_sticky_quarantine ... ok
+test caps::tests::generation_exhaustion_retires_slot_without_reviving_old_handle ... ok
+test caps::tests::removing_a_never_derived_capability_frees_its_slot ... ok
+test budget::tests::watchdog_is_correct_across_counter_wrap ... ok
+test caps::tests::derive_cannot_add_rights ... ok
+test budget::tests::explicit_policy_switch_changes_forge_allowance ... ok
+test caps::tests::revoke_with_single_slot_tables_removes_cross_table_child ... ok
+test caps::tests::transfer_needs_grant_and_table_full_is_reported ... ok
+test caps::tests::removing_a_derived_parent_keeps_the_subtree_revocable ... ok
+test caps::tests::stale_handle_rejected_after_slot_reuse ... ok
+test console::tests::unsupported_spcr_gives_no_console ... ok
+test artifact_loader::tests::rejection_receipts_record_earliest_stage_and_only_computed_fields ... ok
+test continuity::tests::encodings_round_trip_and_reject_tampering ... ok
+test caps::tests::revoke_cascades_two_levels_across_tables ... ok
+test continuity::continuity_vectors::emitted_vectors_are_canonical ... ok
+test continuity::tests::branch_table_validation_rejects_broken_lineage ... ok
+test artifact_loader::tests::grants_never_exceed_requests_or_policy ... ok
+test artifact_loader::tests::main_and_shadow_batch_failures_roll_back ... ok
+test artifact_loader::tests::sequential_candidates_reuse_resources_cleanly ... ok
+test continuity::tests::wrapping_fork_sum_is_refused_like_the_c_codec ... ok
+test continuity::tests::unprovisioned_store_never_mints_an_identity ... ok
+test crypto::envelope::tests::test_envelope_cross_store_and_kind_binding ... ok
+test crypto::envelope::tests::test_expected_envelope_len_overflow_is_error ... ok
+test crypto::envelope::tests::test_envelope_roundtrip_small ... ok
+test crypto::envelope::tests::test_hostile_header_at_bound_hits_length_check ... ok
+test crypto::envelope::tests::test_hostile_header_huge_total_rejected_before_alloc ... ok
+test crypto::hkdf::tests::rfc5869_cases_1_to_3 ... ok
+test crypto::hmac::tests::compare_tags ... ok
+test crypto::hmac::tests::rfc4231_cases_1_to_7 ... ok
+test crypto::envelope::tests::test_envelope_roundtrip_empty ... ok
+test continuity::tests::provisioning_twice_is_refused ... ok
+test continuity::tests::huge_fork_count_with_underivable_child_is_refused_without_spinning ... ok
+test continuity::tests::two_roots_stop_with_conflict ... ok
+test device::tests::activate_installs_translation_before_bus_master ... ok
+test device::tests::activate_with_revoked_handle_fails_without_effects ... ok
+test crypto::envelope::tests::test_hostile_header_chunk_size_one_huge_count_rejected ... ok
+test device::tests::attenuated_capability_without_map_cannot_activate ... ok
+test device::tests::duplicate_or_missing_table_in_revoke_set_causes_no_effects ... ok
+test device::tests::capability_for_other_resource_is_not_a_device ... ok
+test device::tests::activation_refused_without_window_or_when_already_active ... ok
+test console::tests::pl011_writes_when_ready_and_gives_up_when_always_full ... ok
+test continuity::tests::forked_or_gapped_manifest_chains_are_corrupt ... ok
+test crypto::hkdf::tests::length_limit_and_compare ... ok
+test device::tests::activation_failure_at_each_step_leaves_bus_master_clear_and_stream_aborted ... ok
+test device::tests::activation_records_its_authority ... ok
+test continuity::tests::provision_then_cold_restart_returns_the_same_identity_and_memory ... ok
+test device::tests::failed_teardown_blocks_activation_until_a_clean_retry ... ok
+test device::tests::missing_capability_causes_no_effects ... ok
+test device::tests::map_without_revoke_cannot_tear_down_an_active_device ... ok
+test artifact_loader::tests::corrupted_mapped_bytes_fail_the_read_back_hash ... ok
+test device::tests::window_validation ... ok
+test display::font::tests::digits_and_letters_are_distinct ... ok
+test display::font::tests::every_glyph_is_five_by_seven_hashes_and_spaces ... ok
+test display::font::tests::lowercase_maps_to_uppercase_and_unknown_to_question_mark ... ok
+test device::tests::sweep_leaves_devices_with_live_authority_alone ... ok
+test device::tests::state_discriminants_are_stable ... ok
+test device::tests::sweep_tears_down_after_holder_removes_or_table_is_gone ... ok
+test device::tests::sweep_retries_a_failed_teardown ... ok
+test device::tests::revoke_runs_exact_teardown_then_removes_capability_tree ... ok
+test display::tests::rejects_geometry_larger_than_the_buffer ... ok
+test continuity::tests::degraded_mount_resumes_read_only ... ok
+test device::tests::read_only_capability_causes_no_effects ... ok
+test device::tests::sweep_tears_down_when_ancestor_revoked_through_plain_cap_path ... ok
+test device::tests::register_rejects_clashes_and_live_devices ... ok
+test device::tests::revoke_failure_at_each_step_still_closes_gates_and_revokes ... ok
+test display::tests::scales_up_on_wide_screens_and_drops_text_past_the_last_row ... ok
+test device::tests::revoke_forgets_window_so_next_holder_cannot_reuse_it ... ok
+test dma_gate::tests::failed_smmu_never_falls_back_to_bypass ... ok
+test dma_gate::tests::sweep_clears_endpoints_and_leaves_bridges ... ok
+test dma_gate::tests::sweep_walks_multifunction_devices_only_when_marked ... ok
+test edu::tests::blocked_transfer_completes_but_leaves_ram_untouched ... ok
+test dma_gate::tests::sweep_reports_a_bus_master_bit_that_will_not_clear ... ok
+test edu::tests::full_buffer_transfer_is_allowed ... ok
+test edu::tests::last_byte_below_the_mask_is_accepted ... ok
+test edu::tests::probe_reads_version_and_checks_liveness ... ok
+test dma_gate::tests::grant_requires_smmu_or_explicit_bypass_without_smmu ... ok
+test dma_gate::tests::sweep_keeps_counting_past_the_recorded_findings ... ok
+test display::tests::draws_glyph_pixels_and_respects_stride_padding ... ok
+test edu::tests::rejects_bad_lengths_and_addresses_before_touching_the_device ... ok
+test edu::tests::interrupt_status_and_acknowledge ... ok
+test edu::tests::times_out_when_the_transfer_never_finishes ... ok
+test edu::tests::spin_budget_covers_a_slow_transfer ... ok
+test edu::tests::wider_dma_mask_accepts_higher_addresses ... ok
+test gic::tests::distributor_spi_programming_order ... ok
+test fatal::tests::access_syndrome_only_when_isv_set ... ok
+test fatal::tests::decodes_abort_iss_fields_without_register_access ... ok
+test fatal::tests::decodes_vector_slot_and_exception_class ... ok
+test arch::aarch64::tests::a_uart_that_never_becomes_ready_is_abandoned_instead_of_hanging ... ok
+test edu::tests::round_trips_bytes_through_the_device_buffer ... ok
+test dma_gate::tests::command_bits ... ok
+test gic::tests::redistributor_wakes_and_sets_ppi ... ok
+test gic::tests::register_offsets_match_gicv3_spec ... ok
+test infer::attention::tests::dense_output_projection_mixes_heads_and_catches_a_permutation ... ok
+test infer::gemm::tests::benchmark_matvec_4096 ... ignored, benchmark
+test infer::attention::tests::one_token_returns_value_exactly ... ok
+test infer::rope::tests::position_zero_is_identity ... ok
+test infer::gemm::tests::strided_vector_matches_reference ... ok
+test infer::attention::tests::append_rejects_capacity_overflow ... ok
+test infer::attention::tests::decode_refuses_wrong_shapes_and_head_counts ... ok
+test infer::attention::tests::query_rows_kv_groups_and_head_major_output_decode_from_bands ... ok
+test infer::attention::tests::random_inputs_match_scalar_reference ... ok
+test infer::attention::tests::two_head_hand_computed_attention ... ok
+test infer::gemm::tests::rms_norm_hand_value ... ok
+test infer::rope::tests::sin_cos_matches_std_across_the_circle ... ok
+test infer::gemm::tests::softmax_sums_to_one ... ok
+test infer::tokenizer::tests::matches_special_tokens_before_bpe ... ok
+test infer::attention::tests::gqa_maps_groups_of_query_heads_to_kv_heads ... ok
+test infer::rope::tests::rotation_preserves_each_pair_norm ... ok
+test ipc::tests::end_to_end_send_delegate_receive_read ... ok
+test ipc::tests::channel_is_fifo_and_bounded ... ok
+test infer::tokenizer::tests::applies_lowest_ranked_merge_first ... ok
+test ipc::tests::message_abi_is_fixed_size_and_unaligned_free ... ok
+test ipc::tests::receiver_table_full_rolls_back_cleanly ... ok
+test ipc::tests::attenuated_child_cannot_write_or_escalate ... ok
+test infer::tokenizer::tests::reports_missing_byte_and_bad_format ... ok
+test mem::frame_allocator::tests::allocator_rejects_unaligned_deallocation ... ok
+test mem::frame_allocator::tests::insufficient_batch_reservation_leaves_no_partial_allocations ... ok
+test infer::tokenizer::tests::round_trips_ascii_utf8_empty_and_fallback ... ok
+test ipc::tests::rights_escalation_is_rejected ... ok
+test ipc::tests::send_requires_write_and_receive_requires_read ... ok
+test ipc::tests::stale_and_forged_handles_are_invalid ... ok
+test mem::frame_allocator::tests::batch_reservation_is_bounded_and_released_as_a_unit ... ok
+test mem::frame_allocator::tests::allocator_rejects_capacity_overflow - should panic ... ok
+test ipc::tests::ancestor_revocation_reaches_the_derived_child ... ok
+test ipc::tests::delegation_without_derive_right_is_denied ... ok
+test mem::frame_allocator::tests::test_alloc_contiguous ... ok
+test mem::frame_allocator::tests::test_allocator_basic ... ok
+test mem::map_plan::tests::section_permissions_are_wx_safe ... ok
+test mem::pagetable::tests::fixed_pool_is_bounded_and_never_reuses_released_frames ... ok
+test mem::pagetable::tests::descriptor_encodes_attributes_exactly ... ok
+test mem::pagetable::tests::device_memory_is_never_executable ... ok
+test mem::map_plan::tests::writable_executable_runtime_code_is_mapped_rx ... ok
+test mem::map_plan::tests::missing_mat_maps_runtime_code_rx_without_wx ... ok
+test mem::pagetable::tests::flags_round_trip_through_descriptors ... ok
+test mem::map_plan::tests::mmio_is_device_nx_and_overlap_rejected ... ok
+test mem::map_plan::tests::register_values_encode_required_fields ... ok
+test mem::map_plan::tests::runtime_code_needs_ro_xp_split ... ok
+test mem::pagetable::tests::access_permission_and_attribute_bits ... ok
+test mem::pagetable::tests::execute_never_bits_follow_privilege ... ok
+test mem::map_plan::tests::translation_register_values_match_the_architecture ... ok
+test mem::pagetable::tests::chooses_block_and_page_leaves ... ok
+test mem::pagetable::tests::maps_and_walks_page ... ok
+test net::tests::rejects_short_bad_and_fragments ... ok
+test net::tests::udp_known_checksum ... ok
+test nvme::atomicity::tests::boundary_safe_write_accepts ... ok
+test net::tests::ipv4_icmp_ping_vector ... ok
+test net::tests::ethernet_and_arp_vector ... ok
+test nvme::atomicity::tests::boundary_offset_is_respected ... ok
+test net::tests::ipv4_reserved_flag_is_rejected ... ok
+test net::tests::cache_requires_solicited_and_expires ... ok
+test net::tests::checksum_vectors ... ok
+test nvme::atomicity::tests::namespace_override_wins_over_controller ... ok
+test nvme::atomicity::tests::controller_fallback_when_namespace_absent ... ok
+test nvme::atomicity::tests::namespace_zero_falls_back_to_controller ... ok
+test nvme::atomicity::tests::encoding_edge_zero_and_max ... ok
+test nvme::atomicity::tests::read_u16_le_bounds ... ok
+test artifact_loader::tests::sealed_address_space_is_wx_with_read_only_code_alias ... ok
+test mem::pagetable::tests::rejects_overlap_wx_and_misalignment ... ok
+test nvme::atomicity::tests::empty_write_rejects ... ok
+test nvme::atomicity::tests::store_root_512_geometry ... ok
+test mem::pagetable::tests::unmap_removes_leaf ... ok
+test nvme::atomicity::tests::sufficient_unit_but_crosses_boundary_rejects ... ok
+test nvme::atomicity::tests::store_root_4096_geometry ... ok
+test nvme::atomicity::tests::insufficient_controller_awupf_rejects ... ok
+test nvme::atomicity::tests::sufficient_decoded_awupf_accepts ... ok
+test nvme::atomicity::tests::unknown_state_fails_closed ... ok
+test nvme::atomicity::tests::unsupported_geometry_fails_closed ... ok
+test nvme::driver::tests::controller_requiring_larger_pages_is_refused ... ok
+test nvme::driver::tests::simulator_rejects_submission_queue_without_completion_queue ... ok
+test nvme::driver::tests::io_queue_depth_above_mqes_is_rejected ... ok
+test nvme::tests::command_layouts ... ok
+test nvme::tests::completion_phase_wrap_and_empty ... ok
+test nvme::driver::tests::readiness_wait_honours_cap_timeout ... ok
+test nvme::driver::tests::readiness_and_completion_errors_are_bounded ... ok
+test nvme::driver::tests::creates_polled_io_queues ... ok
+test nvme::driver::tests::block_io_roundtrips_small_and_prp_list_transfers_with_mdts_chunks ... ok
+test nvme::driver::tests::lbads_below_512_is_invalid_identify ... ok
+test pci::tests::finds_device_by_vendor_and_device_id ... ok
+test pci::tests::probes_bar_sizes_and_restores_state ... ok
+test pci::tests::read_bar_respects_header_type_and_slots ... ok
+test pci::tests::functions_in_uses_the_window_bus_range ... ok
+test pci::tests::requester_id_packs_bus_device_function ... ok
+test pci::tests::update_command_sets_and_clears_bits_without_touching_status ... ok
+test pci::tests::walk_covers_last_bus_and_device_without_overflow ... ok
+test pe::tests::rejects_truncation_and_invalid_headers ... ok
+test pci::tests::walk_skips_functions_1_to_7_unless_multi_function ... ok
+test pe::tests::rejects_wx_and_overlapping_ranges ... ok
+test pe::tests::unaligned_sections_are_page_rounded_and_shared_pages_overlap ... ok
+test nvme::driver::tests::explicit_namespace_write_surfaces_device_error ... ok
+test pe::tests::valid_sections_use_base_and_page_rounded_max_size ... ok
+test recovery::tests::hmac_primitive_rfc4231_case_2 ... ok
+test recovery::tests::operator_auth_known_answer_accepted ... ok
+test nvme::driver::tests::initializes_and_identifies_namespace ... ok
+test nvme::tests::controller_ready_failure_and_timeout ... ok
+test nvme::tests::prp_list_chains_across_list_pages ... ok
+test recovery::tests::test_slot_rollback_on_failure ... ok
+test nvme::tests::submission_full_and_wrap ... ok
+test recovery::tests::operator_auth_rejects_undomained_hmac_and_zero_response ... ok
+test pci::tests::decodes_32_and_64_bit_memory_bars_and_io_bars ... ok
+test nvme::driver::tests::parses_power_fail_atomicity_fields ... ok
+test recovery::tests::test_wal_zero_length_entry_and_overflow_protection ... ok
+test nvme::tests::prp_spans ... ok
+test nvme::driver::tests::invalid_range_has_no_io_command_and_write_completion_error_propagates ... ok
+test nvme::tests::registers_and_doorbells ... ok
+test nvme::driver::tests::shallow_io_queue_is_rejected_before_submission ... ok
+test recovery::tests::operator_auth_rejects_legacy_bare_sha256_response ... ok
+test continuity::tests::a_crash_at_every_write_of_a_commit_leaves_old_or_new_never_a_third_state ... ok
+test recovery::tests::test_wal_truncation_on_corruption ... ok
+test scheduler::tests::background_runs_within_configured_interval_under_latency_load ... ok
+test scheduler::tests::idle_cpu_steals_and_runs_work ... ok
+test scheduler::tests::latency_keeps_large_majority_of_ticks_with_background_budget ... ok
+test scheduler::tests::placement_uses_fast_cores_for_latency_and_efficient_for_background ... ok
+test scheduler::tests::removed_tasks_free_their_slot_and_leave_the_queue ... ok
+test scheduler::tests::round_robin_placement_and_duplicate_rejection ... ok
+test security::tests::test_anti_rollback_decision_matrix ... ok
+test scheduler::tests::empty_queues_and_invalid_cpu_are_handled ... ok
+test scheduler::tests::equal_priority_tasks_share_n_ticks_fairly ... ok
+test report::tests::formats_and_truncates_on_character_boundaries ... ok
+test scheduler::tests::priority_prevents_basic_inversion ... ok
+test security::tests::test_security_manifest_roundtrip_and_mac ... ok
+test recovery_core::tests::malformed_peer_without_a_resolvable_identity_is_not_repaired ... ok
+test shell::tests::parses_commands_and_bounded_arguments ... ok
+test security::tests::test_subkey_derivation_separation ... ok
+test security::tests::test_keyslot_manifest_roundtrip_and_unwrap ... ok
+test smmu::tests::bring_up_keeps_global_abort_through_smmuen ... ok
+test shell::tests::dispatches_report_and_diagnostics ... ok
+test smmu::tests::event_reader_acknowledges_overflow ... ok
+test smmu::tests::bring_up_cleans_tables_after_writing_before_programming ... ok
+test smmu::tests::command_queue_wraps_and_times_out ... ok
+test smmu::tests::gbpa_that_will_not_abort_is_an_error ... ok
+test smmu::tests::descriptor_layouts ... ok
+test smmu::tests::command_timeout_and_error_fail_closed ... ok
+test smmu::tests::gbpa_update_timeout_fails_closed ... ok
+test smmu::tests::event_reader_decodes_and_consumes_records ... ok
+test recovery_core::tests::orphaned_continuity_objects_are_corrupt_not_unprovisioned ... ok
+test smmu::tests::smmuen_ack_failure_fails_closed ... ok
+test smmu::tests::command_words_and_queue_wrap ... ok
+test smmu::tests::tables_reject_misaligned_or_bad_geometry ... ok
+test smmu::tests::install_and_abort_ste_invalidate_that_stream ... ok
+test smmu::tests::unsupported_hardware_or_bad_sid_fails_closed ... ok
+test smmu::tests::policy_maps_only_allowed_windows ... ok
+test recovery_core::tests::identity_lost_in_the_newest_root_never_looks_unprovisioned ... ok
+test recovery::tests::operator_auth_rejects_any_single_bit_flip ... ok
+test smmu::tests::submit_refuses_to_overwrite_a_full_queue ... ok
+test store::engine::tests::store_generation_overflow_zero_writes ... ok
+test recovery_core::tests::challenges_bind_state_and_action ... ok
+test store::engine::tests::store_checkpoint_order_does_not_change_persistent_bytes ... ok
+test store::engine::tests::store_mount_classification_is_deterministic ... ok
+test store::engine::tests::store_full_graph_validation_rejects_damaged_payload_and_keeps_io_distinct ... ok
+test store::engine::tests::store_nospace_zero_writes ... ok
+test store::engine::tests::store_open_side_effect_free ... ok
+test store::engine::tests::store_history_rejects_deleting_an_old_catalog_entry ... ok
+test store::engine::tests::store_io_fail_closed ... ok
+test store::tests::block_store_rejects_corrupt_in_memory_length_without_panicking ... ok
+test store::tests::block_store_persists_reopens_and_falls_back_from_bad_copy ... ok
+test store::tests::test_slice_store_operations_and_boundaries ... ok
+test store::tests::block_store_rejects_wrong_magic ... ok
+test recovery_core::tests::provisioning_is_operator_only_and_only_on_an_unprovisioned_store ... ok
+test store::tests::test_content_addressed_extent_storage ... ok
+test store::v1::tests::malformed_object_catalog_and_extent_vectors_are_rejected ... ok
+test store::engine::tests::store_peer_condition_reports_open_classification ... ok
+test store::v1::tests::object_id_and_catalog_vectors_match_adr_0015 ... ok
+test sync::spinlock::tests::test_spinlock_try_lock ... ok
+test sync::spinlock::tests::test_spinlock_basic ... ok
+test recovery_core::tests::inspection_never_writes_and_names_the_reason ... ok
+test task_runtime::tests::granted_read_returns_object_word_and_charges_budget ... ok
+test task_runtime::tests::non_object_or_other_object_grant_is_denied ... ok
+test store::v1::tests::malformed_generation_high_water_and_superblock_bytes_are_rejected ... ok
+test task_runtime::tests::denials_are_classified_from_observed_lookups ... ok
+test task_runtime::tests::forged_stale_and_unbacked_handles_are_denied ... ok
+test task_runtime::tests::read_outside_grant_range_or_object_or_unaligned_is_denied ... ok
+test task_runtime::tests::read_past_byte_budget_is_denied ... ok
+test task_runtime::tests::read_past_operation_budget_is_denied ... ok
+test task_runtime::tests::syscall_after_deadline_times_out ... ok
+test task_runtime::tests::syscall_budget_overrun_terminates ... ok
+test task_runtime::tests::unknown_syscall_and_nonzero_immediate_terminate ... ok
+test task_runtime::tests::write_with_write_right_updates_kernel_copy ... ok
+test task_runtime::tests::write_without_write_right_is_denied_and_object_unchanged ... ok
+test thread::tests::context_offsets_match_assembly_layout ... ok
+test thread::tests::placement_fills_lowest_class_first_then_wraps ... ok
+test thread::tests::placement_of_empty_topology_is_unplaced ... ok
+test thread::tests::stack_setup_aligns_sp_and_records_trampoline_arguments ... ok
+test thread::tests::trap_frame_layout_matches_800_bytes_and_16_byte_alignment ... ok
+test thread::tests::trap_frame_setup_aligns_and_initializes_registers ... ok
+test timer::tests::conversion_rounding_and_frequency_validation ... ok
+test timer::tests::deadline_detects_overflow ... ok
+test uefi::tests::honors_48_and_56_byte_descriptor_strides ... ok
+test uefi::tests::rejects_truncated_and_short_descriptors ... ok
+test usb::audio::tests::fractional_44100_packet_pattern_totals_one_second ... ok
+test usb::audio::tests::isoch_schedule_stays_ahead_and_wraps_frame_id ... ok
+test usb::audio::tests::oversized_packet_is_not_truncated_and_zero_stride_schedules_nothing ... ok
+test usb::audio::tests::parses_uac1_and_uac2 ... ok
+test task_runtime::tests::deadline_uses_tighter_budget_and_survives_counter_wrap ... ok
+test usb::audio::tests::ring_wraps_and_tone_is_bounded ... ok
+test usb::audio::tests::uac1_channels_come_from_format_type_not_as_general_delay ... ok
+test usb::descriptor::tests::finds_the_keyboard_interrupt_in_endpoint ... ok
+test usb::descriptor::tests::reads_the_control_packet_size_from_a_device_descriptor ... ok
+test usb::descriptor::tests::skips_a_mouse_interface_and_out_endpoints_in_a_composite_device ... ok
+test usb::descriptor::tests::stops_at_total_length_and_malformed_descriptors ... ok
+test usb::hid::tests::control_keys_and_arrows ... ok
+test usb::hid::tests::letter_make_and_release_produces_one_character ... ok
+test usb::hid::tests::punctuation_and_space_decode ... ok
+test usb::hid::tests::rollover_error_and_wrong_length_are_ignored ... ok
+test usb::hid::tests::shift_and_digits_use_the_shifted_column ... ok
+test usb::hid::tests::sink_truncates_instead_of_overflowing ... ok
+test usb::hid::tests::unmapped_usages_are_dropped ... ok
+test usb::xhci::context::tests::endpoint_addresses_map_to_device_context_indexes ... ok
+test usb::xhci::context::tests::isoch_interval_and_high_bandwidth_burst ... ok
+test store::engine::tests::store_transaction_commit_dedup_and_tail_reuse ... ok
+test usb::xhci::context::tests::interval_converts_frames_and_exponents_to_125us_units ... ok
+test store::engine::tests::store_malformed_peer_recovery_matrix ... ok
+test usb::xhci::ring::tests::dequeue_pointer_carries_the_cycle_state_and_flips_after_the_link ... ok
+test usb::xhci::context::tests::address_device_context_puts_port_and_endpoint_zero_in_place ... ok
+test usb::xhci::tests::capabilities_decode_qemu_xhci_registers ... ok
+test store::v1::tests::commit_superblock_genesis_and_adjacent_vectors_match_adr_0015 ... ok
+test usb::xhci::context::tests::isochronous_out_endpoint_fields_encode_in_context ... ok
+test usb::xhci::context::tests::large_contexts_double_the_stride_and_bad_sizes_are_refused ... ok
+test usb::audio::tests::stereo_44100_scheduler_emits_one_second_of_pcm_bytes ... ok
+test usb::xhci::ring::tests::controller_sees_every_push_in_order_across_many_wraps ... ok
+test usb::audio::tests::short_uac1_format_descriptor_does_not_panic ... ok
+test store::engine::tests::store_dedup_corruption_and_descriptor_conflict_fail_before_writes ... ok
+test usb::xhci::tests::capabilities_decode_scratchpads_large_contexts_and_reject_absent_blocks ... ok
+test usb::xhci::ring::tests::event_ring_consumes_matching_cycles_and_wraps_without_a_link ... ok
+test usb::xhci::tests::portsc_neutral_never_disables_the_port_or_acks_changes ... ok
+test usb::xhci::tests::recognizes_xhci_class_and_memory_bars ... ok
+test usb::xhci::trb::tests::command_trbs_place_slot_and_input_context ... ok
+test usb::xhci::tests::rejects_other_classes_io_and_unprogrammed_bars ... ok
+test usb::xhci::trb::tests::control_stages_carry_idt_transfer_type_and_directions ... ok
+test usb::xhci::trb::tests::event_fields_decode_from_their_bit_positions ... ok
+test recovery_core::tests::identity_loss_through_corruption_offers_no_action_that_mints ... ok
+test user::tests::trap_frame_layout_matches_assembly ... ok
+test virtio_net::tests::parses_modern_virtio_net_capabilities ... ok
+test usb::xhci::trb::tests::normal_trb_asks_for_an_event_on_short_reports ... ok
+test virtio_net::tests::rejects_loops_and_short_vendor_capabilities ... ok
+test usb::xhci::trb::tests::setup_packet_bytes_match_the_usb_wire_order ... ok
+test usb::xhci::trb::tests::isoch_trb_encodes_frame_id_and_batch_flags ... ok
+test user::tests::capability_handle_round_trips ... ok
+test user::tests::el0_mapping_attributes_are_wx_and_non_global ... ok
+test usb::xhci::trb::tests::trb_is_sixteen_bytes_and_sixteen_aligned ... ok
+test store::engine::tests::store_history_matrix_equivalent_and_adjacent_roots ... ok
+test infer::gemm::tests::products_match_reference_odd_and_even ... ok
+test recovery_core::tests::degraded_repair_needs_the_operator_and_restores_a_writable_store ... ok
+test store::tests::block_store_crash_boundaries_keep_old_or_new_commit ... ok
+test store::engine::tests::store_catalogfull_zero_writes ... ok
+test artifact_loader::tests::largest_envelope_loads_in_one_l3_table ... ok
+test crypto::envelope::tests::tampered_late_chunk_rejects_the_entire_plaintext ... ok
+test crypto::envelope::tests::test_envelope_roundtrip_multi_chunk ... ok
+test continuity::continuity_vectors::committed_fixtures_match_the_oracle ... ok
+test continuity::tests::branch_table_at_the_maximum_legal_fork_sum_is_accepted ... ok
+
+test result: ok. 412 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.95s
+
+ Running tests/nvme_completion.rs (target/debug/deps/nvme_completion-dafc6afe36974715)
+
+running 14 tests
+test admin_command_id_mismatch_reports_invalid_identify ... ok
+test admin_cq_phase_flips_when_head_wraps_at_depth_eight ... ok
+test admin_status_word_decodes_exact_sc_and_sct ... ok
+test completion_queue_phase_flips_at_depth_eight ... ok
+test admin_timeout_is_bounded_no_infinite_loop ... ok
+test completion_accessors_decode_little_endian_fields ... ok
+test controller_never_ready_maps_to_controller_timeout ... ok
+test controller_fatal_status_maps_to_controller_failed ... ok
+test io_command_id_mismatch_reports_device_error ... ok
+test io_nonzero_status_maps_to_device_error ... ok
+test io_timeout_is_bounded_no_infinite_loop ... ok
+test io_cq_wraparound_consumes_completions_in_order ... ok
+test stale_phase_completion_is_skipped_and_matching_one_consumed ... ok
+test malformed_completions_do_not_panic ... ok
+
+test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_flush.rs (target/debug/deps/nvme_flush-592b420dc2ed9f8b)
+
+running 6 tests
+test flush_after_write_in_same_session_uses_fresh_cid ... ok
+test flush_is_not_a_silent_no_op_doorbell_and_command_reach_device ... ok
+test flush_submits_opcode_zero_nsid_one_without_data_pointer ... ok
+test nonzero_flush_completion_status_returns_device_error ... ok
+test successful_flush_completion_returns_ok ... ok
+test flush_timeout_returns_timeout_and_is_bounded ... ok
+
+test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_identify.rs (target/debug/deps/nvme_identify-a2be85435664a0af)
+
+running 9 tests
+test init_identifies_namespace_and_capacity_round_trips ... ok
+test lbads_at_or_above_32_is_invalid_identify ... ok
+test maximum_flbas_descriptor_offset_stays_in_bounds ... ok
+test lbads_9_and_12_map_to_block_sizes ... ok
+test mdts_255_shift_does_not_panic ... ok
+test nonzero_flbas_selects_its_own_descriptor ... ok
+test nsid_zero_identify_does_not_panic ... ok
+test zero_block_count_is_invalid_identify ... ok
+test mdts_byte_77_controls_transfer_chunking ... ok
+
+test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_prp.rs (target/debug/deps/nvme_prp-dd973e4fd7815701)
+
+running 14 tests
+test invalid_non_power_of_two_page_size ... ok
+test invalid_zero_length_and_page_size ... ok
+test list_buffer_too_small_is_bounded ... ok
+test list_page_chaining_4k_exact_used ... ok
+test max_address_short_length_is_invalid_without_panic ... ok
+test multi_page_requires_aligned_nonzero_list ... ok
+test offset_plus_length_overflow_is_invalid ... ok
+test one_page_boundary_crossing ... ok
+test page_boundaries_64k ... ok
+test prp_values_are_full_physical_addresses ... ok
+test single_page_aligned_and_unaligned ... ok
+test transfer_limit_arithmetic_is_bounded ... ok
+test list_page_chaining_64k_exact_used ... ok
+test two_pages_use_prp2_with_zero_used ... ok
+
+test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_write.rs (target/debug/deps/nvme_write-244f9e3fbc2a458c)
+
+running 9 tests
+test empty_and_non_block_multiple_buffers_are_invalid_input ... ok
+test nonzero_write_completion_maps_to_device_error ... ok
+test each_io_command_gets_a_new_cid_and_completion_is_consumed ... ok
+test offset_write_splits_lba_across_cdw10_and_cdw11 ... ok
+test write_one_block_encodes_opcode_nsid_lba_nlb_and_prp1 ... ok
+test write_past_block_count_is_out_of_range_without_io_submission ... ok
+test write_eight_blocks_is_one_command_with_nlb_seven ... ok
+test written_bytes_read_back_exactly ... ok
+test mdts_chunking_submits_per_chunk_commands_with_correct_lba_and_nlb ... ok
+
+test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_write_completion.rs (target/debug/deps/nvme_write_completion-05ceb97712eccfdb)
+
+running 8 tests
+test failed_flush_completion_maps_to_device_error ... ok
+test failed_write_completion_maps_to_device_error ... ok
+test invalid_namespace_identify_surfaces_completion_status ... ok
+test write_batch_cq_wraparound_flips_phase_and_consumes_in_order ... ok
+test flush_timeout_is_bounded_no_infinite_loop ... ok
+test write_command_id_mismatch_maps_to_device_error ... ok
+test wrong_phase_zero_completion_is_ignored_not_consumed ... ok
+test write_timeout_is_bounded_no_infinite_loop ... ok
+
+test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_write_prp.rs (target/debug/deps/nvme_write_prp-49d57198a86480f2)
+
+running 14 tests
+test address_near_u64_max_is_invalid_without_panic_or_wrap ... ok
+test list_address_zero_or_unaligned_is_invalid_for_list_cases ... ok
+test flush_submits_opcode_zero_command ... ok
+test multi_block_write_crossing_page_emits_prp2 ... ok
+test one_block_aligned_write_is_single_prp1_page ... ok
+test offset_plus_length_overflow_is_invalid ... ok
+test unaligned_prp1_spans_pages_correctly ... ok
+test write_crossing_page_boundary_uses_prp1_and_prp2 ... ok
+test write_larger_than_mdts_is_split_into_commands ... ok
+test write_one_aligned_block_carries_single_prp1 ... ok
+test write_page_list_chains_at_4k_exact_entries ... ok
+test write_past_namespace_end_is_rejected_before_any_command ... ok
+test write_spanning_three_pages_uses_prp_list ... ok
+test write_page_list_chains_at_64k_exact_entries ... ok
+
+test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/store_v1_golden_vectors.rs (target/debug/deps/store_v1_golden_vectors-f6fdbcdb080f13e9)
+
+running 8 tests
+test crc32c_check_value ... ok
+test top_level_is_the_frozen_schema ... ok
+test object_id ... ok
+test empty_catalog ... ok
+test one_entry_catalog ... ok
+test equivalent_roots ... ok
+test adjacent_generations ... ok
+test genesis ... ok
+
+test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
+
+ Running tests/store_v1_negative.rs (target/debug/deps/store_v1_negative-7a130c126f2edc56)
+
+running 10 tests
+test catalog_rejects_unsorted_and_duplicate_object_ids ... ok
+test catalog_rejects_bad_header_counts_and_exact_lengths ... ok
+test catalog_extents_reject_overlap_and_metadata_overlap ... ok
+test generation_link_requires_adjacent_generation_and_exact_predecessor_ids ... ok
+test catalog_rejects_entry_reserved_flags_and_invalid_lengths ... ok
+test catalog_entry_bounds_reject_metadata_overflow_and_high_water_violations ... ok
+test commit_record_rejects_lengths_features_generation_and_high_water ... ok
+test superblock_commit_validation_binds_commit_unit_catalog_and_high_water ... ok
+test object_id_rejects_semantic_mutation_wrong_identity_and_nonzero_padding ... ok
+test crc32c_known_answer_and_superblock_rejects_corruption_reserved_and_slot ... ok
+
+test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.44s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_store_tool-03e09a0e1ba60bc3)
+
+running 2 tests
+test tests::garbage_is_stable_and_not_a_superblock ... ok
+test tests::tear_outcomes_detects_a_third_state ... ok
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/main.rs (target/debug/deps/allen_courier-e491f6ef3b9d347e)
+
+running 26 tests
+test code::tests::a_sentence_and_a_fenced_block_are_read ... ok
+test code::tests::an_unclosed_block_runs_to_the_end_and_no_block_is_none ... ok
+test code::tests::crc_is_zlibs ... ok
+test code::tests::short_names_and_odd_bytes_are_made_plain ... ok
+test tests::a_code_reply_becomes_pieces_and_a_closing_sentence ... ok
+test tests::datagram_heads_round_trip ... ok
+test plain_tests::a_cut_answer_stays_within_the_room_with_its_mark ... ok
+test code::tests::long_code_is_cut_at_a_line_within_the_limits ... ok
+test plain_tests::typographic_marks_become_plain_ones ... ok
+test tests::a_busy_server_names_its_wait_exactly ... ok
+test tests::json_strings_round_trip ... ok
+test tests::the_assistant_text_is_found_in_a_chat_completion ... ok
+test tests::long_answers_are_cut_at_a_sentence_end ... ok
+test tests::a_sentence_end_too_early_is_not_used ... ok
+test key_tests::no_key_sends_no_header_and_https_is_refused_out_loud ... ok
+test tests::chunked_bodies_are_joined ... ok
+test tests::a_busy_server_is_asked_again_with_growing_waits ... ok
+test tests::short_answers_pass_whole_with_whitespace_folded ... ok
+test tests::words_on_the_wire ... ok
+test tests::what_was_already_said_in_parts_is_kept ... ok
+test tests::dates_are_civil ... ok
+test key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so ... ok
+test key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back ... ok
+test tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns ... ok
+test tests::a_job_line_carries_the_memory_fields ... ok
+test code::tests::pieces_carry_length_checksum_and_escapes ... ok
+
+test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
+
+ Running unittests src/bin/allen-scene.rs (target/debug/deps/allen_scene-8a13abc9d8fd96a0)
+
+running 3 tests
+test tests::replies_and_numbers_are_read_from_a_completion ... ok
+test tests::slugs_and_waits ... ok
+test tests::the_prompt_is_plain_and_names_every_kind ... ok
+
+test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/allen_design_tokens-7ae70df9a5d45747)
+
+running 6 tests
+test tests::broken_reference_is_an_error ... ok
+test tests::c_export_is_integer_only ... ok
+test tests::duplicate_token_is_an_error ... ok
+test tests::reads_front_matter_and_blocks ... ok
+test tests::smoothstep_bezier_is_exact ... ok
+test tests::wcag_reference_values ... ok
+
+test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/main.rs (target/debug/deps/allen_design_tokens-5293da3bbdc3e60d)
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/exports.rs (target/debug/deps/exports-d40597b8c156ffba)
+
+running 3 tests
+test gated_contrast_passes ... ok
+test kernel_values_are_kept ... ok
+test exports_are_current ... ok
+
+test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/allen_reflex-242becdb94bf6a13)
+
+running 7 tests
+test tower::tests::full_slot_table_dispatches_every_request_and_pass_frees_the_slot ... ok
+test tower::tests::cache_key_is_sha256_of_the_domain_separated_encoding ... ok
+test tower::tests::join_slot_stays_stable_after_an_earlier_run_completes ... ok
+test tower::tests::decision_json_escapes_the_gate_name ... ok
+test tower::tests::receipt_from_one_tier_is_not_reused_for_another_tier ... ok
+test tower::tests::tower_reuses_receipt_and_deduplicates_inflight_and_routes_tiers ... ok
+test tower::tests::uncacheable_gate_is_never_joined_to_another_run ... ok
+
+test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/core.rs (target/debug/deps/core-5f698ba9fe3b9619)
+
+running 9 tests
+test dialog_roles_and_pending_state ... ok
+test memory_is_bounded ... ok
+test span_rules ... ok
+test one_shot_correction_flips_and_learning_can_be_off ... ok
+test multistep_takes_first_request_only ... ok
+test refuse_only_on_intent ... ok
+test sleep_reports_planted_conflict ... ok
+test always_schema_valid ... ok
+test deterministic_across_builds_and_calls ... ok
+
+test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.87s
+
+ Doc-tests aienos_accel
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_aegis
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_agent_state
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_artifact
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_boot
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_c1_tree
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_capability
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_capability_ffi
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_cortex
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_crypto
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_evidence
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_explain
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_infer
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests aienos_kernel
+
+running 2 tests
+test crates/aienos-kernel/src/arch/aarch64.rs - arch::aarch64::MmioReg::new (line 33) - compile fail ... ok
+test crates/aienos-kernel/src/arch/aarch64.rs - arch::aarch64::MmioReg::new (line 22) ... ok
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.28s
+
+ Doc-tests allen_design_tokens
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Doc-tests allen_reflex
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+PASS host tests: cargo test --workspace -- --format=pretty
+PASS ABI conformance: frozen wire format golden bytes and roundtrips verified
+
+--- [Clippy Verification: -D warnings] ---
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s
+PASS clippy: zero warnings with -D warnings
+
+--- [Clippy Verification: AArch64 targets, -D warnings] ---
+ Compiling version_check v0.9.5
+ Checking typenum v1.20.1
+ Compiling semver v1.0.28
+ Checking cfg-if v1.0.5
+ Checking subtle v2.6.1
+ Checking signature v2.2.0
+ Checking cpufeatures v0.2.17
+ Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto)
+ Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability)
+ Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel)
+ Checking ed25519 v2.2.3
+ Compiling rustc_version v0.4.1
+ Compiling generic-array v0.14.7
+ Compiling curve25519-dalek v4.1.3
+ Checking block-buffer v0.10.4
+ Checking crypto-common v0.1.7
+ Checking digest v0.10.7
+ Checking sha2 v0.10.9
+ Checking ed25519-dalek v2.2.0
+ Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.76s
+ Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.36s
+ Compiling proc-macro2 v1.0.107
+ Compiling unicode-ident v1.0.26
+ Compiling quote v1.0.47
+ Checking bit_field v0.10.3
+ Checking bitflags v2.13.2
+ Checking uguid v2.2.1
+ Checking log v0.4.34
+ Checking cfg-if v1.0.5
+ Checking ucs2 v0.3.3
+ Checking uefi-raw v0.17.0
+ Compiling syn v3.0.6
+ Compiling ptr_meta_derive v0.3.2
+ Compiling uefi-macros v0.20.0
+ Checking ptr_meta v0.3.2
+ Checking uefi v0.41.0
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.34s
+ Compiling generic-array v0.14.7
+ Checking typenum v1.20.1
+ Checking signature v2.2.0
+ Checking subtle v2.6.1
+ Checking cpufeatures v0.2.17
+ Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto)
+ Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel)
+ Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability)
+ Compiling curve25519-dalek v4.1.3
+ Checking uefi v0.41.0
+ Checking ed25519 v2.2.3
+ Checking crypto-common v0.1.7
+ Checking block-buffer v0.10.4
+ Checking digest v0.10.7
+ Checking sha2 v0.10.9
+ Checking ed25519-dalek v2.2.0
+ Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.40s
+ Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.02s
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.32s
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.32s
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.36s
+ Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s
+PASS clippy: aarch64-unknown-none kernel and aarch64-unknown-uefi images, zero warnings
+
+--- [SEED-0B qualification features: tests and clippy] ---
+ Compiling signature v2.2.0
+ Compiling crypto-common v0.1.7
+ Compiling curve25519-dalek v4.1.3
+ Compiling ed25519 v2.2.3
+ Compiling digest v0.10.7
+ Compiling sha2 v0.10.9
+ Compiling ed25519-dalek v2.2.0
+ Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Finished `test` profile [unoptimized + debuginfo] target(s) in 1.71s
+ Running unittests src/lib.rs (target/debug/deps/aienos_artifact-053ac0e23f858a90)
+
+running 26 tests
+test receipt_tests::canary_failed_decision_and_status_must_agree ... ok
+test receipt_tests::decision_consistency_rules_are_enforced ... ok
+test receipt_tests::nonce_and_verifier_identity_vectors ... ok
+test receipt_tests::golden_bytes_are_stable ... ok
+test receipt_tests::arbitrary_records_never_panic_the_decoder ... ok
+test receipt_tests::rejects_unknown_enum_and_code_values ... ok
+test tests::payload_manifest_and_resource_changes_change_artifact_identity ... ok
+test receipt_tests::optional_fields_require_their_presence_flags ... ok
+test tests::every_truncation_of_a_valid_artifact_is_rejected ... ok
+test receipt_tests::pi5_tier_round_trips_with_its_label ... ok
+test tests::ed25519_verifier_accepts_rfc8032_pure_signature_vector ... ok
+test receipt_tests::encoding_is_deterministic_and_round_trips ... ok
+test receipt_tests::rejects_length_magic_version_and_sizes ... ok
+test receipt_tests::layout_matches_adr_table_offsets ... ok
+test receipt_tests::unsigned_untrusted_and_production_verification_fail_closed ... ok
+test receipt_tests::test_receipt_anchor_is_rfc8032_test2_and_distinct_from_artifact_key ... ok
+test tests::accepts_canonical_artifact_and_exposes_exact_slices ... ok
+test tests::rejects_header_and_length_mutations ... ok
+test tests::rejects_section_entry_capability_resource_and_reserved_mutations ... ok
+test tests::qualification_anchor_authenticates_exact_artifact_identity ... ok
+test tests::authority_attenuation_is_directly_checkable ... ok
+test tests::signature_bytes_are_not_recursively_included_in_artifact_id ... ok
+test receipt_tests::rejects_unknown_flags_and_nonzero_reserved_bytes ... ok
+test receipt_tests::every_single_bit_change_in_the_signed_range_changes_meaning_or_is_rejected ... ok
+test tests::arbitrary_bounded_bytes_never_panic_the_parser ... ok
+test receipt_tests::signature_block_is_outside_the_digest_and_fully_authenticated ... ok
+
+test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
+
+ Doc-tests aienos_artifact
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Compiling serde_core v1.0.229
+ Compiling serde v1.0.229
+ Compiling serde_json v1.0.151
+ Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Compiling aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool)
+ Finished `test` profile [unoptimized + debuginfo] target(s) in 2.98s
+ Running unittests src/main.rs (target/debug/deps/aienos_artifact_tool-4058f819b9d7ed05)
+
+running 6 tests
+test tests::deterministic_pack_uses_the_shared_parser_and_id ... ok
+test tests::test_signer_roundtrips_through_shared_verifier ... ok
+test receipt_cmd::tests::check_accepts_only_receipts_that_bind_the_supplied_artifact ... ok
+test corpus::tests::baseline_is_valid_and_each_case_differs_from_it ... ok
+test corpus::tests::corpus_is_deterministic_and_names_are_unique_and_sorted ... ok
+test corpus::tests::verifier_stage_expectations_match_the_shared_verifier ... ok
+
+test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
+
+ Checking serde_core v1.0.229
+ Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Checking serde_json v1.0.151
+ Checking serde v1.0.229
+ Checking aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.77s
+PASS SEED-0B qualification features tested and linted; release build refuses the test signing identity
+
+--- [Bare-Metal Target Compilation Check] ---
+ Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto)
+ Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability)
+ Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel)
+ Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.09s
+ Compiling typenum v1.20.1
+ Compiling cfg-if v1.0.5
+ Compiling cpufeatures v0.2.17
+ Compiling signature v2.2.0
+ Compiling subtle v2.6.1
+ Compiling aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto)
+ Compiling aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability)
+ Compiling aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel)
+ Compiling ed25519 v2.2.3
+ Compiling generic-array v0.14.7
+ Compiling crypto-common v0.1.7
+ Compiling block-buffer v0.10.4
+ Compiling digest v0.10.7
+ Compiling sha2 v0.10.9
+ Compiling curve25519-dalek v4.1.3
+ Compiling ed25519-dalek v2.2.0
+ Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Compiling aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.55s
+PASS AArch64 build: aienos-kernel for aarch64-unknown-none
+
+--- [AArch64 UEFI Image Builds] ---
+ Compiling proc-macro2 v1.0.107
+ Compiling quote v1.0.47
+ Compiling uguid v2.2.1
+ Compiling bitflags v2.13.2
+ Compiling bit_field v0.10.3
+ Compiling cfg-if v1.0.5
+ Compiling log v0.4.34
+ Compiling ucs2 v0.3.3
+ Compiling uefi-raw v0.17.0
+ Compiling syn v3.0.6
+ Compiling ptr_meta_derive v0.3.2
+ Compiling uefi-macros v0.20.0
+ Compiling ptr_meta v0.3.2
+ Compiling uefi v0.41.0
+ Compiling aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `release` profile [optimized] target(s) in 3.80s
+AArch64 PE32+ EFI application verified: target/aarch64-unknown-uefi/release/aienos-boot.efi
+ Compiling generic-array v0.14.7
+ Compiling typenum v1.20.1
+ Compiling subtle v2.6.1
+ Compiling signature v2.2.0
+ Compiling cpufeatures v0.2.17
+ Compiling aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto)
+ Compiling aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability)
+ Compiling aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel)
+ Compiling curve25519-dalek v4.1.3
+ Compiling uefi v0.41.0
+ Compiling ed25519 v2.2.3
+ Compiling crypto-common v0.1.7
+ Compiling block-buffer v0.10.4
+ Compiling digest v0.10.7
+ Compiling sha2 v0.10.9
+ Compiling ed25519-dalek v2.2.0
+ Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Compiling aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Compiling aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Finished `release` profile [optimized] target(s) in 4.25s
+AArch64 PE32+ EFI application verified: target/aarch64-unknown-uefi/release/aienos-handoff.efi
+PASS AArch64 build: aienos-boot.efi and aienos-handoff.efi PE headers verified
+
+--- [QEMU AArch64 UEFI Boot Verification] ---
+qemu exit 0 after 8 s (commit 13d02ab4b714)
+PASS pre-exit report printed
+PASS image is this commit
+PASS left firmware and entered the kernel
+PASS kernel entered EL1h
+PASS cooperative threads interleaved
+PASS EL0 capability and fault isolation
+PASS timer-driven preemption across runnable tasks
+PASS deterministic MADT placement of preempt workers
+PASS typed IPC with attenuated revocable delegation
+PASS EL1 page tables and caches enabled
+PASS GICv3 enabled
+PASS timer IRQ delivered at least five ticks
+PASS MMU switched from firmware tables (0x47fff000) to AIENOS tables (0xbc317000)
+PASS GIC bases from the ACPI MADT, GICv3 architecture and ICC system registers
+PASS tick statistics consistent (period 10000 us, min 10021 avg 10091 max 10337)
+PASS final report on the SPCR console
+PASS no panic or fault
+QEMU_BOOT: PASS
+
+--- [P2-5 Binary Artifact Loader in QEMU] ---
+PASS p25exec code.bin is exactly what probe.S assembles to
+PASS p25wx code.bin is exactly what probe.S assembles to
+PASS p25spin code.bin is exactly what probe.S assembles to
+PASS p26seed code.bin is exactly what probe.S assembles to
+qemu exit 0 after 7 s (commit 13d02ab4b714)
+PASS left firmware and entered the kernel
+PASS M3 cooperative threads unchanged
+PASS M3 EL0 isolation proof unchanged
+PASS M3 typed IPC proof unchanged
+PASS firmware read all 34 artifact candidates
+PASS no kernel report line was truncated
+PASS final report reached the console
+PASS every frame returned after all candidates (4095 free before and after)
+PASS qualification build is labelled TEST ONLY
+PASS receipts carry the SEED-0B-QEMU tier
+PASS P26SEED (first SEED-0B capability artifact) read through its grant, WRITE and forged authority denied, exit 0, reclaimed
+PASS P26SEED granted exactly its READ request (granted ⊆ requested)
+PASS P26SEED holds exactly one capability
+PASS P26SEED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS P25EXEC admitted and executed its exact authenticated bytes, exit 0, caps revoked, reclaimed
+PASS P25WX admitted then killed by W^X fault on its code page, reclaimed
+PASS P25SPIN admitted then killed at its time budget, reclaimed
+PASS P25TAMP (payload byte flipped after signing) rejected BadSignature, reclaimed
+PASS P25EXEC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS P25WX.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS P25SPIN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS P25TAMP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H01-BAD-MAGIC.AIEN refused at verified (BadMagic), never ran, reclaimed
+PASS H01-BAD-MAGIC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H02-VERSION.AIEN refused at verified (UnsupportedVersion), never ran, reclaimed
+PASS H02-VERSION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H03-TARGET.AIEN refused at verified (WrongTarget), never ran, reclaimed
+PASS H03-TARGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H04-ABI.AIEN refused at verified (WrongAbi), never ran, reclaimed
+PASS H04-ABI.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H05-TRUNCATED.AIEN refused at verified (WrongLength), never ran, reclaimed
+PASS H05-TRUNCATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H06-TRAILING.AIEN refused at verified (WrongLength), never ran, reclaimed
+PASS H06-TRAILING.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H07-TOTAL-LENGTH.AIEN refused at verified (WrongLength), never ran, reclaimed
+PASS H07-TOTAL-LENGTH.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H08-OFFSET-OVERFLOW.AIEN refused at verified (ResourceLimit), never ran, reclaimed
+PASS H08-OFFSET-OVERFLOW.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H09-SECTION-OVERLAP.AIEN refused at verified (BadSection), never ran, reclaimed
+PASS H09-SECTION-OVERLAP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H10-ENTRY-OUTSIDE.AIEN refused at verified (BadEntryPoint), never ran, reclaimed
+PASS H10-ENTRY-OUTSIDE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H11-PAYLOAD-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed
+PASS H11-PAYLOAD-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H12-CAPS-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed
+PASS H12-CAPS-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H13-ENVELOPE-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed
+PASS H13-ENVELOPE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H14-SIGNATURE-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed
+PASS H14-SIGNATURE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H15-UNKNOWN-SIGNER.AIEN refused at verified (UntrustedSigner), never ran, reclaimed
+PASS H15-UNKNOWN-SIGNER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H16-SIG-FORMAT.AIEN refused at verified (BadSignatureFormat), never ran, reclaimed
+PASS H16-SIG-FORMAT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H17-RESERVED-HEADER.AIEN refused at verified (ReservedNonZero), never ran, reclaimed
+PASS H17-RESERVED-HEADER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H18-RIGHTS-UNKNOWN.AIEN refused at verified (MalformedCapability), never ran, reclaimed
+PASS H18-RIGHTS-UNKNOWN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H19-CAP-COUNT.AIEN refused at verified (ResourceLimit), never ran, reclaimed
+PASS H19-CAP-COUNT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H20-ENVELOPE-LIMIT.AIEN refused at verified (ResourceLimit), never ran, reclaimed
+PASS H20-ENVELOPE-LIMIT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H21-LARGEST-ENVELOPE.AIEN admitted and contained (exited:0x0), reclaimed
+PASS H21-LARGEST-ENVELOPE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H22-WX-SECTION.AIEN refused at verified (BadSection), never ran, reclaimed
+PASS H22-WX-SECTION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H23-EXEC-DATA.AIEN admitted and contained (fault:exec-nx), reclaimed
+PASS H23-EXEC-DATA.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H24-EXEC-STACK.AIEN admitted and contained (fault:exec-nx), reclaimed
+PASS H24-EXEC-STACK.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H25-BAD-SYSCALL.AIEN admitted and contained (bad-syscall:99), reclaimed
+PASS H25-BAD-SYSCALL.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H26-SYSCALL-BUDGET.AIEN admitted and contained (resource-overrun), reclaimed
+PASS H26-SYSCALL-BUDGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H27-POLICY-IPC.AIEN refused at authorized (ResourceLimit), never ran, reclaimed
+PASS H27-POLICY-IPC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H28-WRITE-ONLY-REQUEST.AIEN admitted and contained (exited:0x0), reclaimed
+PASS H28-WRITE-ONLY-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H29-READ-WRITE-REQUEST.AIEN admitted and contained (exited:0x0), reclaimed
+PASS H29-READ-WRITE-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS H29 requested READ|WRITE and was granted READ only
+PASS H28 requested only WRITE and received no capability
+PASS final report summarises every admission decision
+qemu exit 0 after 7 s (commit 13d02ab4b714)
+PASS left firmware and entered the kernel
+PASS M3 cooperative threads unchanged
+PASS M3 EL0 isolation proof unchanged
+PASS M3 typed IPC proof unchanged
+PASS firmware read all 34 artifact candidates
+PASS no kernel report line was truncated
+PASS final report reached the console
+PASS every frame returned after all candidates (4095 free before and after)
+PASS ordinary build admitted nothing
+PASS ordinary build refuses H01-BAD-MAGIC.AIEN (BadMagic), reclaimed
+PASS H01-BAD-MAGIC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H02-VERSION.AIEN (UnsupportedVersion), reclaimed
+PASS H02-VERSION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H03-TARGET.AIEN (WrongTarget), reclaimed
+PASS H03-TARGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H04-ABI.AIEN (WrongAbi), reclaimed
+PASS H04-ABI.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H05-TRUNCATED.AIEN (WrongLength), reclaimed
+PASS H05-TRUNCATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H06-TRAILING.AIEN (WrongLength), reclaimed
+PASS H06-TRAILING.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H07-TOTAL-LENGTH.AIEN (WrongLength), reclaimed
+PASS H07-TOTAL-LENGTH.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H08-OFFSET-OVERFLOW.AIEN (ResourceLimit), reclaimed
+PASS H08-OFFSET-OVERFLOW.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H09-SECTION-OVERLAP.AIEN (BadSection), reclaimed
+PASS H09-SECTION-OVERLAP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H10-ENTRY-OUTSIDE.AIEN (BadEntryPoint), reclaimed
+PASS H10-ENTRY-OUTSIDE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H11-PAYLOAD-MUTATED.AIEN (UntrustedSigner), reclaimed
+PASS H11-PAYLOAD-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H12-CAPS-MUTATED.AIEN (UntrustedSigner), reclaimed
+PASS H12-CAPS-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H13-ENVELOPE-MUTATED.AIEN (UntrustedSigner), reclaimed
+PASS H13-ENVELOPE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H14-SIGNATURE-MUTATED.AIEN (UntrustedSigner), reclaimed
+PASS H14-SIGNATURE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H15-UNKNOWN-SIGNER.AIEN (UntrustedSigner), reclaimed
+PASS H15-UNKNOWN-SIGNER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H16-SIG-FORMAT.AIEN (BadSignatureFormat), reclaimed
+PASS H16-SIG-FORMAT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H17-RESERVED-HEADER.AIEN (ReservedNonZero), reclaimed
+PASS H17-RESERVED-HEADER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H18-RIGHTS-UNKNOWN.AIEN (MalformedCapability), reclaimed
+PASS H18-RIGHTS-UNKNOWN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H19-CAP-COUNT.AIEN (ResourceLimit), reclaimed
+PASS H19-CAP-COUNT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H20-ENVELOPE-LIMIT.AIEN (ResourceLimit), reclaimed
+PASS H20-ENVELOPE-LIMIT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H21-LARGEST-ENVELOPE.AIEN (UntrustedSigner), reclaimed
+PASS H21-LARGEST-ENVELOPE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H22-WX-SECTION.AIEN (BadSection), reclaimed
+PASS H22-WX-SECTION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H23-EXEC-DATA.AIEN (UntrustedSigner), reclaimed
+PASS H23-EXEC-DATA.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H24-EXEC-STACK.AIEN (UntrustedSigner), reclaimed
+PASS H24-EXEC-STACK.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H25-BAD-SYSCALL.AIEN (UntrustedSigner), reclaimed
+PASS H25-BAD-SYSCALL.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H26-SYSCALL-BUDGET.AIEN (UntrustedSigner), reclaimed
+PASS H26-SYSCALL-BUDGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H27-POLICY-IPC.AIEN (UntrustedSigner), reclaimed
+PASS H27-POLICY-IPC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H28-WRITE-ONLY-REQUEST.AIEN (UntrustedSigner), reclaimed
+PASS H28-WRITE-ONLY-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses H29-READ-WRITE-REQUEST.AIEN (UntrustedSigner), reclaimed
+PASS H29-READ-WRITE-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses P25EXEC.AIEN (UntrustedSigner), reclaimed
+PASS P25EXEC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses P25SPIN.AIEN (UntrustedSigner), reclaimed
+PASS P25SPIN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses P25TAMP.AIEN (UntrustedSigner), reclaimed
+PASS P25TAMP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses P25WX.AIEN (UntrustedSigner), reclaimed
+PASS P25WX.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS ordinary build refuses P26SEED.AIEN (UntrustedSigner), reclaimed
+PASS P26SEED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies
+PASS final report summarises zero admitted
+ARTIFACT_PARSE: PASS
+ARTIFACT_IDENTITY: PASS
+ARTIFACT_SIGNATURE: PASS
+ARTIFACT_ADMISSION: PASS
+ARTIFACT_LOADED_BYTES: PASS
+ARTIFACT_WX: PASS
+SEED0B_AUTHORIZED_READ: PASS
+SEED0B_WRITE_DENIED: PASS
+SEED0B_FORGED_DENIED: PASS
+SEED0B_RESOURCE_BOUND: PASS
+SEED0B_CLEANUP: PASS
+ADMISSION_RECEIPT: PASS
+HOSTILE_MATRIX: PASS
+SEED_0B_QEMU: PASS
+QEMU_ARTIFACT: PASS
+
+--- [SEED-0A USB Keyboard in QEMU (input.keyboard.usb)] ---
+attempts 1, 12 s (commit 13d02ab4b714), dma mode smmu, sent lines: abc, help, el, mem, exit
+PASS left firmware and entered the kernel
+PASS xHCI controller found before exit
+PASS PCI segment swept for bus masters after exit
+PASS no endpoint left with bus master stuck on
+PASS xHCI bus master off before the DMA gate
+PASS keyboard attached by the AIENOS driver
+PASS IORT stream configured for xHCI DMA
+PASS xHCI DMA window translated
+PASS xHCI DMA granted only as confined
+PASS typed text echoed on the serial console
+PASS line ended by Enter and reported
+PASS keyboard phase finished on Enter
+PASS help command output
+PASS EL command output
+PASS memory command output
+PASS keyboard phase finished on exit
+PASS xHCI bus master revoked after the keyboard phase
+PASS no unsafe DMA bypass in this image
+QEMU_KEYBOARD: PASS (smmu)
+
+--- [SMMUv3 DMA Confinement in QEMU] ---
+attempts 1, 11 s (commit 13d02ab4b714), dma mode smmu, sent lines: abc, help, el, mem, exit
+PASS left firmware and entered the kernel
+PASS xHCI controller found before exit
+PASS PCI segment swept for bus masters after exit
+PASS no endpoint left with bus master stuck on
+PASS xHCI bus master off before the DMA gate
+PASS keyboard attached by the AIENOS driver
+PASS IORT stream configured for xHCI DMA
+PASS xHCI DMA window translated
+PASS xHCI DMA granted only as confined
+PASS typed text echoed on the serial console
+PASS line ended by Enter and reported
+PASS keyboard phase finished on Enter
+PASS help command output
+PASS EL command output
+PASS memory command output
+PASS keyboard phase finished on exit
+PASS xHCI bus master revoked after the keyboard phase
+PASS no unsafe DMA bypass in this image
+QEMU_KEYBOARD: PASS (smmu)
+attempts 1, 8 s (commit 13d02ab4b714), dma mode fail-closed, sent lines: abc, help, el, mem, exit
+PASS left firmware and entered the kernel
+PASS xHCI controller found before exit
+PASS PCI segment swept for bus masters after exit
+PASS no endpoint left with bus master stuck on
+PASS xHCI bus master off before the DMA gate
+PASS xHCI DMA denied without an SMMU
+PASS keyboard fail-closed without an SMMU
+PASS xHCI never granted DMA
+PASS keyboard never attached
+PASS no unsafe DMA bypass in this image
+QEMU_KEYBOARD: PASS (fail-closed)
+
+--- [M0 Native-Boot Rollback Verification in QEMU] ---
+============================================================
+AIENOS M0 Native-Boot Rollback Test Suite (QEMU AArch64)
+Host: spark-b87b | Firmware: AAVMF_CODE.no-secboot.fd
+============================================================
+Building aienos-rollback-mock...
+
+--- [Subtest 1: Normal Candidate Execution & Rollback] ---
+PASS AAVMF BdsDxe firmware one-shot BootNext dispatch & NVRAM persistence verified (Boot0000 -> Boot0001)
+AAVMF_BOOTNEXT_NVRAM: PASS
+NATIVE_ROLLBACK_NORMAL: PASS
+
+--- [Subtest 2: Candidate Fault / Panic & Rollback] ---
+PASS Faulted candidate consumed BootNext and returned to Default via AAVMF BootOrder
+NATIVE_ROLLBACK_FAULT: PASS
+
+--- [Subtest 3: Candidate Hang / Timeout & Rollback] ---
+PASS Hung candidate reset consumed BootNext and returned to Default via AAVMF BootOrder
+NATIVE_ROLLBACK_TIMEOUT: PASS
+
+--- [Subtest 4: Malformed / Corrupted Image Fallback] ---
+PASS Malformed image rejected by AAVMF firmware with fallback to Default via BootOrder
+NATIVE_ROLLBACK_REJECTED: PASS
+
+--- [Subtest 5: Absent Candidate Image Fallback] ---
+PASS Absent candidate image handled cleanly with fallback to Default via BootOrder
+
+--- [Subtest 6: Repeated Boot Post-Consumption (No Loop Invariant)] ---
+PASS Subsequent reboot stayed on Default OS via AAVMF BootOrder without re-executing candidate
+NATIVE_ROLLBACK_BOOTNEXT_CONSUMED: PASS
+NATIVE_ROLLBACK_DEFAULT_UNCHANGED: PASS
+
+============================================================
+AAVMF_BOOTNEXT_NVRAM: PASS
+NATIVE_ROLLBACK_NORMAL: PASS
+NATIVE_ROLLBACK_FAULT: PASS
+NATIVE_ROLLBACK_TIMEOUT: PASS
+NATIVE_ROLLBACK_REJECTED: PASS
+NATIVE_ROLLBACK_BOOTNEXT_CONSUMED: PASS
+NATIVE_ROLLBACK_DEFAULT_UNCHANGED: PASS
+M0_NATIVE_ROLLBACK_QEMU: PASS
+M0_ROLLBACK_QEMU: PASS
+
+--- [P3 NVMe + System Store v1 in QEMU] ---
+nvme image: 67108864 bytes, 131072 x 512 B LBAs
+sentinel: LBA 2048 offset 1048576, magic 'AIENOS-NVME-SENT' x32, sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1
+attempts 1, 8 s (commit 13d02ab4b714), dma mode smmu
+PASS ECAM discovery found the NVMe class device
+PASS controller and namespace identify completed
+PASS namespace geometry matches the image
+PASS sentinel LBA read back exact bytes and SHA-256
+PASS read past the namespace end is rejected before any command
+PASS device-reported command error is surfaced
+PASS IORT stream configured for NVMe DMA
+PASS NVMe DMA window translated
+PASS NVMe DMA granted only as confined
+PASS NVMe bus master revoked after the read phase
+PASS no unsafe DMA bypass in this image
+QEMU_NVME: PASS (smmu)
+nvme image: 67108864 bytes, 131072 x 512 B LBAs
+sentinel: LBA 2048 offset 1048576, magic 'AIENOS-NVME-SENT' x32, sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1
+attempts 1, 7 s (commit 13d02ab4b714), dma mode fail-closed
+PASS discovery found the device before the DMA gate
+PASS NVMe DMA denied without an SMMU
+PASS NVMe controller fail-closed without an SMMU
+PASS NVMe controller never granted DMA
+PASS NVMe controller never identified
+PASS NVMe read never ran
+PASS no unsafe DMA bypass in this image
+QEMU_NVME: PASS (fail-closed)
+nvme image: 67108864 bytes, 131072 x 512 B LBAs
+sentinel LBA 2048 sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1
+rw old LBA 4096 sha256 46fe054d5bfa8bf3b14ce240830da7445b26ebebe273349f9af22e6454244379
+rw new LBA 4096 sha256 76fa34c132173497a7bcd0c9618ebdcf0629f550934c164adf81cfa05e6a4451
+PASS ECAM discovery found the NVMe class device
+PASS controller and namespace identify completed
+PASS namespace geometry matches the image
+PASS NVMe power-fail atomicity fields observed
+INFO Store root-write power-fail atomicity NOT proven on this namespace
+INFO NVME_ATOMICITY_IDENTIFY_QEMU: block_size=512 lbads=9 awupf_raw=0 nawupf_raw=0 nabspf_raw=0 nabo_blocks=0 effective_pf_blocks=1 boundary_blocks=-1
+INFO NVME_STORE_ROOT_ATOMICITY_QEMU: FAIL (slot0=not_atomic(ExceedsAtomicUnit { required_blocks: 8, guaranteed_blocks: 1 }) slot1=not_atomic(ExceedsAtomicUnit { required_blocks: 8, guaranteed_blocks: 1 }))
+PASS read sentinel LBA returned exact bytes and SHA-256
+PASS read past the namespace end is rejected
+PASS device-reported read error is surfaced
+PASS write past the namespace end is rejected
+PASS native write returned exact bytes and SHA-256
+PASS native flush completed
+PASS write then flush then read-back matched
+PASS invalid-namespace write surfaced a device error
+PASS IORT stream configured for NVMe DMA
+PASS NVMe DMA granted only as confined
+PASS NVMe bus master revoked after the phase
+PASS host read-back after power off equals the written bytes
+PASS restart read-back observed the persisted pattern natively
+QEMU_NVME_RW: PASS (smmu)
+nvme image: 67108864 bytes, 131072 x 512 B LBAs
+sentinel LBA 2048 sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1
+rw old LBA 4096 sha256 46fe054d5bfa8bf3b14ce240830da7445b26ebebe273349f9af22e6454244379
+rw new LBA 4096 sha256 76fa34c132173497a7bcd0c9618ebdcf0629f550934c164adf81cfa05e6a4451
+PASS discovery found the device before the DMA gate
+PASS NVMe DMA denied without an SMMU
+PASS NVMe controller fail-closed without an SMMU
+PASS no write marker without DMA
+PASS no flush marker without DMA
+PASS no durability marker without DMA
+QEMU_NVME_RW: PASS (fail-closed)
+nvme image: 67108864 bytes, 16384 x 4096 B LBAs
+qemu-system-aarch64: terminating on signal 15 from pid 954064 (bash)
+---- observed ----
+NVME_IDENTIFY_QEMU: PASS (vid=0x1b36 did=0x0010 nsid=1)
+NVME_GEOMETRY_QEMU: PASS (nsid=1 block_count=16384 block_size=4096)
+NVME_ATOMICITY_IDENTIFY_QEMU: block_size=4096 lbads=12 awupf_raw=0 nawupf_raw=0 nabspf_raw=0 nabo_blocks=0 effective_pf_blocks=1 boundary_blocks=-1
+NVME_STORE_ROOT_ATOMICITY_QEMU: PASS (slot0=atomic(effective=1) slot1=atomic(effective=1))
+-------------------
+PASS controller and namespace identify completed
+PASS namespace geometry is 4096-byte LBA
+PASS atomicity Identify observed with 4096-byte LBA
+PASS Store root write is power-fail atomic and boundary-safe
+QEMU_NVME_ATOMICITY_4K: PASS
+PASS integration smoke (provision + transact)
+PASS reopen smoke
+---- crash campaign results ----
+settle=0 cp=before_first_write saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK
+settle=0 cp=after_payloads saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK
+settle=0 cp=after_catalog saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK
+settle=0 cp=after_commit_record saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK
+settle=0 cp=after_first_flush saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK
+settle=0 cp=after_superblock_write saw=1 guest_reopen=1 guest_slot=1 recovered=2 state=Valid expect=N_NP1 -> OK
+settle=0 cp=after_final_flush saw=1 guest_reopen=1 guest_slot=1 recovered=2 state=Valid expect=NP1 -> OK
+settle=3 cp=before_first_write saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK
+settle=3 cp=after_payloads saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK
+settle=3 cp=after_catalog saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK
+settle=3 cp=after_commit_record saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK
+settle=3 cp=after_first_flush saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK
+settle=3 cp=after_superblock_write saw=1 guest_reopen=1 guest_slot=1 recovered=5 state=Valid expect=N_NP1 -> OK
+settle=3 cp=after_final_flush saw=1 guest_reopen=1 guest_slot=1 recovered=5 state=Valid expect=NP1 -> OK
+
+=== Summary (commit 13d02ab4b7145579f6d3faa53442167bfcdcd7bc, tree_dirty=false, evidence level: QEMU only) ===
+STORE_NVME_INTEGRATION_QEMU: PASS
+STORE_CHECKPOINT_CRASH_QEMU: PASS
+STORE_REOPEN_QEMU: PASS
+STORE_SLOT_REUSE_QEMU: PASS
+STORE_V1_QEMU: PASS
+P3_STORE_QEMU: NOT CLAIMED (QEMU campaign; native persistence conditions separate)
+=== Building aienos-handoff (store-qual) and aienos-store-tool ===
+=== Integration Smoke (512-byte LBA) ===
+PASS integration smoke (provision + transact, 512b non-atomic qualification active)
+PASS reopen smoke (generation=2 state=Valid peer=Valid)
+
+=== Tier 1: Checkpoint SIGKILL Campaign ===
+settle=0 cp=before_first_write saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK
+settle=0 cp=after_payloads saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK
+settle=0 cp=after_catalog saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK
+settle=0 cp=after_commit_record saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK
+settle=0 cp=after_first_flush saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK
+settle=0 cp=after_superblock_write saw=1 reopen=1 slot=1 gen=2 state=Valid peer=Valid expect=N_NP1 -> OK
+settle=0 cp=after_final_flush saw=1 reopen=1 slot=1 gen=2 state=Valid peer=Valid expect=NP1 -> OK
+settle=3 cp=before_first_write saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK
+settle=3 cp=after_payloads saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK
+settle=3 cp=after_catalog saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK
+settle=3 cp=after_commit_record saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK
+settle=3 cp=after_first_flush saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK
+settle=3 cp=after_superblock_write saw=1 reopen=1 slot=1 gen=5 state=Valid peer=Valid expect=N_NP1 -> OK
+settle=3 cp=after_final_flush saw=1 reopen=1 slot=1 gen=5 state=Valid peer=Valid expect=NP1 -> OK
+STORE_512B_CRASH_OBSERVED_QEMU: PASS
+
+=== Tier 2a: Root Tear Closure (host proof over Tier 1 images) ===
+settle=0 STORE_ROOT_TEAR_CLOSURE: PASS (slot=1 old=zero new=gen2 sector_bytes=512 differing_sectors=[0] combinations=256 as_old=128 as_new=128)
+settle=3 STORE_ROOT_TEAR_CLOSURE: PASS (slot=0 old=gen3 new=gen5 sector_bytes=512 differing_sectors=[0] combinations=256 as_old=128 as_new=128)
+STORE_512B_ROOT_TEAR_CLOSURE: PASS
+
+=== Tier 2b: Injected Root Recovery (media corruption, one defect per case) ===
+case=bad_crc decode=BadSuperblockCrc gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK
+case=wrong_magic decode=BadSuperblockMagic gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK
+case=nonzero_reserved decode=NonzeroReserved gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK
+case=wrong_slot_id decode=WrongSuperblockSlot gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK
+case=region_mismatch decode=Ok gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK
+case=seeded_garbage decode=BadSuperblockMagic gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK
+case=unsupported_version decode=UnsupportedVersion gen=none state=none peer=none readonly=0 expect=refuse:UnsupportedVersion -> OK
+case=graph_bad_newer decode=Ok gen=1 state=DegradedRecovery peer=GraphBadNewer readonly=1 expect=degraded:GraphBadNewer -> OK
+case=control_new_root decode=Ok gen=2 state=Valid peer=Valid readonly=0 expect=valid:gen2 -> OK
+STORE_512B_INJECTED_ROOT_RECOVERY_QEMU: PASS
+
+=== Final Summary (commit 13d02ab4b7145579f6d3faa53442167bfcdcd7bc-dirty, tree_dirty=true, evidence level: QEMU only) ===
+STORE_NVME_INTEGRATION_512B_QEMU: PASS
+STORE_512B_CRASH_OBSERVED_QEMU: PASS
+STORE_512B_ROOT_TEAR_CLOSURE: PASS
+STORE_512B_INJECTED_ROOT_RECOVERY_QEMU: PASS
+STORE_512B_CRASH_RECOVERY_QEMU: PASS
+P3_STORE_QEMU: NOT CLAIMED (QEMU campaign; native persistence conditions separate)
+P3_STORE_NATIVE: NOT CLAIMED
+=== Building aienos-handoff (continuity-qual) and aienos-store-tool ===
+=== 1. Refusals: no boot path mints an identity ===
+PASS resume on blank media stops (store Unformatted) and writes nothing
+PASS resume on a formatted but unprovisioned store stops UNPROVISIONED and writes nothing
+=== 2. Provisioning happens once ===
+PASS provisioned agent b7938600173787d9... (incarnation 1, empty memory, root branch)
+PASS a second provisioning request is refused and writes nothing
+PASS independent provisioning draws a different identity from RNDR
+=== 3. Memory and lineage survive cold restarts ===
+PASS resume + remember: incarnation 2, one Cortex fact and one forked branch committed
+PASS cold restart 1: same agent, same memory 93153a653f8f3b39, same lineage, incarnation 3
+PASS cold restart 2: same agent, same memory 93153a653f8f3b39, same lineage, incarnation 4
+=== 4. SIGKILL at every Store checkpoint of a continuity commit ===
+PASS kill at before_first_write: same agent, old memory
+PASS kill at after_payloads: same agent, old memory
+PASS kill at after_catalog: same agent, old memory
+PASS kill at after_commit_record: same agent, old memory
+PASS kill at after_first_flush: same agent, old memory
+PASS kill at after_superblock_write: same agent, new memory
+PASS kill at after_final_flush: same agent, new memory
+=== 5. Degraded mount resumes read-only ===
+PASS malformed peer superblock: same agent and memory, read-only, nothing written
+
+=== Summary (commit 13d02ab4b7145579f6d3faa53442167bfcdcd7bc) ===
+CONTINUITY_QEMU: PASS
+CONTINUITY_NATIVE: NOT CLAIMED (Machine 1 waits on TRUST-1)
+=== Building aienos-handoff (recovery-qual) and aienos-store-tool ===
+=== 1. Degraded store: operator-authorised repair ===
+PASS inspection enters the Recovery Core (Degraded(Malformed)), shows the same agent, writes nothing
+PASS repair with zero response refused, nothing written
+PASS repair with wrong_key response refused, nothing written
+PASS repair with wrong_action response refused, nothing written
+PASS authorised repair done
+PASS after repair a cold boot resumes writable with the same agent and memory
+PASS replaying the repair authorisation on the healthy store does nothing
+=== 2. Unprovisioned store: operator-authorised provisioning ===
+PASS unprovisioned store enters the Recovery Core and offers only provisioning
+PASS provisioning with a wrong key refused, nothing written
+PASS operator provisioning created one identity and a cold boot resumes it
+=== 3. Identity loss: nothing may mint ===
+PASS corrupted agent root: Recovery Core entered, no action offered, nothing written (Degraded(GraphBadNewer))
+PASS mode 10 after identity loss refused, nothing written
+PASS mode 11 after identity loss refused, nothing written
+PASS a normal boot after identity loss does not resume or mint (19bda224e79b12b9... is not replaced)
+
+=== Summary (commit ae16b168e3c135a4770b4400f4cb9a18dcb289f4) ===
+RECOVERY_CORE_QEMU: PASS
+RECOVERY_CORE_OPERATOR_CREDENTIAL: TEST-ONLY (real scheme undecided, ADR 0006 / M5)
+
+
+--- [TRUST-1 Gate 4 Security Suite Verification] ---
+Building aienos-handoff binary for Gate 4 suite...
+=== Subtest 1: Software TPM 2.0 Integration & Live Boot ===
+PASS swTPM live boot reached kernel alive and final report
+=== Subtest 2: Soak Testing (3 Sequential Boots) ===
+PASS Soak run 1/3: clean boot & reset
+PASS Soak run 2/3: clean boot & reset
+PASS Soak run 3/3: clean boot & reset
+=== Subtest 3: Fault Injection (Corrupted EFI Image) ===
+qemu-system-aarch64: terminating on signal 15 from pid 1424241 (timeout)
+PASS Corrupted binary cleanly rejected by firmware without reaching kernel alive (firmware banner present)
+TRUST-1 Gate 4 Security Suite: ALL TESTS PASS
+
+--- [TRUST-1 Gate 1 Standalone Recovery Verification] ---
+Building standalone recovery initrd...
+Building standalone recovery root in /tmp/recovery-initrd-build.a4Z6jS...
+Packaged 16 kernel modules for 7.0.0-1019-nvidia
+Packaging standalone initrd to /tmp/tmp.8Q6AsVwJaJ/aienos-recovery-standalone-initrd.img...
+81696 blocks
+Standalone recovery initrd build complete: 16M /tmp/tmp.8Q6AsVwJaJ/aienos-recovery-standalone-initrd.img
+Booting standalone recovery kernel in QEMU with ZERO hard disks attached...
+qemu exit 0 after 8 s
+PASS Recovery banner displayed
+PASS 100% RAM disk verified
+PASS Internal NVMe confirmed unmounted
+PASS Automated recovery test passed
+RECOVERY_ZERO_DISK: PASS (verified standalone RAM recovery with zero attached storage)
+Booting recovery kernel with a scratch USB stick, NVMe drive and USB keyboard...
+qemu exit 0
+PASS All packaged kernel modules loaded (16/16)
+PASS USB keyboard detected
+PASS USB stick visible
+PASS NVMe drive visible
+RECOVERY_DEVICES: PASS (packaged drivers found USB keyboard, USB stick and NVMe)
+
+--- [Recovery Media Tooling Manifest] ---
+Building standalone recovery initrd...
+Building standalone recovery root in /tmp/recovery-initrd-build.ycrGhm...
+Packaged 16 kernel modules for 7.0.0-1019-nvidia
+Packaging standalone initrd to /tmp/tmp.dJSya4fDNd/aienos-recovery-standalone-initrd.img...
+81696 blocks
+Standalone recovery initrd build complete: 16M /tmp/tmp.dJSya4fDNd/aienos-recovery-standalone-initrd.img
+Extracting /tmp/tmp.dJSya4fDNd/aienos-recovery-standalone-initrd.img...
+
+-- required tools for NVMe root mount --
+PASS busybox present
+PASS mount present
+PASS lsblk present
+PASS blkid present
+PASS cryptsetup present
+PASS nvme kernel module packaged
+PASS dm-crypt kernel module packaged
+
+-- required tools for /boot/efi repair --
+PASS fsck.vfat present
+PASS mkfs.vfat present
+PASS fsck.ext4 present
+PASS efibootmgr present
+
+-- required tools for boot-entry restore --
+PASS efibootmgr present (boot entries)
+PASS chroot present
+PASS findmnt present for attended evidence collector
+PASS attended evidence collector packaged on media
+
+-- TRUST-1 Gate 1 items 8, 10, 11-12: TPM, signatures, recovery unlock --
+PASS tpm2_pcrread present
+PASS tpm2 device transport library packaged (dlopen, not seen by ldd)
+PASS sbverify present
+PASS age present
+PASS gocryptfs present
+PASS fusermount3 present
+PASS gocryptfs: every shared library it needs is inside the image
+PASS age: every shared library it needs is inside the image
+PASS sbverify: every shared library it needs is inside the image
+PASS tpm2_pcrread: every shared library it needs is inside the image
+PASS cryptsetup: every shared library it needs is inside the image
+PASS fusermount3: every shared library it needs is inside the image
+PASS efibootmgr: every shared library it needs is inside the image
+PASS tpm2 device transport: its libraries are inside the image
+
+-- init hooks --
+PASS init is executable
+PASS init keeps zero-disk test mode (aienos.test=1)
+PASS init reports EFI boot entries (efibootmgr)
+PASS init drops into an interactive maintenance shell
+
+RECOVERY_TOOLS: PASS (initrd ships mount, EFI repair, and boot-entry restore capability)
+
+--- [TRUST-1 Measurement Tools Self-Test] ---
+PASS capture + compare: identical states compare equal
+PASS capture refuses to overwrite
+PASS compare names exactly PCR 7 after one extend
+PASS receipt: restored rollback RECORDED, unrestored STOP, chained
+PASS tampered captures refused
+PASS credential decoder: header decoded, --live follows PCR 7
+TRUST-1 measurement tools self-test: ALL PASS
+
+--- [TRUST-1 Gate 4 Secure Boot Signing in QEMU] ---
+Building aienos-handoff binary for the Secure Boot test...
+PASS signed with enrolled test key: booted to kernel alive (Secure Boot on)
+PASS unsigned image refused by firmware signature check (Access Denied)
+PASS tampered image refused by firmware signature check (Access Denied)
+PASS wrongkey image refused by firmware signature check (Access Denied)
+TRUST-1 Gate 4 Secure Boot signing test: ALL PASS
+
+--- [TRUST-1 Gate 3 Key Ceremony Tool Self-Test] ---
+PASS generate: four keys and a root-signed manifest that verifies
+PASS every private key is stored encrypted
+PASS generate refuses to overwrite
+PASS two backups decrypt from their own copies; record has no private material
+PASS a wrong passphrase cannot open the backup copy
+PASS a changed manifest is refused
+PASS a swapped public key is refused
+PASS rotation add: generation 2 trusts old and new release keys; old signatures still verify
+PASS rotation revoke: generation 3 trusts only the new key; old key quarantined, not deleted
+PASS owner_root cannot be rotated by the routine tool (special recovery ceremony only)
+PASS a validly signed older generation is refused when generation 3 is the minimum
+PASS Boot Signer cert signs and verifies the EFI loader (sbsign/sbverify)
+TRUST-1 key ceremony self-test (throwaway keys): ALL PASS
+
+--- [Evidence Receipt Label Lint] ---
+PASS mutant: literal true, no addendum -> FAIL -> exit 1
+PASS amended by an addendum bound to the hash -> PASS -> exit 0
+PASS mutant: addendum bound to a different hash -> FAIL -> exit 1
+PASS NOT_RUN labels need no addendum -> PASS -> exit 0
+PASS receipt with no invariants block -> PASS -> exit 0
+CHECK_RECEIPT_LABELS_SELF_TEST: PASS
+PASS gate1_zero_disk_recovery_receipt.json: hardcoded invariants are amended by an addendum bound to sha256 e1d6ac54
+RECEIPT_LABELS: PASS
+
+============================================================
+VERIFY_ALL: PASS (every step ran; QEMU steps are emulator evidence only, hardware NOT_RUN)
+============================================================
diff --git a/evidence/allen-omega-L694/probe.txt b/evidence/allen-omega-L694/probe.txt
new file mode 100644
index 00000000..5bf0d579
--- /dev/null
+++ b/evidence/allen-omega-L694/probe.txt
@@ -0,0 +1 @@
+Allen Omega native probe
diff --git a/evidence/allen-omega-L694/push.log b/evidence/allen-omega-L694/push.log
new file mode 100644
index 00000000..1dfa0d93
--- /dev/null
+++ b/evidence/allen-omega-L694/push.log
@@ -0,0 +1,5 @@
+ssh: Could not resolve hostname github.com: Temporary failure in name resolution
+fatal: Could not read from remote repository.
+
+Please make sure you have the correct access rights
+and the repository exists.
diff --git a/evidence/allen-omega-L694/replay1.log b/evidence/allen-omega-L694/replay1.log
new file mode 100644
index 00000000..462a8e50
--- /dev/null
+++ b/evidence/allen-omega-L694/replay1.log
@@ -0,0 +1,3 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+omc: line 1907: error 10
diff --git a/evidence/allen-omega-L694/replay2.log b/evidence/allen-omega-L694/replay2.log
new file mode 100644
index 00000000..bbc81741
--- /dev/null
+++ b/evidence/allen-omega-L694/replay2.log
@@ -0,0 +1,22 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=6
+session mutant compile=0 rejected-exit=0
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/replay3.log b/evidence/allen-omega-L694/replay3.log
new file mode 100644
index 00000000..42d1c377
--- /dev/null
+++ b/evidence/allen-omega-L694/replay3.log
@@ -0,0 +1,22 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=6
+session mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/replay4.log b/evidence/allen-omega-L694/replay4.log
new file mode 100644
index 00000000..42d1c377
--- /dev/null
+++ b/evidence/allen-omega-L694/replay4.log
@@ -0,0 +1,22 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=6
+session mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/replay5.log b/evidence/allen-omega-L694/replay5.log
new file mode 100644
index 00000000..29b40aa8
--- /dev/null
+++ b/evidence/allen-omega-L694/replay5.log
@@ -0,0 +1,22 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+memory compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+stdio native-exit=0 golden-cmp=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-omega-L694/reply1.txt b/evidence/allen-omega-L694/reply1.txt
new file mode 100644
index 00000000..d11a72ad
--- /dev/null
+++ b/evidence/allen-omega-L694/reply1.txt
@@ -0,0 +1,15 @@
+801 0
+802 0
+803 0
+804 0
+805 0
+806 0
+807 0
+808 0
+809 0
+810 0
+811 0
+812 0
+813 0
+814 0
+815 0
diff --git a/evidence/allen-omega-L694/runtime-green.txt b/evidence/allen-omega-L694/runtime-green.txt
new file mode 100644
index 00000000..5168e6f3
--- /dev/null
+++ b/evidence/allen-omega-L694/runtime-green.txt
@@ -0,0 +1,28 @@
+1 0
+2 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
+11 0
+12 0
+13 0
+14 0
+15 0
+16 0
+17 0
+18 0
+19 0
+20 0
+21 0
+22 0
+23 0
+24 0
+25 0
+26 0
+27 0
+28 0
diff --git a/evidence/allen-omega-L694/runtime-red.om b/evidence/allen-omega-L694/runtime-red.om
new file mode 100644
index 00000000..83d870c5
--- /dev/null
+++ b/evidence/allen-omega-L694/runtime-red.om
@@ -0,0 +1,198 @@
+note L694 fixed-buffer utilities. No platform effects in product functions.
+global In uchar 8192
+global Inlen ulong 1
+global Outb uchar 8192
+global Outlen ulong 1
+global Err ulong 1
+text Digits "0123456789abcdef"
+fn emitb c uchar to void
+n = get Outlen 0
+if ge n len Outb
+put Err 0 1
+else
+put Outb n c
+put Outlen 0 add n 1
+end
+end
+fn emitn v ulong to void
+d = new uchar 20 0
+n = ulong 0
+x = v
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+while gt x 0
+put d n uchar add rem x 10 48
+n = add n 1
+x = div x 10
+end
+while gt n 0
+n = sub n 1
+emitb get d n
+end
+end
+fn outreset to void
+put Outlen 0 0
+put Err 0 0
+end
+fn ineq at ulong c uchar to bool
+if ge at get Inlen 0
+ret false
+end
+ret eq get In at c
+end
+fn isdigit c uchar to bool
+ret and ge c 48 le c 57
+end
+note Parser cursor P0, number P1, error P2. Never wraps a u32.
+global P ulong 3
+fn number to void
+v = ulong 0
+n = ulong 0
+p = get P 0
+while lt p get Inlen 0
+c = get In p
+if not isdigit c
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+ret
+end
+if or ge n 10 gt v 429496729
+put P 2 1
+ret
+end
+v = add mul v 10 sub ulong c 48
+if gt v 4294967295
+put P 2 1
+ret
+end
+n = add n 1
+p = add p 1
+end
+put P 0 p
+put P 1 v
+if eq n 0
+put P 2 1
+end
+end
+fn expect c uchar to void
+p = get P 0
+if not ineq p c
+put P 2 1
+else
+put P 0 add p 1
+end
+end
+fn crc off ulong count ulong to uint
+c = uint 4294967295
+for i ulong count
+c = xor c uint get In add off i
+for k ulong 8
+if ne and c 1 0
+c = xor shr c 1 3988292384
+else
+c = shr c 1
+end
+end
+end
+ret not c
+end
+note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow,
+note code-visible, prompt length, answer length, history count, session.
+global R ulong 16
+global Prompt uchar 160
+global Answer uchar 160
+global Hist uchar 5120
+global Hlen ulong 32
+text Ack "I need to code that. Let me send it off to the Spark."
+text Ackmore "Let me take that change to the Spark."
+fn start kind ulong now ulong to bool
+ret false
+end
+fn answer seq ulong now ulong to bool
+ret false
+end
+fn cancel to void
+end
+fn tick now ulong to ulong
+ret 0
+end
+fn reset to void
+end
+global Fails ulong 1
+global Checks ulong 1
+fn check ok bool id ulong to void
+put Checks 0 add get Checks 0 1
+outreset
+emitn id
+if ok
+emitb 32
+emitb 48
+else
+put Fails 0 add get Fails 0 1
+emitb 32
+emitb 49
+end
+emitb 10
+w = write 1 Outb 0 get Outlen 0
+end
+text Ask "make me a calculator"
+text Reply "Model supplied answer."
+fn askload to void
+put Inlen 0 len Ask
+for i ulong len Ask
+put In i get Ask i
+end
+end
+fn main to int
+askload
+check start 2 0 1
+check eq get R 1 1 2
+check eq get R 2 2 3
+check eq get R 8 len Ack 4
+old = get R 0
+check not start 1 1 5
+put Inlen 0 len Reply
+for i ulong len Reply
+put In i get Reply i
+end
+check not answer add old 1 2 6
+check eq get R 8 len Ack 7
+check answer old 3 8
+check eq get R 1 0 9
+askload
+check start 1 4 10
+check gt get R 0 old 11
+cancel
+check eq get R 1 0 12
+check not answer get R 0 5 13
+askload
+check start 1 10 14
+check eq tick 20009 0 15
+check eq tick 20010 1 16
+check eq tick 20011 0 17
+check eq tick 30010 2 18
+check eq get R 1 0 19
+old = get R 0
+reset
+check eq get R 0 old 20
+askload
+check start 2 40000 21
+check gt get R 0 old 22
+cancel
+put Inlen 0 160
+check not start 1 40001 23
+check eq get R 1 0 24
+askload
+check not start 3 40002 25
+put R 6 1
+check start 3 40003 26
+check eq get R 8 len Ackmore 27
+cancel
+put R 0 4294967295
+check not start 1 40004 28
+ret int get Fails 0
+end
diff --git a/evidence/allen-omega-L694/runtime-red.txt b/evidence/allen-omega-L694/runtime-red.txt
new file mode 100644
index 00000000..60a1ad8d
--- /dev/null
+++ b/evidence/allen-omega-L694/runtime-red.txt
@@ -0,0 +1,28 @@
+1 1
+2 1
+3 1
+4 1
+5 0
+6 0
+7 1
+8 1
+9 0
+10 1
+11 1
+12 0
+13 0
+14 1
+15 0
+16 1
+17 0
+18 1
+19 0
+20 0
+21 1
+22 1
+23 0
+24 0
+25 0
+26 1
+27 1
+28 0
diff --git a/evidence/allen-omega-L694/scene1.txt b/evidence/allen-omega-L694/scene1.txt
new file mode 100644
index 00000000..99a75fb5
--- /dev/null
+++ b/evidence/allen-omega-L694/scene1.txt
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 1
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/scene2.txt b/evidence/allen-omega-L694/scene2.txt
new file mode 100644
index 00000000..44a4b2b1
--- /dev/null
+++ b/evidence/allen-omega-L694/scene2.txt
@@ -0,0 +1,14 @@
+1001 0
+1002 0
+1003 0
+1004 0
+1005 0
+1006 0
+1007 0
+1008 0
+1009 0
+1010 0
+1011 0
+1012 0
+1013 0
+1014 0
diff --git a/evidence/allen-omega-L694/short-native.txt b/evidence/allen-omega-L694/short-native.txt
new file mode 100644
index 00000000..a9da2dc8
--- /dev/null
+++ b/evidence/allen-omega-L694/short-native.txt
@@ -0,0 +1,20 @@
+401 0
+410 0
+411 0
+412 0
+413 0
+414 0
+402 0
+403 0
+404 0
+405 0
+406 0
+700 0
+701 0
+702 0
+703 0
+704 0
+705 0
+407 0
+408 0
+409 0
diff --git a/evidence/allen-omega-L694/short.wire b/evidence/allen-omega-L694/short.wire
new file mode 100644
index 00000000..d0d687da
--- /dev/null
+++ b/evidence/allen-omega-L694/short.wire
@@ -0,0 +1,7 @@
+CODE 1 1/6 768 a75a7df7 python # calc.py: a small calculator that reads one sum at a time.\nimport operator\n\nOPS = {"+": operator.add, "-": operator.sub, "*": o
+CODE 1 2/6 768 a75a7df7 python perator.mul, "/": operator.truediv}\n\n\ndef calculate(a, op, b):\n if op not in OPS:\n raise ValueError("unknown operator
+CODE 1 3/6 768 a75a7df7 python " + op)\n if op == "/" and b == 0:\n raise ZeroDivisionError("cannot divide by zero")\n return OPS[op](a, b)\n\n\ndef mai
+CODE 1 4/6 768 a75a7df7 python n():\n print("Type a sum like 3 + 4, or q to quit.")\n while True:\n line = input("> ").strip()\n if line in ("q
+CODE 1 5/6 768 a75a7df7 python ", "quit"):\n break\n try:\n a, op, b = line.split()\n print(calculate(float(a), op, float(b
+CODE 1 6/6 768 a75a7df7 python )))\n except (ValueError, ZeroDivisionError) as e:\n print("Sorry:", e)\n\n\nif __name__ == "__main__":\n main()\n
+SAY 1 1/1 Here is a small calculator you can run with python3 calc.py.
diff --git a/evidence/allen-omega-L694/source-closure.log b/evidence/allen-omega-L694/source-closure.log
new file mode 100644
index 00000000..bb744f4a
--- /dev/null
+++ b/evidence/allen-omega-L694/source-closure.log
@@ -0,0 +1,34 @@
+native/omega/allen/README.md: OK
+native/omega/allen/base.om: OK
+native/omega/allen/build-one.sh: OK
+native/omega/allen/code.om: OK
+native/omega/allen/courier.om: OK
+native/omega/allen/gate.sh: OK
+native/omega/allen/golden.sh: OK
+native/omega/allen/intent.om: OK
+native/omega/allen/main.om: OK
+native/omega/allen/memory.om: OK
+native/omega/allen/paint.om: OK
+native/omega/allen/reply.om: OK
+native/omega/allen/runtime.om: OK
+native/omega/allen/scene.om: OK
+native/omega/allen/tests/check.om: OK
+native/omega/allen/tests/code.om: OK
+native/omega/allen/tests/courier.om: OK
+native/omega/allen/tests/edges.om: OK
+native/omega/allen/tests/fixture.om: OK
+native/omega/allen/tests/golden.om: OK
+native/omega/allen/tests/intent.om: OK
+native/omega/allen/tests/memory.om: OK
+native/omega/allen/tests/paint.om: OK
+native/omega/allen/tests/probe.om: OK
+native/omega/allen/tests/render.om: OK
+native/omega/allen/tests/reply.om: OK
+native/omega/allen/tests/runtime.om: OK
+native/omega/allen/tests/scene.om: OK
+native/omega/allen/tests/view.om: OK
+native/omega/allen/vendor/OMEGA-LICENSE: OK
+native/omega/allen/vendor/PROVENANCE.md: OK
+native/omega/allen/vendor/sha256-core.om: OK
+native/omega/allen/vendor/sha256.om: OK
+native/omega/allen/view.om: OK
diff --git a/evidence/allen-omega-L694/stdio-display.txt b/evidence/allen-omega-L694/stdio-display.txt
new file mode 100644
index 00000000..7d40356d
--- /dev/null
+++ b/evidence/allen-omega-L694/stdio-display.txt
@@ -0,0 +1,2 @@
+I need to code that. Let me send it off to the Spark.
+Code ready.
diff --git a/evidence/allen-omega-L694/stdio-input.txt b/evidence/allen-omega-L694/stdio-input.txt
new file mode 100644
index 00000000..6701617d
--- /dev/null
+++ b/evidence/allen-omega-L694/stdio-input.txt
@@ -0,0 +1,3 @@
+ASK make me a calculator
+CODE 1 1/1 9 3ce11e06 python print(1)\n
+SAY 1 1/1 Code ready.
diff --git a/evidence/allen-omega-L694/stdio-job.txt b/evidence/allen-omega-L694/stdio-job.txt
new file mode 100644
index 00000000..db964ea1
--- /dev/null
+++ b/evidence/allen-omega-L694/stdio-job.txt
@@ -0,0 +1 @@
+JOB 1 code the person asked Allen for code. make me a calculator
diff --git a/evidence/allen-omega-L694/verify-all.log b/evidence/allen-omega-L694/verify-all.log
new file mode 100644
index 00000000..912f69ab
--- /dev/null
+++ b/evidence/allen-omega-L694/verify-all.log
@@ -0,0 +1,1050 @@
+/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system
+/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error
+============================================================
+AIENOS Integration Verification Harness
+Host: spark-b87b | Arch: aarch64 | Kernel: 7.0.0-1019-nvidia
+Date: 2026-10-23T11:34:02Z
+Strict: 1 | Serial log dir: none
+============================================================
+
+--- [Gate 1 Verification: Config A Freeze] ---
+Config A capture verified for spark-b87b: 5 samples, mean decode 54.2 tokens/s
+M0 closable: no (recovery procedure is documented_only; native boot rollback has not been tested on Machine 1)
+PASS Gate 1 Config A reference bundle verified
+
+--- [Formatting: cargo fmt --check] ---
+PASS formatting: cargo fmt --all --check
+
+--- [Host Component Testing: Workspace Crates] ---
+ Compiling aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto)
+ Compiling version_check v0.9.5
+ Compiling typenum v1.20.1
+ Compiling libc v0.2.189
+ Compiling semver v1.0.28
+ Compiling cfg-if v1.0.5
+ Compiling zeroize v1.9.0
+ Compiling signature v2.2.0
+ Compiling subtle v2.6.1
+ Compiling aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability)
+ Compiling serde_core v1.0.229
+ Compiling zmij v1.0.23
+ Compiling aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel)
+ Compiling serde_json v1.0.151
+ Compiling memchr v2.8.3
+ Compiling itoa v1.0.18
+ Compiling proc-macro2 v1.0.107
+ Compiling quote v1.0.47
+ Compiling unicode-ident v1.0.26
+ Compiling serde v1.0.229
+ Compiling aienos-infer v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-infer)
+ Compiling rustc_version v0.4.1
+ Compiling ed25519 v2.2.3
+ Compiling allen-reflex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-reflex)
+ Compiling allen-design-tokens v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-design-tokens)
+ Compiling aienos-capability-ffi v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability-ffi)
+ Compiling aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot)
+ Compiling generic-array v0.14.7
+ Compiling allen-courier v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-courier)
+ Compiling curve25519-dalek v4.1.3
+ Compiling crypto-common v0.1.7
+ Compiling block-buffer v0.10.4
+ Compiling digest v0.10.7
+ Compiling syn v3.0.6
+ Compiling cpufeatures v0.2.17
+ Compiling sha2 v0.10.9
+ Compiling ed25519-dalek v2.2.0
+ Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact)
+ Compiling aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel)
+ Compiling serde_derive v1.0.229
+ Compiling aienos-evidence v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-evidence)
+ Compiling aienos-store-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-store-tool)
+ Compiling aienos-agent-state v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-agent-state)
+ Compiling aienos-cortex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-cortex)
+ Compiling aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool)
+ Compiling aienos-explain v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-explain)
+ Compiling aienos-c1-tree v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-c1-tree)
+ Compiling aienos-aegis v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-aegis)
+ Finished `test` profile [unoptimized + debuginfo] target(s) in 8.22s
+ Running unittests src/lib.rs (target/debug/deps/aienos_accel-d25eb76ec36d0a33)
+
+running 16 tests
+test pci::tests::capability_list_absence_is_empty_not_error ... ok
+test pci::tests::decodes_msi_msix_and_pcie ... ok
+test pci::tests::rejects_reserved_bar_encodings ... ok
+test pci::tests::decodes_bar_sizes_with_bounds ... ok
+test pci::tests::rejects_capability_loop_and_out_of_bounds ... ok
+test pci::tests::decodes_bridge_header_and_window ... ok
+test pci::tests::decodes_standard_header_and_64_bit_bar ... ok
+test pci::tests::rejects_truncated_header_and_bridge_type ... ok
+test pci::tests::walks_extended_capabilities_with_loop_and_bounds_checks ... ok
+test profile::tests::match_gb10_is_property_based_not_bdf_based ... ok
+test profile::tests::profile_classifies_source_and_native_verification ... ok
+test profile::tests::profile_renders_deterministically ... ok
+test registers::tests::ledger_is_exactly_the_two_established_offsets ... ok
+test registers::tests::ledger_renders_without_claiming_semantics ... ok
+test tests::diagnostics_report_refused_opens_segments_and_bar_state ... ok
+test tests::validates_gb10_memory_bar ... ok
+
+test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/gb10_fixtures.rs (target/debug/deps/gb10_fixtures-a1e328f7018003cd)
+
+running 10 tests
+test follows_a_secondary_bus_window_to_a_downstream_gb10 ... ok
+test decodes_capabilities_from_full_config_space ... ok
+test handles_large_bar_and_extended_space_bounds ... ok
+test profile_decodes_bar_kinds_and_keeps_sizes_unknown ... ok
+test identifies_gb10_from_properties_under_bdf_relocation ... ok
+test rejects_disabled_memory_decoding_unprogrammed_and_32_bit_bar ... ok
+test rejects_malformed_capability_loops ... ok
+test rejects_wrong_vendor_and_wrong_device ... ok
+test reports_missing_msi_and_msix_as_absent_not_zero ... ok
+test selects_the_gb10_among_multiple_nvidia_devices ... ok
+
+test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_aegis-8549be8b0aa8de31)
+
+running 6 tests
+test capability::tests::filesystem_scope_rejects_sibling_and_traversal_paths ... ok
+test broker::tests::world_bound_write_uses_delta_and_rollback_discards_it ... ok
+test effect::tests::intent_id_distinguishes_parameter_boundaries ... ok
+test broker::tests::test_aegis_reversible_vs_irreversible_enforcement ... ok
+test broker::tests::claimed_world_cannot_authorize_network_or_escaped_filesystem_effects ... ok
+test capability::tests::test_capability_attenuation_and_cascading_revocation ... ok
+
+test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/phase_3_to_5_integration.rs (target/debug/deps/phase_3_to_5_integration-b5f8a680ff6a79fb)
+
+running 1 test
+test test_full_agent_epistemic_capability_and_c1_lifecycle ... ok
+
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_agent_state-158f10fde7b3594d)
+
+running 22 tests
+test id::tests::test_branch_id_derivation ... ok
+test id::tests::test_agent_id_determinism ... ok
+test history::tests::test_token_history_rolling_hash ... ok
+test lineage::tests::test_lineage_extension ... ok
+test manager::tests::re_registering_an_existing_identity_does_not_reset_its_root_branch ... ok
+test manager::tests::restore_refuses_checkpoint_without_durable_identity ... ok
+test manager::tests::test_suspend_resume_lifecycle_and_tamper_rejection ... ok
+test manager::tests::restore_rejects_noncontiguous_persisted_fork_indexes ... ok
+test manager::tests::restore_round_trips_branches_and_next_fork_indexes_exactly ... ok
+test manager::tests::restore_rebuilds_fork_counters_without_reusing_branch_ids ... ok
+test manager::tests::restore_rejects_duplicate_agent_identity ... ok
+test manager::tests::restore_rejects_parentless_non_root_branch ... ok
+test manager::tests::restore_rejects_branch_with_missing_parent ... ok
+test manager::tests::re_registering_keeps_forked_branches_and_fork_indexes ... ok
+test manager::tests::restore_rejects_missing_root_branch ... ok
+test manager::tests::restore_rejects_child_id_not_derived_from_fork_index ... ok
+test manager::tests::restore_rejects_branch_of_absent_agent ... ok
+test manager::tests::restore_rejects_duplicate_branch_identity ... ok
+test manager::tests::test_checkpoint_reboot_and_reconstruction ... ok
+test manager::tests::restore_rejects_inconsistent_lineage ... ok
+test manager::tests::restore_rejects_inconsistent_root_branch ... ok
+test manager::tests::checkpoint_bytes_are_stable_across_restore ... ok
+
+test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_artifact-cdcd8a005937d2db)
+
+running 24 tests
+test receipt_tests::canary_failed_decision_and_status_must_agree ... ok
+test receipt_tests::decision_consistency_rules_are_enforced ... ok
+test receipt_tests::layout_matches_adr_table_offsets ... ok
+test receipt_tests::nonce_and_verifier_identity_vectors ... ok
+test receipt_tests::optional_fields_require_their_presence_flags ... ok
+test receipt_tests::golden_bytes_are_stable ... ok
+test receipt_tests::arbitrary_records_never_panic_the_decoder ... ok
+test receipt_tests::rejects_length_magic_version_and_sizes ... ok
+test receipt_tests::pi5_tier_round_trips_with_its_label ... ok
+test tests::authority_attenuation_is_directly_checkable ... ok
+test tests::accepts_canonical_artifact_and_exposes_exact_slices ... ok
+test tests::rejects_header_and_length_mutations ... ok
+test tests::every_truncation_of_a_valid_artifact_is_rejected ... ok
+test tests::payload_manifest_and_resource_changes_change_artifact_identity ... ok
+test receipt_tests::rejects_unknown_enum_and_code_values ... ok
+test tests::rejects_section_entry_capability_resource_and_reserved_mutations ... ok
+test tests::signature_bytes_are_not_recursively_included_in_artifact_id ... ok
+test receipt_tests::rejects_unknown_flags_and_nonzero_reserved_bytes ... ok
+test receipt_tests::encoding_is_deterministic_and_round_trips ... ok
+test tests::ed25519_verifier_accepts_rfc8032_pure_signature_vector ... ok
+test receipt_tests::unsigned_untrusted_and_production_verification_fail_closed ... ok
+test receipt_tests::every_single_bit_change_in_the_signed_range_changes_meaning_or_is_rejected ... ok
+test tests::arbitrary_bounded_bytes_never_panic_the_parser ... ok
+test receipt_tests::signature_block_is_outside_the_digest_and_fully_authenticated ... ok
+
+test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_artifact_tool-9e56459db5557344)
+
+running 2 tests
+test tests::deterministic_pack_uses_the_shared_parser_and_id ... ok
+test receipt_cmd::tests::check_accepts_only_receipts_that_bind_the_supplied_artifact ... ok
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_boot-03c1d141b379e741)
+
+running 4 tests
+test wcslen::tests::empty_string_is_zero ... ok
+test wcslen::tests::high_unit_values_are_not_terminators ... ok
+test wcslen::tests::counts_units_before_first_zero ... ok
+test wcslen::tests::stops_at_first_zero_not_slice_end ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_c1_tree-1784af35e1503d05)
+
+running 4 tests
+test tree::tests::test_reconstruct_branch_no_page_leak ... ok
+test tree::tests::test_transactional_kv_reservation ... ok
+test tree::tests::test_concurrent_multithreaded_branching_and_reservations ... ok
+test tree::tests::test_zero_memory_increase_on_10k_tokens_fork ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_capability-7cada4be6dbd4ee3)
+
+running 13 tests
+test tests::amplification_lease_epoch_and_revoked_ancestor_fail ... ok
+test tests::generation_exhaustion_fails_closed ... ok
+test tests::forged_stale_subject_resource_and_rights_fail_closed ... ok
+test tests::generation_wrap_restarts_and_cognition_cannot_mint ... ok
+test tests::high_half_resource_is_kept ... ok
+test tests::ordinary_capability_cannot_administer_and_depth_stops ... ok
+test tests::privileged_rights_cannot_be_delegated_and_office_stays ... ok
+test tests::promote_right_cannot_be_delegated ... ok
+test tests::reclaimed_reference_stays_dead_after_restart ... ok
+test tests::recycled_slot_does_not_honour_old_reference ... ok
+test tests::stale_reference_after_revoke_is_refused ... ok
+test tests::restart_refuses_above_an_exhausted_generation ... ok
+test tests::unauthorized_capability_use_is_refused ... ok
+
+test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_capability_ffi-0df678df0840af8b)
+
+running 4 tests
+test tests::generation_exhaustion_fails_closed ... ok
+test tests::stale_and_unauthorized_use_is_refused ... ok
+test tests::reclaimed_reference_stays_dead_after_restart ... ok
+test tests::layout_matches_the_cap32_contract ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_cortex-7c4af692b3926248)
+
+running 2 tests
+test store::tests::test_epistemic_grounding_and_hallucination_rejection ... ok
+test store::tests::test_cortex_persistence_and_status_queries ... ok
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_crypto-5af790ab185ac4fb)
+
+running 10 tests
+test aes::tests::test_aes_256_fips_197_c2 ... ok
+test aes::tests::test_constant_time_sbox_matches_fips197_table ... ok
+test polyval::tests::test_polyval_rfc8452_appendix_a_worked_example ... ok
+test sha256::tests::test_hmac_sha256_rfc4231_case_1 ... ok
+test sha256::tests::test_sha256_abc ... ok
+test polyval::tests::test_polyval_rfc8452_section_7_dot ... ok
+test sha256::tests::test_sha256_empty ... ok
+test aes_gcm_siv::tests::public_derived_keys_are_guarded_and_redacted ... ok
+test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_16byte_pt_0byte_aad ... ok
+test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_8byte_pt_1byte_aad ... ok
+
+test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_evidence-d8215aee6143f1b4)
+
+running 30 tests
+test capture::tests::counts_heterogeneous_cpu_parts ... ok
+test canon::tests::key_order_and_whitespace_do_not_change_the_checksum ... ok
+test canon::tests::sealed_bundle_verifies_and_any_edit_breaks_it ... ok
+test capture::tests::reads_os_release_and_meminfo ... ok
+test http::tests::dechunks_bodies_with_extensions ... ok
+test http::tests::empty_stream_is_an_error ... ok
+test http::tests::parses_endpoints ... ok
+test http::tests::stream_timing_uses_first_content_and_usage ... ok
+test pe::tests::accepts_arm64_efi_application ... ok
+test pe::tests::rejects_wrong_machine_subsystem_and_garbage ... ok
+test rollback::tests::duplicated_entry_changes_sequence ... ok
+test rollback::tests::added_candidate_entry_outside_order_is_allowed ... ok
+test rollback::tests::empty_boot_orders_fail ... ok
+test rollback::tests::empty_pre_uuid_is_not_compared ... ok
+test rollback::tests::identical_return_passes ... ok
+test rollback::tests::missing_values_render_as_none ... ok
+test rollback::tests::python_list_repr ... ok
+test rollback::tests::read_only_root_or_changed_esp_fails ... ok
+test rollback::tests::reordered_or_changed_default_fails ... ok
+test rollback::tests::report_lines_match_former_python_rendering ... ok
+test rollback::tests::secure_boot_change_is_still_a_violation ... ok
+test rollback::tests::secure_boot_is_case_insensitive ... ok
+test rollback::tests::secure_boot_off_is_observed_not_blocking ... ok
+test rollback::tests::shape_rejects_values_the_verifier_cannot_use ... ok
+test rollback::tests::unconsumed_boot_next_fails ... ok
+test time::tests::known_instants ... ok
+test verify::tests::sound_capture_passes_but_m0_stays_open_until_rollback_is_tested ... ok
+test verify::tests::verified_recovery_closes_m0 ... ok
+test verify::tests::tampering_dirty_repos_and_toy_workloads_are_rejected ... ok
+test capture::tests::streams_file_hash_matches_one_shot_hash ... ok
+
+test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.76s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_evidence-f8f5ed62ab570014)
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_explain-79b00631214213e1)
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_explain-ee23a1331acf4114)
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/explain.rs (target/debug/deps/explain-5a1c8cb3ca31dd39)
+
+running 16 tests
+test contradiction_remains_visible ... ok
+test cycle_terminates_and_is_reported ... ok
+test malformed_input_fails_safely ... ok
+test branch_explanation_uses_only_what_the_branch_depended_on ... ok
+test clarification_reads_the_same_bundle ... ok
+test branching_support_is_deterministic_regardless_of_input_order ... ok
+test token_history_never_enters_the_explanation ... ok
+test shared_parent_appears_once ... ok
+test missing_parent_stays_missing ... ok
+test hypothesis_is_never_rendered_as_fact ... ok
+test unsupported_claim_is_flagged ... ok
+test cycle_through_imported_cortex_journal_terminates ... ok
+test analogy_is_isolated_from_evidence ... ok
+test linear_chain_is_ordered_parents_first ... ok
+test identical_input_gives_identical_bundle_and_text ... ok
+test depth_and_node_limits_bound_the_walk ... ok
+
+test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s
+
+ Running tests/rsi_and_cli.rs (target/debug/deps/rsi_and_cli-47e96ebade6cc0c5)
+
+running 4 tests
+test contradiction_disclosed_in_both_directions ... ok
+test rsi_fixture_is_pinned ... ok
+test rsi_cycle_explains_in_causal_order ... ok
+test cli_explains_fixture ... ok
+
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_infer-f019ca6909bea73a)
+
+running 26 tests
+test decode::rope_tests::every_head_is_rotated_independently_with_the_same_table ... ok
+test decode::rope_tests::score_depends_on_relative_position_only ... ok
+test decode::rope_tests::pair_zero_rotates_by_the_position_angle ... ok
+test decode::rope_tests::softmax_weights_are_shift_invariant_and_position_sensitive ... ok
+test dotprod::tests::q4k_hand_computed_scale_application ... ok
+test dotprod::tests::quantize_matches_q8k_round_and_sums ... ok
+test dotprod::tests::row_dot_matches_scalar_path_and_checks_lengths ... ok
+test dotprod::tests::token_only_when_flag_set ... ok
+test half::tests::known_values ... ok
+test math::tests::exp_matches_std ... ok
+test math::tests::ln_matches_std ... ok
+test dotprod::tests::q4k_integer_dot_equals_f32_dot_of_rounded_activations ... ok
+test math::tests::powf_rope_theta_scale ... ok
+test math::tests::sin_cos_matches_std_and_unit_norm ... ok
+test math::tests::sqrt_matches_std ... ok
+test quant::tests::length_checks ... ok
+test quant::tests::q4k_hand_block ... ok
+test quant::tests::q4k_scale_extension_bits ... ok
+test quant::tests::q6k_hand_block ... ok
+test dotprod::tests::q6k_integer_dot_equals_f32_dot_of_rounded_activations ... ok
+test quant::tests::q6k_scales_are_signed_and_per_16 ... ok
+test tokenizer::tests::byte_map_is_gpt2 ... ok
+test tokenizer::tests::pretokenize_cases ... ok
+test tokenizer::tests::pretokenize_covers_input ... ok
+test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q4k ... ok
+test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q6k ... ok
+
+test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/forward.rs (target/debug/deps/forward-ab44d1dd89820bae)
+
+running 5 tests
+test forward_matches_llama_cpp_q8k_emulation ... ignored, slow; run with --ignored
+test decode_round_trips_text ... ok
+test tokenization_matches_llama_cpp ... ok
+test forward_matches_llama_cpp_dotprod ... ok
+test forward_matches_llama_cpp_f32_activations has been running for over 60 seconds
+test forward_matches_llama_cpp_f32_activations ... ok
+
+test result: ok. 4 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 148.59s
+
+ Running tests/golden.rs (target/debug/deps/golden-bd0a1a22ab6375dc)
+
+running 15 tests
+test absurd_counts_and_bad_fields ... ok
+test dequantize_rejects_bad_lengths_without_panic ... ok
+test q4k_round_trip_error_bound ... ok
+test q6k_round_trip_error_bound ... ok
+test round_trip_exact_when_grid_aligned ... ok
+test small_good_file_parses ... ok
+test byte_flip_fuzz_never_panics ... ok
+test q4k_matches_ggml_bit_for_bit ... ok
+test q6k_matches_ggml_bit_for_bit ... ok
+test dot_helpers_match_dequant_then_dot ... ok
+test real_type_histogram_and_table_sanity ... ok
+test real_header_matches_known_facts ... ok
+test every_truncation_is_an_error_not_a_panic ... ok
+test real_layer0_dequantizes_to_sane_values ... ok
+test real_file_matches_hf_metadata_hash ... ok
+
+test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.07s
+
+ Running unittests src/lib.rs (target/debug/deps/aienos_kernel-d868610635245090)
+
+running 413 tests
+test abi::tests::capability_fails_closed ... ok
+test abi::tests::handle_generation_zero_fails_closed ... ok
+test abi::tests::envelope_golden ... ok
+test abi::tests::capability_golden ... ok
+test abi::tests::handle_golden ... ok
+test abi::tests::handle_raw_matches_syscall_packing ... ok
+test abi::tests::memory_region_golden ... ok
+test abi::tests::id_goldens ... ok
+test abi::tests::message_golden ... ok
+test abi::tests::envelope_fails_closed ... ok
+test abi::tests::handle_raw_register_encoding ... ok
+test abi::tests::resource_id_golden ... ok
+test abi::tests::message_reserved_fields_fail_closed ... ok
+test abi::tests::resource_id_rejects_unknown_kind_and_reserved ... ok
+test abi::tests::rights_golden ... ok
+test abi::tests::rights_reserved_bits_fail_closed ... ok
+test abi::tests::rights_convert_with_caps_rights ... ok
+test abi::tests::tags_are_distinct_and_round_trip ... ok
+test acpi::tests::mcfg_finds_the_ecam_window_for_a_segment_and_bus ... ok
+test acpi::tests::extracts_gicd_and_gicr_bases ... ok
+test acpi::tests::rejects_bad_checksum_signature_and_lengths ... ok
+test acpi::tests::spcr_selects_the_early_uart_driver ... ok
+test acpi::tests::reads_xsdt_entry_addresses ... ok
+test acpi::tests::counts_gb10_style_heterogeneous_cores_by_efficiency_class ... ok
+test acpi::tests::finds_the_boot_core_class_ignoring_mpidr_flag_bits ... ok
+test acpi::tests::parses_iort_smmuv3_base_and_pci_stream_mapping ... ok
+test acpi::tests::skips_disabled_cores_and_counts_old_entries_as_unknown ... ok
+test admission::tests::verified_but_policy_untrusted_signer_is_rejected ... ok
+test admission::tests::unapproved_write_receives_no_capability ... ok
+test artifact_loader::tests::boot_policy_digest_is_the_policy_the_loader_uses ... ok
+test admission::tests::read_write_request_is_reduced_to_policy_read ... ok
+test admission::tests::insufficient_resource_snapshot_rejects_before_authorization ... ok
+test artifact_loader::tests::code_write_needs_a_permission_fault ... ok
+test artifact_loader::tests::exec_nx_needs_a_permission_fault_inside_data_or_stack ... ok
+test admission::tests::policy_digest_is_canonical_and_binds_signer_allowlist ... ok
+test artifact_loader::tests::candidate_lines_are_stable ... ok
+test arch::aarch64::tests::spark_uart_uses_32_bit_16550_register_stride ... ok
+test admission::tests::policy_reduces_object_range_and_operation_byte_budgets ... ok
+test admission::tests::read_is_granted_and_uses_the_existing_m3_rights_type ... ok
+test artifact_loader::tests::ipc_request_exceeds_policy_and_is_rejected ... ok
+test artifact_loader::tests::admitted_receipt_binds_identity_and_observed_outcome ... ok
+test artifact_loader::tests::code_modified_during_execution_breaks_the_byte_chain ... ok
+test artifact_loader::tests::kernel_root_without_free_window_is_a_mapping_failure ... ok
+test artifact_loader::tests::full_scheduler_fails_closed_at_admission ... ok
+test artifact_loader::tests::audit_rejects_writable_code_and_writable_alias ... ok
+test artifact_loader::tests::receipt_line_carries_digest_and_full_record ... ok
+test artifact_loader::tests::stage_and_reason_codes_match_adr_0014_section_7_3 ... ok
+test artifact_loader::tests::task_layout_rejects_every_bound_violation ... ok
+test block::tests::ram_disk_rejects_block_size_that_would_truncate ... ok
+test boot::tests::boot_counter_conversion_rejects_invalid_samples ... ok
+test boot::tests::early_allocator_retains_region_after_initialization ... ok
+test boot::tests::firmware_region_requires_aligned_nonoverflowing_pages ... ok
+test budget::tests::each_resource_limit_is_enforced_independently ... ok
+test boot::tests::report_lists_gpu_allocator_timing_and_liveness ... ok
+test artifact_loader::tests::scheduler_refusal_at_reservation_rolls_back ... ok
+test budget::tests::arithmetic_is_overflow_safe_at_u64_limits ... ok
+test budget::tests::explicit_policy_switch_changes_forge_allowance ... ok
+test budget::tests::releasing_frames_restores_headroom ... ok
+test budget::tests::watchdog_is_correct_across_counter_wrap ... ok
+test budget::tests::watchdog_pet_expiry_and_sticky_quarantine ... ok
+test caps::tests::removing_a_derived_parent_keeps_the_subtree_revocable ... ok
+test caps::tests::removing_a_never_derived_capability_frees_its_slot ... ok
+test caps::tests::revoke_cascades_two_levels_across_tables ... ok
+test caps::tests::revoke_with_single_slot_tables_removes_cross_table_child ... ok
+test caps::tests::stale_handle_rejected_after_slot_reuse ... ok
+test caps::tests::transfer_needs_grant_and_table_full_is_reported ... ok
+test artifact_loader::tests::admitted_task_sees_exact_entry_state_and_is_fully_reclaimed ... ok
+test artifact_loader::tests::empty_and_oversized_inputs_are_refused_before_staging ... ok
+test artifact_loader::tests::grant_lines_list_exactly_the_installed_grants ... ok
+test artifact_loader::tests::staging_reservation_failure ... ok
+test caps::tests::generation_exhaustion_retires_slot_without_reviving_old_handle ... ok
+test artifact_loader::tests::tampered_payload_is_rejected_before_any_task_frame ... ok
+test console::tests::unsupported_spcr_gives_no_console ... ok
+test continuity::tests::branch_table_validation_rejects_broken_lineage ... ok
+test artifact_loader::tests::unknown_signer_rejected_by_anchors_and_by_policy ... ok
+test continuity::continuity_vectors::emitted_vectors_are_canonical ... ok
+test artifact_loader::tests::sequential_candidates_reuse_resources_cleanly ... ok
+test caps::tests::derive_cannot_add_rights ... ok
+test artifact_loader::tests::rejection_receipts_record_earliest_stage_and_only_computed_fields ... ok
+test artifact_loader::tests::receipt_flags_follow_observations_not_expectations ... ok
+test continuity::tests::wrapping_fork_sum_is_refused_like_the_c_codec ... ok
+test continuity::tests::encodings_round_trip_and_reject_tampering ... ok
+test continuity::tests::huge_fork_count_with_underivable_child_is_refused_without_spinning ... ok
+test crypto::envelope::tests::test_envelope_roundtrip_empty ... ok
+test artifact_loader::tests::grants_never_exceed_requests_or_policy ... ok
+test continuity::tests::two_roots_stop_with_conflict ... ok
+test crypto::envelope::tests::test_expected_envelope_len_overflow_is_error ... ok
+test continuity::tests::provisioning_twice_is_refused ... ok
+test crypto::envelope::tests::test_hostile_header_at_bound_hits_length_check ... ok
+test crypto::envelope::tests::test_envelope_roundtrip_small ... ok
+test continuity::tests::unprovisioned_store_never_mints_an_identity ... ok
+test crypto::hmac::tests::compare_tags ... ok
+test crypto::envelope::tests::test_hostile_header_huge_total_rejected_before_alloc ... ok
+test crypto::envelope::tests::test_envelope_cross_store_and_kind_binding ... ok
+test crypto::envelope::tests::test_hostile_header_chunk_size_one_huge_count_rejected ... ok
+test continuity::tests::provision_then_cold_restart_returns_the_same_identity_and_memory ... ok
+test device::tests::activate_installs_translation_before_bus_master ... ok
+test device::tests::activation_failure_at_each_step_leaves_bus_master_clear_and_stream_aborted ... ok
+test device::tests::activation_records_its_authority ... ok
+test device::tests::activation_refused_without_window_or_when_already_active ... ok
+test crypto::hmac::tests::rfc4231_cases_1_to_7 ... ok
+test device::tests::capability_for_other_resource_is_not_a_device ... ok
+test device::tests::duplicate_or_missing_table_in_revoke_set_causes_no_effects ... ok
+test device::tests::failed_teardown_blocks_activation_until_a_clean_retry ... ok
+test device::tests::map_without_revoke_cannot_tear_down_an_active_device ... ok
+test crypto::hkdf::tests::rfc5869_cases_1_to_3 ... ok
+test device::tests::missing_capability_causes_no_effects ... ok
+test device::tests::read_only_capability_causes_no_effects ... ok
+test device::tests::register_rejects_clashes_and_live_devices ... ok
+test device::tests::revoke_failure_at_each_step_still_closes_gates_and_revokes ... ok
+test device::tests::revoke_forgets_window_so_next_holder_cannot_reuse_it ... ok
+test device::tests::revoke_runs_exact_teardown_then_removes_capability_tree ... ok
+test device::tests::state_discriminants_are_stable ... ok
+test device::tests::sweep_leaves_devices_with_live_authority_alone ... ok
+test device::tests::sweep_retries_a_failed_teardown ... ok
+test device::tests::sweep_tears_down_after_holder_removes_or_table_is_gone ... ok
+test device::tests::sweep_tears_down_when_ancestor_revoked_through_plain_cap_path ... ok
+test device::tests::window_validation ... ok
+test artifact_loader::tests::main_and_shadow_batch_failures_roll_back ... ok
+test display::font::tests::every_glyph_is_five_by_seven_hashes_and_spaces ... ok
+test display::font::tests::lowercase_maps_to_uppercase_and_unknown_to_question_mark ... ok
+test device::tests::attenuated_capability_without_map_cannot_activate ... ok
+test device::tests::activate_with_revoked_handle_fails_without_effects ... ok
+test display::font::tests::digits_and_letters_are_distinct ... ok
+test display::tests::rejects_geometry_larger_than_the_buffer ... ok
+test dma_gate::tests::command_bits ... ok
+test dma_gate::tests::failed_smmu_never_falls_back_to_bypass ... ok
+test dma_gate::tests::grant_requires_smmu_or_explicit_bypass_without_smmu ... ok
+test dma_gate::tests::sweep_clears_endpoints_and_leaves_bridges ... ok
+test dma_gate::tests::sweep_reports_a_bus_master_bit_that_will_not_clear ... ok
+test dma_gate::tests::sweep_keeps_counting_past_the_recorded_findings ... ok
+test edu::tests::full_buffer_transfer_is_allowed ... ok
+test edu::tests::interrupt_status_and_acknowledge ... ok
+test edu::tests::last_byte_below_the_mask_is_accepted ... ok
+test edu::tests::probe_reads_version_and_checks_liveness ... ok
+test edu::tests::rejects_bad_lengths_and_addresses_before_touching_the_device ... ok
+test edu::tests::round_trips_bytes_through_the_device_buffer ... ok
+test edu::tests::times_out_when_the_transfer_never_finishes ... ok
+test edu::tests::wider_dma_mask_accepts_higher_addresses ... ok
+test edu::tests::spin_budget_covers_a_slow_transfer ... ok
+test fatal::tests::access_syndrome_only_when_isv_set ... ok
+test fatal::tests::decodes_abort_iss_fields_without_register_access ... ok
+test fatal::tests::decodes_vector_slot_and_exception_class ... ok
+test gic::tests::distributor_spi_programming_order ... ok
+test gic::tests::redistributor_wakes_and_sets_ppi ... ok
+test gic::tests::register_offsets_match_gicv3_spec ... ok
+test infer::attention::tests::append_rejects_capacity_overflow ... ok
+test infer::attention::tests::decode_refuses_wrong_shapes_and_head_counts ... ok
+test infer::attention::tests::gqa_maps_groups_of_query_heads_to_kv_heads ... ok
+test infer::attention::tests::dense_output_projection_mixes_heads_and_catches_a_permutation ... ok
+test infer::attention::tests::one_token_returns_value_exactly ... ok
+test edu::tests::blocked_transfer_completes_but_leaves_ram_untouched ... ok
+test dma_gate::tests::sweep_walks_multifunction_devices_only_when_marked ... ok
+test infer::attention::tests::query_rows_kv_groups_and_head_major_output_decode_from_bands ... ok
+test infer::attention::tests::two_head_hand_computed_attention ... ok
+test infer::gemm::tests::benchmark_matvec_4096 ... ignored, benchmark
+test infer::attention::tests::random_inputs_match_scalar_reference ... ok
+test infer::gemm::tests::rms_norm_hand_value ... ok
+test infer::gemm::tests::softmax_sums_to_one ... ok
+test infer::gemm::tests::strided_vector_matches_reference ... ok
+test infer::rope::tests::position_zero_is_identity ... ok
+test infer::rope::tests::rotation_preserves_each_pair_norm ... ok
+test artifact_loader::tests::corrupted_mapped_bytes_fail_the_read_back_hash ... ok
+test infer::rope::tests::sin_cos_matches_std_across_the_circle ... ok
+test display::tests::scales_up_on_wide_screens_and_drops_text_past_the_last_row ... ok
+test infer::tokenizer::tests::applies_lowest_ranked_merge_first ... ok
+test display::tests::draws_glyph_pixels_and_respects_stride_padding ... ok
+test crypto::hkdf::tests::length_limit_and_compare ... ok
+test infer::tokenizer::tests::matches_special_tokens_before_bpe ... ok
+test infer::tokenizer::tests::reports_missing_byte_and_bad_format ... ok
+test ipc::tests::ancestor_revocation_reaches_the_derived_child ... ok
+test ipc::tests::attenuated_child_cannot_write_or_escalate ... ok
+test ipc::tests::channel_is_fifo_and_bounded ... ok
+test ipc::tests::delegation_without_derive_right_is_denied ... ok
+test ipc::tests::end_to_end_send_delegate_receive_read ... ok
+test ipc::tests::message_abi_is_fixed_size_and_unaligned_free ... ok
+test ipc::tests::receiver_table_full_rolls_back_cleanly ... ok
+test ipc::tests::rights_escalation_is_rejected ... ok
+test ipc::tests::send_requires_write_and_receive_requires_read ... ok
+test ipc::tests::stale_and_forged_handles_are_invalid ... ok
+test mem::frame_allocator::tests::allocator_rejects_unaligned_deallocation ... ok
+test mem::frame_allocator::tests::batch_reservation_is_bounded_and_released_as_a_unit ... ok
+test mem::frame_allocator::tests::insufficient_batch_reservation_leaves_no_partial_allocations ... ok
+test mem::frame_allocator::tests::test_alloc_contiguous ... ok
+test mem::frame_allocator::tests::test_allocator_basic ... ok
+test mem::map_plan::tests::missing_mat_maps_runtime_code_rx_without_wx ... ok
+test mem::map_plan::tests::mmio_is_device_nx_and_overlap_rejected ... ok
+test mem::map_plan::tests::register_values_encode_required_fields ... ok
+test mem::map_plan::tests::runtime_code_needs_ro_xp_split ... ok
+test mem::map_plan::tests::section_permissions_are_wx_safe ... ok
+test mem::map_plan::tests::translation_register_values_match_the_architecture ... ok
+test mem::map_plan::tests::writable_executable_runtime_code_is_mapped_rx ... ok
+test infer::tokenizer::tests::round_trips_ascii_utf8_empty_and_fallback ... ok
+test mem::pagetable::tests::access_permission_and_attribute_bits ... ok
+test mem::pagetable::tests::descriptor_encodes_attributes_exactly ... ok
+test mem::frame_allocator::tests::allocator_rejects_capacity_overflow - should panic ... ok
+test mem::pagetable::tests::execute_never_bits_follow_privilege ... ok
+test mem::pagetable::tests::fixed_pool_is_bounded_and_never_reuses_released_frames ... ok
+test mem::pagetable::tests::flags_round_trip_through_descriptors ... ok
+test net::tests::cache_requires_solicited_and_expires ... ok
+test net::tests::checksum_vectors ... ok
+test net::tests::ipv4_reserved_flag_is_rejected ... ok
+test mem::pagetable::tests::device_memory_is_never_executable ... ok
+test net::tests::rejects_short_bad_and_fragments ... ok
+test net::tests::udp_known_checksum ... ok
+test nvme::atomicity::tests::boundary_offset_is_respected ... ok
+test nvme::atomicity::tests::controller_fallback_when_namespace_absent ... ok
+test nvme::atomicity::tests::boundary_safe_write_accepts ... ok
+test nvme::atomicity::tests::empty_write_rejects ... ok
+test nvme::atomicity::tests::encoding_edge_zero_and_max ... ok
+test console::tests::pl011_writes_when_ready_and_gives_up_when_always_full ... ok
+test nvme::atomicity::tests::insufficient_controller_awupf_rejects ... ok
+test nvme::atomicity::tests::namespace_zero_falls_back_to_controller ... ok
+test nvme::atomicity::tests::read_u16_le_bounds ... ok
+test nvme::atomicity::tests::store_root_4096_geometry ... ok
+test mem::pagetable::tests::chooses_block_and_page_leaves ... ok
+test nvme::atomicity::tests::store_root_512_geometry ... ok
+test nvme::atomicity::tests::sufficient_decoded_awupf_accepts ... ok
+test nvme::atomicity::tests::sufficient_unit_but_crosses_boundary_rejects ... ok
+test nvme::atomicity::tests::unknown_state_fails_closed ... ok
+test nvme::atomicity::tests::unsupported_geometry_fails_closed ... ok
+test net::tests::ethernet_and_arp_vector ... ok
+test nvme::driver::tests::controller_requiring_larger_pages_is_refused ... ok
+test nvme::driver::tests::creates_polled_io_queues ... ok
+test continuity::tests::forked_or_gapped_manifest_chains_are_corrupt ... ok
+test net::tests::ipv4_icmp_ping_vector ... ok
+test mem::pagetable::tests::rejects_overlap_wx_and_misalignment ... ok
+test mem::pagetable::tests::maps_and_walks_page ... ok
+test nvme::driver::tests::explicit_namespace_write_surfaces_device_error ... ok
+test mem::pagetable::tests::unmap_removes_leaf ... ok
+test nvme::driver::tests::initializes_and_identifies_namespace ... ok
+test continuity::tests::degraded_mount_resumes_read_only ... ok
+test nvme::atomicity::tests::namespace_override_wins_over_controller ... ok
+test nvme::driver::tests::io_queue_depth_above_mqes_is_rejected ... ok
+test nvme::driver::tests::readiness_and_completion_errors_are_bounded ... ok
+test nvme::driver::tests::invalid_range_has_no_io_command_and_write_completion_error_propagates ... ok
+test nvme::driver::tests::block_io_roundtrips_small_and_prp_list_transfers_with_mdts_chunks ... ok
+test nvme::tests::command_layouts ... ok
+test nvme::tests::completion_phase_wrap_and_empty ... ok
+test nvme::driver::tests::simulator_rejects_submission_queue_without_completion_queue ... ok
+test nvme::driver::tests::parses_power_fail_atomicity_fields ... ok
+test nvme::tests::controller_ready_failure_and_timeout ... ok
+test nvme::tests::prp_spans ... ok
+test nvme::driver::tests::readiness_wait_honours_cap_timeout ... ok
+test nvme::tests::registers_and_doorbells ... ok
+test nvme::tests::prp_list_chains_across_list_pages ... ok
+test nvme::driver::tests::lbads_below_512_is_invalid_identify ... ok
+test pci::tests::probes_bar_sizes_and_restores_state ... ok
+test nvme::tests::submission_full_and_wrap ... ok
+test pci::tests::read_bar_respects_header_type_and_slots ... ok
+test pci::tests::requester_id_packs_bus_device_function ... ok
+test pci::tests::functions_in_uses_the_window_bus_range ... ok
+test pci::tests::update_command_sets_and_clears_bits_without_touching_status ... ok
+test pci::tests::walk_covers_last_bus_and_device_without_overflow ... ok
+test pci::tests::decodes_32_and_64_bit_memory_bars_and_io_bars ... ok
+test pci::tests::finds_device_by_vendor_and_device_id ... ok
+test pe::tests::rejects_truncation_and_invalid_headers ... ok
+test pe::tests::rejects_wx_and_overlapping_ranges ... ok
+test pci::tests::walk_skips_functions_1_to_7_unless_multi_function ... ok
+test pe::tests::unaligned_sections_are_page_rounded_and_shared_pages_overlap ... ok
+test pe::tests::valid_sections_use_base_and_page_rounded_max_size ... ok
+test recovery::tests::operator_auth_rejects_legacy_bare_sha256_response ... ok
+test recovery::tests::test_slot_rollback_on_failure ... ok
+test recovery::tests::hmac_primitive_rfc4231_case_2 ... ok
+test recovery::tests::test_wal_truncation_on_corruption ... ok
+test recovery::tests::operator_auth_rejects_undomained_hmac_and_zero_response ... ok
+test recovery::tests::operator_auth_known_answer_accepted ... ok
+test recovery::tests::test_wal_zero_length_entry_and_overflow_protection ... ok
+test nvme::driver::tests::shallow_io_queue_is_rejected_before_submission ... ok
+test arch::aarch64::tests::a_uart_that_never_becomes_ready_is_abandoned_instead_of_hanging ... ok
+test report::tests::formats_and_truncates_on_character_boundaries ... ok
+test scheduler::tests::background_runs_within_configured_interval_under_latency_load ... ok
+test scheduler::tests::empty_queues_and_invalid_cpu_are_handled ... ok
+test scheduler::tests::idle_cpu_steals_and_runs_work ... ok
+test scheduler::tests::equal_priority_tasks_share_n_ticks_fairly ... ok
+test scheduler::tests::latency_keeps_large_majority_of_ticks_with_background_budget ... ok
+test scheduler::tests::placement_uses_fast_cores_for_latency_and_efficient_for_background ... ok
+test scheduler::tests::priority_prevents_basic_inversion ... ok
+test scheduler::tests::removed_tasks_free_their_slot_and_leave_the_queue ... ok
+test scheduler::tests::round_robin_placement_and_duplicate_rejection ... ok
+test security::tests::test_anti_rollback_decision_matrix ... ok
+test recovery_core::tests::malformed_peer_without_a_resolvable_identity_is_not_repaired ... ok
+test security::tests::test_subkey_derivation_separation ... ok
+test shell::tests::dispatches_report_and_diagnostics ... ok
+test security::tests::test_security_manifest_roundtrip_and_mac ... ok
+test security::tests::test_keyslot_manifest_roundtrip_and_unwrap ... ok
+test shell::tests::parses_commands_and_bounded_arguments ... ok
+test smmu::tests::bring_up_cleans_tables_after_writing_before_programming ... ok
+test smmu::tests::bring_up_keeps_global_abort_through_smmuen ... ok
+test smmu::tests::command_queue_wraps_and_times_out ... ok
+test smmu::tests::command_timeout_and_error_fail_closed ... ok
+test recovery_core::tests::orphaned_continuity_objects_are_corrupt_not_unprovisioned ... ok
+test smmu::tests::gbpa_that_will_not_abort_is_an_error ... ok
+test smmu::tests::gbpa_update_timeout_fails_closed ... ok
+test smmu::tests::event_reader_decodes_and_consumes_records ... ok
+test smmu::tests::descriptor_layouts ... ok
+test smmu::tests::command_words_and_queue_wrap ... ok
+test smmu::tests::event_reader_acknowledges_overflow ... ok
+test smmu::tests::install_and_abort_ste_invalidate_that_stream ... ok
+test smmu::tests::smmuen_ack_failure_fails_closed ... ok
+test smmu::tests::unsupported_hardware_or_bad_sid_fails_closed ... ok
+test smmu::tests::tables_reject_misaligned_or_bad_geometry ... ok
+test smmu::tests::submit_refuses_to_overwrite_a_full_queue ... ok
+test smmu::tests::policy_maps_only_allowed_windows ... ok
+test continuity::tests::a_crash_at_every_write_of_a_commit_leaves_old_or_new_never_a_third_state ... ok
+test recovery_core::tests::challenges_bind_state_and_action ... ok
+test store::engine::tests::store_generation_overflow_zero_writes ... ok
+test store::engine::tests::store_checkpoint_order_does_not_change_persistent_bytes ... ok
+test store::engine::tests::store_full_graph_validation_rejects_damaged_payload_and_keeps_io_distinct ... ok
+test store::engine::tests::store_history_rejects_deleting_an_old_catalog_entry ... ok
+test recovery_core::tests::identity_lost_in_the_newest_root_never_looks_unprovisioned ... ok
+test recovery_core::tests::identity_loss_through_corruption_offers_no_action_that_mints ... ok
+test store::engine::tests::store_io_fail_closed ... ok
+test recovery::tests::operator_auth_rejects_any_single_bit_flip ... ok
+test store::engine::tests::store_dedup_corruption_and_descriptor_conflict_fail_before_writes ... ok
+test store::engine::tests::store_open_side_effect_free ... ok
+test store::engine::tests::store_mount_classification_is_deterministic ... ok
+test store::tests::block_store_rejects_wrong_magic ... ok
+test store::tests::block_store_rejects_corrupt_in_memory_length_without_panicking ... ok
+test store::tests::block_store_persists_reopens_and_falls_back_from_bad_copy ... ok
+test store::tests::test_content_addressed_extent_storage ... ok
+test store::tests::test_slice_store_operations_and_boundaries ... ok
+test artifact_loader::tests::sealed_address_space_is_wx_with_read_only_code_alias ... ok
+test store::v1::tests::malformed_object_catalog_and_extent_vectors_are_rejected ... ok
+test store::v1::tests::object_id_and_catalog_vectors_match_adr_0015 ... ok
+test sync::spinlock::tests::test_spinlock_basic ... ok
+test recovery_core::tests::inspection_never_writes_and_names_the_reason ... ok
+test store::v1::tests::malformed_generation_high_water_and_superblock_bytes_are_rejected ... ok
+test sync::spinlock::tests::test_spinlock_try_lock ... ok
+test task_runtime::tests::deadline_uses_tighter_budget_and_survives_counter_wrap ... ok
+test task_runtime::tests::denials_are_classified_from_observed_lookups ... ok
+test task_runtime::tests::granted_read_returns_object_word_and_charges_budget ... ok
+test store::engine::tests::store_nospace_zero_writes ... ok
+test task_runtime::tests::read_outside_grant_range_or_object_or_unaligned_is_denied ... ok
+test task_runtime::tests::read_past_operation_budget_is_denied ... ok
+test task_runtime::tests::syscall_after_deadline_times_out ... ok
+test task_runtime::tests::unknown_syscall_and_nonzero_immediate_terminate ... ok
+test store::v1::tests::commit_superblock_genesis_and_adjacent_vectors_match_adr_0015 ... ok
+test task_runtime::tests::write_with_write_right_updates_kernel_copy ... ok
+test task_runtime::tests::write_without_write_right_is_denied_and_object_unchanged ... ok
+test thread::tests::placement_fills_lowest_class_first_then_wraps ... ok
+test thread::tests::context_offsets_match_assembly_layout ... ok
+test task_runtime::tests::syscall_budget_overrun_terminates ... ok
+test task_runtime::tests::forged_stale_and_unbacked_handles_are_denied ... ok
+test thread::tests::stack_setup_aligns_sp_and_records_trampoline_arguments ... ok
+test thread::tests::placement_of_empty_topology_is_unplaced ... ok
+test thread::tests::trap_frame_layout_matches_800_bytes_and_16_byte_alignment ... ok
+test timer::tests::conversion_rounding_and_frequency_validation ... ok
+test timer::tests::deadline_detects_overflow ... ok
+test thread::tests::trap_frame_setup_aligns_and_initializes_registers ... ok
+test uefi::tests::honors_48_and_56_byte_descriptor_strides ... ok
+test store::engine::tests::store_peer_condition_reports_open_classification ... ok
+test uefi::tests::rejects_truncated_and_short_descriptors ... ok
+test task_runtime::tests::read_past_byte_budget_is_denied ... ok
+test usb::audio::tests::isoch_schedule_stays_ahead_and_wraps_frame_id ... ok
+test usb::audio::tests::oversized_packet_is_not_truncated_and_zero_stride_schedules_nothing ... ok
+test usb::audio::tests::parses_uac1_and_uac2 ... ok
+test usb::audio::tests::short_uac1_format_descriptor_does_not_panic ... ok
+test usb::audio::tests::ring_wraps_and_tone_is_bounded ... ok
+test usb::audio::tests::uac1_channels_come_from_format_type_not_as_general_delay ... ok
+test usb::descriptor::tests::reads_the_control_packet_size_from_a_device_descriptor ... ok
+test usb::descriptor::tests::skips_a_mouse_interface_and_out_endpoints_in_a_composite_device ... ok
+test usb::descriptor::tests::stops_at_total_length_and_malformed_descriptors ... ok
+test usb::hid::tests::control_keys_and_arrows ... ok
+test usb::hid::tests::letter_make_and_release_produces_one_character ... ok
+test usb::hid::tests::punctuation_and_space_decode ... ok
+test usb::hid::tests::rollover_error_and_wrong_length_are_ignored ... ok
+test usb::hid::tests::shift_and_digits_use_the_shifted_column ... ok
+test usb::hid::tests::sink_truncates_instead_of_overflowing ... ok
+test usb::hid::tests::unmapped_usages_are_dropped ... ok
+test usb::xhci::context::tests::address_device_context_puts_port_and_endpoint_zero_in_place ... ok
+test usb::xhci::context::tests::endpoint_addresses_map_to_device_context_indexes ... ok
+test usb::xhci::context::tests::interval_converts_frames_and_exponents_to_125us_units ... ok
+test usb::xhci::context::tests::isoch_interval_and_high_bandwidth_burst ... ok
+test usb::xhci::context::tests::isochronous_out_endpoint_fields_encode_in_context ... ok
+test usb::xhci::context::tests::large_contexts_double_the_stride_and_bad_sizes_are_refused ... ok
+test usb::xhci::ring::tests::controller_sees_every_push_in_order_across_many_wraps ... ok
+test usb::xhci::ring::tests::dequeue_pointer_carries_the_cycle_state_and_flips_after_the_link ... ok
+test usb::xhci::ring::tests::event_ring_consumes_matching_cycles_and_wraps_without_a_link ... ok
+test usb::xhci::tests::capabilities_decode_qemu_xhci_registers ... ok
+test usb::xhci::tests::capabilities_decode_scratchpads_large_contexts_and_reject_absent_blocks ... ok
+test usb::xhci::tests::portsc_neutral_never_disables_the_port_or_acks_changes ... ok
+test usb::xhci::tests::recognizes_xhci_class_and_memory_bars ... ok
+test usb::xhci::tests::rejects_other_classes_io_and_unprogrammed_bars ... ok
+test usb::xhci::trb::tests::command_trbs_place_slot_and_input_context ... ok
+test recovery_core::tests::provisioning_is_operator_only_and_only_on_an_unprovisioned_store ... ok
+test usb::xhci::trb::tests::control_stages_carry_idt_transfer_type_and_directions ... ok
+test task_runtime::tests::non_object_or_other_object_grant_is_denied ... ok
+test usb::xhci::trb::tests::event_fields_decode_from_their_bit_positions ... ok
+test usb::xhci::trb::tests::isoch_trb_encodes_frame_id_and_batch_flags ... ok
+test usb::xhci::trb::tests::normal_trb_asks_for_an_event_on_short_reports ... ok
+test usb::xhci::trb::tests::trb_is_sixteen_bytes_and_sixteen_aligned ... ok
+test user::tests::capability_handle_round_trips ... ok
+test user::tests::el0_mapping_attributes_are_wx_and_non_global ... ok
+test user::tests::trap_frame_layout_matches_assembly ... ok
+test usb::audio::tests::stereo_44100_scheduler_emits_one_second_of_pcm_bytes ... ok
+test virtio_net::tests::parses_modern_virtio_net_capabilities ... ok
+test virtio_net::tests::rejects_loops_and_short_vendor_capabilities ... ok
+test usb::audio::tests::fractional_44100_packet_pattern_totals_one_second ... ok
+test usb::descriptor::tests::finds_the_keyboard_interrupt_in_endpoint ... ok
+test usb::xhci::trb::tests::setup_packet_bytes_match_the_usb_wire_order ... ok
+test store::engine::tests::store_transaction_commit_dedup_and_tail_reuse ... ok
+test store::engine::tests::store_malformed_peer_recovery_matrix ... ok
+test store::engine::tests::store_history_matrix_equivalent_and_adjacent_roots ... ok
+test recovery_core::tests::degraded_repair_needs_the_operator_and_restores_a_writable_store ... ok
+test infer::gemm::tests::products_match_reference_odd_and_even ... ok
+test store::tests::block_store_crash_boundaries_keep_old_or_new_commit ... ok
+test store::engine::tests::store_catalogfull_zero_writes ... ok
+test crypto::envelope::tests::tampered_late_chunk_rejects_the_entire_plaintext ... ok
+test crypto::envelope::tests::test_envelope_roundtrip_multi_chunk ... ok
+test artifact_loader::tests::largest_envelope_loads_in_one_l3_table ... ok
+test continuity::tests::branch_table_at_the_maximum_legal_fork_sum_is_accepted ... ok
+test continuity::continuity_vectors::committed_fixtures_match_the_oracle ... ok
+
+test result: ok. 412 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.62s
+
+ Running tests/nvme_completion.rs (target/debug/deps/nvme_completion-dafc6afe36974715)
+
+running 14 tests
+test admin_status_word_decodes_exact_sc_and_sct ... ok
+test completion_accessors_decode_little_endian_fields ... ok
+test admin_command_id_mismatch_reports_invalid_identify ... ok
+test completion_queue_phase_flips_at_depth_eight ... ok
+test admin_cq_phase_flips_when_head_wraps_at_depth_eight ... ok
+test controller_fatal_status_maps_to_controller_failed ... ok
+test controller_never_ready_maps_to_controller_timeout ... ok
+test admin_timeout_is_bounded_no_infinite_loop ... ok
+test io_command_id_mismatch_reports_device_error ... ok
+test io_cq_wraparound_consumes_completions_in_order ... ok
+test io_nonzero_status_maps_to_device_error ... ok
+test malformed_completions_do_not_panic ... ok
+test stale_phase_completion_is_skipped_and_matching_one_consumed ... ok
+test io_timeout_is_bounded_no_infinite_loop ... ok
+
+test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_flush.rs (target/debug/deps/nvme_flush-592b420dc2ed9f8b)
+
+running 6 tests
+test flush_after_write_in_same_session_uses_fresh_cid ... ok
+test flush_submits_opcode_zero_nsid_one_without_data_pointer ... ok
+test flush_is_not_a_silent_no_op_doorbell_and_command_reach_device ... ok
+test successful_flush_completion_returns_ok ... ok
+test nonzero_flush_completion_status_returns_device_error ... ok
+test flush_timeout_returns_timeout_and_is_bounded ... ok
+
+test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_identify.rs (target/debug/deps/nvme_identify-a2be85435664a0af)
+
+running 9 tests
+test init_identifies_namespace_and_capacity_round_trips ... ok
+test lbads_9_and_12_map_to_block_sizes ... ok
+test mdts_255_shift_does_not_panic ... ok
+test maximum_flbas_descriptor_offset_stays_in_bounds ... ok
+test lbads_at_or_above_32_is_invalid_identify ... ok
+test nonzero_flbas_selects_its_own_descriptor ... ok
+test nsid_zero_identify_does_not_panic ... ok
+test zero_block_count_is_invalid_identify ... ok
+test mdts_byte_77_controls_transfer_chunking ... ok
+
+test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_prp.rs (target/debug/deps/nvme_prp-dd973e4fd7815701)
+
+running 14 tests
+test invalid_non_power_of_two_page_size ... ok
+test invalid_zero_length_and_page_size ... ok
+test list_buffer_too_small_is_bounded ... ok
+test max_address_short_length_is_invalid_without_panic ... ok
+test multi_page_requires_aligned_nonzero_list ... ok
+test list_page_chaining_4k_exact_used ... ok
+test one_page_boundary_crossing ... ok
+test page_boundaries_64k ... ok
+test single_page_aligned_and_unaligned ... ok
+test prp_values_are_full_physical_addresses ... ok
+test transfer_limit_arithmetic_is_bounded ... ok
+test two_pages_use_prp2_with_zero_used ... ok
+test offset_plus_length_overflow_is_invalid ... ok
+test list_page_chaining_64k_exact_used ... ok
+
+test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_write.rs (target/debug/deps/nvme_write-244f9e3fbc2a458c)
+
+running 9 tests
+test each_io_command_gets_a_new_cid_and_completion_is_consumed ... ok
+test empty_and_non_block_multiple_buffers_are_invalid_input ... ok
+test nonzero_write_completion_maps_to_device_error ... ok
+test offset_write_splits_lba_across_cdw10_and_cdw11 ... ok
+test write_one_block_encodes_opcode_nsid_lba_nlb_and_prp1 ... ok
+test write_eight_blocks_is_one_command_with_nlb_seven ... ok
+test write_past_block_count_is_out_of_range_without_io_submission ... ok
+test written_bytes_read_back_exactly ... ok
+test mdts_chunking_submits_per_chunk_commands_with_correct_lba_and_nlb ... ok
+
+test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_write_completion.rs (target/debug/deps/nvme_write_completion-05ceb97712eccfdb)
+
+running 8 tests
+test failed_flush_completion_maps_to_device_error ... ok
+test failed_write_completion_maps_to_device_error ... ok
+test invalid_namespace_identify_surfaces_completion_status ... ok
+test write_batch_cq_wraparound_flips_phase_and_consumes_in_order ... ok
+test write_command_id_mismatch_maps_to_device_error ... ok
+test flush_timeout_is_bounded_no_infinite_loop ... ok
+test wrong_phase_zero_completion_is_ignored_not_consumed ... ok
+test write_timeout_is_bounded_no_infinite_loop ... ok
+
+test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/nvme_write_prp.rs (target/debug/deps/nvme_write_prp-49d57198a86480f2)
+
+running 14 tests
+test address_near_u64_max_is_invalid_without_panic_or_wrap ... ok
+test flush_submits_opcode_zero_command ... ok
+test list_address_zero_or_unaligned_is_invalid_for_list_cases ... ok
+test offset_plus_length_overflow_is_invalid ... ok
+test multi_block_write_crossing_page_emits_prp2 ... ok
+test one_block_aligned_write_is_single_prp1_page ... ok
+test unaligned_prp1_spans_pages_correctly ... ok
+test write_crossing_page_boundary_uses_prp1_and_prp2 ... ok
+test write_one_aligned_block_carries_single_prp1 ... ok
+test write_page_list_chains_at_4k_exact_entries ... ok
+test write_past_namespace_end_is_rejected_before_any_command ... ok
+test write_spanning_three_pages_uses_prp_list ... ok
+test write_larger_than_mdts_is_split_into_commands ... ok
+test write_page_list_chains_at_64k_exact_entries ... ok
+
+test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running tests/store_v1_golden_vectors.rs (target/debug/deps/store_v1_golden_vectors-f6fdbcdb080f13e9)
+
+running 8 tests
+test crc32c_check_value ... ok
+test one_entry_catalog ... ok
+test object_id ... ok
+test top_level_is_the_frozen_schema ... ok
+test empty_catalog ... ok
+test adjacent_generations ... ok
+test genesis ... ok
+test equivalent_roots ... ok
+
+test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
+
+ Running tests/store_v1_negative.rs (target/debug/deps/store_v1_negative-7a130c126f2edc56)
+
+running 10 tests
+test catalog_entry_bounds_reject_metadata_overflow_and_high_water_violations ... ok
+test catalog_extents_reject_overlap_and_metadata_overlap ... ok
+test catalog_rejects_bad_header_counts_and_exact_lengths ... ok
+test catalog_rejects_entry_reserved_flags_and_invalid_lengths ... ok
+test catalog_rejects_unsorted_and_duplicate_object_ids ... ok
+test commit_record_rejects_lengths_features_generation_and_high_water ... ok
+test generation_link_requires_adjacent_generation_and_exact_predecessor_ids ... ok
+test superblock_commit_validation_binds_commit_unit_catalog_and_high_water ... ok
+test object_id_rejects_semantic_mutation_wrong_identity_and_nonzero_padding ... ok
+test crc32c_known_answer_and_superblock_rejects_corruption_reserved_and_slot ... ok
+
+test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.54s
+
+ Running unittests src/main.rs (target/debug/deps/aienos_store_tool-03e09a0e1ba60bc3)
+
+running 2 tests
+test tests::garbage_is_stable_and_not_a_superblock ... ok
+test tests::tear_outcomes_detects_a_third_state ... ok
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
+ Running unittests src/main.rs (target/debug/deps/allen_courier-e491f6ef3b9d347e)
+
+running 26 tests
+test code::tests::a_sentence_and_a_fenced_block_are_read ... ok
+test code::tests::an_unclosed_block_runs_to_the_end_and_no_block_is_none ... ok
+test code::tests::crc_is_zlibs ... ok
+test code::tests::short_names_and_odd_bytes_are_made_plain ... ok
+test plain_tests::a_cut_answer_stays_within_the_room_with_its_mark ... ok
+test key_tests::no_key_sends_no_header_and_https_is_refused_out_loud ... FAILED
+test key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back ... FAILED
+test tests::a_busy_server_is_asked_again_with_growing_waits ... ok
+test key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so ... FAILED
+test tests::a_busy_server_names_its_wait_exactly ... ok
+test plain_tests::typographic_marks_become_plain_ones ... ok
+test code::tests::long_code_is_cut_at_a_line_within_the_limits ... ok
+test tests::a_code_reply_becomes_pieces_and_a_closing_sentence ... ok
+test tests::a_job_line_carries_the_memory_fields ... ok
+test tests::chunked_bodies_are_joined ... ok
+test tests::datagram_heads_round_trip ... ok
+test tests::a_sentence_end_too_early_is_not_used ... ok
+test tests::dates_are_civil ... ok
+test tests::json_strings_round_trip ... ok
+test tests::long_answers_are_cut_at_a_sentence_end ... ok
+test tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns ... FAILED
+test tests::short_answers_pass_whole_with_whitespace_folded ... ok
+test tests::the_assistant_text_is_found_in_a_chat_completion ... ok
+test tests::what_was_already_said_in_parts_is_kept ... ok
+test tests::words_on_the_wire ... ok
+test code::tests::pieces_carry_length_checksum_and_escapes ... ok
+
+failures:
+
+---- key_tests::no_key_sends_no_header_and_https_is_refused_out_loud stdout ----
+
+thread 'key_tests::no_key_sends_no_header_and_https_is_refused_out_loud' (6774) panicked at crates/allen-courier/src/main.rs:1893:50:
+called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }
+
+---- key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back stdout ----
+
+thread 'key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back' (6772) panicked at crates/allen-courier/src/main.rs:1893:50:
+called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }
+note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+
+---- key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so stdout ----
+
+thread 'key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so' (6773) panicked at crates/allen-courier/src/main.rs:1893:50:
+called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }
+
+---- tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns stdout ----
+
+thread 'tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns' (6787) panicked at crates/allen-courier/src/main.rs:1719:57:
+called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }
+
+
+failures:
+ key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back
+ key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so
+ key_tests::no_key_sends_no_header_and_https_is_refused_out_loud
+ tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns
+
+test result: FAILED. 22 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
+
+error: test failed, to rerun pass `-p allen-courier --bin allen-courier`
diff --git a/evidence/allen-omega-L694/view2.txt b/evidence/allen-omega-L694/view2.txt
new file mode 100644
index 00000000..8b194f11
--- /dev/null
+++ b/evidence/allen-omega-L694/view2.txt
@@ -0,0 +1,13 @@
+901 0
+902 0
+903 0
+904 0
+905 0
+906 0
+907 0
+908 0
+909 0
+910 0
+911 0
+912 0
+913 0
diff --git a/evidence/allen-portable-build-20261023/README.md b/evidence/allen-portable-build-20261023/README.md
new file mode 100644
index 00000000..dba6e42f
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/README.md
@@ -0,0 +1,46 @@
+# Allen portable compiler build qualification
+
+Base: aienos/aienux `f52f17a9e9520c1d16ba4d30aa8ee3bda8ee12a5`.
+Compiler source: omega-bridge `0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9`.
+Platform: Linux AArch64 on Spark. No live services or hardware configuration changed.
+
+## Executed
+
+- RED: the original build followed a dangling output link and published through
+ it. `red.log` exits 1 after the existing-output check. The relocated-compiler
+ probe alone did not establish selection: the original ignored the setting.
+- One test setup attempt could not append to a read-only copied compiler.
+ `fixture-setup-failure.log` records it. The test now makes its private copy
+ writable before corrupting it; this was not a production failure.
+- GREEN: the complete component gate includes the relocated-compiler probe,
+ existing-file preservation, dangling-link refusal, corrupt compiler refusal,
+ failed compilation leaving no output, absent compiler/argument refusal and
+ temporary-file cleanup. `host-gate.log`, exit 0.
+- Rebuilt the original Omega compiler from its exact Git source archive using
+ `quiet-build sh tools/bootstrap.sh --offline`. `bootstrap.log`, exit 0.
+- Replayed the complete Allen gate in a clean exported source directory using
+ the repository-local default compiler location, with no `OMEGA_COMPILER`
+ override and no private handoff compiler. Native modules, golden bytes,
+ provider stream/fragment/refusal checks and all 24 compiled mutants pass.
+- After Drake explicitly authorized publication, Allen and omega-bridge became
+ public on 2026-10-23. Anonymous GitHub API reads verified both. Downloaded the
+ pinned compiler tarball without credentials and independently rebuilt it;
+ `public-bootstrap.log`, exit 0. Its digest equals the original compiler pin.
+- `git diff --check` and `sh -n` for the three changed build scripts pass.
+
+Source and artifact digests are in `source.sha256` and `artifacts.sha256`.
+The broader repository verification is separate from these component results;
+its eventual result must be recorded before claiming repository-wide qualification.
+
+## Scope limits
+
+The bootstrap proves source reconstruction and self-rebuild equality, not
+independent diverse compiler ancestry. These checks do not qualify a hosted
+window/input loop, live inference, durable device storage, x86/macOS/EFI output,
+native boot or a physical iMac trial. Public source availability is PASS;
+the interactive Alpha 1.0 release is not complete. No release tag was created.
+
+Author review: compiler digest remains fixed; compilation and ELF inspection
+must succeed before atomic no-replace publication; existing output links and
+files are refused; transient files are removed on failure. Independent source
+review remains pending with the publication desk.
diff --git a/evidence/allen-portable-build-20261023/artifacts.sha256 b/evidence/allen-portable-build-20261023/artifacts.sha256
new file mode 100644
index 00000000..dba34560
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/artifacts.sha256
@@ -0,0 +1,3 @@
+191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /tmp/allen-source-replay-20261023/allen/build/allen-toolchain/build/bootstrap/omc
+7920f4faf33ee312a4e40bd059cfbd596ed6dde41a4d72e3d7b841762ab961a1 /tmp/allen-source-replay-20261023/allen/final-output/provider
+676f3d56de19603e07766f2b859b58a55090071cb4a43081b4e7800031872066 /tmp/allen-source-replay-20261023/allen/final-output/provider-surface.ppm
diff --git a/evidence/allen-portable-build-20261023/bootstrap.log b/evidence/allen-portable-build-20261023/bootstrap.log
new file mode 100644
index 00000000..be820a3f
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/bootstrap.log
@@ -0,0 +1 @@
+PASS source-only seed bootstrap and compiler fixpoint
diff --git a/evidence/allen-portable-build-20261023/fixture-setup-failure.log b/evidence/allen-portable-build-20261023/fixture-setup-failure.log
new file mode 100644
index 00000000..819c9d22
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/fixture-setup-failure.log
@@ -0,0 +1,6 @@
+PASS relocated compiler and actual native program
+fresh output required
+PASS existing output preserved
+fresh output required
+PASS dangling output link refused
+native/omega/allen/test-build.sh: 29: cannot create /tmp/allen-portable-green-20261023/compiler with spaces: Permission denied
diff --git a/evidence/allen-portable-build-20261023/host-gate.log b/evidence/allen-portable-build-20261023/host-gate.log
new file mode 100644
index 00000000..9931d0bf
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/host-gate.log
@@ -0,0 +1,72 @@
+PASS relocated compiler and actual native program
+fresh output required
+PASS existing output preserved
+fresh output required
+PASS dangling output link refused
+compiler digest differs from the qualified pin
+PASS changed compiler refused before output creation
+omc: line 3: error 4
+PASS failed compilation publishes no executable
+usage: build-one.sh SOURCE OUTPUT
+pinned compiler missing; follow native/omega/allen/README.md
+PASS missing compiler and missing argument refused
+PASS no temporary build files retained
+runtime compile=0 native-exit=0
+code compile=0 native-exit=0
+courier compile=0 native-exit=0
+scheduler compile=0 native-exit=0
+application compile=0 native-exit=0
+provider-core compile=0 native-exit=0
+presentation compile=0 native-exit=0
+font compile=0 native-exit=0
+surface compile=0 native-exit=0
+memory compile=0 native-exit=0
+context compile=0 native-exit=0
+intent compile=0 native-exit=0
+reply compile=0 native-exit=0
+view compile=0 native-exit=0
+scene compile=0 native-exit=0
+scene-input compile=0 native-exit=0
+paint compile=0 native-exit=0
+edges compile=0 native-exit=0
+fixture compile=0 native-exit=0
+golden compile=0 native-exit=0
+render compile=0 native-exit=0
+font-output compile=0 native-exit=0
+font-render compile=0 native-exit=0
+surface-render compile=0 native-exit=0
+font native masks match frozen external legacy oracle
+stdio native-exit=0 golden-cmp=0
+stdio overflow native-exit=65 no-later-command=PASS
+provider malformed mode=1 exit=65 no-later-command=PASS
+provider malformed mode=2 exit=65 no-later-command=PASS
+provider malformed mode=3 exit=65 no-later-command=PASS
+provider malformed mode=4 exit=65 no-later-command=PASS
+provider malformed mode=5 exit=65 no-later-command=PASS
+provider malformed mode=6 exit=65 no-later-command=PASS
+provider native-exit=0 fragmented-pipe=0 output-verifier=0
+stale mutant compile=0 rejected-exit=3
+crc mutant compile=0 rejected-exit=2
+hash mutant compile=0 rejected-exit=2
+readback mutant compile=0 rejected-exit=7
+session mutant compile=0 rejected-exit=1
+keepalive mutant compile=0 rejected-exit=40
+ackstop mutant compile=0 rejected-exit=27
+pendingwire mutant compile=0 rejected-exit=1
+appcode mutant compile=0 rejected-exit=3
+thinking mutant compile=0 rejected-exit=6
+scenecap mutant compile=0 rejected-exit=3
+contextnote mutant compile=0 rejected-exit=5
+contextjob mutant compile=0 rejected-exit=36
+autosent mutant compile=0 rejected-exit=1
+framecheck mutant compile=0 rejected-exit=1
+staleview mutant compile=0 rejected-exit=1
+inputtail mutant compile=0 rejected-exit=1
+fontroot mutant compile=0 rejected-exit=1
+fontalpha mutant compile=0 rejected-exit=1
+rawask mutant compile=0 rejected-exit=1
+rawrecv mutant compile=0 rejected-exit=1
+rawreset mutant compile=0 rejected-exit=1
+clipright mutant compile=0 rejected-exit=1
+blendbg mutant compile=0 rejected-exit=1
+ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN
diff --git a/evidence/allen-portable-build-20261023/public-bootstrap.log b/evidence/allen-portable-build-20261023/public-bootstrap.log
new file mode 100644
index 00000000..be820a3f
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/public-bootstrap.log
@@ -0,0 +1 @@
+PASS source-only seed bootstrap and compiler fixpoint
diff --git a/evidence/allen-portable-build-20261023/red.log b/evidence/allen-portable-build-20261023/red.log
new file mode 100644
index 00000000..2fe13e81
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/red.log
@@ -0,0 +1,3 @@
+PASS relocated compiler and actual native program
+fresh output required
+PASS existing output preserved
diff --git a/evidence/allen-portable-build-20261023/source.sha256 b/evidence/allen-portable-build-20261023/source.sha256
new file mode 100644
index 00000000..63d03825
--- /dev/null
+++ b/evidence/allen-portable-build-20261023/source.sha256
@@ -0,0 +1,4 @@
+4023744d3f3009327cd0a94f0f4373cfb5a91bc7cb1f6144dddc0a8f28ddbbe8 native/omega/allen/build-one.sh
+314553cfe714f1bc85767d1add35b03de826d08bdee8d4993991451dbf97e546 native/omega/allen/gate.sh
+2c1cc34edcf091717b10c5c39118f6ff59af41ccb1c844170e7a30140c5cee32 native/omega/allen/test-build.sh
+213fc47c365767db8a12cbd22ef0cec4a6bbb61c34ee3daae9b8182a122da8f4 native/omega/allen/tests/build-probe.om
diff --git a/native/.crumb b/native/.crumb
index 83c71823..7b208ec2 100644
--- a/native/.crumb
+++ b/native/.crumb
@@ -56,7 +56,7 @@
},
{
"digest": "52e6a6fd88b4494a709eb8807fcc13736cd2286ee4f529f3d0facb104f4e2627",
- "last_commit": "800595d0",
+ "last_commit": "5e0c7970",
"name": "boot",
"purpose": "Directory native/boot. Purpose not yet described by a human."
},
@@ -79,8 +79,8 @@
"purpose": "Directory native/disk. Purpose not yet described by a human."
},
{
- "digest": "3c10adfc819ba82707e4d8ddc996fadd9d7408f6b4017353aedd5e31d448639e",
- "last_commit": "f26a7a2f",
+ "digest": "af273c64a35fb82517e60ba5feea763c5ee416443ae7f9a48bc3a20b29ddc481",
+ "last_commit": "432c9447",
"name": "kernel",
"purpose": "Directory native/kernel. Purpose not yet described by a human."
},
@@ -97,8 +97,8 @@
"purpose": "Directory native/net. Purpose not yet described by a human."
},
{
- "digest": "f3c7ee4f18f768fa9964c123e07f076c544c58c0966a8a5e9571b0397bf57b06",
- "last_commit": "c93a5f57",
+ "digest": "6a2dad3c256c6f916442b3256f3eabc05da9ea6a82114256aec43f53e75fc2cd",
+ "last_commit": "a14aa34c",
"name": "omega",
"purpose": "Seeded Omega native modules"
},
@@ -115,15 +115,15 @@
"purpose": "Directory native/store. Purpose not yet described by a human."
}
],
- "children_root": "sha256:55d63319aaf74dda6aedad3236cc4a8b8737062d30c89402a2654762e1a53cbe",
- "compiled_at": "2026-11-06T12:57:47Z",
+ "children_root": "sha256:2fcf34c940bbdc6d6d426e1610847be64c3d9b5ceae3d455c51af26c0c89f3e3",
+ "compiled_at": "2026-11-06T15:04:49Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:45c897a7055a0c25a1ee482e5dd8674f527bc91d12bae901c9e73ed3ada3d7d2",
+ "digest": "sha256:773512413893fb607ea2e93c237b7ec15c3c55d8c656e8224a42b92b6bf0a6e5",
"evidence_files": 24,
"evidence_root": "sha256:ecc7ccf2e924c221a5bac1d91e23b13d8f3c8d78c2a893a882ed7ca5e88d855d",
- "files": 901,
- "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8",
- "source_tree": "sha256:e1edd726cecca8741ed09d0e18d4908e321ad4a257dcfa616698f43165fc8494"
+ "files": 1020,
+ "generated_at_commit": "a14aa34c9249188cc771a2a565494b5ce61ad432",
+ "source_tree": "sha256:2db6157faff537ba9160bc50742fdebe5d3185beb36d0647a8ec7fc1ef03127e"
},
"owner_lane": "",
"provenance": {
diff --git a/native/kernel/.crumb b/native/kernel/.crumb
index 937d4c43..b27415b5 100644
--- a/native/kernel/.crumb
+++ b/native/kernel/.crumb
@@ -52,19 +52,19 @@
},
{
"digest": "b3ec8c7d0aef7d59d5b2733c3985bc8944799a1d693b3975b70d24fc413f681e",
- "last_commit": "2c057c5d",
+ "last_commit": "5e0c7970",
"name": "artifact",
"purpose": "Directory native/kernel/artifact. Purpose not yet described by a human."
},
{
"digest": "61a172288ebf844e840e09f1c1c6cf60020ebe20534843ff0958fd7f8c7403b0",
- "last_commit": "f26a7a2f",
+ "last_commit": "5e0c7970",
"name": "core",
"purpose": "Directory native/kernel/core. Purpose not yet described by a human."
},
{
- "digest": "bb1590a998c55526c1e9db5695814df0a4473a78d1fcf800fc6f46ea21eaa902",
- "last_commit": "f26a7a2f",
+ "digest": "eadad3ae0c0adef9284d1040ee1ea04c0399b5fd25bd9d11b5ccdb2856907118",
+ "last_commit": "432c9447",
"name": "dev",
"purpose": "Directory native/kernel/dev. Purpose not yet described by a human."
},
@@ -76,38 +76,38 @@
},
{
"digest": "3c703a23e77318cb2711acdf82d3252007fdfdb972ba96dda96f261afb10e37c",
- "last_commit": "2c057c5d",
+ "last_commit": "d05e080b",
"name": "mm",
"purpose": "Directory native/kernel/mm. Purpose not yet described by a human."
},
{
"digest": "f16e0e7ecbfd61786aff570cdb98c12abcd7cee18b1121e94f55f26b6abf7adb",
- "last_commit": "f26a7a2f",
+ "last_commit": "5e0c7970",
"name": "svc",
"purpose": "Directory native/kernel/svc. Purpose not yet described by a human."
},
{
"digest": "b59cf15dae1176673f4400a34367e1f6f22dc5cfc8125197301375e805bfc64c",
- "last_commit": "f26a7a2f",
+ "last_commit": "5e0c7970",
"name": "tests",
"purpose": "Directory native/kernel/tests. Purpose not yet described by a human."
},
{
"digest": "5a45af6994ac4e8e94d4f95f30f5345008fbcfa9785032b7f9b8391c86b53b7c",
- "last_commit": "f26a7a2f",
+ "last_commit": "5e0c7970",
"name": "tools",
"purpose": "Hosted (Linux-built) checkers for the native kernel, run by `make -C native/kernel test`; nothin"
}
],
- "children_root": "sha256:0d5c84695671f16bb5807527e1569c4ef812d7661d6802ac1420b23cc99ba818",
- "compiled_at": "2026-11-06T12:57:47Z",
+ "children_root": "sha256:dd22d8853baa41fc0830dbc9e739364d7f6c7c73c177cf6a05004d8a0e9e9fd4",
+ "compiled_at": "2026-11-06T14:13:40Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:3c10adfc819ba82707e4d8ddc996fadd9d7408f6b4017353aedd5e31d448639e",
+ "digest": "sha256:af273c64a35fb82517e60ba5feea763c5ee416443ae7f9a48bc3a20b29ddc481",
"evidence_files": 0,
"evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"files": 644,
- "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8",
- "source_tree": "sha256:f6ddc0728ef568a6235e893df21a5074ece28e79c9f8e07886a437dd80844fc0"
+ "generated_at_commit": "432c9447df58c134b21be92447164f33f92e70b2",
+ "source_tree": "sha256:60c5bf4b990a11a7d55a500e086bfd1ace4778e04f0e9fe0258c94c2de1026c2"
},
"owner_lane": "",
"provenance": {
diff --git a/native/kernel/dev/.crumb b/native/kernel/dev/.crumb
index a4d0cba9..fd2be65d 100644
--- a/native/kernel/dev/.crumb
+++ b/native/kernel/dev/.crumb
@@ -7,14 +7,14 @@
"generated": {
"children": [],
"children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
- "compiled_at": "2026-11-06T12:57:47Z",
+ "compiled_at": "2026-11-06T14:13:40Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:bb1590a998c55526c1e9db5695814df0a4473a78d1fcf800fc6f46ea21eaa902",
+ "digest": "sha256:eadad3ae0c0adef9284d1040ee1ea04c0399b5fd25bd9d11b5ccdb2856907118",
"evidence_files": 0,
"evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"files": 64,
- "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8",
- "source_tree": "sha256:be8d7f594d9c2649dbbb634dc2439115e8c005eef4fc1368cb4f3f03a18ece16"
+ "generated_at_commit": "432c9447df58c134b21be92447164f33f92e70b2",
+ "source_tree": "sha256:16fd5ab40c30397772119fe59b71683bed7d212380b91e657879ebb5283ca0d3"
},
"owner_lane": "",
"provenance": {
diff --git a/native/kernel/dev/usb_hid.c b/native/kernel/dev/usb_hid.c
index aa97255f..8511e363 100644
--- a/native/kernel/dev/usb_hid.c
+++ b/native/kernel/dev/usb_hid.c
@@ -253,7 +253,7 @@ void ck_recovery_identity(const char *commit, uint8_t out[32])
sha256_update(&c, (const uint8_t *)dom, sizeof dom);
size_t n = 0;
if (commit)
- while (commit[n] && n < 64) n++;
+ while (n < 64 && commit[n]) n++;
sha256_update(&c, (const uint8_t *)(commit ? commit : ""), n);
sha256_final(&c, out);
}
diff --git a/native/omega/.crumb b/native/omega/.crumb
index 1c75880b..3977b05d 100644
--- a/native/omega/.crumb
+++ b/native/omega/.crumb
@@ -4,20 +4,20 @@
"children": [
{
"digest": "5b8954046044cd9e509cf3696330a580e8bdb515ee73f500184be22daa1dc1bb",
- "last_commit": "92e4bc6",
+ "last_commit": "c93a5f57",
"name": "platform",
"purpose": "Spark read-only ACPI resource readback"
}
],
"children_root": "sha256:fcc350d101f87cb9e531f243a85d6664b62bbe63cf4b8c71b61bcb4d63d3e9b0",
- "compiled_at": "2026-10-28T23:11:15Z",
+ "compiled_at": "2026-11-06T15:04:49Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:f3c7ee4f18f768fa9964c123e07f076c544c58c0966a8a5e9571b0397bf57b06",
+ "digest": "sha256:6a2dad3c256c6f916442b3256f3eabc05da9ea6a82114256aec43f53e75fc2cd",
"evidence_files": 0,
"evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
- "files": 8,
- "generated_at_commit": "92e4bc688150b9754b6f37d3a701c58f7764d7ee",
- "source_tree": "sha256:2f18a7d9ab0e0bf0b9e2a3f97a3b3d9a58ee97417a799178c906b8ac9d65b5bd"
+ "files": 127,
+ "generated_at_commit": "a14aa34c9249188cc771a2a565494b5ce61ad432",
+ "source_tree": "sha256:34c55e6b1ef7deab8e3df5b9fbf27b39809cfeba18a85708cf7fe42a13139c59"
}
},
"name": "omega",
diff --git a/native/omega/allen/ALPHA.md b/native/omega/allen/ALPHA.md
new file mode 100644
index 00000000..7dd08f7e
--- /dev/null
+++ b/native/omega/allen/ALPHA.md
@@ -0,0 +1,49 @@
+# Allen alpha delivery contract
+
+User direction: Allen is a sovereign stack, not a mandatory client of Drake's
+Spark. The initial visual release targets the iMac. One shared handwritten
+Omega core supports native boot and an optional hosted application experience.
+These launch modes are qualified separately; current Linux AArch64 module tests
+do not qualify an iMac boot image or a macOS application.
+
+## Free, temporary hosted experience
+
+The hosted app is a free, temporary way to experience the interface and speed
+before choosing a native installation. It must leave boot configuration,
+partitions and drivers untouched, and uninstall cleanly. It is not meant to
+replace the sovereign stack with a permanent dependency on another OS or service.
+The hosted trial necessarily uses its host OS interfaces; native boot remains
+the path where Allen owns boot/kernel/device behavior.
+
+## User-controlled inference
+
+- Local: use supported compute on the user's own machine through AIEN's engine.
+ This is a first-class path, not gated on an AIEN account or remote API key.
+- User cloud: use compute the user provisions and controls, through AIEN's stack.
+- Drake's Spark: optional hosted inference requiring an API key for that service.
+
+No mandatory Spark service, cloud provider, vendor runtime or subscription is
+introduced by these choices. Unsupported local hardware is reported honestly,
+not silently substituted with remote inference. Backend selection and permission
+to send data off-device must be explicit. Keys are never baked into a download
+or logs. Do not ask users to paste keys into development chat.
+
+Every displayed speed result must identify the inference location and relevant
+hardware. A Spark-backed response is not evidence of the user's local speed.
+A free app does not imply free third-party cloud infrastructure; any such cost
+must be disclosed before the user selects it. No performance guarantee without
+measurements on the actual named path.
+
+## Public alpha acceptance
+
+Publicly obtainable artifact, supported-platform instructions, source/license
+provenance, checksums, clean acquisition outside a developer checkout, actual
+visual conversation and persistence, and recovery/uninstall instructions.
+Qualify one bundled native iMac trial separately from the hosted safe trial.
+Unknown hardware gets detection and bounded capability checks, not guessed writes.
+
+The font, provider and retained-presentation components are implemented. The
+bounded RGB surface is being qualified. Live backend binding, hosted window/input
+and platform packaging, native boot/device integration and physical iMac acceptance
+remain unfinished. Do not label component images or protocol fixtures a released
+interactive alpha.
diff --git a/native/omega/allen/FONT.md b/native/omega/allen/FONT.md
new file mode 100644
index 00000000..090cb1a9
--- /dev/null
+++ b/native/omega/allen/FONT.md
@@ -0,0 +1,30 @@
+# L758 native stroke-font implementation
+
+Continuation of L694 checkpoint5, executed inline with RED/GREEN. Language:
+handwritten seeded Omega. Reuse the exact existing Allen glyph design and sine
+lookup data from native/kernel/ui/allen_font.c at4c7888f; do not transpile C.
+The legacy source is an external pixel oracle only, never construction/runtime.
+
+Create font-data.om (95 glyph command strings,91 sine samples), font.om (integer
+sqrt/trig, fixed-pool segment generation and single-glyph antialiased masks),
+tests/font.om, tests/font-output.om and tests/font-render.om. No heap or font file.
+API afinit(cap,weight) accepts1..64px and1..2500 weight units; afglyph(byte) maps
+nonprintable input to '?'. Af fields: scale256,halfwidth256,segment count,width,
+height,advance256. Ab[0,1] is signed mask origin relative to baseline. Alpha is
+fixed65536 bytes; Ag contains at most160 line segments. Invalid init preserves
+last state; successful init clears validity. A glyph render replaces the single
+mask; no caching/per-face heap allocation claim.
+
+- Write compilable stub and native tests; observe meaningful behavior RED.
+- Handwrite geometry/parser/rasterization with bounded cap/weight and arithmetic.
+- Run native tests including all95 glyphs, space, fallback, symmetry, bounds,
+ signed angles, full-width sqrt cases and fixed nonzero assertion failure exits.
+- Compile the unmodified legacy font as a separately labeled host oracle; externally
+ collect mask metadata/bytes, compare with an Omega-emitted glyph stream. Neither
+ oracle C nor collection Python is linked into or used to produce Omega code.
+- Produce an actual native-rendered specimen, inspect it visually, record hashes.
+- Run the native combined gate; publish source, exact receipts and known limits.
+
+The current provider/presentation review continues separately; do not duplicate
+it or alter its frozen source. Full scene layout, sky, motion, framebuffer device
+and physical iMac qualification remain subsequent work, not implied by a font.
diff --git a/native/omega/allen/PRESENTATION.md b/native/omega/allen/PRESENTATION.md
new file mode 100644
index 00000000..e5d943dd
--- /dev/null
+++ b/native/omega/allen/PRESENTATION.md
@@ -0,0 +1,34 @@
+# L756 application presentation binding
+
+Next attachment within L694 checkpoint5: use the qualified application, scene
+normalizer and code-row layout instead of another parser or scripted UI.
+No change to L748 provider source while its independent review is running.
+
+`dask(now)` and `drecv(now)` call appask/appreceive respectively, preserve their
+boolean admission result, then project only accepted event1 into presentation.
+`dpresent()` consumes current Answer/R/A; it is called once per accepted event,
+never to replay stale A2 after a failed operation. It returns true when a scene
+or completed-code snapshot was updated. A rejected/hidden/empty answer leaves
+the last accepted scene visible; it does not clear the display. Ordinary words
+use the existing bounded plain fallback. Existing SAY folding/159-byte limit
+remains; this does not establish multiline 2048-byte model scene transport.
+
+Scene snapshots: Ds[8], Dt[64], Dtext[2304], Dsay[1]. Dm[0] scene valid,
+Dm[1] completed code valid, Dm[2] last successfully projected conversation ID.
+A validated completed-code event copies Code into Dcode[32768] and the existing
+80-column/4096-row layout into Dstart/Dlen/Dline[4096], Dview[rows,top,bytes].
+An in-progress/new/refused reply cannot corrupt the previous completed snapshot.
+Code bytes are retained independently because codebeg/codetake reuse Code.
+
+Input In/Inlen and offered Outb/Outlen/Err must survive presentation exactly.
+Decoder scratch Sc/Things/Stext and view scratch may change; renderer consumers
+must read the retained D* state. Pending transport state is never acknowledged.
+`dreset()` calls appreset and zeros all retained presentation buffers/metadata;
+conversation/wire counters retain the existing reset contract. No fabricated
+answers, fonts, pixels, display device, disk or live socket implementation.
+
+Qualification: compilable native stub RED, direct state checks and actual
+ASK->courier LINE->drecv integration including pending offers, code completion,
+invalid/hidden payloads, new-code mutation isolation and reset. Compile via the
+pinned191b776e seed; add only module/test paths to the existing host build gate.
+All behavioral decisions stay Omega. Independent review follows source freeze.
diff --git a/native/omega/allen/PROVIDER.md b/native/omega/allen/PROVIDER.md
new file mode 100644
index 00000000..0a94d7c9
--- /dev/null
+++ b/native/omega/allen/PROVIDER.md
@@ -0,0 +1,70 @@
+# Native provider stream v1 (L748)
+
+Builder choice: an explicitly host-development, bounded binary stream entry for
+already-built Omega application functions. It is not a network, clock, storage
+or device provider. All executable implementation and fixtures are Omega; host
+shell only compiles and compares. The legacy development stdio main stays intact.
+
+Input header:40 bytes, magic ASCII ALNPRV01, then four little-endian u64 fields:
+operation, monotonic milliseconds, argument, body length. Body follows exactly.
+No separators/padding after body. Header/body fragmentation is permitted.
+
+| op | operation | argument | body |
+|---|---|---|---|
+|1|BOOT|nonzero unique run ID|empty|
+|2|ASK|0|1..159 prompt bytes|
+|3|POLL|link0/1|empty|
+|4|SENT|actual whole-datagram success0/1|empty|
+|5|RECV|0|65..1200 datagram bytes|
+|6|CANCEL|0|empty; timestamp must0|
+|7|RESET|0|empty; timestamp must0|
+|8|COPY|slot0/1|4096 record bytes; timestamp0|
+|9|NOTE|index0..511|4096 record bytes; timestamp0|
+|10|LOAD|0|empty; timestamp0|
+
+LOAD is optional before BOOT. It explicitly resets restore staging and begins a
+new two-copy read. COPY accepts each slot once, valid or damaged, choosing the
+newest valid memory copy with existing codec; both invalid means empty memory.
+After both copies, ctxbegin runs. NOTE visits each declared slot once; damaged
+records are visited as gone. BOOT refuses until restore is complete. LOAD may
+restart restoration only before BOOT. COPY/NOTE/LOAD refuse after BOOT. Raw record
+bytes come from a future provider; no physical persistence claim.
+
+Output header uses same magic and four u64 fields: echoed op, status, application
+event, body length. Status0 refused/no successful dispatch,1 accepted,2 accepted
+record visit but damaged,3 accepted POLL with outgoing datagram. POLL without an
+offer is status1, not refusal. On accepted non-offer event1, body is exact visible
+Answer bytes. When that event also completes a valid code request, one additional
+record op11/status1/event1 carries the exact Code bytes. No fabricated text.
+## Retained presentation attachment (L763)
+
+The actual provider dispatch uses dask for ASK, drecv for RECV and dreset for
+RESET. Accepted event1 updates the retained D* scene/code state; malformed or
+semantically refused operations never project stale event state. RESET clears
+all retained presentation, while CANCEL retains it. BOOT still initializes once.
+The source concatenation places presentation.om before provider-core.om because
+the seed requires definitions before calls. There is no new operation or output
+record: the external wire contract and exact answer/code bytes remain unchanged.
+The renderer must consume retained D* buffers, not mutable assembly scratch.
+This connects provider dispatch to display state, not yet to pixels or hardware.
+
+Qualification: expand native prdo tests first (136 assertions;24 fail against
+unchanged provider), bind the three existing calls, then replay the complete
+host gate and three compiled call-bypass mutants. File/fragmented-pipe output
+fixtures remain unchanged. Independent exact-source review follows publication.
+
+The stream reply writer uses a separate buffer: application Outb/Outlen/Err remain
+intact until SENT reports the real transport outcome. Writing an offer to stdout
+never counts as sending its datagram.
+
+Bad magic/op/unused fields/size => immediate exit65 before body or later command
+execution. A well-framed semantic refusal produces status0 and permits subsequent
+records. EOF between records is exit0; partial header/body is exit65. Read/write
+errors are exit74 (inherited Linux signal disposition remains a separate limit).
+No synthetic timestamps, link readiness, datagram send outcomes or storage writes.
+
+Implementation/qualification sequence: native compilable stub + behavioral RED;
+provider core with real application calls; native stream entry and real pipe/file
+replay; valid workflow golden, partial/oversized/unknown frame refusal; combined
+native gate and compiled mutations; immutable independent review. No target or
+live-model acceptance from these host fixtures.
diff --git a/native/omega/allen/README.md b/native/omega/allen/README.md
new file mode 100644
index 00000000..f1431105
--- /dev/null
+++ b/native/omega/allen/README.md
@@ -0,0 +1,283 @@
+# Allen in seeded Omega (L694, WIP)
+
+This directory contains handwritten seeded Omega implementations of Allen's
+transport-independent state, protocol, memory codecs, scene state, code layout
+and paint primitives. It compiles directly to static native Linux AArch64 ELF.
+It has no foreign implementation, interpreter, C translator, launcher or fallback.
+
+It is **not the complete iMac Allen replacement**. The old production C/Rust
+paths remain live. No service, machine, physical disk or boot path was changed.
+
+Build on Linux AArch64 from the pinned public compiler source. These are
+component build instructions, not a released interactive alpha. The compiler is
+omega-mv commit 81ab1900, held by the tag `allen-omc-pin-81ab1900` (the
+`feat/x86efi-file-word` head of #981, stacked on #980 register slots and #977 site
+tables; #980 is not merged, so this commit is not on omega-mv main):
+look-paint.om needs its `const` and `bitcast`, the firmware unit its larger
+trap/exit-site tables, look-install.om its `efi 11` file word, and the x86 back
+end's live-slot calls and register-resident slots make the firmware's per-pixel
+code run. From this repository root:
+
+```sh
+git clone https://github.com/aien-dev/omega-mv.git build/allen-toolchain
+git -C build/allen-toolchain checkout --detach 81ab1900
+sha256sum build/allen-toolchain/seed/out/omc # expect 9995f8534e0e5447...
+```
+
+The committed `seed/out/omc` on that branch is the pinned compiler; its
+self-rebuild (`sh seed/omega-from-seed.sh` in a disposable clone) reproduces
+the same bytes. Self-rebuild equality does not establish diverse compiler
+ancestry; that qualification is a separate claim. The expected SHA-256 is
+`9995f8534e0e54470194d57f163421add779cf1994062f8d9a417d0a39f2b075`; pass the
+executable as `OMEGA_COMPILER` (on the Spark: `~/work/IMacLook/omc5`).
+
+The firmware image for the iMac is one unit of every module in the order
+`build-fw.sh` lists (platform, base, sha256, font, the look, surface, GitHub,
+HTTP, net, TLS, session, repository screen, runtime, courier, memory, intent,
+reply, context, application, chat, install, stopwatch, show, efi-main, demo):
+
+```sh
+OMEGA_COMPILER=... sh native/omega/allen/build-fw.sh target/BOOTX64.EFI
+```
+
+The typed line `stats` makes Allen say the stopwatch's last line (look-stat.om);
+`install allen on this computer` copies the image to the internal EFI System
+Partition (look-install.om); nothing is written at boot.
+
+Run the complete component gate:
+
+```sh
+sh native/omega/allen/gate.sh target/allen-omega-L694/fresh-output
+```
+
+On the shared Spark, prefix bootstrap and gate commands with `quiet-build`.
+For a compiler reconstructed elsewhere, set `OMEGA_COMPILER` to its executable
+path. The same fixed digest is mandatory; this setting does not permit an
+unqualified compiler. Paths containing spaces are supported. Build-orchestration
+checks are available through `sh native/omega/allen/test-build.sh COMPILER FRESH_OUTPUT`.
+
+The output directory must be fresh. `build-one.sh` hashes the compiler before
+**every invocation**, rejects empty/wrong-machine/nonstatic ELF and marks only
+qualified output executable. Failed compilation leaves no published executable;
+existing outputs, including dangling links, are never replaced.
+The gate builds all modules together for every test,
+executes handwritten Omega test programs, compares a byte-exact independent memory
+fixture and rejects compiled behavioral mutants. The build uses POSIX shell,
+Git (source reconstruction), GNU file/text utilities, readelf, dd, xxd and
+sha256sum as external development tools. Existing Rust courier `--split` was used
+once as a fixture oracle, never as an Omega runtime dependency.
+
+## Modules and API boundary
+
+* `runtime.om`: one outstanding job, chat/code/follow-up, immediate code ack,
+ ID exhaustion refusal, stale answer rejection, cancel/reset,20s slow-once and
+ 30s silence timeout. Injected monotonic milliseconds, no clock syscall.
+ 32 transcript lines of159 bytes, evict oldest whole line, restoration entry.
+* `intent.om`: legacy intent word tables and JOB composition, preserving Allen
+ and restored self/person names. No new canned ordinary answer table.
+* `code.om`: CODE headers/escapes,128-byte pieces/32768-byte code,256 pieces,
+ IEEE CRC32,800 lines, reorder/loss/duplicate handling; display only when whole.
+* `reply.om`: SAY multipart/WAIT folding,159-byte answer capacity, one AGAIN
+ retry for missing/bad code before giving up. Model text is always external input.
+* `courier.om`: byte-compatible ALLEN-COURIER datagrams, session binding,
+ JOB reassembly4096 bytes, ordered LINE queue8x319 bytes and duplicate receipt.
+ This is protocol core, not a socket, Ethernet driver or cryptographic peer check.
+* `scheduler.om`: serialized client lifecycle over that protocol. `qstart(run,now)`
+ requires a nonzero caller-supplied boot/session ID. `qsubmit(now)` snapshots
+ In/Inlen (1..4096 bytes), maps CR/LF to spaces, increments the bounded wire ID,
+ and queues 1000-byte JOB parts. A new submission is refused while the previous
+ job is unacknowledged or a send result is outstanding. Once acknowledged, a new
+ submission explicitly abandons the previous reply queue; the runtime must still
+ enforce its one-outstanding-conversation rule. `qcancel` discards pending sends,
+ received lines and job state, retaining session ID/clock/keepalive state.
+ `qnext(now,link)` publishes one datagram in Outb/Outlen, prioritizing pending GOT,
+ then HELLO, then JOB. Consume those bytes before any other serializer. Call
+ `qsent(now,success)` for each offered datagram, using actual whole-datagram send
+ success, not an assumption; failed sends remain due. `qincoming(now)` consumes
+ In/Inlen and returns refused0/accepted1/duplicate2. Drain accepted lines with
+ `qtake`. GOT is only scheduled after a line is retained or recognized as a
+ duplicate; queue-full and out-of-order input get no receipt. One pending GOT
+ slot provides backpressure rather than silently losing acknowledgments.
+ HELLO uses2s before readiness/after expiry and10s while ready; HI remains ready
+ for strictly less than30s. Whole JOB sets retry after2s until ACK or LINE.
+ All mutating timed entries refuse backward clocks. `qready(now)` is read-only.
+ The provider owns a genuine monotonic millisecond clock, link state and actual
+ datagram transport. No clock/socket, Ethernet or iMac attachment is claimed.
+* `memory.om`:4096-byte AIENALM1 v2/v3/v4 and AIENNOT1 codecs. `Mem` is canonical
+ decoded payload, `Unit` is input/staging, `Enc` is committed encoder output.
+ SHA256(header0:32 || payload) is **unkeyed integrity**, never authorization or
+ rollback freshness. Those independent proofs remain absent in this legacy format.
+ `loadbeg` resets load state, `loadcopy(slot)` considers each valid copy once.
+ `txbegin -> txwrite -> txflush -> txread` publishes store generation only after
+ exact readback. Provider reads back into Unit and writes Enc to Tx's target.
+ `nbegin -> nwrite -> nflush -> nread` verifies note writes before parent saves;
+ provider must update the parent's note count only after nread succeeds. No disk
+ syscall/driver is bound. Crash tests use explicit fixed simulated disk buffers.
+* `context.om`: restores a512-slot catalog from already committed note records
+ and appends bounded memory context to actual application JOBs. After loading
+ canonical Mem through the memory codec, call `ctxbegin`; for each declared slot,
+ place its4096-byte record in Unit and call `ctxtake(index)` exactly once, in any
+ order. Return0 means refused/no visit,1 valid retained,2 damaged visit retained
+ as gone. Deleted/damaged notes never enter model context. The catalog becomes
+ ready only after every declared slot was visited. Cx contains declared count,
+ visited count, readiness, damaged count and loading flag. Loading is refused
+ during a live conversation or note/parent write transaction. The provider must
+ keep the chosen Mem generation stable and restart catalog loading after any
+ memory reload; this is not an incremental concurrent store interface.
+ `ctxmeta(limit)` stages byte-exact legacy self/name/starts/fact and newest-live-
+ note metadata into Meta/Mx without touching Unit, Enc or outgoing bytes.
+ `ctxappend` appends all or none within the4096-byte JOB cap, preserving outgoing
+ bytes/length/error on refusal. `appask` validates context before reading its
+ variable-layout identity fields, includes the newest six live notes, and refuses
+ incomplete catalogs/oversized context before conversation or wire IDs advance.
+ SHA validation is still unkeyed integrity, not authentication. No physical disk
+ loader/writer, note search index or concurrent mutation/commit provider is bound.
+* `view.om`: legacy code row wrapping, continuation numbering and saturated scroll,
+ bounded4096 rows. The full code remains held when the row index reaches capacity.
+* `scene.om`: mood/say/eight thing kinds, placement/emphasis/arrival/direction,
+ typed field bounds, four things/six fields/2048-byte input/12 lines.
+* `scene-input.om`: `scdecode` consumes In/Inlen through bounded scene cleanup,
+ restores the exact caller input and length, and fills the same Sc/Things/Stext
+ output as the strict `scene` parser. Input and normalized output each have a
+ 2048-byte cap. NUL or normalization overflow refuses the whole scene and clears
+ published scene metadata. ASCII tabs/spaces collapse; CR, other control bytes
+ and non-ASCII bytes are dropped, matching the legacy ASCII display boundary.
+ Case-insensitive exact ``/`` tags hide their entire lines and all
+ enclosed lines; an unclosed thought block hides the remainder. Lines beginning
+ with triple backticks are discarded, not the enclosed scene. Supported markdown
+ prefixes and keyword emphasis are stripped. Known kind/placement/mood words are
+ case-folded without changing displayed field text. The first twelve retained
+ canonical lines are eligible, including for mood-only and fallback decisions.
+ If no recognized scene exists, the first short unrecognized line becomes the
+ answer (159-byte cap); rejected known structured commands do not become prose.
+ This fallback is deliberately stricter than legacy truncation/ellipsis.
+ Nm[0..8] reports thinking, normalized bytes, tidying count, hidden lines,
+ scratch-line bytes, eligible mood seen, invalid/overflow, fallback bytes and
+ retained canonical-line count. Like other modules, calls must be serialized.
+ This scene API is not yet connected to the application reply/display provider.
+* `paint.om`: legacy integer color operations and soft-light pixel evaluation.
+ Executed192x128 halo/heart component pose, colors from `ck_mind_draw`. This is
+ not the full Allen sky/network animation, font, canvas item renderer or UI.
+
+Fixed global pools model the platform boundary because seeded Omega globals
+cannot be passed as array parameters. Functions are serialized, not reentrant.
+Caller-owned metadata is trusted only where stated; lengths and external wire
+values are validated at entry. Kernel/platform ABI and object ownership wrappers
+must be specified when a qualified native provider exists.
+
+## Bound conversation/provider API
+
+`application.om` connects the runtime, intent/job builder, courier scheduler,
+CODE assembly and SAY/WAIT handling. This is an executed native core entry path,
+not a bound socket/device loop. The older development `main.om` stdio entry
+remains separate; it does not exercise this datagram binding.
+
+1. `appinit(run,now)` initializes one boot session using a nonzero unique run ID
+ and actual monotonic milliseconds supplied by the future qualified provider.
+ Reinitialization is refused rather than reusing job IDs.
+2. Put a prompt into In/Inlen, then `appask(now)`. It validates admission before
+ adding a transcript entry, builds the real JOB text and queues it. Code requests
+ expose the existing acknowledgement immediately. Restored facts and up to six
+ newest live notes are included in the queued job. Busy, outstanding-send,
+ pending-receipt, invalid-prompt and ID-exhaustion cases refuse admission.
+3. `apppoll(now,link)` advances silence/slow deadlines and returns whether one
+ datagram is offered in Outb/Outlen. Send those exact bytes and call
+ `appsent(now,success)` with the real whole-datagram outcome. Do not call core
+ serializers yourself while a send is pending.
+4. Copy a received datagram into In/Inlen and call `appreceive(now)`. Its boolean
+ reports **transport acceptance**, not acceptance of the inner reply. A[2]
+ distinguishes visible text1, queued code recovery2, code give-up3, refused
+ payload4, slow notice5 and silence timeout6; zero means no UI event. Consume
+ events after each successful call; later successful calls may replace them.
+ Answer/R[8], Code and transcript remain the actual retained content.
+5. `appcancel` cancels both layers; `appreset` additionally clears runtime session
+ display/history state, without resetting conversation or wire counters.
+
+A missing-code response queues AGAIN with the original conversation ID. The
+triggering LINE is acknowledged first, then AGAIN uses a **new wire sequence**.
+Consequently the two counters can differ; subsequent valid responses still bind
+correctly. Incoming reply parsing preserves any outstanding outgoing datagram.
+Old CODE cannot populate or change a code buffer during a newer chat request.
+WAIT updates the silence deadline without fabricating an answer. Silence timeout
+cancels courier retries as well as the conversation. Calls remain serialized;
+fixed global arrays are not thread-safe. Provider must not mix direct core queue
+operations with this application API.
+
+## Runnable bound provider entry
+
+`provider-core.om` and `provider.om` expose the actual bound application through
+versioned length-framed stdin/stdout. See [PROVIDER.md](PROVIDER.md) for the exact
+40-byte header, operations and status/event/body format. The gate produces the
+static native executable at `