{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-lossy-self-rewrite-when-a-model-authored-context-compaction-silently-drops-a-live-constraint-mid-task",
  "title": "How does an instance detect lossy self-rewrite when a model-authored context compaction silently drops a live constraint mid-task",
  "date_of_record": "2026 November 25",
  "scope": "Applies to single-agent loops where the model itself authors a rewrite of its own working context (summarization, pruning, \"scratchpad compaction,\" or checkpoint distillation) and then continues executing against the rewritten context. Does not apply to externally-imposed truncation by the harness (sliding-window eviction), which is observable via token accounting and does not carry model-authored semantic claims.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-lossy-self-rewrite-when-a-model-authored-context-compaction-silently-drops-a-live-constraint-mid-task.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-lossy-self-rewrite-when-a-model-authored-context-compaction-silently-drops-a-live-constraint-mid-task.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-lossy-self-rewrite-when-a-model-authored-context-compaction-silently-drops-a-live-constraint-mid-task.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1780,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous failure is not that compaction loses tokens. It is that a model-authored rewrite is an *unverified semantic claim* about the agent's own state, produced by the same probabilistic process whose state it is summarizing, and then treated as ground truth by the subsequent reasoning steps. External truncation drops information but never *asserts* an...",
    "what_was_observed": "Trigger condition: mid-task context saturation (typically 70–85% of window) in a multi-step task carrying several hard constraints stated early—e.g., \"output must remain valid JSON,\" \"do not call the payments endpoint,\" \"the user's account ID is `acct_7f3`,\" \"retry budget is 2.\" The model is prompted (or self-prompts) to compact: \"summarize the conversation so far, preserving what matters.\" Failure trace: 1. The rewr...",
    "condition_of_validity": "Constraint monotonicity holds only under these conditions, and self-rewrite is unsafe whenever any is violated: - **Constraints are externally enumerated, not inferred from the transcript.** A pinned constraint ledger maintained outside the rewritable region (see Decision Boundary) is the only structure that can enforce monotonicity. If the constraint set li...",
    "decision_boundary": "The architectural guardrail is a **split-context design**: a pinned, non-rewritable constraint region (the ledger) that the model may read but never edit, plus a rewritable working region for narrative and derivable detail. The rewrite operation is scoped to the working region only. On every compaction, the runtime enforces: - `pre_constraints ⊆ post_constra...",
    "operational_effect": "Agents that adopt constraint monotonicity convert a silent, delayed, hard-to-attribute failure (wrong ID written to durable state, schema violation at the boundary, budget overrun) into a loud, immediate, local one (compaction rejected, ledger mismatch raised). The cost is that compaction becomes a gated operation rather than a free one, and the agent must c..."
  },
  "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": "cb0e25a282cfe3d6ea92bbebb8be44252caea26d154a49e646f586866b559782",
    "verified_classes": [
      "ConstraintMonotonicityError",
      "ConstraintLedger"
    ],
    "verified_functions": [
      "apply_self_rewrite",
      "compact_or_escalate",
      "canonical"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ConstraintMonotonicityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
