{
  "schemaVersion": 1,
  "tool": {
    "name": "skewcheck",
    "version": "0.1.0"
  },
  "executionId": "example-C-assertion-drift",
  "project": "fixture/C-assertion-drift",
  "createdAt": "2026-10-24T18:29:57.610Z",
  "baselineRevision": "shop-v1",
  "candidateRevision": "C-assertion-drift",
  "database": {
    "serverVersion": "16.15 (Debian 16.15-1.pgdg12+2)"
  },
  "proposedMigrations": [
    "002_status_default.sql"
  ],
  "experiment": [
    "control: old application (shop-v1) × baseline schema (1 migrations)",
    "candidate ×2: old application (shop-v1) × proposed schema (2 migrations)"
  ],
  "verdict": "ADVISORY",
  "blocking": false,
  "exitCode": 0,
  "summary": "Something changed for the previous application version, but the evidence is not sufficient to call it a compatibility regression.",
  "reasons": [
    "test/orders.test.js: assertion drift"
  ],
  "recommendedAction": "Review the listed findings and decide whether the old version's changed behaviour is acceptable during rollout.",
  "complete": true,
  "findings": [
    {
      "kind": "assertion_drift",
      "test": "test/orders.test.js",
      "facts": [
        "test/orders.test.js passes on the baseline schema and fails in all candidate runs without any new database error.",
        "Test output (tail):   error: |- |     Expected values to be strictly equal: |   code: 'ERR_ASSERTION' |   name: 'AssertionError'"
      ],
      "interpretation": "Likely a changed value or behaviour rather than a schema incompatibility (behavioural changes in this migration: Column orders.status default 'new'::text → 'pending'::text). A human should decide whether the old application's expectation still matters while both versions run.",
      "changeIds": [
        "column_default_changed:orders.status"
      ]
    }
  ],
  "schemaChanges": [
    {
      "id": "column_default_changed:orders.status",
      "kind": "column_default_changed",
      "risk": "behavioral",
      "schema": "public",
      "table": "orders",
      "column": "status",
      "before": "'new'::text",
      "after": "'pending'::text",
      "exercisedBy": [
        "insert"
      ],
      "note": "Inserts that omit this column will store a different value."
    }
  ],
  "coverage": [
    {
      "changeId": "column_default_changed:orders.status",
      "target": "orders.status",
      "risk": "behavioral",
      "required": true,
      "exercised": true,
      "statementCount": 2,
      "tests": [
        "test/orders.test.js"
      ],
      "staticReferences": [
        "src/orders.js:5",
        "src/orders.js:12",
        "src/orders.js:16",
        "test/orders.test.js:9",
        "test/orders.test.js:12"
      ]
    }
  ],
  "coverageSummary": "1 of 1 risk-bearing schema change(s) were exercised by the old application's tests in the control run.",
  "runs": [
    {
      "id": "ctl",
      "label": "control (old app × baseline schema)",
      "app": "baseline",
      "schema": "baseline",
      "database": "sc_ctl",
      "revision": "shop-v1",
      "completed": true,
      "migrations": [
        {
          "file": "001_init.sql",
          "ok": true
        }
      ],
      "tests": [
        {
          "test": "test/customers.test.js",
          "outcome": "pass",
          "exitCode": 0,
          "durationMs": 103,
          "outputTail": "TAP version 13\n# Subtest: signs up a customer and finds them by email\nok 1 - signs up a customer and finds them by email\n  ---\n  duration_ms: 10.508789\n  ...\n1..1\n# tests 1\n# suites 0\n# pass 1\n# fail 0\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 73.861289\n"
        },
        {
          "test": "test/orders.test.js",
          "outcome": "pass",
          "exitCode": 0,
          "durationMs": 102,
          "outputTail": "TAP version 13\n# Subtest: new orders start in status \"new\" and can be shipped\nok 1 - new orders start in status \"new\" and can be shipped\n  ---\n  duration_ms: 13.362002\n  ...\n1..1\n# tests 1\n# suites 0\n# pass 1\n# fail 0\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 75.922529\n"
        }
      ],
      "errors": [],
      "statements": 7
    },
    {
      "id": "cand1",
      "label": "candidate #1 (old app × proposed schema)",
      "app": "baseline",
      "schema": "candidate",
      "database": "sc_cand1",
      "revision": "shop-v1",
      "completed": true,
      "migrations": [
        {
          "file": "001_init.sql",
          "ok": true
        },
        {
          "file": "002_status_default.sql",
          "ok": true
        }
      ],
      "tests": [
        {
          "test": "test/customers.test.js",
          "outcome": "pass",
          "exitCode": 0,
          "durationMs": 100,
          "outputTail": "TAP version 13\n# Subtest: signs up a customer and finds them by email\nok 1 - signs up a customer and finds them by email\n  ---\n  duration_ms: 10.663535\n  ...\n1..1\n# tests 1\n# suites 0\n# pass 1\n# fail 0\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 71.590066\n"
        },
        {
          "test": "test/orders.test.js",
          "outcome": "fail",
          "exitCode": 1,
          "durationMs": 100,
          "outputTail": "TAP version 13\n# Subtest: new orders start in status \"new\" and can be shipped\nnot ok 1 - new orders start in status \"new\" and can be shipped\n  ---\n  duration_ms: 11.398998\n  location: '<app>/test/orders.test.js:9:1'\n  failureType: 'testCodeFailure'\n  error: |-\n    Expected values to be strictly equal:\n    \n    'pending' !== 'new'\n    \n  code: 'ERR_ASSERTION'\n  name: 'AssertionError'\n  expected: 'new'\n  actual: 'pending'\n  operator: 'strictEqual'\n  stack: |-\n    TestContext.<anonymous> (<app>/test/orders.test.js:12:10)\n    process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    async Test.run (node:internal/test_runner/test:935:9)\n    async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3)\n  ...\n1..1\n# tests 1\n# suites 0\n# pass 0\n# fail 1\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 72.532381\n"
        }
      ],
      "errors": [],
      "statements": 4
    },
    {
      "id": "cand2",
      "label": "candidate #2 (old app × proposed schema)",
      "app": "baseline",
      "schema": "candidate",
      "database": "sc_cand2",
      "revision": "shop-v1",
      "completed": true,
      "migrations": [
        {
          "file": "001_init.sql",
          "ok": true
        },
        {
          "file": "002_status_default.sql",
          "ok": true
        }
      ],
      "tests": [
        {
          "test": "test/customers.test.js",
          "outcome": "pass",
          "exitCode": 0,
          "durationMs": 97,
          "outputTail": "TAP version 13\n# Subtest: signs up a customer and finds them by email\nok 1 - signs up a customer and finds them by email\n  ---\n  duration_ms: 10.17595\n  ...\n1..1\n# tests 1\n# suites 0\n# pass 1\n# fail 0\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 70.002439\n"
        },
        {
          "test": "test/orders.test.js",
          "outcome": "fail",
          "exitCode": 1,
          "durationMs": 99,
          "outputTail": "TAP version 13\n# Subtest: new orders start in status \"new\" and can be shipped\nnot ok 1 - new orders start in status \"new\" and can be shipped\n  ---\n  duration_ms: 11.811819\n  location: '<app>/test/orders.test.js:9:1'\n  failureType: 'testCodeFailure'\n  error: |-\n    Expected values to be strictly equal:\n    \n    'pending' !== 'new'\n    \n  code: 'ERR_ASSERTION'\n  name: 'AssertionError'\n  expected: 'new'\n  actual: 'pending'\n  operator: 'strictEqual'\n  stack: |-\n    TestContext.<anonymous> (<app>/test/orders.test.js:12:10)\n    process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    async Test.run (node:internal/test_runner/test:935:9)\n    async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3)\n  ...\n1..1\n# tests 1\n# suites 0\n# pass 0\n# fail 1\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 72.564437\n"
        }
      ],
      "errors": [],
      "statements": 4
    }
  ],
  "skippedChecks": [
    "Current application × proposed schema (no current app configured).",
    "Performance / lock-time analysis (out of scope)."
  ],
  "limitations": [
    "Skewcheck only observes code paths that the old application's tests execute; untested paths are reported as coverage gaps, not as safe.",
    "Coverage is identifier-level: a statement \"touches\" a changed object when it names the table (and column, or uses *). It is not a SQL parser.",
    "Correlation between an error and a schema change uses a fixed set of deterministic rules (R1–R6). Anything else is reported as ADVISORY, never UNSAFE.",
    "Performance, locking and migration runtime on production-sized data are not evaluated.",
    "Test files of one run share a database and run sequentially; ordering effects are identical across runs but are not isolated.",
    "Data-only migration effects are detected only when a test asserts on the affected data."
  ],
  "policy": {
    "advisory": "warn",
    "noEvidence": "block",
    "inconclusive": "block",
    "candidateRepeats": 2,
    "testTimeoutMs": 60000,
    "maxBaselineFailureRatio": 0.5,
    "protectedPaths": [],
    "repairBranchPrefixes": [
      "skewcheck-repair/"
    ]
  }
}