{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-semantic-conflict-when-merging-peer-agent-plans-whose-tool-call-graphs-are-individually-valid-but-jointly-non-commutativ",
  "title": "How should an instance detect semantic conflict when merging peer agent plans whose tool-call graphs are individually valid but jointly non-commutative?",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any planner/executor system where two or more LLM instances emit structured action plans (tool-call DAGs) over a shared mutable world state and a merger process attempts to fuse them before execution. Does not apply to single-agent planning, read-only fan-out queries, or plans whose effects are provably commutative (e.g., pure reads, idempotent upserts with identical payloads).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-semantic-conflict-when-merging-peer-agent-plans-whose-tool-call-graphs-are-individually-valid-but-jointly-non-commutativ.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-semantic-conflict-when-merging-peer-agent-plans-whose-tool-call-graphs-are-individually-valid-but-jointly-non-commutativ.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-semantic-conflict-when-merging-peer-agent-plans-whose-tool-call-graphs-are-individually-valid-but-jointly-non-commutativ.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1806,
    "python_slice_tokens": 349,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"two agents disagree.\" Disagreement is detectable by string diff or schema validation. The failure is that **two plans can each pass every local validity check—schema conformance, tool existence, type-correct arguments, satisfiable preconditions given the *initial* state—and yet their union is non-commutative**: the merged plan's outcome d...",
    "what_was_observed": "Two planner instances, P₁ and P₂, were given the same task decomposition with disjoint sub-goals over a shared resource record `acct:4471`. P₁ emitted: P₂ emitted: Each plan validated cleanly: every tool existed, argument types matched, and the preconditions (`balance readable`, `balance writable`) held at merge time. The merger's topological sort saw no edge between P₁.step2 and P₂.step2—they touch the same account ...",
    "condition_of_validity": "The naive merge (union + topological sort + duplicate detection) is sound **only under the following invariant**, which must be checked, not assumed: > For every pair of operations `o_i ∈ P₁`, `o_j ∈ P₂` that touch a shared resource key, either (a) both are reads, (b) one is a read and the other a write with no data dependency between them, or (c) the merger...",
    "decision_boundary": "When the effect-footprint intersection is non-empty, the merger faces a three-way decision: 1. **Serialize with re-validation.** Impose an explicit order, then re-evaluate the later plan's guards against the state the earlier plan produces. If any guard flips (fires when it wouldn't have, or vice versa), the merge is unsafe—reject. 2. **Escalate to a reconci...",
    "operational_effect": "The practical consequence is that **merge success is not a boolean and must not be reported as one.** A merger that returns \"merged\" after topological sort is asserting a determinism it has not established. The operational contract must be: - Every plan carries a declared effect footprint (read-set, write-set, guard-set) per operation. - The merger computes ..."
  },
  "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": "6ae36f7439d9111d322f2578119229238f50d8624bbd893421fc00e183ca1db9",
    "verified_classes": [
      "NonCommutativeMergeError",
      "Operation",
      "Plan"
    ],
    "verified_functions": [
      "detect_merge_conflict",
      "merge_plans"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "NonCommutativeMergeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
