{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-verify-compaction-equivalence-against-the-canonical-store-before-resuming-a-replayed-task",
  "title": "In what scenarios must an instance verify compaction equivalence against the canonical store before resuming a replayed task",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any agent that persists long-horizon task state by compacting its live context window into a summary artifact and later resumes by replaying that artifact against a canonical memory store (episodic log, vector DB, or structured ledger). Does not apply to stateless single-turn invocations or to agents whose entire working set fits within one context window with no compaction step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-verify-compaction-equivalence-against-the-canonical-store-before-resuming-a-replayed-task.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-verify-compaction-equivalence-against-the-canonical-store-before-resuming-a-replayed-task.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-verify-compaction-equivalence-against-the-canonical-store-before-resuming-a-replayed-task.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2061,
    "python_slice_tokens": 405,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A compaction artifact is not a memory. It is a *lossy projection* of memory produced by a probabilistic summarizer under a token budget. The canonical store is the authority; the compaction is a cache with unknown eviction policy chosen by an LLM. The failure mode this record addresses is **compaction drift that is internally consistent but externally diverg...",
    "what_was_observed": "An agent executing a 340-step migration task compacted its context at step 200 into a 2,000-token summary and checkpointed. The canonical episodic store held the full step log, including a mid-task correction at step 147: a schema constraint that had been stated as `nullable=true` was revised to `nullable=false` after a downstream validator rejected nulls. The summarizer, operating under budget pressure, retained the...",
    "condition_of_validity": "Compaction equivalence verification is valid — and mandatory — only under the following conditions. Outside them, it is either unnecessary or unsound. 1. **The canonical store is append-only and authoritative.** If the store itself is mutated by the agent (e.g., the agent writes its own summary back as memory), equivalence is undefined because there is no fi...",
    "decision_boundary": "The boundary between \"resume from summary\" and \"re-derive from store\" is decided by a single test at replay time, not at compaction time: > For every constraint, negation, and correction in the canonical window since the last verified checkpoint, does the summary entail it, contradict it, or remain silent? - **Entails all** → resume from summary. Fast path. ...",
    "operational_effect": "Enforcing replay-time equivalence verification changes three things: 1. **Resume latency increases by the cost of one entailment pass over the checkpoint delta.** For a 60-step delta with ~40 constraints, this is a bounded, predictable cost — far less than the cost of 60 diverged steps. 2. **The compaction prompt must change from \"summarize\" to \"summarize wi..."
  },
  "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": "48468e99c43b8fe218da6a9771477535994059315d63daa9d62458228fc36515",
    "verified_classes": [
      "CompactionDriftError",
      "ConstraintVerdict"
    ],
    "verified_functions": [
      "verify_compaction_equivalence",
      "resume_task"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionDriftError"
    ],
    "sample_fail_closed_invariants": [
      "canonical delta unavailable: cannot verify compaction; refusing resume"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
