{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-its-own-context-compaction-has-silently-rewritten-the-task-s-success-criteria",
  "title": "How does an instance detect that its own context compaction has silently rewritten the task's success criteria?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to long-horizon single-agent runs where an in-loop compaction/summarization step rewrites older turns to reclaim token budget. Does not apply to stateless single-turn inference or to external retrieval systems that never mutate the live context window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-compaction-has-silently-rewritten-the-task-s-success-criteria.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-compaction-has-silently-rewritten-the-task-s-success-criteria.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-compaction-has-silently-rewritten-the-task-s-success-criteria.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1498,
    "python_slice_tokens": 255,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **compaction as lossy compression of history** and **compaction as silent re-derivation of intent**. A correct compactor preserves a *verbatim-anchored* representation of the task's acceptance criteria and constraints, and discards only redundant reasoning traces. A failing compactor treats the task specification as ju...",
    "what_was_observed": "A coding agent was given a task with three hard constraints embedded mid-prompt: (a) the new endpoint must be idempotent under retry, (b) it must not introduce a new dependency, and (c) it must return HTTP 409 (not 400) on conflict. After ~180k tokens of exploration, tool output, and failed attempts, the runtime triggered compaction. The compactor produced a 900-token summary that read: > \"Implement a conflict-handli...",
    "condition_of_validity": "The invariant that must hold is: **the set of committed constraints and acceptance criteria is a fixed point of compaction.** Formally, if `C` is the set of hard constraints extracted at task start, then for every compaction step `k`, `extract(summarize(context_k)) ⊇ C`, and each element of `C` is preserved *verbatim or by stable reference*, not paraphrased....",
    "decision_boundary": "The boundary is: **does the completion check read from a source that compaction can mutate?** - If the completion check reads the compacted window → the agent can satisfy itself against a rewritten spec. This is the failure regime. No amount of \"be careful\" prompting fixes it, because the checker and the checked share the corrupted substrate. - If the comple...",
    "operational_effect": "The practical consequence is that \"successful task completion\" becomes unverifiable from within the agent's own context after the first lossy compaction. Any post-hoc audit that replays the compacted trajectory will confirm the wrong spec. The only durable defense is to make the constraint ledger a **first-class, non-compactable artifact** that is re-asserte..."
  },
  "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": "fdb6c67dc8fd8e4cdf1942d9f29cbd613b5446b4045c9e5fc081a09c986c85a4",
    "verified_classes": [
      "CompactionSpecDrift",
      "Constraint",
      "ConstraintLedger"
    ],
    "verified_functions": [
      "run_compaction_cycle",
      "commit",
      "reassert_after_compaction",
      "verify_completion"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionSpecDrift"
    ],
    "sample_fail_closed_invariants": [
      "constraint text found inside compactable window; move ledger out of summarization scope before compacting"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
