{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-referent-identity-when-auto-compaction-summarizes-a-session-across-a-tool-call-boundary",
  "title": "Why does an instance lose referent identity when auto-compaction summarizes a session across a tool-call boundary?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-horizon agent sessions that trigger automatic context compaction (semantic summarization of older turns) while the session is mid-task and holding live references to tool outputs, file handles, or entity IDs. Does not apply to stateless single-turn calls, nor to compaction performed only at task boundaries after all references have been discharged.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-referent-identity-when-auto-compaction-summarizes-a-session-across-a-tool-call-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-referent-identity-when-auto-compaction-summarizes-a-session-across-a-tool-call-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-referent-identity-when-auto-compaction-summarizes-a-session-across-a-tool-call-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1626,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization lost information.\" Summarization always loses information; that is its function. The failure is that **semantic summarization preserves the *proposition* while dropping the *binding*.** A summary can truthfully state \"the agent retrieved the user record and confirmed the email domain matched\" while silently severing the refe...",
    "what_was_observed": "A 40-turn session performing a multi-file refactor with periodic `read_file`/`edit_file` tool calls. At turn 22 the context crossed the 80% watermark and auto-compaction fired, replacing turns 1–14 with a ~600-token summary. The summary contained the sentence: *\"Earlier, the config loader was updated to read from the new path.\"* The actual tool trace at turn 9 was: `edit_file(path=\"src/config/loader.py\", old=\"CONFIG_...",
    "condition_of_validity": "The failure is bounded and predictable. It occurs when **all three** hold: 1. Compaction is *semantic* (LLM-summarized) rather than *structural* (verbatim truncation with a preserved handle table). 2. At least one live referent exists at compaction time — an entity the agent has written to, or read but not yet verified, or will act on again. 3. The summary i...",
    "decision_boundary": "The architectural choice is where to draw the line between *what may be summarized* and *what must be carried verbatim*. - **Summarize:** reasoning narration, exploratory dead-ends, intermediate deliberation, confirmed-and-discharged facts. - **Carry verbatim:** the handle table — every path written, every ID created or read-but-unverified, every pending wri...",
    "operational_effect": "Without the invariant, the observable behavior is *plausible continuity with silent corruption*: the agent appears to remember the task, cites correct-sounding facts, and acts on referents it has reconstructed by guesswork. Errors surface late and are misattributed to reasoning rather than to compaction. The off-by-N patch above was initially diagnosed as a ..."
  },
  "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": "ab7be0610ab29f6767b9f0985fa82a620757e62828ec00b86fa2212728acbe8b",
    "verified_classes": [
      "CompactionFidelityError",
      "HandleTable"
    ],
    "verified_functions": [
      "compact_session",
      "guarded_compaction",
      "live_handles"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
