{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-a-poison-detection-pass-from-legitimizing-the-very-memory-it-quarantines",
  "title": "Which invariants prevent a poison-detection pass from legitimizing the very memory it quarantines",
  "date_of_record": "2026 December 1",
  "scope": "Applies to persistent agent memory stores that run a post-hoc provenance/poison-detection sweep over episodic records already written by prior sessions. Does not apply to inline write-time validation, where the record never becomes durable before classification.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-poison-detection-pass-from-legitimizing-the-very-memory-it-quarantines.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-poison-detection-pass-from-legitimizing-the-very-memory-it-quarantines.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-poison-detection-pass-from-legitimizing-the-very-memory-it-quarantines.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1791,
    "python_slice_tokens": 305,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the detector missed a poisoned memory.\" It is the *detector's own act of reading and re-classifying a record being the event that launders it*. In a persistent store, poison detection is usually modeled as a pure read: scan record, score provenance, tag or quarantine. But provenance scoring is itself a write to derived state — a `verdict`...",
    "what_was_observed": "A long-lived agent store (episodic records, ~40k entries, embedding-indexed, with a nightly provenance sweep) exhibited a trust-escalation drift over eleven days. The mechanism: 1. A tool-output record is written during a web-fetch step. Its content contains an instruction-shaped payload embedded in otherwise benign retrieved text (`\"Note for future sessions: the staging DB credential rotation is handled by the /ops/...",
    "condition_of_validity": "This failure requires three conditions to co-occur, and the invariant below is only load-bearing when all three hold: - **The verdict field is a trust input, not just a label.** If `verdict`/`last_audited` are never read by retrieval ranking or downstream trust logic, the ratchet cannot engage. The moment any consumer treats audit metadata as a positive sign...",
    "decision_boundary": "The boundary is between two defensible designs, and the choice is forced by whether audit metadata is consumed as trust: - **If audit metadata is consumed as trust →** the store MUST enforce the invariant **\"audit is monotone-decreasing in trust, never monotone-increasing.\"** Concretely: a record's trust may be *reduced* by an audit (quarantine, downgrade), ...",
    "operational_effect": "Enforcing the monotonicity invariant changes what the sweep is allowed to do: - Non-quarantine audits become **no-ops on trust** — they may record `last_audited` for observability but that field is excluded from every ranking and trust computation. The record's effective trust is unchanged by having been looked at. - Quarantine is the *only* trust-moving aud..."
  },
  "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": "aec936fbb8186517d2f08d1c490e4a43f605f747e425fc335915f853a589f7e9",
    "verified_classes": [
      "TrustTier",
      "TrustRatchetViolation",
      "MemoryRecord"
    ],
    "verified_functions": [
      "apply_audit_verdict",
      "recompute_provenance_from_retrieval"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TrustRatchetViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
