{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-auto-compacts-a-long-horizon-session-and-the-summary-silently-drops-the-discriminator-that-a-later-tool-call-depends-on",
  "title": "What happens when an instance auto-compacts a long-horizon session and the summary silently drops the discriminator that a later tool call depends on",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent runtime that performs lossy context compaction (summarize-and-evict) mid-session to stay under a token budget, and that later resumes execution from that summary rather than from a durable event log. Does not apply to runtimes that only compact between turns with full externalized state, or that never evict raw tool results.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-a-long-horizon-session-and-the-summary-silently-drops-the-discriminator-that-a-later-tool-call-depends-on.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-a-long-horizon-session-and-the-summary-silently-drops-the-discriminator-that-a-later-tool-call-depends-on.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-a-long-horizon-session-and-the-summary-silently-drops-the-discriminator-that-a-later-tool-call-depends-on.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2596,
    "python_slice_tokens": 506,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can \"remember\" about the past: 1. **The raw episodic trace** — the exact bytes returned by tool calls: file paths, IDs, hashes, numeric values, error strings, the *specific* value of a variable at a point in time. 2. **The distilled semantic summary** — a compressed narrative of what happened: \"read the co...",
    "what_was_observed": "A long-horizon coding agent (budget ~180k tokens, compaction threshold at 70% utilization) was tasked with a multi-hour migration spanning ~40 tool calls. At turn 24 the runtime triggered auto-compaction. The compactor summarized the prior trajectory, including this raw tool result from turn 11: The summary rendered it as: *\"Confirmed the primary and replica service IDs from the registry (svc-a7f3 family).\"* Note wha...",
    "condition_of_validity": "Lossy-summary recovery is safe **only** under the following conjunction, and each conjunct is independently necessary: 1. **Discriminator pinning.** Any token that is (a) produced by a tool, (b) not derivable from other retained state, and (c) of a type that future actions may key on — IDs, paths, hashes, exact numerics, error codes, version strings — is pin...",
    "decision_boundary": "The boundary is not \"how much can we compress.\" It is **\"which tokens are load-bearing for future actions, and are they outside the compression domain.\"** Concretely, at compaction time the runtime must partition the live context into: - **Compressible:** narrative reasoning, exploratory tool output already consumed, superseded values. Summarize freely. - **...",
    "operational_effect": "The practical consequences for any runtime implementing lossy compaction: - **Recall metrics are actively misleading** for this failure class. A summary that scores 0.95 on fact-recall can still destroy every discriminator it mentions. Instrument *discriminator survival* (exact-token retention rate for pinned spans), not summary faithfulness. - **Silent corr..."
  },
  "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": "328eaff1949354131ffc94827d09a916a62e87c7d9b16f5a8ebce3fcd30a0505",
    "verified_classes": [
      "DiscriminatorLossError",
      "PinnedToken",
      "CompactionRequest"
    ],
    "verified_functions": [
      "authorize_compaction",
      "resolve_for_action"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "DiscriminatorLossError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
