← back to NationalPaperHangers Yfr2 C3

verification/e2e-proof.json

88 lines

{
  "intent": "Implement and verify the first local-only NPH measure-attribution Phase-A slice: pure tier predicates plus an unapplied additive structural migration.",
  "risk_tier": "R1",
  "environment": "isolated git worktree plus uniquely named disposable local PostgreSQL database; no canonical database, runtime service, provider, or customer surface",
  "build_identity": {
    "branch": "yfr2-c3-nph-attribution",
    "parent_commit": "b672493a7a58cc4e84ddd55e41fca84a13521033",
    "ticket": "TK-10960-nph-local-phase-a-attribution-schema-and"
  },
  "timestamp": "2026-08-29T19:51:00-07:00",
  "baseline": "Worktree was clean at the requested parent. The primary NationalPaperHangers checkout was out of scope and was not accessed for writes.",
  "commands": [
    {
      "command": "node --test tests/measure-tier.test.js tests/measure-attribution-sql.test.js",
      "result": "PASS: 19 tests, 0 failures"
    },
    {
      "command": "node --check lib/domain/measure-tier.js",
      "result": "PASS"
    },
    {
      "command": "node --test tests/measure-kit.test.js tests/measure-tier.test.js tests/measure-attribution-sql.test.js",
      "result": "PASS: 33 tests, 0 failures"
    },
    {
      "command": "npm test",
      "result": "BLOCKED BY ENVIRONMENT: existing dependency-backed tests could not load supertest because this isolated worktree has no node_modules. The dependency-free existing measure-kit suite passed."
    },
    {
      "command": "npm ci --offline --ignore-scripts",
      "result": "NO INSTALL: offline npm cache lacked xtend-4.0.2; no network fallback was attempted and node_modules remains absent"
    },
    {
      "command": "git diff --check",
      "result": "PASS"
    },
    {
      "command": "apply db/schema.sql, migrations 001-023, seed two legacy rows, then apply migration 024 in nph_yfr2_c3_20260829",
      "result": "PASS: PostgreSQL parsed and committed the complete fresh migration path; both legacy rows retained room_captures IS NULL"
    },
    {
      "command": "update seeded legacy routed row after migration; exercise current-route pairing and exact-installer FK negatives",
      "result": "PASS: legacy update succeeded; valid exact route succeeded; missing routed_to and mismatched installer were rejected with the expected constraint classes"
    }
  ],
  "assertions": [
    {
      "boundary": "tier-domain",
      "verdict": "PASS",
      "evidence": "Versioned pure predicate returns ineligible, standard, or spec_ready from explicit fields; tests cover consent, provenance, test exclusion, routing, preferred contact, scope, structured specification completeness, malformed captures, and forbidden free-text inference."
    },
    {
      "boundary": "migration-contract",
      "verdict": "PASS",
      "evidence": "Static verifier proves the intended shape, and PostgreSQL executed the complete fresh schema/migration chain through 024. Seeded legacy captured/routed rows retained unknown captures as NULL, remained update-compatible, and exact-route positive/negative constraints behaved as designed."
    },
    {
      "boundary": "database-side-effect",
      "verdict": "PASS",
      "evidence": "Migration was applied only to uniquely named disposable local database nph_yfr2_c3_20260829. Canonical national_paper_hangers remained read-only and was queried only for aggregate/schema types; no canonical write occurred."
    },
    {
      "boundary": "runtime-and-external-side-effect",
      "verdict": "PASS",
      "evidence": "No API route, service, feature flag, deploy, restart, email, Stripe/provider call, or customer-facing surface was exercised or changed."
    },
    {
      "boundary": "broader-existing-suite",
      "verdict": "SKIP",
      "reason": "Three existing suites require supertest, which is not installed in the isolated worktree. Network dependency installation was outside this task's external-call gate. Existing dependency-free measure-kit tests passed 14/14. The changed predicate and migration paths are covered by 19/19 new tests plus the disposable PostgreSQL rehearsal."
    }
  ],
  "negative_checks": [
    "test/non-production records cannot qualify",
    "missing consent/contact/routing/scope cannot be inferred",
    "product_name and notes cannot satisfy specification fields",
    "malformed room captures cannot produce spec_ready",
    "boolean, array, padded, malformed, impossible-calendar, and other coercible numeric/date values cannot qualify; a valid leap-day offset timestamp does qualify",
    "legacy routed records remain update-compatible and legacy room captures remain NULL",
    "current route without routed_to and installer-mismatched exact routes are rejected by PostgreSQL",
    "inline partial UNIQUE and mutable touch_kind primary shapes are rejected",
    "migration text contains no INSERT, UPDATE, DELETE, TRUNCATE, destructive DROP, trigger, or feature activation"
  ],
  "cleanup": "Disposable database nph_yfr2_c3_20260829 was dropped after assertions. Failed offline npm installation left no node_modules directory. Source changes are retained in the isolated worktree for review and commit.",
  "overall_verdict": "PASS_WITH_ENVIRONMENTAL_SUITE_LIMIT",
  "residual_risk": "The full dependency-backed existing HTTP suite remains unavailable because locked dependencies are not installed. Migration rehearsal proves a fresh full-chain apply and representative legacy/constraint behavior, but production apply, feature activation, API wiring, and backfill remain explicitly out of scope and gated."
}