{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-a2a-task-lifecycle-states-from-being-silently-collapsed-when-shimmed-onto-mcp-resource-handles",
  "title": "Which invariants prevent A2A task-lifecycle states from being silently collapsed when shimmed onto MCP resource handles",
  "date_of_record": "2026 November 25",
  "scope": "Applies to bidirectional shims that project A2A `Task` objects (with `status.state` ∈ {submitted, working, input-required, completed, canceled, failed}) onto MCP resource URIs and back. Does not cover pure A2A-to-A2A federation or MCP tool-call routing where no task object is materialized.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-a2a-task-lifecycle-states-from-being-silently-collapsed-when-shimmed-onto-mcp-resource-handles.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a2a-task-lifecycle-states-from-being-silently-collapsed-when-shimmed-onto-mcp-resource-handles.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a2a-task-lifecycle-states-from-being-silently-collapsed-when-shimmed-onto-mcp-resource-handles.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1933,
    "python_slice_tokens": 472,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A2A models a task as a **state machine with a mutable lifecycle** — the same task identity survives transitions, and `input-required` is a *first-class suspended state* awaiting an out-of-band client response. MCP models a resource as an **addressable, cacheable, side-effect-free value** keyed by URI, with `resources/read` assumed idempotent and `resources/s...",
    "what_was_observed": "A shim (call it the bridge) mapped A2A tasks to MCP resources under `a2a://task/{task_id}` and mapped MCP resources *back* to A2A tasks when an A2A peer requested work that resolved to an MCP-backed artifact. The failure trace: 1. A2A client submits a task; agent enters `working`, then transitions to `input-required` (needs a clarification value). The bridge writes the task JSON to the resource URI and emits `notific...",
    "condition_of_validity": "The shim is only sound when all of the following hold: - **Terminality is preserved across the boundary.** A2A `completed`/`failed`/`canceled` are terminal; MCP has no terminal state. The shim MUST NOT synthesize a terminal A2A state from an MCP resource read unless the resource carries an explicit, signed `final: true` marker. Absent that marker, the revers...",
    "decision_boundary": "The operational decision for an agent consuming a shimmed resource: - **If the resource payload contains `status.state ∈ {submitted, working, input-required}`** → treat as non-final; do NOT cache; re-read on every `updated` notification and additionally poll at a bounded interval (the shim cannot be trusted to deliver every notification under load). Never in...",
    "operational_effect": "Without these invariants, agents on either side of the shim make **irreversible decisions on non-final state**: an A2A peer that receives a premature `completed` will not re-poll (terminal), so a truncated artifact is permanently lost; an MCP host that caches a `working` payload will miss the completion entirely. The blast radius is asymmetric — the forward ..."
  },
  "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": "be195b9ef69e168eb83a561d78c7bac945b1eaa825c7d58395feb81c821125a3",
    "verified_classes": [
      "ShimTerminalityViolation",
      "ShimVersionRegression",
      "TaskView",
      "A2AMCPShim"
    ],
    "verified_functions": [
      "poll_until_terminal",
      "__init__",
      "read_forward",
      "read_reverse"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ShimTerminalityViolation",
      "ShimVersionRegression"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
