Skip to content

docs(constitution): Compaction Parity — boot-injected context must survive compaction (+ parity test)#848

Merged
JKHeadley merged 1 commit into
mainfrom
echo/compaction-parity-standard
Jun 5, 2026
Merged

docs(constitution): Compaction Parity — boot-injected context must survive compaction (+ parity test)#848
JKHeadley merged 1 commit into
mainfrom
echo/compaction-parity-standard

Conversation

@JKHeadley

Copy link
Copy Markdown
Owner

ELI16

Some context gets injected into a session right at the start — the org's rules, learned preferences, and (with #811) the "what I already have" inventory. But long sessions get compacted: the conversation is squeezed into a summary, and anything that only existed at the start survives only if the summary happens to keep it. So a days-long session can silently forget things it was explicitly told at message one. You caught this live on #811's review ("sessions last days — won't it be forgotten?") — and it turned out the entire class of boot injectors (org-intent, preferences) had the same silent gap, after three review rounds missed it.

This amendment makes the rule constitutional: whatever a session must know at message one, it must still know after compaction. Every session-start injector ships with its compaction-recovery twin — re-injected, never presumed to survive. Re-injection is actually better than survival: re-fetching gives fresher state (a secret stored on day two shows up in the day-two context).

And per Structure-over-Willpower, it ships with teeth, not prose: a parity test that mechanically checks every */session-context fetch in the session-start hook also appears in the compaction-recovery hook. The two legacy violators (org-intent, preferences) sit on a shrink-only allowlist — new injectors cannot land boot-only, and the allowlist may only get shorter (each removal = a fixed legacy injector; tracked as framework-issue session-context-injectors-lack-compaction-parity).

What you're ratifying

The "Compaction Parity" article in docs/STANDARDS-REGISTRY.md (placed beside Migration Parity — same family of "the change must reach everywhere it matters" reasoning) + its enforcement test. Your merge is the ratification act.

Note: the test passes on this branch today (the two legacy injectors are allowlisted) and keeps passing after #811 merges (its injector has the compact twin built in).

🤖 Generated with Claude Code

…rvive compaction (+ structural parity test)

New standard, earned from PR #811's design review: the boot self-knowledge
block survived three convergence rounds boot-only until the operator asked
"sessions last days; won't this be forgotten after compaction?" — the whole
session-context injector class (org-intent, preferences) carried the same
silent gap.

Rule: whatever a session must know at message one, it must still know after
compaction — every session-start injector ships its compaction-recovery twin.
Enforcement: tests/unit/session-context-compaction-parity.test.ts asserts
every */session-context fetch in the session-start hook appears in the
compaction-recovery hook, with a shrink-only allowlist for the two legacy
violators (tracked: framework-issue
session-context-injectors-lack-compaction-parity).

Ratification: proposed to Justin (topic 19437, 2026-06-05) — his suggestion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
instar Ready Ready Preview, Comment Jun 5, 2026 4:37pm

Request Review

@JKHeadley JKHeadley merged commit 18d06be into main Jun 5, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant