{
  "schemaVersion": 1,
  "contract": "kungfu-buildchain-v4-delivery-warrant-shadow-fixtures",
  "canonicalization": "buildchain-canonical-json/v1",
  "clock": "explicit-input-only",
  "projection": [
    "action-or-typed-error",
    "expected-old-and-next-state-roots",
    "receipt-root",
    "generation-and-fencing-counter",
    "active-pull-request",
    "ordered-candidate-statuses"
  ],
  "traces": [
    {
      "id": "submission-selection-heartbeat-close",
      "create": {
        "repository": "kungfu-systems/buildchain",
        "protectedBase": "dev/v4/v4.0",
        "policy": { "agingSeconds": 300, "leaseSeconds": 600 },
        "now": "2026-08-07T00:00:00Z"
      },
      "steps": [
        {
          "id": "submit-101",
          "operation": "submit",
          "pullRequestNumber": 101,
          "overrides": { "deliveryClass": "non-native-fast" },
          "now": "2026-08-07T00:00:01Z"
        },
        {
          "id": "submit-102",
          "operation": "submit",
          "pullRequestNumber": 102,
          "overrides": {
            "deliveryClass": "non-native-fast",
            "priority": "expedited"
          },
          "now": "2026-08-07T00:00:02Z"
        },
        {
          "id": "duplicate-101",
          "operation": "submit",
          "pullRequestNumber": 101,
          "overrides": { "deliveryClass": "non-native-fast" },
          "now": "2026-08-07T00:00:03Z"
        },
        {
          "id": "select",
          "operation": "select",
          "saveWarrant": "selected",
          "now": "2026-08-07T00:00:04Z"
        },
        {
          "id": "renew",
          "operation": "heartbeat",
          "useWarrant": "selected",
          "now": "2026-08-07T00:01:00Z"
        },
        {
          "id": "close",
          "operation": "close",
          "useWarrant": "selected",
          "outcome": "merged",
          "reason": "exact merge group passed",
          "now": "2026-08-07T00:02:00Z"
        }
      ],
      "expectedLegacyProjectionRoot": "sha256:eb860ad33e3abb6a93c0635b0f06b4f433bc9b76deaa8e7b648e0ef2e296679b"
    },
    {
      "id": "lease-expiry-and-stale-fence",
      "create": {
        "repository": "kungfu-systems/buildchain",
        "protectedBase": "dev/v4/v4.0",
        "policy": { "agingSeconds": 300, "leaseSeconds": 60 },
        "now": "2026-08-07T01:00:00Z"
      },
      "steps": [
        {
          "id": "submit",
          "operation": "submit",
          "pullRequestNumber": 120,
          "overrides": {
            "environmentRoot": "sha256:9999999999999999999999999999999999999999999999999999999999999999",
            "nativeCommandContract": {
              "schema": "kungfu.buildchain.native-command-contract/v1",
              "runner": "bash-lc",
              "command": "node --test tests/v4-warrant-shadow-plan.test.mjs",
              "commandRoot": "sha256:4d9a03536802c46fe254f247b7236925aec49d789e5e9ac7b2dceac08d7cefab"
            }
          },
          "now": "2026-08-07T01:00:01Z"
        },
        {
          "id": "submit-successor",
          "operation": "submit",
          "pullRequestNumber": 121,
          "overrides": { "deliveryClass": "non-native-fast" },
          "now": "2026-08-07T01:00:02Z"
        },
        {
          "id": "select-old",
          "operation": "select",
          "saveWarrant": "old",
          "leaseSeconds": 60,
          "now": "2026-08-07T01:00:03Z"
        },
        {
          "id": "recover",
          "operation": "recover-expired",
          "now": "2026-08-07T01:02:00Z"
        },
        {
          "id": "close-expired",
          "operation": "close",
          "useWarrant": "old",
          "outcome": "terminal-failure",
          "reason": "fenced native worker stop proved",
          "now": "2026-08-07T01:02:01Z"
        },
        {
          "id": "select-new",
          "operation": "select",
          "saveWarrant": "new",
          "leaseSeconds": 60,
          "now": "2026-08-07T01:02:02Z"
        },
        {
          "id": "reject-old",
          "operation": "heartbeat",
          "useWarrant": "old",
          "expectError": "stale-fencing-token",
          "now": "2026-08-07T01:02:03Z"
        }
      ],
      "expectedLegacyProjectionRoot": "sha256:3f734b04ac8baaf84a95d9f8746db5fd41dbfd73f147de2f884c09e373157aa9"
    },
    {
      "id": "settlement-idempotence",
      "create": {
        "repository": "kungfu-systems/buildchain",
        "protectedBase": "dev/v4/v4.0",
        "policy": { "agingSeconds": 300, "leaseSeconds": 600 },
        "now": "2026-08-07T02:00:00Z"
      },
      "steps": [
        {
          "id": "not-applicable",
          "operation": "settle-not-applicable",
          "pullRequestNumber": 149,
          "sourceHead": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "outcome": "merged",
          "reason": "terminal before Warrant admission",
          "now": "2026-08-07T02:00:01Z"
        },
        {
          "id": "submit",
          "operation": "submit",
          "pullRequestNumber": 150,
          "overrides": { "deliveryClass": "non-native-fast" },
          "now": "2026-08-07T02:00:02Z"
        },
        {
          "id": "select",
          "operation": "select",
          "saveWarrant": "active",
          "now": "2026-08-07T02:00:03Z"
        },
        {
          "id": "settle",
          "operation": "settle-active",
          "useWarrant": "active",
          "saveSettlement": "terminal",
          "outcome": "merged",
          "reason": "exact merge group passed",
          "now": "2026-08-07T02:01:00Z"
        },
        {
          "id": "duplicate",
          "operation": "settle-duplicate",
          "useSettlement": "terminal",
          "now": "2026-08-07T02:02:00Z"
        }
      ],
      "expectedLegacyProjectionRoot": "sha256:b71de84b0483fcce3f0ba1f45ac20dead3227fc24a62769192eb16abca7f3a2f"
    },
    {
      "id": "queued-cancellation-idempotence",
      "create": {
        "repository": "kungfu-systems/buildchain",
        "protectedBase": "dev/v4/v4.0",
        "policy": { "agingSeconds": 300, "leaseSeconds": 600 },
        "now": "2026-08-07T03:00:00Z"
      },
      "steps": [
        {
          "id": "submit",
          "operation": "submit",
          "pullRequestNumber": 151,
          "overrides": { "deliveryClass": "non-native-fast" },
          "now": "2026-08-07T03:00:01Z"
        },
        {
          "id": "cancel",
          "operation": "cancel-queued",
          "pullRequestNumber": 151,
          "observedSourceHead": "ffffffffffffffffffffffffffffffffffffffff",
          "reason": "pull request closed",
          "now": "2026-08-07T03:00:02Z"
        },
        {
          "id": "duplicate",
          "operation": "cancel-queued",
          "pullRequestNumber": 151,
          "observedSourceHead": "ffffffffffffffffffffffffffffffffffffffff",
          "reason": "pull request closed",
          "now": "2026-08-07T03:00:03Z"
        }
      ],
      "expectedLegacyProjectionRoot": "sha256:a9ce9cad968234febd2ef74c2e6fab77f45899bc5dd74ee7128cadd02a997b8c"
    },
    {
      "id": "cas-response-loss-provider-conflict",
      "create": {
        "repository": "kungfu-systems/buildchain",
        "protectedBase": "dev/v4/v4.0",
        "policy": { "agingSeconds": 300, "leaseSeconds": 600 },
        "now": "2026-08-07T04:00:00Z"
      },
      "steps": [
        {
          "id": "submit",
          "operation": "submit",
          "pullRequestNumber": 160,
          "overrides": { "deliveryClass": "non-native-fast" },
          "now": "2026-08-07T04:00:01Z"
        },
        {
          "id": "accept-current",
          "operation": "expected-old",
          "expectedRoot": "submit"
        },
        {
          "id": "reject-stale",
          "operation": "expected-old",
          "expectedRoot": "initial"
        },
        {
          "id": "readback",
          "operation": "response-loss-readback",
          "committedRoot": "submit"
        },
        { "id": "provider-stop", "operation": "provider-conflict" }
      ],
      "expectedLegacyProjectionRoot": "sha256:be002515ae6304c3cd325ee4bb6d07e6229922d620389285474325eb20aa27e9"
    }
  ]
}
