docs(constitution): Compaction Parity — boot-injected context must survive compaction (+ parity test)#848
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-contextfetch 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-issuesession-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