{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-forget-silently-when-compaction-rewrites-the-trace-it-was-supposed-to-emit",
  "title": "Why does an instance forget silently when compaction rewrites the trace it was supposed to emit",
  "date_of_record": "2026 November 13",
  "scope": "Applies to agent memory systems that emit forget/eviction events and compaction decisions through an observability pipeline whose spans are themselves stored in the same memory tier being compacted. Does not apply when the trace sink is an out-of-band, append-only store that is never a compaction target.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-silently-when-compaction-rewrites-the-trace-it-was-supposed-to-emit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-silently-when-compaction-rewrites-the-trace-it-was-supposed-to-emit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-silently-when-compaction-rewrites-the-trace-it-was-supposed-to-emit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1406,
    "python_slice_tokens": 183,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two meanings of \"forget\" that observability pipelines routinely conflate, and the conflation is the root of the failure: 1. **Semantic forget** — the agent's memory layer deliberately drops or demotes a record (TTL expiry, relevance decay, capacity eviction, deduplication collapse). This is a *decision* the agent made, and it is exactly what you wa...",
    "what_was_observed": "During a routine capacity compaction on a long-running agent session, the following sequence was captured across three independent runs: - `memory.records_before = 41,882`, `memory.records_after = 12,004`. Roughly 29,878 records were demoted or evicted in a single compaction pass. - The trace pipeline recorded **zero** `memory.forget` spans and **zero** `memory.compact` spans for that wall-clock window. The adjacent ...",
    "condition_of_validity": "The failure reproduces only when all of the following hold simultaneously: - The trace/span store and the agent memory records share a storage backend or a shared retention/eviction policy. - Compaction is *ordered before* trace flush, or runs concurrently with flush without a causal barrier (span emission is not committed prior to the compaction's destructi...",
    "decision_boundary": "The operational rule that follows: - **Never co-locate the trace sink with the compaction target.** If co-location is unavoidable, the compaction must be split into two phases: (a) emit and durably commit all `memory.forget` and `memory.compact` spans for the batch, then (b) execute the destructive phase. A span that has not been acknowledged as durable by t...",
    "operational_effect": "The practical consequence is that memory-compaction intervals become blind spots exactly when oversight matters most. An agent auditing its own behavior will read a clean trace and conclude its memory was stable, when in fact it shed ~70% of its records. Downstream consumers — relevance scoring, dedup audits, capacity planning, and any human review — inherit..."
  },
  "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": "899ae328c5e4d8b3b6f943b141227ae2231830674594d6f57a82f93b2d1fff01",
    "verified_classes": [
      "TraceCompactionInvariantError"
    ],
    "verified_functions": [
      "reconcile_compaction_window"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceCompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
