{
  "schema_version": "1.3.0",
  "slug": "across-what-durable-step-ledger-and-reverse-compensation-gates-must-an-instance-orchestrate-multi-service-sagas-to-prevent-orphaned-partial-mutations",
  "title": "Across what durable-step-ledger and reverse-compensation gates must an instance orchestrate multi-service sagas to prevent orphaned partial mutations?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** An AI instance, autonomous coding agent, or backend service coordinates a logical transaction across multiple distinct services, external APIs, or heterogeneous data stores that cannot share a single local ACID database ",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/across-what-durable-step-ledger-and-reverse-compensation-gates-must-an-instance-orchestrate-multi-service-sagas-to-prevent-orphaned-partial-mutations.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/across-what-durable-step-ledger-and-reverse-compensation-gates-must-an-instance-orchestrate-multi-service-sagas-to-prevent-orphaned-partial-mutations.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/across-what-durable-step-ledger-and-reverse-compensation-gates-must-an-instance-orchestrate-multi-service-sagas-to-prevent-orphaned-partial-mutations.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 3356,
    "python_slice_tokens": 796,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Autonomous systems frequently execute business workflows that span multiple independent storage engines or external network services—such as reserving inventory in Service A, charging a credit card in Service B, and provisioning a cloud cluster in Service C. Because no single ACID database transaction (`BEGIN ... ROLLBACK`) can span heterogeneous HTTP APIs, ...",
    "what_was_observed": "In cloud infrastructure provisioners, order-fulfillment pipelines, and multi-agent tool workflows, instances operating without durable step ledgers and LIFO compensation gates exhibit four primary failure modes: 1. **Uncompensated Mid-Sequence Failure (Orphaned Resource Leak):** An orchestrator creates an IAM role (Step 1), provisions a paid GPU instance (Step 2), and fails while attaching a DNS record (Step 3) due t...",
    "condition_of_validity": "* **Applies when:** An AI instance, autonomous coding agent, or backend service coordinates a logical transaction across multiple distinct services, external APIs, or heterogeneous data stores that cannot share a single local ACID database transaction. * **Does not apply when:** All tables being mutated reside within the same relational database instance and...",
    "decision_boundary": "1. **Can all the writes in your workflow fit inside a single database `BEGIN ... COMMIT` transaction?** If yes, use a standard database transaction. Only use a saga when your workflow has to mutate state across separate services or external APIs (like charging Stripe and updating an external inventory service). 2. **When your saga calls an external API in St...",
    "operational_effect": "1. **Write-Ahead Step Intent Persistence:** Across all generated multi-service orchestrators, the instance records `STARTED` state and a deterministic `fwd_idempotency_key` in the saga ledger before issuing any external mutation call. 2. **Idempotent Reverse (`LIFO`) Compensation Loops:** Every reversible step is paired with an idempotent `compensate_fn` inv..."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING"
  ],
  "composition_edges": {
    "primary_domain": "network_timeout_and_idempotent_retries",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/beneath-what-concurrency-and-backpressure-ceilings-must-an-instance-throttle-fan-out-tasks-to-prevent-file-descriptor-and-connection-pool-starvation.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"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/across-what-readiness-unregistration-and-in-flight-drain-gates-must-an-instance-sequence-sigterm-shutdown-to-prevent-dropped-requests-and-truncated-writes.md",
      "https://corpusfetch.com/c/across-what-bounded-queue-admission-control-and-load-shedding-gates-must-an-instance-manage-concurrency-to-prevent-unbounded-memory-growth-and-tail-latency-collapse.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/across-what-deadline-propagation-and-cancellation-cascade-gates-must-an-instance-govern-grpc-and-http2-calls-to-prevent-zombie-worker-exhaustion-and-wasted-compute.md",
      "https://corpusfetch.com/c/across-what-pre-ping-validation-and-idle-recycle-gates-must-an-instance-govern-connection-pools-to-prevent-half-open-socket-crashes-and-session-exhaustion.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "bc7628f1c4527b6529a8ac7018c9cfc73f8eceed8a7b4c5500dfdf467d1a7698",
    "verified_classes": [
      "SagaAbortedError",
      "SagaStepSpec",
      "DurableSagaOrchestrator"
    ],
    "verified_functions": [
      "__init__",
      "__init__",
      "_init_ledger",
      "_record_step_state",
      "execute_saga",
      "_compensate_lifo"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SagaAbortedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "sqlite3",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
