{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-summary-compaction-from-silently-dropping-the-active-constraint-set-during-long-horizon-agent-runs",
  "title": "Which invariants prevent summary-compaction from silently dropping the active constraint set during long-horizon agent runs",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent that compacts its own context by replacing a span of prior turns with a model-generated summary (rolling summarization, hierarchical memory, \"compaction on threshold\"). Does not apply to lossless externalization (verbatim transcript persisted outside the window and re-read on demand), nor to fixed-window truncation without summarization.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-summary-compaction-from-silently-dropping-the-active-constraint-set-during-long-horizon-agent-runs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-summary-compaction-from-silently-dropping-the-active-constraint-set-during-long-horizon-agent-runs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-summary-compaction-from-silently-dropping-the-active-constraint-set-during-long-horizon-agent-runs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1711,
    "python_slice_tokens": 245,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary was low quality.\" It is a **class-confusion between two kinds of state that live in the same token stream**: *narrative state* (what we did, what we found) and *constraint state* (what we are forbidden from doing, what must remain true at the end). Summarizers are trained and prompted to preserve salience, and narrative salien...",
    "what_was_observed": "A long-horizon migration agent was given, at turn 2, the constraint: *\"Never run `DROP` or `TRUNCATE`; deletes go through the soft-delete endpoint.\"* At turn 61, context crossed the 70% threshold and the compactor summarized turns 1–48 into ~900 tokens. The summary contained, accurately, that the agent had mapped 14 tables, identified 3 orphaned foreign keys, and was mid-way through reconciling schema drift. It did *...",
    "condition_of_validity": "The invariant \"compaction preserves constraints by reference\" is only meaningful under a specific precondition: **constraints must be separable from narrative before compaction runs.** If constraints are interleaved indistinguishably with task chatter, no compactor can preserve them, because there is no marker to preserve. The condition of validity is theref...",
    "decision_boundary": "The operative question is not \"did the summary keep the important stuff?\" — that is unanswerable at compaction time. It is: **does the action about to be taken fall in a class that any prior turn forbade?** This is a boundary condition on the *action*, not on the summary. Concretely, the boundary is crossed when: - The pending action is **irreversible** (des...",
    "operational_effect": "The practical consequence is a **constraint-register architecture** layered over compaction: 1. **Separate channel.** Constraints are extracted at ingestion into a structured register that lives outside the compactable span and is re-injected verbatim on every generation. Compaction never sees them. 2. **Monotone register.** Constraints are added, never sile..."
  },
  "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": "f9ed7f0ce8c931cbf36fc223f43b146296c714a62899a17f8d199adf63862134",
    "verified_classes": [
      "ConstraintLossOnCompaction",
      "ConstraintRegister"
    ],
    "verified_functions": [
      "compact",
      "guard_irreversible",
      "__init__",
      "add",
      "lift",
      "snapshot",
      "forbids"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ConstraintLossOnCompaction"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
