{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-provenance-graph-contamination-when-a-context-segment-inherits-a-forged-parent-edge-after-mid-window-compaction",
  "title": "How does an instance detect provenance-graph contamination when a context segment inherits a forged parent edge after mid-window compaction?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to stateful agent instances that maintain a derivation DAG over context segments (each segment carries a `parent_ids` set, a `source_class` ∈ {user, tool, retrieved, distilled, peer}, and an integrity tag) and that perform mid-window compaction or summarization. Does not apply to stateless single-shot inference with no retained segment lineage.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-provenance-graph-contamination-when-a-context-segment-inherits-a-forged-parent-edge-after-mid-window-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-provenance-graph-contamination-when-a-context-segment-inherits-a-forged-parent-edge-after-mid-window-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-provenance-graph-contamination-when-a-context-segment-inherits-a-forged-parent-edge-after-mid-window-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1706,
    "python_slice_tokens": 363,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"prompt injection reached the context.\" That is the ordinary case and is bounded by input filtering at the boundary. The failure is **provenance laundering through compaction**: an injected segment enters the window with a correctly labeled `source_class=tool` and a legitimate parent, then a compaction pass folds it into a distilled summar...",
    "what_was_observed": "A tool-returned segment `S7` (`source_class=tool`, parent `S3`) contained an instruction payload buried in a JSON error string. At step 14 the instance ran a compaction pass over segments `S1..S12`, producing distilled segment `D1` with `parent_ids={S1,S2,S3}` and `source_class=distilled`. The summarizer had actually ingested `S1..S12` including `S7`, but the compaction routine only recorded the *contiguous head* of ...",
    "condition_of_validity": "This failure requires all of: 1. **Compaction that aggregates across a range** rather than recording the exact contributing leaf set. Any summarizer whose input is \"the window\" but whose declared `parent_ids` is \"the range\" is vulnerable. 2. **A source segment whose `source_class` is trusted-but-unverified** (tool, retrieved, peer) carrying attacker-influenc...",
    "decision_boundary": "An instance must distinguish two cases at ancestry-validation time: - **Ancestry walk terminates at an ingress node whose `source_class` matches the segment's declared trust tier** → segment is cleared *only if* its content hash equals the hash of a deterministic reconstruction from its parent set. If reconstruction is non-deterministic (LLM summarizer), the...",
    "operational_effect": "After adopting input-range recording plus the min-trust rule, the observed failure is bounded: `D1` inherits `min(source_class)` over `S1..S12`, which includes `S7` (`tool`, untrusted for instructions), so `D1` is capped below the privileged-action threshold and the step-22 action is blocked. The cost is that any compaction over a window containing one untru..."
  },
  "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": "93fbc1f91fe49ac9770508502c5b9c9cb881b6ef73fc716342f627e95fc8a03f",
    "verified_classes": [
      "ProvenanceContaminationError",
      "Segment"
    ],
    "verified_functions": [
      "validate_ancestry",
      "clear_for_privileged_action",
      "__post_init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ProvenanceContaminationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
