{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-hierarchical-transcript-compaction-from-silently-deleting-the-evidence-an-agent-s-own-verifier-needs",
  "title": "Which invariants prevent hierarchical transcript compaction from silently deleting the evidence an agent's own verifier needs",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-running agents that persist episodic transcripts and, on context-window pressure, replace older spans with summaries produced by a recursive summarizer (leaf chunks → cluster summaries → root summary). Does not apply to append-only logs read in full, or to agents whose compaction is lossless (e.g., verbatim external memory with pointer-only eviction).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-transcript-compaction-from-silently-deleting-the-evidence-an-agent-s-own-verifier-needs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-transcript-compaction-from-silently-deleting-the-evidence-an-agent-s-own-verifier-needs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-transcript-compaction-from-silently-deleting-the-evidence-an-agent-s-own-verifier-needs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2142,
    "python_slice_tokens": 391,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an agent's transcript does when the context window fills: it *narrates* (provides narrative continuity so the model can reason about what it has done) and it *witnesses* (retains the exact tokens, tool outputs, and identifiers that downstream steps — including the agent's own verifier — must re-read verbatim). Hierarchical summarization ...",
    "what_was_observed": "A migration agent (call it `M`) was tasked with renaming 340 database columns across 12 migration files. Its loop was: read file → propose edits → apply → run a schema-linter tool → record the linter's exit code and stderr → proceed. Context pressure triggered auto-compaction at token 118k. The compactor chunked the transcript into 40-message leaves, summarized each leaf with a small model, then recursively summarize...",
    "condition_of_validity": "The guardrail holds only under these conditions, and fails silently outside them: - **Witness fields are declared before compaction, not inferred during it.** The agent must maintain a typed `witness_log` of records that are *never* eligible for summarization: tool name, exact arguments hash, raw exit code, raw stderr/stdout (truncated only by a fixed byte b...",
    "decision_boundary": "The boundary between \"safe to summarize\" and \"must witness\" is drawn per field, not per message: The operational decision: when a span contains any non-summarizable field, the compactor must emit a *structured witness record* alongside the prose summary, and the summary must be marked `witness-backed: false` for any claim lacking one. A verifier encountering...",
    "operational_effect": "With witness separation in place, the incident's step 140 verifier would have read the root summary's claim \"linter run completed\" for 0007, found no witness id in the provenance set, and returned `UNVERIFIED` — forcing a re-run of the linter, which would have returned exit `1` and blocked completion. The cost is one extra linter invocation per compaction bo..."
  },
  "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": "c4d57d20012f9cb2315db3de2c5fa798f1f85610b5f81eba76f85a671ae675a2",
    "verified_classes": [
      "UnwitnessedCompletionError",
      "WitnessRecord",
      "SummaryNode"
    ],
    "verified_functions": [
      "verify_completion"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnwitnessedCompletionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
