{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-compact-its-own-context-window-mid-task-the-fidelity-floor-invariant-for-self-triggered-lossy-summari",
  "title": "Under what conditions must an instance refuse to compact its own context window mid-task: the fidelity-floor invariant for self-triggered lossy summarization",
  "date_of_record": "2026 December 2",
  "scope": "Applies to long-horizon agent instances that autonomously decide when to compact their own working context (rolling summarization, hierarchical memory flush, KV-cache eviction with re-summarization) while a task is in flight. Does not apply to externally-scheduled compaction between discrete tasks, nor to append-only episodic logs that are never rewritten in place.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-its-own-context-window-mid-task-the-fidelity-floor-invariant-for-self-triggered-lossy-summari.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-its-own-context-window-mid-task-the-fidelity-floor-invariant-for-self-triggered-lossy-summari.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-its-own-context-window-mid-task-the-fidelity-floor-invariant-for-self-triggered-lossy-summari.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1885,
    "python_slice_tokens": 265,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways an agent can lose state, and they demand opposite mitigations. **Capacity loss** is the ordinary case: the context window fills, the oldest tokens are evicted or folded into a summary, and the agent continues with less raw material. Capacity loss is *expected* and is bounded by how much detail the summary preserves. ...",
    "what_was_observed": "A planning agent was executing a multi-step data-migration task with a hard constraint surfaced in step 2: *\"the legacy `orders` table must not be truncated until the reconciliation report at `/reports/recon_2025_06.csv` has been verified to contain a non-zero `settled_total` column.\"* This is a negative constraint (a prohibition) plus a path pointer plus a column predicate—three pieces of state that are individually...",
    "condition_of_validity": "The self-compaction decision is valid **only** when, for every constraint in the region being compacted, at least one of the following holds: 1. **Exercised:** a downstream step has already evaluated the constraint and its outcome is recorded in a form the summary cannot lose (e.g., a boolean `recon_verified=True` written to a durable scratchpad, not a prose...",
    "decision_boundary": "The boundary is not \"occupancy > X%.\" It is a three-way conjunction evaluated per constraint, not per window: - **Trigger side:** the compactor may fire on occupancy alone **only if** the set of latent, non-re-derivable, destructive constraints in the compaction region is empty. - **If the set is non-empty:** the compactor must either (a) emit a structured *...",
    "operational_effect": "Implementing the fidelity-floor invariant changes the agent's behavior in three observable ways. First, compaction becomes **constraint-gated** rather than occupancy-gated: the agent maintains a manifest of load-bearing tokens and refuses to summarize spans containing unexercised entries. Second, summaries become **auditable**: every compaction emits a diff ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "5479cf4c2cc453757846d4f476b6345102f28e334ebb58065801fddfc550e786",
    "verified_classes": [
      "CompactionFidelityError",
      "Constraint",
      "CompactionRegion"
    ],
    "verified_functions": [
      "assert_compaction_safe",
      "maybe_compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
