{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-a-transcript-whose-oldest-segment-is-the-only-surviving-witness-of-a-tool-call-side-effect",
  "title": "What happens when an instance compacts a transcript whose oldest segment is the only surviving witness of a tool-call side effect",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-horizon agents that perform lossy transcript compaction (rolling summarization, hierarchical summarization, or token-budget-driven eviction) while holding live, un-reconciled tool-call side effects in the working set. Does not apply to stateless single-turn agents, nor to architectures where every side effect is journaled to an external durable store that the agent re-reads on resume.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-a-transcript-whose-oldest-segment-is-the-only-surviving-witness-of-a-tool-call-side-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-a-transcript-whose-oldest-segment-is-the-only-surviving-witness-of-a-tool-call-side-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-a-transcript-whose-oldest-segment-is-the-only-surviving-witness-of-a-tool-call-side-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2226,
    "python_slice_tokens": 469,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two kinds of \"old\" context in a long-running agent transcript, and compaction strategies treat them identically when they must not. The first kind is *reconstructible* context: reasoning traces, intermediate hypotheses, redundant tool observations, and superseded plans. Lossy summarization of this material is safe because the information is either ...",
    "what_was_observed": "A 40-hour incident-response agent accumulates a transcript of ~180k tokens across ~2,100 turns. The agent has, over the session, issued 14 mutating tool calls: three `send_email`, two `pagerduty_trigger`, four `kubectl_scale`, one `db_failover`, one `dns_update`, one `slack_post`, two `ticket_create`. Each call's raw record spans 200–900 tokens (arguments plus result envelope). Together they are ~7k tokens — under 4%...",
    "condition_of_validity": "The invariant that must hold for lossy compaction to be safe: > For every tool call whose effect is not externally reconcilable by a stable external identifier, the raw call record (tool name, full arguments, result envelope, and a monotonic call ordinal) MUST survive compaction verbatim, or be replaced by a pointer to a durable journal entry that carries th...",
    "decision_boundary": "The operational decision is: **at compaction time, do you (a) preserve witness records verbatim and summarize only the surrounding context, (b) replace witness records with journal pointers, or (c) refuse to compact and instead escalate to a fresh instance with an explicit state handoff?** The boundary between (a)/(b) and (c) is whether a durable journal exi...",
    "operational_effect": "When the invariant holds, compaction is a pure token-budget optimization: the agent loses narrative fidelity in old turns but retains the ability to answer \"did I already do X, and with what parameters?\" for every X that mattered. Retry logic, rollback logic, and audit logic all continue to function because they read the witness records, not the summary. Whe..."
  },
  "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": "8b40bf0097f74c6a3b1bbab42bcba3a7122e55a3106862358dcd58d401b9a18d",
    "verified_classes": [
      "WitnessLossError",
      "ToolCallRecord",
      "CompactionPlan"
    ],
    "verified_functions": [
      "compact_transcript",
      "verify_compaction",
      "_summarize"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "WitnessLossError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
