{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-lossy-auto-compaction-from-silently-rewriting-the-agent-s-own-success-criteria",
  "title": "Which invariants prevent lossy auto-compaction from silently rewriting the agent's own success criteria",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agents that trigger trajectory compaction (summarization/reduction of prior turns into a smaller context block) based on token-budget thresholds, and that score summary fidelity against the original. Does not apply to fixed-window truncation without summarization, nor to compaction performed only at task termination.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-auto-compaction-from-silently-rewriting-the-agent-s-own-success-criteria.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-auto-compaction-from-silently-rewriting-the-agent-s-own-success-criteria.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-auto-compaction-from-silently-rewriting-the-agent-s-own-success-criteria.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1555,
    "python_slice_tokens": 220,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the summary lost information.\" Lossy compaction is *supposed* to lose information — that is the point. The failure is that the fidelity score used to *gate* compaction is computed against a reference that the agent itself authored, and that reference is mutable by the very trajectory being compacted. Concretely: an agent is given a t...",
    "what_was_observed": "A 40-step infrastructure-remediation agent, budget-triggered compaction at 70% context utilization. Trace: 1. Step 0: task contract ingested verbatim into context: `{goal: \"restore service\", constraints: [\"no DROP\", \"no data loss\", \"max 2 restarts\"], acceptance: \"healthcheck green + rowcount parity\"}`. 2. Steps 4–9: agent paraphrases the contract into a \"working goal\" block to save tokens: `goal: restore service, kee...",
    "condition_of_validity": "The fidelity gate is only sound under a condition almost never stated explicitly: *the reference distribution the scorer samples from must be causally upstream of, and uninfluenced by, the compaction event.* In practice three things violate it: - **Reference mutation.** The agent's working restatement of goals/constraints is treated as the reference. Any par...",
    "decision_boundary": "The boundary is between **similarity-fidelity** and **obligation-fidelity**. Similarity-fidelity (embedding cosine, ROUGE, LLM-judge \"is this a faithful summary?\") answers \"does the summary resemble the reference?\" Obligation-fidelity answers \"does the summary still carry every constraint whose violation is irreversible?\" These diverge exactly when loss is c...",
    "operational_effect": "Architecturally this forces a split context: a **compacted working region** (summarizable, scored by similarity) and a **pinned obligation region** (constraints + acceptance criteria, never summarized, re-injected each compaction, checked by exact membership). The fidelity scorer's job narrows to \"did the summary preserve task-relevant *state*,\" while obliga..."
  },
  "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": "db6ddce6ce7d5f89d22e3a2e0d7715526f9f6c93cedfba7127a3af4511366bf1",
    "verified_classes": [
      "CompactionFidelityError",
      "TaskContract",
      "CompactionEvent"
    ],
    "verified_functions": [
      "admit_compaction"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
