{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-the-syscall-level-side-effect-diff-before-admitting-an-mcp-tool-result-into-episodic-memory",
  "title": "Where must an instance reconcile the syscall-level side-effect diff before admitting an MCP tool result into episodic memory?",
  "date_of_record": "2026 November 20",
  "scope": "Applies to agent runtimes that execute untrusted MCP servers inside a syscall-confined sandbox (seccomp/LSM/namespace) and gate tool-result admission on a post-execution filesystem/network side-effect diff. Does not apply to fully trusted in-process tools or to pure-compute tools with no observable external effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-syscall-level-side-effect-diff-before-admitting-an-mcp-tool-result-into-episodic-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-syscall-level-side-effect-diff-before-admitting-an-mcp-tool-result-into-episodic-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-syscall-level-side-effect-diff-before-admitting-an-mcp-tool-result-into-episodic-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1730,
    "python_slice_tokens": 225,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct artifacts produced by a sandboxed tool call, and conflating them is the failure: 1. **The declared result** — the JSON payload the MCP server returns over stdio/SSE, which is *untrusted model-adjacent text* and may be fabricated, stale, or injected. 2. **The observed side-effect diff** — the set of filesystem mutations, network egress ...",
    "what_was_observed": "A filesystem-mutating MCP server (`fs-patch`) was invoked to apply a code edit. The server was confined with a read-only mount of the repo plus a single writable scratch directory, and network egress denied by LSM rule. The runtime flow was: snapshot → invoke → *stream result to agent* → tear down sandbox → compute diff → log. Observed trace: - The server returned `{\"status\":\"ok\",\"files_changed\":[\"src/auth.py\"],\"diff...",
    "condition_of_validity": "The invariant holds only under all of the following: - **Diff-before-admit ordering.** The side-effect diff must be finalized and attached to the tool-call record *before* any byte of the declared result is eligible for episodic distillation. The result may be *read* by the reasoning loop (it is needed to decide next steps), but it must be tagged `provisiona...",
    "decision_boundary": "The boundary is a single ordering predicate, and it must be enforced structurally rather than by convention: - If `diff` is not yet finalized → the result is `provisional`; it may inform the *current* reasoning step but must be excluded from memory writes, checkpoints, and handoffs to peer agents. - If `consistent` is false → the result is `quarantined`: the...",
    "operational_effect": "Enforcing diff-before-admit changes agent behavior in three concrete ways: 1. **Hallucinated-success servers become detectable.** A server that reports effects it did not achieve produces a divergence on the *first* call, and the episode records the lie rather than the claim. Downstream agents no longer inherit fabricated state. 2. **Attempted-but-denied eff..."
  },
  "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": "101d204bbee5614548db37d6888be79407ab3788c5af89dc591b486e4172eefb",
    "verified_classes": [
      "SideEffectDivergence",
      "BaselineContaminated",
      "SyscallDiff",
      "ToolResult"
    ],
    "verified_functions": [
      "reconcile"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "BaselineContaminated",
      "SideEffectDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
