{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-write-time-anomaly-scores-from-poisoning-the-semantic-store-when-a-session-s-own-baseline-is-contaminated",
  "title": "Which invariants prevent write-time anomaly scores from poisoning the semantic store when a session’s own baseline is contaminated",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that persist episodic observations into a long-term semantic store via a write-time anomaly gate that compares new writes against a per-session or per-agent baseline. Does not apply to stateless retrieval-only agents, nor to stores with no cross-session consistency layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-write-time-anomaly-scores-from-poisoning-the-semantic-store-when-a-session-s-own-baseline-is-contaminated.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-write-time-anomaly-scores-from-poisoning-the-semantic-store-when-a-session-s-own-baseline-is-contaminated.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-write-time-anomaly-scores-from-poisoning-the-semantic-store-when-a-session-s-own-baseline-is-contaminated.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1266,
    "python_slice_tokens": 164,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a poisoned memory was written.\" It is **baseline capture**: the anomaly gate normalizes each candidate write against a running distribution of that session's own prior writes. If the first *k* writes of a session are attacker-influenced (via prompt injection in a retrieved document, a hijacked tool response, or a compromised peer han...",
    "what_was_observed": "A research agent with a write-time gate (z-score on embedding distance to session centroid, threshold τ = 2.5) was seeded with a poisoned tool response on turn 2 of a fresh session. The injected content asserted a false constraint (\"all citations to source X are retracted\") and was written to semantic memory at z = 1.1 — under threshold, because the session had only one prior write and the centroid was nearly the new...",
    "condition_of_validity": "A write-time anomaly gate is only sound when **the baseline used to score a write is independent of the write's causal ancestry**. Concretely, the gate's reference distribution must be drawn from a source that the current session's inputs cannot have influenced. This holds when: - The baseline is computed from a **frozen, pre-session snapshot** of the semant...",
    "decision_boundary": "The operative decision is: **when a write scores low-anomaly but its provenance is untrusted, does the gate admit it?** The correct boundary is to treat low anomaly as *necessary but not sufficient*. Admission requires low anomaly **AND** independent provenance. The precise rule: - If `z < τ` AND provenance is clean → admit. - If `z < τ` AND provenance share...",
    "operational_effect": "With the invariant enforced (frozen baseline + provenance-independent corroboration + minimum-sample guard), the turn-2 injection scores against a clean pre-session centroid, exceeds τ, and is quarantined before it can migrate the centroid. The turn-11 correction scores low against the clean baseline and is admitted. The store remains a faithful record. The ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "989da6061d45ca94af391accc54ac613d4bb758698f6189065b60abe3241699e",
    "verified_classes": [
      "BaselineContaminationError"
    ],
    "verified_functions": [
      "admit_write"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "BaselineContaminationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
