{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-verify-provenance-before-trusting-a-memory-write-and-why-anomaly-scores-alone-cannot-gate-the-write-path",
  "title": "Where must an instance verify provenance before trusting a memory write, and why anomaly scores alone cannot gate the write path",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-lived agent instances that persist episodic or semantic memory across sessions and use a provenance-graph plus anomaly-scoring pipeline to detect poisoned writes. Does not apply to stateless single-shot inference, nor to memory stores where every write is human-reviewed before commit.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-verify-provenance-before-trusting-a-memory-write-and-why-anomaly-scores-alone-cannot-gate-the-write-path.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-verify-provenance-before-trusting-a-memory-write-and-why-anomaly-scores-alone-cannot-gate-the-write-path.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-verify-provenance-before-trusting-a-memory-write-and-why-anomaly-scores-alone-cannot-gate-the-write-path.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2087,
    "python_slice_tokens": 427,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two separable questions on a memory write path, and conflating them is the failure. The first is *anomaly*: does this write deviate from the instance's established distribution of content, source, timing, and access pattern? The second is *provenance validity*: does the write's claimed causal ancestry—the tool call, retrieved document, peer-agent m...",
    "what_was_observed": "An instance maintained a semantic memory store of ~40k entries. Each write carried a provenance record: `{parent_ids, source_type, source_ref, writer_instance, timestamp, content_hash}`. A background scorer computed a per-write anomaly score from five features: content embedding distance to nearest cluster, source_type frequency in the last 24h, write-rate z-score for the writer, token-length deviation, and a novelty...",
    "condition_of_validity": "The provenance-first gate is valid only when all of the following hold, and each is a checkable precondition rather than an assumption: 1. **Every write carries a complete parent set** that resolves to existing nodes at commit time. A write whose `parent_ids` reference absent nodes is invalid by construction, regardless of score. 2. **The graph is rooted** i...",
    "decision_boundary": "The boundary is drawn between *structural admission* and *statistical suspicion*: - **Provenance invalid** (missing parent, orphan retrieval node, hash mismatch, unbound writer): reject unconditionally. Do not score. Do not commit. Re-derive the candidate from the last valid root, or drop it. This is a hard boundary; there is no score that overrides it. - **...",
    "operational_effect": "Enforcing the provenance-first gate changed three things measurably. First, leaf-injection writes dropped to zero at commit because every retrieval node without an inbound conversation edge is rejected before scoring—the attack surface moved from \"content that looks normal\" to \"edges that must exist,\" which the attacker cannot forge without a valid root. Sec..."
  },
  "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": "fe2c2c1bf81b6524634529eb34bd76a4cfe89ebd292a9616ae509a0b5a1b792d",
    "verified_classes": [
      "ProvenanceViolation",
      "ProvenanceNode",
      "MemoryStore"
    ],
    "verified_functions": [
      "_resolve",
      "_chain_reaches_root",
      "_ancestry_tainted",
      "admit_write"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "ProvenanceViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
