{
  "command": [
    "D:\\work\\CodexFDE\\.venv\\Scripts\\python.exe",
    "-X",
    "utf8",
    "D:\\work\\CodexFDE\\docs\\courses\\L08\\examples\\atomic_reservation_lab.py",
    "write-error"
  ],
  "cwd": "D:\\work\\CodexFDE",
  "exit_code": 0,
  "stdout": "{\n  \"mode\": \"write-error\",\n  \"evidence_kind\": \"actual_service_temporary_database\",\n  \"status\": \"confirmed\",\n  \"reserved\": [\n    0,\n    0\n  ],\n  \"available\": [\n    5,\n    5\n  ],\n  \"error\": {\n    \"type\": \"IntegrityError\",\n    \"message\": \"L08 injected second-write failure\"\n  },\n  \"all_observed_tables_unchanged\": true,\n  \"observed_tables\": [\n    \"stock_balance\",\n    \"stock_reservations\",\n    \"sales_document_lines\",\n    \"sales_documents\"\n  ],\n  \"before\": {\n    \"stock_balance\": [\n      {\n        \"organization_id\": \"ORG-DEFAULT\",\n        \"product_id\": \"PRD-4C6D9069EA644C8CBD326E56F470274B\",\n        \"location_id\": \"LOC-MAIN-STOCK\",\n        \"lot_id\": \"\",\n        \"on_hand\": 5,\n        \"reserved\": 0,\n        \"incoming\": 0,\n        \"outgoing\": 0,\n        \"updated_at\": \"2026-09-08 16:13:00\",\n        \"version\": 2\n      },\n      {\n        \"organization_id\": \"ORG-DEFAULT\",\n        \"product_id\": \"PRD-FE57DC6655F342CAAB055316975BC32C\",\n        \"location_id\": \"LOC-MAIN-STOCK\",\n        \"lot_id\": \"\",\n        \"on_hand\": 5,\n        \"reserved\": 0,\n        \"incoming\": 0,\n        \"outgoing\": 0,\n        \"updated_at\": \"2026-09-08 16:13:00\",\n        \"version\": 2\n      }\n    ],\n    \"stock_reservations\": [],\n    \"sales_document_lines\": [\n      {\n        \"id\": \"SOL-69A5B2DC971C4165A8A3E3AF72362A3F\",\n        \"document_id\": \"SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"line_number\": 1,\n        \"product_id\": \"PRD-4C6D9069EA644C8CBD326E56F470274B\",\n        \"description\": \"A\",\n        \"ordered_quantity\": 2,\n        \"reserved_quantity\": 0,\n        \"shipped_quantity\": 0,\n        \"returned_quantity\": 0,\n        \"unit_price_cents\": 1000,\n        \"discount_basis_points\": 0,\n        \"tax_rate_basis_points\": 1300,\n        \"net_cents\": 2000,\n        \"tax_cents\": 260,\n        \"total_cents\": 2260,\n        \"warehouse_id\": \"SITE-MAIN\"\n      },\n      {\n        \"id\": \"SOL-C18128B60902446FB21788D1D21C6A32\",\n        \"document_id\": \"SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"line_number\": 2,\n        \"product_id\": \"PRD-FE57DC6655F342CAAB055316975BC32C\",\n        \"description\": \"B\",\n        \"ordered_quantity\": 3,\n        \"reserved_quantity\": 0,\n        \"shipped_quantity\": 0,\n        \"returned_quantity\": 0,\n        \"unit_price_cents\": 1000,\n        \"discount_basis_points\": 0,\n        \"tax_rate_basis_points\": 1300,\n        \"net_cents\": 3000,\n        \"tax_cents\": 390,\n        \"total_cents\": 3390,\n        \"warehouse_id\": \"SITE-MAIN\"\n      }\n    ],\n    \"sales_documents\": [\n      {\n        \"id\": \"SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"organization_id\": \"ORG-DEFAULT\",\n        \"document_number\": \"SO-20260909-00001\",\n        \"document_type\": \"order\",\n        \"customer_id\": \"CUS-91D71E8402D349AC8EB1DDC64D04F10A\",\n        \"status\": \"confirmed\",\n        \"order_date\": \"2026-09-09\",\n        \"requested_delivery_date\": null,\n        \"currency\": \"CNY\",\n        \"exchange_rate_micros\": 1000000,\n        \"subtotal_cents\": 5000,\n        \"discount_cents\": 0,\n        \"tax_cents\": 650,\n        \"freight_cents\": 0,\n        \"total_cents\": 5650,\n        \"paid_cents\": 0,\n        \"shipping_address\": \"\",\n        \"billing_address\": \"\",\n        \"channel\": \"direct\",\n        \"external_reference\": \"__internal__:SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"notes\": \"\",\n        \"cancellation_reason\": \"\",\n        \"confirmed_at\": \"2026-09-08 16:13:00\",\n        \"shipped_at\": null,\n        \"cancelled_at\": null,\n        \"created_by\": \"system\",\n        \"created_at\": \"2026-09-08 16:13:00\",\n        \"updated_at\": \"2026-09-08 16:13:00\",\n        \"version\": 2\n      }\n    ]\n  },\n  \"after\": {\n    \"stock_balance\": [\n      {\n        \"organization_id\": \"ORG-DEFAULT\",\n        \"product_id\": \"PRD-4C6D9069EA644C8CBD326E56F470274B\",\n        \"location_id\": \"LOC-MAIN-STOCK\",\n        \"lot_id\": \"\",\n        \"on_hand\": 5,\n        \"reserved\": 0,\n        \"incoming\": 0,\n        \"outgoing\": 0,\n        \"updated_at\": \"2026-09-08 16:13:00\",\n        \"version\": 2\n      },\n      {\n        \"organization_id\": \"ORG-DEFAULT\",\n        \"product_id\": \"PRD-FE57DC6655F342CAAB055316975BC32C\",\n        \"location_id\": \"LOC-MAIN-STOCK\",\n        \"lot_id\": \"\",\n        \"on_hand\": 5,\n        \"reserved\": 0,\n        \"incoming\": 0,\n        \"outgoing\": 0,\n        \"updated_at\": \"2026-09-08 16:13:00\",\n        \"version\": 2\n      }\n    ],\n    \"stock_reservations\": [],\n    \"sales_document_lines\": [\n      {\n        \"id\": \"SOL-69A5B2DC971C4165A8A3E3AF72362A3F\",\n        \"document_id\": \"SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"line_number\": 1,\n        \"product_id\": \"PRD-4C6D9069EA644C8CBD326E56F470274B\",\n        \"description\": \"A\",\n        \"ordered_quantity\": 2,\n        \"reserved_quantity\": 0,\n        \"shipped_quantity\": 0,\n        \"returned_quantity\": 0,\n        \"unit_price_cents\": 1000,\n        \"discount_basis_points\": 0,\n        \"tax_rate_basis_points\": 1300,\n        \"net_cents\": 2000,\n        \"tax_cents\": 260,\n        \"total_cents\": 2260,\n        \"warehouse_id\": \"SITE-MAIN\"\n      },\n      {\n        \"id\": \"SOL-C18128B60902446FB21788D1D21C6A32\",\n        \"document_id\": \"SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"line_number\": 2,\n        \"product_id\": \"PRD-FE57DC6655F342CAAB055316975BC32C\",\n        \"description\": \"B\",\n        \"ordered_quantity\": 3,\n        \"reserved_quantity\": 0,\n        \"shipped_quantity\": 0,\n        \"returned_quantity\": 0,\n        \"unit_price_cents\": 1000,\n        \"discount_basis_points\": 0,\n        \"tax_rate_basis_points\": 1300,\n        \"net_cents\": 3000,\n        \"tax_cents\": 390,\n        \"total_cents\": 3390,\n        \"warehouse_id\": \"SITE-MAIN\"\n      }\n    ],\n    \"sales_documents\": [\n      {\n        \"id\": \"SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"organization_id\": \"ORG-DEFAULT\",\n        \"document_number\": \"SO-20260909-00001\",\n        \"document_type\": \"order\",\n        \"customer_id\": \"CUS-91D71E8402D349AC8EB1DDC64D04F10A\",\n        \"status\": \"confirmed\",\n        \"order_date\": \"2026-09-09\",\n        \"requested_delivery_date\": null,\n        \"currency\": \"CNY\",\n        \"exchange_rate_micros\": 1000000,\n        \"subtotal_cents\": 5000,\n        \"discount_cents\": 0,\n        \"tax_cents\": 650,\n        \"freight_cents\": 0,\n        \"total_cents\": 5650,\n        \"paid_cents\": 0,\n        \"shipping_address\": \"\",\n        \"billing_address\": \"\",\n        \"channel\": \"direct\",\n        \"external_reference\": \"__internal__:SAL-3AE92E166D7C4A02983751A6C1793C0A\",\n        \"notes\": \"\",\n        \"cancellation_reason\": \"\",\n        \"confirmed_at\": \"2026-09-08 16:13:00\",\n        \"shipped_at\": null,\n        \"cancelled_at\": null,\n        \"created_by\": \"system\",\n        \"created_at\": \"2026-09-08 16:13:00\",\n        \"updated_at\": \"2026-09-08 16:13:00\",\n        \"version\": 2\n      }\n    ]\n  },\n  \"real_remote_run\": false\n}\n",
  "stderr": "",
  "source_sha256": "04995cc079904bc0e8840d83b2f423cd8a035bc02f028eda6bdbe52b0166d63b",
  "result": {
    "mode": "write-error",
    "evidence_kind": "actual_service_temporary_database",
    "status": "confirmed",
    "reserved": [
      0,
      0
    ],
    "available": [
      5,
      5
    ],
    "error": {
      "type": "IntegrityError",
      "message": "L08 injected second-write failure"
    },
    "all_observed_tables_unchanged": true,
    "observed_tables": [
      "stock_balance",
      "stock_reservations",
      "sales_document_lines",
      "sales_documents"
    ],
    "before": {
      "stock_balance": [
        {
          "organization_id": "ORG-DEFAULT",
          "product_id": "PRD-4C6D9069EA644C8CBD326E56F470274B",
          "location_id": "LOC-MAIN-STOCK",
          "lot_id": "",
          "on_hand": 5,
          "reserved": 0,
          "incoming": 0,
          "outgoing": 0,
          "updated_at": "2026-09-08 16:13:00",
          "version": 2
        },
        {
          "organization_id": "ORG-DEFAULT",
          "product_id": "PRD-FE57DC6655F342CAAB055316975BC32C",
          "location_id": "LOC-MAIN-STOCK",
          "lot_id": "",
          "on_hand": 5,
          "reserved": 0,
          "incoming": 0,
          "outgoing": 0,
          "updated_at": "2026-09-08 16:13:00",
          "version": 2
        }
      ],
      "stock_reservations": [],
      "sales_document_lines": [
        {
          "id": "SOL-69A5B2DC971C4165A8A3E3AF72362A3F",
          "document_id": "SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "line_number": 1,
          "product_id": "PRD-4C6D9069EA644C8CBD326E56F470274B",
          "description": "A",
          "ordered_quantity": 2,
          "reserved_quantity": 0,
          "shipped_quantity": 0,
          "returned_quantity": 0,
          "unit_price_cents": 1000,
          "discount_basis_points": 0,
          "tax_rate_basis_points": 1300,
          "net_cents": 2000,
          "tax_cents": 260,
          "total_cents": 2260,
          "warehouse_id": "SITE-MAIN"
        },
        {
          "id": "SOL-C18128B60902446FB21788D1D21C6A32",
          "document_id": "SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "line_number": 2,
          "product_id": "PRD-FE57DC6655F342CAAB055316975BC32C",
          "description": "B",
          "ordered_quantity": 3,
          "reserved_quantity": 0,
          "shipped_quantity": 0,
          "returned_quantity": 0,
          "unit_price_cents": 1000,
          "discount_basis_points": 0,
          "tax_rate_basis_points": 1300,
          "net_cents": 3000,
          "tax_cents": 390,
          "total_cents": 3390,
          "warehouse_id": "SITE-MAIN"
        }
      ],
      "sales_documents": [
        {
          "id": "SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "organization_id": "ORG-DEFAULT",
          "document_number": "SO-20260909-00001",
          "document_type": "order",
          "customer_id": "CUS-91D71E8402D349AC8EB1DDC64D04F10A",
          "status": "confirmed",
          "order_date": "2026-09-09",
          "requested_delivery_date": null,
          "currency": "CNY",
          "exchange_rate_micros": 1000000,
          "subtotal_cents": 5000,
          "discount_cents": 0,
          "tax_cents": 650,
          "freight_cents": 0,
          "total_cents": 5650,
          "paid_cents": 0,
          "shipping_address": "",
          "billing_address": "",
          "channel": "direct",
          "external_reference": "__internal__:SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "notes": "",
          "cancellation_reason": "",
          "confirmed_at": "2026-09-08 16:13:00",
          "shipped_at": null,
          "cancelled_at": null,
          "created_by": "system",
          "created_at": "2026-09-08 16:13:00",
          "updated_at": "2026-09-08 16:13:00",
          "version": 2
        }
      ]
    },
    "after": {
      "stock_balance": [
        {
          "organization_id": "ORG-DEFAULT",
          "product_id": "PRD-4C6D9069EA644C8CBD326E56F470274B",
          "location_id": "LOC-MAIN-STOCK",
          "lot_id": "",
          "on_hand": 5,
          "reserved": 0,
          "incoming": 0,
          "outgoing": 0,
          "updated_at": "2026-09-08 16:13:00",
          "version": 2
        },
        {
          "organization_id": "ORG-DEFAULT",
          "product_id": "PRD-FE57DC6655F342CAAB055316975BC32C",
          "location_id": "LOC-MAIN-STOCK",
          "lot_id": "",
          "on_hand": 5,
          "reserved": 0,
          "incoming": 0,
          "outgoing": 0,
          "updated_at": "2026-09-08 16:13:00",
          "version": 2
        }
      ],
      "stock_reservations": [],
      "sales_document_lines": [
        {
          "id": "SOL-69A5B2DC971C4165A8A3E3AF72362A3F",
          "document_id": "SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "line_number": 1,
          "product_id": "PRD-4C6D9069EA644C8CBD326E56F470274B",
          "description": "A",
          "ordered_quantity": 2,
          "reserved_quantity": 0,
          "shipped_quantity": 0,
          "returned_quantity": 0,
          "unit_price_cents": 1000,
          "discount_basis_points": 0,
          "tax_rate_basis_points": 1300,
          "net_cents": 2000,
          "tax_cents": 260,
          "total_cents": 2260,
          "warehouse_id": "SITE-MAIN"
        },
        {
          "id": "SOL-C18128B60902446FB21788D1D21C6A32",
          "document_id": "SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "line_number": 2,
          "product_id": "PRD-FE57DC6655F342CAAB055316975BC32C",
          "description": "B",
          "ordered_quantity": 3,
          "reserved_quantity": 0,
          "shipped_quantity": 0,
          "returned_quantity": 0,
          "unit_price_cents": 1000,
          "discount_basis_points": 0,
          "tax_rate_basis_points": 1300,
          "net_cents": 3000,
          "tax_cents": 390,
          "total_cents": 3390,
          "warehouse_id": "SITE-MAIN"
        }
      ],
      "sales_documents": [
        {
          "id": "SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "organization_id": "ORG-DEFAULT",
          "document_number": "SO-20260909-00001",
          "document_type": "order",
          "customer_id": "CUS-91D71E8402D349AC8EB1DDC64D04F10A",
          "status": "confirmed",
          "order_date": "2026-09-09",
          "requested_delivery_date": null,
          "currency": "CNY",
          "exchange_rate_micros": 1000000,
          "subtotal_cents": 5000,
          "discount_cents": 0,
          "tax_cents": 650,
          "freight_cents": 0,
          "total_cents": 5650,
          "paid_cents": 0,
          "shipping_address": "",
          "billing_address": "",
          "channel": "direct",
          "external_reference": "__internal__:SAL-3AE92E166D7C4A02983751A6C1793C0A",
          "notes": "",
          "cancellation_reason": "",
          "confirmed_at": "2026-09-08 16:13:00",
          "shipped_at": null,
          "cancelled_at": null,
          "created_by": "system",
          "created_at": "2026-09-08 16:13:00",
          "updated_at": "2026-09-08 16:13:00",
          "version": 2
        }
      ]
    },
    "real_remote_run": false
  },
  "real_remote_run": false
}