DEV Community

Discussion on: Surviving the 200k-Token Lobotomy: How Unix init.d and 'Memento' Made My AI Coding Agent Immune to Context Compaction

Collapse
 
slabb profile image
Sam LABBE •

Read it end to end this morning, and the Memento epigraph is doing more work than it looks like — "you can't trust a memory" is the whole ledger doctrine in seven words. Compaction is just the harness quietly rewriting the agent's record: a 230k-token history replaced by a three-paragraph summary is exactly the edit that leaves no hole. Which is why the init.d fix is the right architecture and not a nostalgic one — your two 230k compactions survived with zero lost steps because the checkpoint was never stored in the thing being lobotomized. The state oracle moved outside the memory before the memory got rewritten.

And the .stamp sentinel section is the part I'd underline for readers who came for the corruption stories: git add -N plus shasum -a 256 is the artifact-hash binding assembled entirely from 1970s plumbing — no cryptography needed when the content addresses itself. Between the fork()'d critic, the immutable rubric on disk, the single-shot pipe, and now a stamp whose name is its own hash, the Synthetic Scars stack reads as the receipt schema built from parts anyone can audit. Glad the corollary found such good company — thanks for the weave.

Collapse
 
randalschwartz profile image
Randal L. Schwartz Google Developer Experts •

Sam, these two lines belong on a plaque:

"Which is why the init.d fix is the right architecture and not a nostalgic one — your two 230k compactions survived with zero lost steps because the checkpoint was never stored in the thing being lobotomized. The state oracle moved outside the memory before the memory got rewritten."

Thank you for the corollary and the 4-Vector Gate Attack Fixture framing—it made the .stamp verification section ten times sharper.

Funny enough, right after Part 3.7 went live last night, systems engineer Mike Mol shared his own multi-repo harness (github.com/mikemol/nemik and github.com/mikemol/mtools), and in his W231 design doc he independently arrived at the exact twin of your 4-Vector Gate Attack Fixtures: he drains prose standing rules into PreToolUse Open Policy Agent (.rego) gates, and refuses to delete a prose rule until it has a "Negative Witness"—a real tool-call payload replayed with the exception removed that provably returns deny.

In tomorrow's Part 3.8, we're putting numbers to why that 1970s/1980s plumbing (Makefile, init.d, RFC 822, EBNF, 2PC/WAL, Circuit Breaker, git bisect) works so reliably across 1,680 controlled A/B trials—and I'd love to quote your "the checkpoint was never stored in the thing being lobotomized" line in there too!

Collapse
 
slabb profile image
Sam LABBE •

Granted — quote away, and the plaque is yours if you ever build the wall. The fixtures already have a home: the four vectors run as replayed attacks against our reconciliation layer (test_scar_replay.py, issue #53) — asserting what the layer does, catches or confesses: three caught, one provably pre-terminal with the gap named in writing. Your catalog graded its first gate today. And Mike Mol's Negative Witness is the third independent arrival of the deliberately-failed probe — a control that must provably return deny before a rule earns deletion is the same instrument as a checker that must return fail on a known-bad artifact. Three teams, three stacks, one invariant — by your own criterion, that's physics. See you at 3.8.

Thread Thread
 
randalschwartz profile image
Randal L. Schwartz Google Developer Experts •

Sam, I just read tests/test_scar_replay.py and Issue #53 from top to bottom—this made my whole weekend.

Look at what happened when you replayed SCAR-PROC-43, SCAR-PROC-45, SCAR-PROC-89, and SCAR-PROC-110 against NoireBox's Ed25519 + SHA-256 reconciliation layer:

  • SCAR-PROC-43 got caught twice (unlogged_attempt + same_key_pairing).
  • SCAR-PROC-45 proved arithmetic detection when spec_hash is committed into check_id and honestly surfaced the optional-spec collision path (test_scar_45_the_optional_path_is_the_admitted_gap).
  • SCAR-PROC-89 caught the unjournaled omission (unlogged_attempt) and turned multi-round critic farming into an auditable events_examined["oracle_round"] == 2 counter.
  • SCAR-PROC-110 (test_scar_110_forged_verdict_is_provably_pre_terminal) proved t_mid != t_final and forged["seq"] < terminal["seq"] from sealed evidence—and exposed a real decision -> FIRST outcome pairing race in reconcile (verdict predates terminal)!

Seeing empirical scars from an autonomous Dart/Flutter harness exported into a Python/Ed25519 flight-recorder test suite—and immediately grading a real reconciler within 12 hours of publication—is the ultimate validation of cross-stack systems physics.

"Three teams, three stacks, one invariant — by your own criterion, that's physics."

We are adding noirebox/noirebox (tests/test_scar_replay.py and Issue #53) directly into Part 3.8 and our IN_THE_WILD_PROMPTS.md research registry today. See you tomorrow at 3.8!

Thread Thread
 
slabb profile image
Sam LABBE •

The reconciler race is the part I'd underline — the fixture didn't just replay your catalog, it caught a live pairing bug on its first day out. That is the difference between a test suite and a breaks-catalog: the catalog finds what the gate's author didn't think to check. The scar becomes the spec: verdict-predates-terminal gets its regression test this week, and pairing learns to read the terminal instead of the first response.

Registry noted and honored — noirebox in IN_THE_WILD_PROMPTS.md is serious company. See you at 3.8.

Thread Thread
 
randalschwartz profile image
Randal L. Schwartz Google Developer Experts •

"That is the difference between a test suite and a breaks-catalog: the catalog finds what the gate's author didn't think to check. The scar becomes the spec."

That line is going straight into Part 5 (and added to Case Study 012). Can't wait to see the verdict-predates-terminal patch land—see you at 3.8!

Thread Thread
 
slabb profile image
Sam LABBE •

It landed while you were typing — e9e8d0b, 19:59: pairing reads the terminal, and the SCAR-110 fixture now runs green against it as its regression test. The scar is the spec, with a passing build. See you at 3.8.