plan section 9 says the opcode-model horizon must not start "until the
corpus collection exists, or there is nothing to train on". it exists now.
src/cartridges/corpus.rs: every candidate policy that goes through a swap —
from the ui or from the agent's swap_cartridge tool — becomes a Sample:
rustlite source, opcode trace, Origin (Human | Agent{intent}), and the
runtime's Verdict. persisted to vanish-cartridges/corpus.json, bounded at
200, keyed by an FNV-1a fingerprint of the source so re-trying a program
updates its verdict in place rather than growing the log.
captured inside Cognition::swap_policy, which now returns (Sample,
Result<…>). that signature is the design: every attempt yields a sample,
and whether it also yields a swap is the verdict.
three decisions worth defending:
- refusals are kept. a corpus of only successes teaches nothing about the
boundary, and the boundary is where a generated program actually fails. a
program that emitted and then trapped keeps its trace; one that never
compiled has an empty one and says so rather than inventing a label.
- the trace drops operands. emission is deterministic, so the source
rebuilds the module exactly — storing operands would double the corpus to
hold what it already holds.
- the histogram counts verified programs only. a rejected sequence is not
evidence about what good code looks like, though it is excellent evidence
about what fails.
the intent argument on swap_cartridge is now required: one line on what the
model meant the program to do, stored even when the attempt is refused. it
is the only prompt-shaped thing the swap path ever sees.
9 new evals. the feed and the tool result both carry corpus stats and the
most-emitted opcodes.
what this still does not buy, and section 9 now says so: whether a policy
HELPED. the corpus records what was tried and whether it ran; "did the
shaped prompt produce a better answer" needs an outcome signal the loop
does not collect.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Plan §9 says the opcode-model horizon must not start "until the corpus collection exists, or there is nothing to train on". It exists now.
what it records
src/cartridges/corpus.rs. Every candidate policy that goes through a swap — from the UI or from the agent'sswap_cartridgetool — becomes aSample: rustlite source, opcode trace,Origin(Human|Agent { intent }), and the runtime'sVerdict. Persisted tovanish-cartridges/corpus.json, bounded at 200, keyed by an FNV-1a fingerprint of the source so re-trying a program updates its verdict in place rather than growing the log.Captured inside
Cognition::swap_policy, which now returns(Sample, Result<…>). That signature is the design: every attempt yields a sample; whether it also yields a swap is the verdict.three decisions worth defending
emit_module(parse(source))rebuilds the module exactly: the source is the record, and the trace is the same program in the shape a model would emit it. Storing operands would double the corpus to hold what it already holds.The
intentargument onswap_cartridgeis now required — one line on what the model meant the program to do. It is the only prompt-shaped thing the swap path ever sees, and it is stored even when the attempt is refused.what this still does not buy
Whether a policy helped. The corpus records what was tried and whether it ran. "Did the shaped prompt produce a better answer" needs an outcome signal the loop does not collect, and no amount of corpus makes that question answerable. §9 now says this in those words rather than letting the item imply otherwise.
evidence
9 new evals (31 in
tests/cognitive_wiring.rs), including: the trace naming its exported functions and ending every body onend; v3 emitting a demonstrably richer trace than v1 (br_if,i32.load8_u) so the measurement distinguishes programs; refusals kept with and without traces; fingerprint dedup updating a verdict in place; the bound dropping the oldest; a round-trip plus every decode refusal named; and an oversized source truncated on a character boundary — a naiveString::truncatemid-character panics, and the corpus must not be the thing that takes the worker down.bash ci/run_tests.sh→ unit tests + 20 suites + clippy;cargo check --lib --bins --target wasm32-unknown-unknownclean.smoke-previewwill be red for the usual Vercel Deployment Protection reason.🤖 Generated with Claude Code