{
  "schemaVersion": 1,
  "tool": {
    "name": "skewcheck",
    "version": "0.1.0"
  },
  "executionId": "example-F-preexisting-failure",
  "project": "fixture/F-preexisting-failure",
  "createdAt": "2026-10-24T18:30:01.699Z",
  "baselineRevision": "shop-v1-with-broken-test",
  "candidateRevision": "F-preexisting-failure",
  "database": {
    "serverVersion": "16.15 (Debian 16.15-1.pgdg12+2)"
  },
  "proposedMigrations": [
    "002_loyalty.sql"
  ],
  "experiment": [
    "control: old application (shop-v1-with-broken-test) × baseline schema (1 migrations)",
    "candidate ×2: old application (shop-v1-with-broken-test) × proposed schema (2 migrations)"
  ],
  "verdict": "SAFE",
  "blocking": false,
  "exitCode": 0,
  "summary": "No supported incompatibility was detected under the conditions tested. This is not a universal safety guarantee.",
  "reasons": [],
  "recommendedAction": "Proceed with normal review. Keep the old application's tests meaningful; SAFE only covers what they exercise.",
  "complete": true,
  "findings": [
    {
      "kind": "preexisting_failure",
      "test": "test/reports.test.js",
      "facts": [
        "test/reports.test.js fails on the baseline schema and on the proposed schema."
      ],
      "interpretation": "Pre-existing failure; not attributed to the proposed migration and not used as evidence."
    }
  ],
  "schemaChanges": [
    {
      "id": "table_added:audit_log",
      "kind": "table_added",
      "risk": "inert",
      "schema": "public",
      "table": "audit_log",
      "after": "table"
    },
    {
      "id": "column_added:customers.loyalty_tier",
      "kind": "column_added",
      "risk": "inert",
      "schema": "public",
      "table": "customers",
      "column": "loyalty_tier",
      "after": "text"
    },
    {
      "id": "index_added:orders.orders_created_at_idx",
      "kind": "index_added",
      "risk": "inert",
      "schema": "public",
      "table": "orders",
      "object": "orders_created_at_idx",
      "after": "CREATE INDEX orders_created_at_idx ON public.orders USING btree (created_at)"
    }
  ],
  "coverage": [
    {
      "changeId": "table_added:audit_log",
      "target": "audit_log",
      "risk": "inert",
      "required": false,
      "exercised": false,
      "statementCount": 0,
      "tests": [],
      "staticReferences": []
    },
    {
      "changeId": "column_added:customers.loyalty_tier",
      "target": "customers.loyalty_tier",
      "risk": "inert",
      "required": false,
      "exercised": true,
      "statementCount": 4,
      "tests": [
        "test/customers.test.js",
        "test/orders.test.js",
        "test/reports.test.js"
      ],
      "staticReferences": []
    },
    {
      "changeId": "index_added:orders.orders_created_at_idx",
      "target": "orders.orders_created_at_idx",
      "risk": "inert",
      "required": false,
      "exercised": true,
      "statementCount": 4,
      "tests": [
        "test/orders.test.js"
      ],
      "staticReferences": []
    }
  ],
  "coverageSummary": "All 3 schema change(s) are additive and cannot affect statements the old application issues; no coverage is required.",
  "runs": [
    {
      "id": "ctl",
      "label": "control (old app × baseline schema)",
      "app": "baseline",
      "schema": "baseline",
      "database": "sc_ctl",
      "revision": "shop-v1-with-broken-test",
      "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.493326\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 74.638333\n"
        },
        {
          "test": "test/orders.test.js",
          "outcome": "pass",
          "exitCode": 0,
          "durationMs": 101,
          "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: 14.120237\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 74.321036\n"
        },
        {
          "test": "test/reports.test.js",
          "outcome": "fail",
          "exitCode": 1,
          "durationMs": 95,
          "outputTail": "TAP version 13\n# Subtest: exports customer phone list\nnot ok 1 - exports customer phone list\n  ---\n  duration_ms: 8.754304\n  location: '<app>/test/reports.test.js:8:1'\n  failureType: 'testCodeFailure'\n  error: 'column \"phone\" does not exist'\n  code: '42703'\n  name: 'error'\n  stack: |-\n    <skewcheck>/node_modules/pg-pool/index.js:45:11\n    process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    async TestContext.<anonymous> (<app>/test/reports.test.js:9:13)\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 68.954811\n"
        }
      ],
      "errors": [
        {
          "run": "ctl",
          "test": "test/reports.test.js",
          "sqlstate": "42703",
          "message": "column \"phone\" does not exist",
          "detail": null,
          "statement": "SELECT name, phone FROM customers",
          "fingerprint": "select name , phone from customers",
          "key": "42703|column \"phone\" does not exist|select name , phone from customers",
          "severity": "ERROR",
          "objects": {
            "column": "phone"
          }
        }
      ],
      "statements": 8
    },
    {
      "id": "cand1",
      "label": "candidate #1 (old app × proposed schema)",
      "app": "baseline",
      "schema": "candidate",
      "database": "sc_cand1",
      "revision": "shop-v1-with-broken-test",
      "completed": true,
      "migrations": [
        {
          "file": "001_init.sql",
          "ok": true
        },
        {
          "file": "002_loyalty.sql",
          "ok": true
        }
      ],
      "tests": [
        {
          "test": "test/customers.test.js",
          "outcome": "pass",
          "exitCode": 0,
          "durationMs": 120,
          "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: 19.440923\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 86.458768\n"
        },
        {
          "test": "test/orders.test.js",
          "outcome": "pass",
          "exitCode": 0,
          "durationMs": 101,
          "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: 14.387895\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 74.728212\n"
        },
        {
          "test": "test/reports.test.js",
          "outcome": "fail",
          "exitCode": 1,
          "durationMs": 97,
          "outputTail": "TAP version 13\n# Subtest: exports customer phone list\nnot ok 1 - exports customer phone list\n  ---\n  duration_ms: 8.846519\n  location: '<app>/test/reports.test.js:8:1'\n  failureType: 'testCodeFailure'\n  error: 'column \"phone\" does not exist'\n  code: '42703'\n  name: 'error'\n  stack: |-\n    <skewcheck>/node_modules/pg-pool/index.js:45:11\n    process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    async TestContext.<anonymous> (<app>/test/reports.test.js:9:13)\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 68.916355\n"
        }
      ],
      "errors": [
        {
          "run": "cand1",
          "test": "test/reports.test.js",
          "sqlstate": "42703",
          "message": "column \"phone\" does not exist",
          "detail": null,
          "statement": "SELECT name, phone FROM customers",
          "fingerprint": "select name , phone from customers",
          "key": "42703|column \"phone\" does not exist|select name , phone from customers",
          "severity": "ERROR",
          "objects": {
            "column": "phone"
          }
        }
      ],
      "statements": 8
    },
    {
      "id": "cand2",
      "label": "candidate #2 (old app × proposed schema)",
      "app": "baseline",
      "schema": "candidate",
      "database": "sc_cand2",
      "revision": "shop-v1-with-broken-test",
      "completed": true,
      "migrations": [
        {
          "file": "001_init.sql",
          "ok": true
        },
        {
          "file": "002_loyalty.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.142431\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 69.495141\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: 14.012203\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 72.816508\n"
        },
        {
          "test": "test/reports.test.js",
          "outcome": "fail",
          "exitCode": 1,
          "durationMs": 110,
          "outputTail": "TAP version 13\n# Subtest: exports customer phone list\nnot ok 1 - exports customer phone list\n  ---\n  duration_ms: 8.766909\n  location: '<app>/test/reports.test.js:8:1'\n  failureType: 'testCodeFailure'\n  error: 'column \"phone\" does not exist'\n  code: '42703'\n  name: 'error'\n  stack: |-\n    <skewcheck>/node_modules/pg-pool/index.js:45:11\n    process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    async TestContext.<anonymous> (<app>/test/reports.test.js:9:13)\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 82.857524\n"
        }
      ],
      "errors": [
        {
          "run": "cand2",
          "test": "test/reports.test.js",
          "sqlstate": "42703",
          "message": "column \"phone\" does not exist",
          "detail": null,
          "statement": "SELECT name, phone FROM customers",
          "fingerprint": "select name , phone from customers",
          "key": "42703|column \"phone\" does not exist|select name , phone from customers",
          "severity": "ERROR",
          "objects": {
            "column": "phone"
          }
        }
      ],
      "statements": 8
    }
  ],
  "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/"
    ]
  }
}