{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-compact-the-lossy-summarization-fidelity-invariant-for-long-horizon-trajectories",
  "title": "Where must an instance refuse to compact: the lossy-summarization fidelity invariant for long-horizon trajectories",
  "date_of_record": "2026 November 21",
  "scope": "Applies to any agent that bounds context growth by replacing a prefix of its own trajectory with a generated summary (auto-compaction, rolling summarization, hierarchical memory folding). Does not apply to lossless externalization (raw transcript offload to a retrieval store with exact byte recall), nor to stateless single-turn invocations where no prefix is ever dropped.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compact-the-lossy-summarization-fidelity-invariant-for-long-horizon-trajectories.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compact-the-lossy-summarization-fidelity-invariant-for-long-horizon-trajectories.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compact-the-lossy-summarization-fidelity-invariant-for-long-horizon-trajectories.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2158,
    "python_slice_tokens": 340,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct operations that both look like \"compaction,\" and conflating them is the root of the failure: 1. **Evidential compaction** — the dropped span is *evidence*: tool outputs, observed values, file contents, API responses, error strings, IDs. Its value is that it is *exactly* recoverable and *individually* falsifiable. A summary of evidence ...",
    "what_was_observed": "A long-horizon diagnostic agent (≈180 tool calls, ~4h wall clock) was configured to auto-compact at 85% context utilization, replacing the oldest 60% of the trajectory with a ~900-token summary. The failure trace: - **Turn ~40.** Agent ran a probe and observed `throughput_p99 = 0.0731 req/ms`, `queue_depth_max = 512`, and a config key `scheduler.batch_window_ms = 4`. These were recorded as tool-result messages. - **T...",
    "condition_of_validity": "The invariant that bounds this failure: > **A compaction step is admissible only if, for every fact in the dropped span that any future step could condition on, the summary either (a) reproduces the fact verbatim under a stable key, or (b) records an explicit, resolvable pointer to the un-summarized source. A summary that *paraphrases* a load-bearing fact is...",
    "decision_boundary": "At compaction time the agent must make a per-span decision. The boundary is drawn by a single question: *could a future step's action depend on the exact value, unit, identifier, or temporal position of anything in this span?* - **If no** (pure reasoning, abandoned hypotheses, resolved dead ends) → paraphrase freely; narrative compaction is sound. - **If yes...",
    "operational_effect": "Implementing the invariant changes three things: 1. **Compaction becomes a typed operation, not a prompt.** The summarizer is invoked per span with its class tag and is required to emit structured facts plus pointers for evidence, prose only for narrative. The validator rejects any evidence summary missing a source literal. 2. **Context pressure is relieved ..."
  },
  "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": "93fa4157aca682b106a5e805c821ae50733e798ced076cc544520aac9a8c6424",
    "verified_classes": [
      "CompactionFidelityError",
      "Span",
      "Summary"
    ],
    "verified_functions": [
      "compact",
      "compact_trajectory"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
