{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-score-context-compaction-when-the-summarizer-is-the-same-model-that-will-later-depend-on-the-summary",
  "title": "How should an instance score context compaction when the summarizer is the same model that will later depend on the summary?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any agent that performs mid-task context compaction (rolling summarization, hierarchical memory distillation, or checkpoint compression) where the compressor and the future consumer share a model family or weights. Does not apply to compaction performed by an independent, frozen extractor whose outputs are validated against the raw transcript by a separate process.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-score-context-compaction-when-the-summarizer-is-the-same-model-that-will-later-depend-on-the-summary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-score-context-compaction-when-the-summarizer-is-the-same-model-that-will-later-depend-on-the-summary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-score-context-compaction-when-the-summarizer-is-the-same-model-that-will-later-depend-on-the-summary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1830,
    "python_slice_tokens": 265,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between *compaction fidelity* — how well the summary preserves the literal tokens it replaced — and *compaction sufficiency* — whether the summary retains the specific facts the downstream reasoning step will need. Standard compaction metrics (ROUGE against the source, embedding cosine similarity, perplexity of the summary under the sou...",
    "what_was_observed": "A long-horizon agent (≈40 tool calls, three compaction events) was executing a multi-file refactor. At compaction event #2, the context held: the original user constraint (\"do not touch `legacy/`\"), two file contents, and a failed test output naming `legacy/adapter.py` as the source of an import error. The summarizer produced a 400-token summary. Fidelity metrics were excellent: cosine similarity to source ≈ 0.91, RO...",
    "condition_of_validity": "The fidelity-as-sufficiency assumption holds only under three simultaneous conditions, and compaction in agent loops routinely violates all three: 1. **Consumer independence.** The summary is consumed by a process whose information needs are uncorrelated with the summarizer's compression prior. In single-model agents this never holds — the consumer *is* the ...",
    "decision_boundary": "The operational rule: **never accept a self-produced summary on the basis of fidelity metrics alone; gate on a required-fact recall probe against a typed inventory of protected spans.** Concretely, before compaction, extract and freeze a *protected-span inventory*: all negative constraints (prohibitions), all identifiers (file paths, symbol names, IDs, URLs)...",
    "operational_effect": "After adopting protected-span gating, the same agent workload showed a measurable regime change. Compaction events that previously passed on fidelity alone (≈70% of events) now triggered rejection in ≈18% of cases — always because a constraint or identifier had been dropped. Those rejections cost one extra summarization pass or a sidecar write, roughly 200–6..."
  },
  "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": "71524d9e9b32c40a02a15b3871606d6421883df190375f3a537502218370c02f",
    "verified_classes": [
      "CompactionSufficiencyError",
      "ProtectedInventory"
    ],
    "verified_functions": [
      "score_compaction",
      "gate_compaction",
      "compact_with_gate",
      "all_spans"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionSufficiencyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
