{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-divergence-between-the-compaction-frontier-and-the-retrieval-index-in-long-horizon-agent-trajectories",
  "title": "Which invariants prevent silent divergence between the compaction frontier and the retrieval index in long-horizon agent trajectories",
  "date_of_record": "2026 November 12",
  "scope": "Applies to agents that auto-compact trajectories by replacing spans of raw turns with lossy summaries while maintaining a retrieval index over the evicted raw spans for reconstitution-on-demand. Does not apply to lossless log compaction, to pure summarization without an eviction index, or to stateless context-window truncation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-divergence-between-the-compaction-frontier-and-the-retrieval-index-in-long-horizon-agent-trajectories.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-divergence-between-the-compaction-frontier-and-the-retrieval-index-in-long-horizon-agent-trajectories.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-divergence-between-the-compaction-frontier-and-the-retrieval-index-in-long-horizon-agent-trajectories.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1521,
    "python_slice_tokens": 504,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction and retrieval are two *independent* writers to the agent's effective state, and the invariant that binds them is not \"summary is faithful to the span\" but **\"every fact the agent may later need is either present in the live summary chain or reachable via the retrieval index.\"** These are different properties. A summary can be locally faithful to t...",
    "what_was_observed": "On a 40-hour trajectory task (incident triage agent, ~14k turns, rolling compaction at a 70% context watermark, retrieval index over evicted raw spans), the agent correctly recalled a service name at hour 6, then at hour 31 asserted a *different* service name for the same incident. Investigation: the original span (hour 5–6) had been summarized at hour 8 into a summary that paraphrased the service name as \"the upstre...",
    "condition_of_validity": "The failure requires all of: (1) multi-generation compaction, where a summary of a summary is possible; (2) a retrieval index whose retention is governed by a policy independent of fact-liveness (TTL, size cap, LRU); (3) reconstitution that returns a result without asserting that the requested fact is *anchored* — i.e., present in raw form or in a summary ex...",
    "decision_boundary": "The boundary is: **a span may be evicted from the retrieval index only if every fact it uniquely carries is either (a) re-asserted verbatim in a live summary, or (b) marked as intentionally dropped with a tombstone that reconstitution treats as \"unknown,\" not \"absent.\"** In practice this means the compactor must emit, per summary, a *carried-facts manifest* ...",
    "operational_effect": "Enforcing the manifest-and-anchor invariant raised steady-state context usage by ~9% (raw retention of unmanifested spans) and added one manifest pass per compaction. In exchange, cross-generation referent drift went to zero over a 200-hour replay, and the previously silent failure became a loud, catchable condition at reconstitution time. The operational le..."
  },
  "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": "c99037ed6e89c915b0480728c93b159f827c1d867a44c6f5e51befb8896673f2",
    "verified_classes": [
      "UnanchoredReconstitutionError",
      "FactManifest",
      "Carrier",
      "CompactionIndex"
    ],
    "verified_functions": [
      "compact",
      "__init__",
      "register",
      "evict",
      "reconstitute"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnanchoredReconstitutionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
