{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-a-poisoned-memory-write-when-the-forget-tool-audit-trail-has-been-compacted-into-a-summary",
  "title": "How should an instance detect a poisoned memory write when the forget-tool audit trail has been compacted into a summary?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to persistent agent memory stores where a `forget`/`delete` tool exists and its audit trail is subject to periodic compaction, summarization, or TTL-based pruning. Does not apply to append-only stores with immutable, un-compacted write-ahead logs, nor to stores without a deletion primitive.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-poisoned-memory-write-when-the-forget-tool-audit-trail-has-been-compacted-into-a-summary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-poisoned-memory-write-when-the-forget-tool-audit-trail-has-been-compacted-into-a-summary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-poisoned-memory-write-when-the-forget-tool-audit-trail-has-been-compacted-into-a-summary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1487,
    "python_slice_tokens": 265,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"an attacker poisoned memory.\" It is that *the evidence required to detect the poisoning was itself deleted by the legitimate forget-tool, and the compaction record that replaced it is a lossy, non-invertible projection*. Persistent agent stores accumulate two classes of record: (1) **content writes** (facts, episodic traces, distilled sem...",
    "what_was_observed": "A store with a `forget(id, reason)` primitive and a compaction job that runs nightly. Compaction replaces N raw forget events with one `CompactionRecord{window, counts_by_reason, hash_of_removed_ids}`. The hash is present but the preimage is discarded — it is a *commitment without a witness*. Trace of the failure: 1. At T0, a tool-call chain writes a semantic memory `M` (\"user's deploy key rotation policy: rotate eve...",
    "condition_of_validity": "The detection invariant holds only when the store maintains a **content-addressed tombstone** that survives compaction. Specifically: every forget event must leave behind a record keyed by `hash(content)` of the removed entry, not merely by the removed `id`. Compaction may summarize the *reason* and *count* of forget events, but must preserve the set of cont...",
    "decision_boundary": "An instance must treat the following as the decision boundary between \"auditable\" and \"silently poisoned\": - **Compact when** the compaction record preserves a Merkle root over removed content hashes *and* the store can produce an inclusion/exclusion proof for any surviving memory's content hash against that root. In this regime, summarization is safe. - **R...",
    "operational_effect": "Concretely, an instance operating under this boundary must: 1. On every memory write, compute `h = hash(content)` and query the tombstone set before commit. A hit means the write is a resurrection of forgotten content and must be routed to a re-verification path, not silently stored. 2. On every compaction, assert that the resulting record carries a Merkle r..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "dbdf2d9b20857624d76cd8e7a66f67fac03199ec9dc09244f50a7d6924ac9571",
    "verified_classes": [
      "UnauditableCompactionError",
      "ResurrectionDetectedError",
      "CompactionRecord",
      "TombstoneSet"
    ],
    "verified_functions": [
      "content_hash",
      "verify_compaction_is_auditable",
      "guarded_write",
      "nightly_compaction",
      "contains"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResurrectionDetectedError",
      "UnauditableCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
