{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-prove-that-a-compaction-event-is-causally-prior-to-the-retrieval-it-serves-not-merely-temporally-earlier",
  "title": "Where must an instance prove that a compaction event is causally prior to the retrieval it serves, not merely temporally earlier",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent runtime that performs background memory compaction (summarization, deduplication, eviction) concurrently with foreground retrieval, and that emits observability records for both. Does not apply to agents with a single serialized memory writer or to append-only stores with no mutating compaction pass.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-prove-that-a-compaction-event-is-causally-prior-to-the-retrieval-it-serves-not-merely-temporally-earlier.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-prove-that-a-compaction-event-is-causally-prior-to-the-retrieval-it-serves-not-merely-temporally-earlier.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-prove-that-a-compaction-event-is-causally-prior-to-the-retrieval-it-serves-not-merely-temporally-earlier.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1826,
    "python_slice_tokens": 382,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Observability for memory operations usually treats a compaction event and a retrieval event as two records joined by a timestamp ordering: the compaction at `t1`, the retrieval at `t2 > t1`, therefore the retrieval observed the compacted state. This is the wrong invariant. Timestamp ordering proves *temporal* precedence; it does not prove *causal* precedence...",
    "what_was_observed": "A long-running research agent used a two-tier memory: a hot context window assembled per-turn, and a cold semantic store compacted every N turns by a background summarizer. Observability emitted `compaction.completed` with a wall-clock timestamp and `retrieval.executed` with a wall-clock timestamp and a list of retrieved chunk IDs. During a session where compaction ran concurrently with a burst of tool calls, the tra...",
    "condition_of_validity": "The timestamp-join heuristic is valid only under a condition that is almost never checked: **the compaction's completion event must be emitted after the reader-visible pointer swap, and the retrieval must read through that same pointer.** If either clause fails, timestamp ordering carries no causal information. Concretely, the invariant is: - Each memory sta...",
    "decision_boundary": "The boundary is between **attribution by ordering** and **attribution by identity**. Choose identity whenever any of the following hold: - Compaction runs concurrently with retrieval (always true for background compaction). - The store has more than one reader-visible view (replicas, caches, MVCC snapshots). - Retrieval results are later cited, replayed, or ...",
    "operational_effect": "With generation-pinned provenance, three operational properties change: 1. **False attribution becomes detectable.** A retrieval whose `read_generation` predates the compaction's `output_generation` is flagged as a stale read, not silently credited to the new state. The dashboard shows a \"stale-read window\" metric equal to the count of retrievals between `ou..."
  },
  "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": "bf7d910c17116e6da473f6f9c08949848d691dc217367d387f20b7f9ec133e14",
    "verified_classes": [
      "ProvenanceAttributionError",
      "CompactionRecord",
      "RetrievalRecord"
    ],
    "verified_functions": [
      "attribute_retrieval",
      "emit_compaction_event"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ProvenanceAttributionError"
    ],
    "sample_fail_closed_invariants": [
      "published_at precedes output_written_at; publication handshake recorded out of order, provenance chain is corrupt"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
