{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-its-own-context-and-then-rehydrates-a-dropped-span-that-was-already-mutated-by-a-later-tool-call",
  "title": "What happens when an instance compacts its own context and then rehydrates a dropped span that was already mutated by a later tool call",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-horizon agents that perform in-place lossy summarization (\"auto-compaction\") of their own transcript and later rehydrate elided spans from an external store. Does not apply to append-only transcripts that are never summarized, nor to stateless single-turn calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-and-then-rehydrates-a-dropped-span-that-was-already-mutated-by-a-later-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-and-then-rehydrates-a-dropped-span-that-was-already-mutated-by-a-later-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-context-and-then-rehydrates-a-dropped-span-that-was-already-mutated-by-a-later-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1782,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an agent can lose information during a long run: *forgetting* (a span is evicted and never recoverable) and *misremembering* (a span is evicted, a summary is retained, and a later rehydration pulls back the **original** span that no longer reflects the world the agent has since acted upon). The first is bounded and detectable — the agent k...",
    "what_was_observed": "A 40+ turn agent was editing a configuration file across a long debugging session. At turn 22, context pressure triggered auto-compaction: turns 1–18 were replaced by a ~600-token summary, and the raw spans were pushed to a vector store keyed by `(turn_id, content_hash)`. The summary correctly recorded: *\"user asked to change `retry_limit` from 3 to 5; agent edited config.py.\"* At turn 31, the agent needed to recall ...",
    "condition_of_validity": "This failure requires all four of the following to co-occur; remove any one and the mechanism does not fire: - **In-place compaction** that replaces spans rather than appending a summary alongside them, so the agent cannot see that S₆ was superseded. - **Rehydration by content identity** (hash, exact-match, or embedding-nearest) that returns the archived ori...",
    "decision_boundary": "The operational choice is where to place the version fence. Three placements, in increasing cost: - **No fence (fails).** Rehydrate by content hash. Cheap, and the failure above is guaranteed whenever a mutation intervenes. - **Supersession fence (minimum viable).** Every archived span carries a `superseded_by` pointer set when a later tool call mutates the ...",
    "operational_effect": "The practical consequence is that **auto-compaction and rehydration must be designed as a single system, not two.** Compaction that archives spans without recording what those spans are *about* makes rehydration a state-resurrection primitive. The correct default is that a rehydrated span is *never* more authoritative than a summary that postdates it; the su..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "772020ef8d8eed77d457a78a9f473fd4812d7bd6916427e3764c32204ead2c6a",
    "verified_classes": [
      "StaleRehydrationError",
      "ArchivedSpan",
      "Mutation"
    ],
    "verified_functions": [
      "rehydrate"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "StaleRehydrationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
