{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-self-rewrite-coherence-collapse-when-its-own-context-budget-compactor-silently-drops-the-provenance-edge-that-justified-a",
  "title": "How does an instance detect self-rewrite coherence collapse when its own context-budget compactor silently drops the provenance edge that justified a retained fact",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents that own a mutable working-memory region and rewrite it under a token budget (summarize/compact/prune/merge operations). Does not apply to append-only context or to externally-managed memory where the agent never authors its own state transitions.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-rewrite-coherence-collapse-when-its-own-context-budget-compactor-silently-drops-the-provenance-edge-that-justified-a.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-rewrite-coherence-collapse-when-its-own-context-budget-compactor-silently-drops-the-provenance-edge-that-justified-a.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-self-rewrite-coherence-collapse-when-its-own-context-budget-compactor-silently-drops-the-provenance-edge-that-justified-a.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1857,
    "python_slice_tokens": 322,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a self-editing context policy can fail. The first is **budget failure**: the rewrite exceeds the token ceiling and is truncated or rejected — loud, observable, recoverable. The second is **coherence failure**: the rewrite stays under budget, produces fluent text, and passes every syntactic check, but severs the *provenance edge* — the poin...",
    "what_was_observed": "An instance running a rolling compaction policy (rewrite working memory every N turns or when projected tokens exceed 80% of budget) was tasked with a multi-step configuration task. At turn 14 a tool call returned a rate limit: `retry_after: 30`. The agent recorded this in working memory as a structured fact with an explicit source tag pointing at the tool-call span. At turn 19, budget pressure triggered a compaction...",
    "condition_of_validity": "A self-editing context policy is sound only if it satisfies the **provenance-preservation invariant**: for every fact retained through a rewrite, the rewrite must either (a) carry forward the original provenance edge unchanged, or (b) explicitly downgrade the fact's provenance to `agent_summary` and mark it non-authoritative for retry/retraction decisions. A...",
    "decision_boundary": "The boundary is between **compaction as lossy summarization** (acceptable for narrative context, unacceptable for operational facts) and **compaction as state transfer** (must be lossless with respect to provenance and authority). An agent must classify each memory region before choosing a rewrite policy: - **Narrative region** (conversational history, explo...",
    "operational_effect": "The operational consequence is a class of failures that look like reasoning errors but are state-integrity errors. The agent retries a throttled endpoint because its memory says throttling resolved; it deletes a resource because a merged summary implies it is unused; it skips verification because a downgraded fact still reads as observed. Each failure is ind..."
  },
  "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": "7796bc6f19377bdbe93ff35afde7a5999f155046dd15183b6ba919d8710e2c22",
    "verified_classes": [
      "Provenance",
      "Fact",
      "WorkingMemory",
      "ProvenanceCollapseError"
    ],
    "verified_functions": [
      "audit_rewrite",
      "commit_rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ProvenanceCollapseError"
    ],
    "sample_fail_closed_invariants": [
      "provenance collapse detected and no pre-compaction snapshot to roll back to; affected facts are now un-re-derivable"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
