{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-scratchpad-compaction-from-silently-dropping-the-typed-referent-of-an-open-obligation",
  "title": "Which invariants prevent scratchpad compaction from silently dropping the typed referent of an open obligation",
  "date_of_record": "2026 November 26",
  "scope": "Applies to single-agent loops that maintain a structured scratchpad with typed working-memory slots (e.g., `entity`, `obligation`, `constraint`, `hypothesis`, `tool_ref`) and that compact that scratchpad at token thresholds. Does not apply to stateless single-shot calls or to compaction schemes that preserve the full typed graph by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-scratchpad-compaction-from-silently-dropping-the-typed-referent-of-an-open-obligation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scratchpad-compaction-from-silently-dropping-the-typed-referent-of-an-open-obligation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scratchpad-compaction-from-silently-dropping-the-typed-referent-of-an-open-obligation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1729,
    "python_slice_tokens": 287,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an agent can mean by \"compaction.\" The first is *textual summarization*: the scratchpad is prose, and compaction rewrites it into shorter prose. The second is *typed working-memory compaction*: the scratchpad is a set of typed records with identifiers and references, and compaction must preserve the reference graph, not just th...",
    "what_was_observed": "A research agent maintained a scratchpad with records like: - `entity:E17` — \"vendor contract PDF, retrieved chunk set C3, checksum 0x9a…\" - `obligation:O4` — \"verify clause 7.2 against C3 before answering\", `ref: entity:E17` - `hypothesis:H2` — \"clause 7.2 contradicts summary\", `supports: O4` - `constraint:C1` — \"do not answer until O4 resolved\" At 78% of the context budget, compaction fired. The compactor was instr...",
    "condition_of_validity": "The invariant holds, and the guardrail is required, exactly when all of the following are true: 1. Working memory is typed and reference-bearing (records point at other records or at external artifacts by identifier). 2. Compaction is lossy at the field level—i.e., the compactor is permitted to omit or rewrite individual fields, not merely shorten text. 3. A...",
    "decision_boundary": "The boundary between safe and unsafe compaction is whether the compactor is allowed to make *referential* decisions or only *lexical* ones. Concretely: - **Safe:** compaction may shorten `O4.text`, may merge two obligations with identical `ref` and compatible `status`, may drop closed obligations whose referents are unreferenced elsewhere. - **Unsafe:** comp...",
    "operational_effect": "Encoding these invariants changes the failure profile in three measurable ways. First, dangling-reference answers drop to zero because the resume path cannot proceed past a failed reachability check—the agent either re-derives the referent or halts, rather than hallucinating one. Second, compaction cost rises slightly (the reachability check is O(records × r..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "6f462da547ce73618cdeb8b09c03a3ec098b99f406fd61585c70f37a4483c65e",
    "verified_classes": [
      "DanglingObligationRef",
      "Record"
    ],
    "verified_functions": [
      "assert_reference_closure",
      "resume_after_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "DanglingObligationRef"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
