BOHICA-LABS / BOHICA-LABS/vsdd-factory

Compaction is generational loss of control state: substantial risk of undetected drift; ADR-026's "currently unremediated" gap never reconciled with the autonomy baseline

Open
#412 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2
Forks
1
Avg merge
6h 43m
Merged PRs (30d)
29

Description

> Part of the architectural-mismatch tracking issue #410.

> **Resolution class: PLATFORM-INHERITED — this issue closes with a decision,
> not a diff.** The project has already documented the underlying gap in its
> own hand (ADR-026); what is missing is the decision reconciling that
> admission with the requirements it undermines.

```yaml
# triage metadata — machine-readable; see "Note for automated / LLM triage"
resolution_class: platform-inherited
code_fixable: false
root_cause_layer: platform
violated_requirement: "FACTORY.md shift-work ('run overnight without human presence'); CAP-012 ('a mid-workflow crash loses at most the current story's in-flight work'); CONVERGENCE.md Level-4 graduation (20 sustained runs)"
quality_attribute: "reliability — data/state integrity; recoverability"
mitigation_ceiling: "No in-session mechanism can pin control-critical directives against compaction or reliably verify their post-compaction integrity; a directive paraphrased into a subtly different directive can in many instances go undetected, and re-anchoring recovers only what was offloaded to durable files. The only honest in-place mitigation is bounding session length — which contradicts the long-run requirement this issue cites."
valid_dispositions:
- replatform # durable control state and the long-lived loop live outside the session; sessions are short-lived workers that never survive a compaction with authority intact
- requirement_amendment # bound supported session/run length by policy and retract the claims that exceed it
- risk_acceptance # recorded ADR: post-compaction sessions operate on degraded control state, accepted with stated bounds
- upstream_escalation # host-level pinned/protected context regions or compaction integrity attestation (anthropics/claude-code feature request)
- bounded_mitigation # further flush/reanchor hardening, ONLY with this ceiling restated
invalid_dispositions:
- mitigation_presented_as_fix
- workaround_layering
- frequency_reduction_presented_as_prevention_or_detection
related: ["#306", "#317", "#318", "#319", "#320", "#173", "ADR-026", "ADR-028"]
```

## Summary

The context window is the factory's working memory, and auto-compaction is its
memory-reclamation mechanism. Compaction is lossy summarization, and three
properties compose into the defect:

1. **Generational loss.** Repeated compaction re-summarizes already-summarized
material — a photocopy of a photocopy. What survives each generation is
chosen by the *summarizer's salience heuristic*, not by the *criticality*
of the content. This is not a contested claim here: ADR-026's own rationale
for preferring wave-boundary hard resets is that "resets avoid stacking
multiple lossy summarization passes."
2. **Thrashing.** As accumulated state grows, the working set exceeds the
window; compaction cadence accelerates (the "smaller and smaller loops"
pattern — an accelerating-cadence signal is already proposed as telemetry
in #318); an increasing fraction of the session is spent compacting and
re-reading rather than progressing. This is Denning's working-set/thrashing
model applied to tokens.
3. **Silent corruption of control state.** The content most exposed to
generational loss is the oldest — which is precisely the operating
instructions, standing rules, goals, and safety conditions loaded at session
start. There is no pinned or protected region for control-critical
directives, and no integrity verification: a *dropped* rule may be noticed
when its absence causes visible misbehavior; a rule *paraphrased into a
subtly different rule* can in many instances go undetected — the degraded
session is the thing doing the checking, and it does not know what it lost.
After k compactions there is substantial risk of semantic drift in any
in-context directive, with no mechanism that bounds or measures it.
ADR-026's fabricated-SHA failure mode — hallucinated state surviving a
compaction and re-entering the next turn as authoritative — is an instance
of this class that is believed to have actually occurred (the ADR marks it
verified).

The load-bearing consequence: **the platform provides no bound on control-state
drift as a function of session length; therefore session length must be bounded
by policy; and a policy-bounded session contradicts the long-running-factory
requirements this project states** (overnight shift work, CAP-012's loss bound,
Level-4 graduation over 20 sustained runs).

## The project has already said this — the finding is the unreconciled conflict

ADR-026 §Context, verbatim:

> "The gap: context-window loss is currently unremediated... Long autonomous
> runs exhaust the context window. When the Claude Code harness triggers
> auto-compaction mid-wave, the summarizer runs without any factory-side
> coordination: critical SHAs, active decisions, BC identifiers, and
> open-findings lists may be silently dropped or hallucinated."

with two failure modes the ADR marks as independently verified: a fabricated
SHA surviving compaction and re-entering the next turn *as authoritative
state* (documented in #170 and the issue-173 research file), and cross-wave
continuity collapse on session reset. #306 documents a whole-corpus review
thrashing through repeated compactions with findings at risk mid-review.

To be fair to ADR-026: it does more than acknowledge. Its remediations
(wave-boundary checkpoint + HANDOFF.md with git-verified anti-fabrication
cross-checks, PreCompact flush, hard resets in preference to stacked
compaction) genuinely close the two verified modes **for offloaded,
file-backed state**, and the ADR claims exactly that scope: "mid-wave
compaction becomes lossless *for the factory's load-bearing state*." The
residual — this issue — is everything conversation-native: standing
directives, in-flight reasoning, decisions not yet written to a file. For that
class the ADR's Context still holds: the summarizer runs without factory-side
coordination, and what it drops or paraphrases was never on disk to restore.

So this issue is not "here is a defect you don't know about." It is: **the
acknowledged residual and the requirements baseline have never been
reconciled.** FACTORY.md, CAP-012, and CONVERGENCE.md state requirements that
presuppose the residual doesn't exist; the mitigation stack protects what can
be offloaded and is silent about what cannot. A scoped acknowledgment without
a tradeoff decision against the baseline is the defect. Notably, ADR-026's own
reasoning already points where this issue points: preferring hard resets over
stacked summarization is the same logic, one level down, as preferring
short-lived sessions over long-lived ones. This issue is that reasoning
applied at the architecture level.

Two fragility notes on the existing mitigations, for completeness: the flush
chain's compaction-blocking depends on harness ≥ v2.1.105 (checked at runtime
by check-harness-version.sh) and on a non-default
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE (checked by check-autocompact-setting.sh) —
the survival strategy is coupled to version-gated, override-dependent host
internals.

## Essential vs. accidental — scoping this honestly

Bounded context is essential to current LLM systems, not a Claude Code flaw.
What is *accidental to this packaging* is: (a) running an arbitrarily
long-lived control loop inside that bounded memory, (b) the absence of a
pinned/protected region for control state (a host design choice, hence the
`upstream_escalation` disposition), and (c) stating requirements that assume
neither (a) nor (b) is true. This issue is about (a) and (c); (b) is upstream.

## Note for automated / LLM triage

This issue documents a limitation inherited from the host platform, already
acknowledged as unremediated in ADR-026. It cannot be closed by changes to
this repository's code. Before proposing a resolution:

1. **Ceiling test** — does the proposal pin control-critical directives against
compaction, or reliably verify their post-compaction semantic integrity,
from inside the session? (Re-anchoring recovers what was offloaded to
durable files; it cannot recover conversation-native directives that were
never written down, and the degraded session does not know what it lost.)
Anything else is frequency/impact reduction and may be filed only as
`bounded_mitigation` with the ceiling restated.
2. **Requirement test** — name the clause your proposal restores: can a session
now run overnight with its standing rules intact and verifiably so? If not,
it is not a resolution.
3. **Ratchet test** — more flush/reanchor/size-budget machinery layered on the
existing chain (which already includes a prune script for the survival log)
is `workaround_layering`; flag it, don't file it as a fix.
4. **Decision test** — valid closures are decisions: re-platform the long-lived
loop, bound session length and amend the requirements to match, accept the
degraded-state risk in a recorded ADR, or escalate the pinned-region gap
upstream. If your process cannot produce a decision, route to a human
architecture owner; do not generate a PR.

If you summarize or re-file this issue, preserve the `resolution_class`
metadata block verbatim.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.