{
  "blueprint": "invoice-reminders",
  "builder": "Claude, following the phase prompts in order (a fresh subagent per phase that saw only the spec and the build folder)",
  "testedSpecSha256": "24a5f88f6d0fe3ed07dc74b329ffb72d569e1150e946fdc49f3bc8997fca7480",
  "reviewDate": "2026-11-06",
  "reviewMethod": "Playwright scripts (Chromium) clicked through the build as the named seed people (Maya, Theo) from the development \"sign in as\" switcher, asserting on what was on screen; where a check says the server must refuse something the script also made the request directly (Import, Settings and the sending switch as Theo, a $20,000 payment, a write-off as Theo and without a reason, the cron endpoint with a wrong secret). The sample file in section 12 was pasted into Import, previewed and imported; reminder emails were read on Today's run and the Outbox screen; the reminder job ran from the development \"Run job now\" control and POST /jobs/reminders with the development clock (Saturday Oct 17, Monday Oct 19, Wednesday Oct 21, Monday Oct 26); both CSV exports were downloaded, parsed and matched against the screen. The run below is the single final run on a fresh database after all spec gaps were fixed, resetting to the seed before each phase's checks. Earlier per-phase runs found the gaps and are not counted. Results are final post-fix checks, not first-attempt success rates or an independent human audit.",
  "automatedTests": {
    "passed": 113,
    "total": 113,
    "command": "npm test",
    "rerunDuringReview": true
  },
  "gapsFixed": 83,
  "runs": [
    {
      "startedAt": "2026-11-06T09:59:10.900Z",
      "finishedAt": "2026-11-06T09:59:20.492Z",
      "phases": [
        1,
        2,
        3,
        4
      ],
      "passed": 18,
      "total": 18,
      "items": [
        {
          "phase": 1,
          "text": "Invoices shows seven open invoices totalling $31,800, with $20,500 overdue.",
          "status": "pass",
          "evidence": "Signed in as Maya, Invoices shows 7 rows (INV-1025, INV-1029, INV-1035, INV-1037, INV-1032, INV-1041, INV-1043), every one Open; cards: Open invoices 7, Open total $31,800.00, Overdue $20,500.00."
        },
        {
          "phase": 1,
          "text": "The aging report shows not yet due $11,300, 1 to 30 days $19,600, 31 to 60 days $900, and $0 in the older buckets.",
          "status": "pass",
          "evidence": "Aging report rows: \"Not yet due 2 $11,300.00\"; \"1 to 30 days 4 $19,600.00\"; \"31 to 60 days 1 $900.00\"; \"61 to 90 days 0 $0.00\"; \"Over 90 days 0 $0.00\"; \"Total 7 $31,800.00\"."
        },
        {
          "phase": 1,
          "text": "Checking the sample file in section 12 shows 5 unchanged, 1 updated (INV-1043, balance $6,500 to $3,500), 2 new (INV-1044, and INV-1045 for a new customer Quill Studio), 1 error (INV-1046, missing due date) and INV-1032 as not in the file; importing makes the open total $32,500.",
          "status": "pass",
          "evidence": "Signed in as Maya, the sample file pasted into Import and checked shows New 2, Updated 1, Unchanged 5, Errors 1, Not in file 1: INV-1025, 1029, 1035, 1037, 1041 Unchanged; \"7 INV-1043 Pine Labs 2026-11-14 $3,500.00 Updated Balance $6,500.00 to $3,500.00\"; \"8 INV-1044 Acme Corp 2026-11-13 $2,200.00 New\"; \"9 INV-1045 Quill Studio 2026-11-14 $1,500.00 New New customer Quill Studio\"; \"10 INV-1046 Kestrel Schools $800.00 Error Missing due_date\"; Not in this file: INV-1032 Acme Corp $2,500.00. Before pressing Import the open total was still $31,800.00. After Import the open total is $32,500.00 and INV-1032 stays open, flagged: \"INV-1032 Acme Corp Oct 8, 2026 7 days $2,500.00 OpenNot in latest import Due today · Oct 8\"."
        },
        {
          "phase": 1,
          "text": "Signed in as Theo, Import and Settings are not offered, and direct requests to them are refused.",
          "status": "pass",
          "evidence": "Signed in as Theo, the menu reads \"Invoices, Customers, Today's run, Needs a call, Aging report, Reminders sent\" (no Import or Settings). Direct requests: GET /import 403, GET /settings 403, POST /import/apply 403, POST /settings 403; opening /import in the browser shows \"Not allowed Only an admin (the finance lead) can do this. Back to invoices\"."
        },
        {
          "phase": 2,
          "text": "Today's run preview lists one email to Acme Corp with INV-1041 and INV-1032 (total $7,300) and a Final notice to Bluebird Ltd copying Nina Shah, and lists Kestrel Schools (promised by Oct 20) and Harbor Clinic (customer paused) as skipped with those reasons.",
          "status": "pass",
          "evidence": "Signed in as Maya, Today's run (Thu Oct 15) previews 2 emails: Acme Corp to ap@acme.example, template \"7 days overdue\", INV-1032 (7 days overdue) and INV-1041 (Heads-up), Total $7,300.00; Bluebird Ltd Final notice to payables@bluebird.example, Cc \"nina@northwind.example (account owner Nina Shah)\", INV-1029 $12,000.00. Skipped: \"Kestrel Schools INV-1035 Oct 1, 2026 $3,200.00 Promised to pay by Oct 20\"; \"Harbor Clinic INV-1037 Oct 5, 2026 $1,900.00 Customer paused (\"disputing the September hours\")\"."
        },
        {
          "phase": 2,
          "text": "With the sending switch off, running the job puts exactly those two emails in the outbox as held; running it again adds nothing.",
          "status": "pass",
          "evidence": "With sending off, \"Run job now\" reported \"Job ran at Oct 15, 2026 10:00: daily run done: 2 emails written to the outbox (held).\". Outbox went from 11 to 13 rows; the new ones: \"Oct 15, 2026 10:00 reminder ap@acme.example Northwind Design: $7,300.00 overdue held\" and \"Oct 15, 2026 10:00 final notice payables@bluebird.example nina@northwind.example Final notice: $12,000.00, 30 days overdue held\". Running the job again reported \"Job ran at Oct 15, 2026 10:00: today's run already happened, nothing added.\" and the outbox stayed at 13. POST /jobs/reminders with a wrong secret returned 401; with the secret it returned daily_run \"already_ran\" and the outbox still had 13 rows."
        },
        {
          "phase": 2,
          "text": "Saving a template that uses {amount_due} is refused with \"{amount_due} isn't a merge field.\"",
          "status": "pass",
          "evidence": "Signed in as Maya, editing the \"7 days overdue\" template and adding \"Amount: {amount_due}\" to the body, then saving, showed \"{amount_due} isn't a merge field.\"; reopening the template shows the body without {amount_due} (nothing saved)."
        },
        {
          "phase": 2,
          "text": "Moving the clock to Saturday and running the job sends nothing; on Monday Oct 19 it sends Acme the \"Due today\" reminder for INV-1041, which fell due on Sunday.",
          "status": "pass",
          "evidence": "Clock set to Sat Oct 17 10:00: \"Run job now\" reported \"Job ran at Oct 17, 2026 10:00: not a business day, no run.\" and the outbox stayed at 13 rows. Clock set to Mon Oct 19 10:00: the job reported \"Job ran at Oct 19, 2026 10:00: daily run done: 1 email written to the outbox (held).\" and wrote one email: \"Oct 19, 2026 10:00 reminder ap@acme.example Northwind Design: $4,800.00 due today held\"; its Reminders INV-1041 (Due today, Oct 19, 2026) (INV-1032 not included, its 7 days overdue step was already sent)."
        },
        {
          "phase": 2,
          "text": "Signed in as Theo, the sending switch can't be changed, including by a direct request.",
          "status": "pass",
          "evidence": "Signed in as Theo, Settings shows \"Not allowed Only an admin (the finance lead) can do this. Back to invoices\" and the menu is \"Invoices, Customers, Today's run, Needs a call, Aging report, Reminders sent\" (no Settings). Direct POST /settings/sending enabled=1&confirm=yes returned 403; POST /settings sending_enabled=1 returned 403. Signed in as Maya afterwards, Settings still says \"Sending to customers: Off\"."
        },
        {
          "phase": 3,
          "text": "Recording a $2,500 payment on INV-1032 marks it paid, and today's preview then shows Acme's email with INV-1041 only.",
          "status": "pass",
          "evidence": "Signed in as Theo, recording a $2,500 payment on INV-1032 shows Balance \"$0.00 of $2,500.00\" and Status paid. Today's run preview then shows Acme Corp's email with INV-1041 only (Heads-up, Total $4,800.00); INV-1032 is not listed anywhere in the email."
        },
        {
          "phase": 3,
          "text": "A $1,000 payment on INV-1029 leaves a balance of $11,000, shown in Bluebird's Final notice in today's preview; a payment of $20,000 on it is refused.",
          "status": "pass",
          "evidence": "A $1,000 payment on INV-1029 shows Balance \"$11,000.00 of $12,000.00\"; the preview's Bluebird Ltd Final notice lists INV-1029 with Total $11,000.00. A $20,000 payment is refused on screen (\"A payment of $20,000.00 is more than the balance of $11,000.00.\") and the balance stays $11,000.00; the same payment sent directly returned 400."
        },
        {
          "phase": 3,
          "text": "Signed in as Maya, moving the clock to Wednesday Oct 21 and running the job with INV-1035 unpaid marks Kestrel's promise as broken in a note, emails Theo, and puts a \"14 days overdue\" reminder for INV-1035 to Kestrel in the outbox.",
          "status": "pass",
          "evidence": "Signed in as Maya (the Outbox is admin-only), clock set to Wed Oct 21 10:00 with INV-1035 unpaid, \"Run job now\" reported \"Job ran at Oct 21, 2026 10:00: daily run done: 3 emails written to the outbox (held); 1 promise broken (INV-1035); outbox: 0 sent, 1 logged, 0 failed.\". INV-1035's notes now include \"Promise broken: Kestrel Schools promised to pay by Oct 20, 2026 and INV-1035 is still unpaid (balance $3,200.00). Reminders resume with the current step.\". New outbox rows include \"Oct 21, 2026 10:00 promise broken theo@northwind.example Kestrel Schools didn't pay INV-1035 by Oct 20 logged\" and \"Oct 21, 2026 10:00 reminder finance@kestrel.example Northwind Design: $3,200.00 is 20 days overdue held\", whose reminders line reads INV-1035 (14 days overdue)."
        },
        {
          "phase": 3,
          "text": "Marking INV-1041 disputed with a reason removes it from the run (the preview lists it as skipped, disputed); resolving the dispute with a note puts it back, and with the clock at Monday Oct 26 the preview includes it in Acme's \"7 days overdue\" email.",
          "status": "pass",
          "evidence": "Marking INV-1041 disputed (\"Acme says the October retainer was cancelled\") sets Status disputed, and the next run's preview lists it as skipped: \"Acme Corp INV-1041 Oct 18, 2026 $4,800.00 Disputed (\"Acme says the October retainer was cancelled\")\". Resolving it with the note \"Retainer confirmed by Acme; dispute closed\" sets Status open and the note is on the timeline; the preview no longer skips it as disputed (\"Acme Corp INV-1041 Oct 18, 2026 $4,800.00 Due today already sent on Oct 21\"). With the clock at Mon Oct 26, the preview includes INV-1041 in Acme Corp's email at its \"7 days overdue\" step."
        },
        {
          "phase": 3,
          "text": "Needs a call lists INV-1025 for Olsen & Co, with \"Final notice sent Sep 30\".",
          "status": "pass",
          "evidence": "Needs a call lists 1 invoice(s); its row: \"INV-1025 Olsen & Co accounts@olsen.example Theo Park Aug 31, 2026 56 days $900.00 Final notice sent Sep 30 (26 days ago) None Log a call\"."
        },
        {
          "phase": 3,
          "text": "Signed in as Theo, writing off INV-1025 is refused; signed in as Maya, it works with a reason and the balance becomes $0.",
          "status": "pass",
          "evidence": "Signed in as Theo, INV-1025's page offers no write-off form and a direct write-off request returned 403; the balance stays $900.00. Signed in as Maya, a write-off with no reason returned 400; with the reason \"Olsen & Co closed; uncollectable\" it works: Balance \"$0.00 of $900.00\", Status written off."
        },
        {
          "phase": 4,
          "text": "The aging report by customer shows Bluebird Ltd's $12,000 in 1 to 30 days and Olsen & Co's $900 in 31 to 60 days, and its CSV has the same rows and totals.",
          "status": "pass",
          "evidence": "Signed in as Maya, Aging report > By customer shows 6 customers and a total row; Bluebird Ltd: $0.00 | $12,000.00 | $0.00 | $0.00 | $0.00 | $12,000.00 ($12,000.00 in 1 to 30 days); Olsen & Co: $0.00 | $0.00 | $900.00 | $0.00 | $0.00 | $900.00 ($900.00 in 31 to 60 days); total row $11,300.00 | $19,600.00 | $900.00 | $0.00 | $0.00 | $31,800.00. Export CSV downloaded aging-by-customer-2026-10-15.csv with header \"customer,not_yet_due,days_1_30,days_31_60,days_61_90,over_90_days,total\" and 7 rows that match the screen cell for cell, ending \"Total,11300.00,19600.00,900.00,0.00,0.00,31800.00\"."
        },
        {
          "phase": 4,
          "text": "After today's run, the reminders-sent report for this week lists the Acme and Bluebird emails with their invoices, steps and status held, and exports as CSV.",
          "status": "pass",
          "evidence": "Signed in as Maya, \"Run job now\" reported \"Job ran at Oct 15, 2026 10:00: daily run done: 2 emails written to the outbox (held).\". Reminders sent, This week (\"Oct 12, 2026 to Oct 18, 2026: 2 emails covering 3 invoices · held2\"): \"Oct 15, 2026 Acme Corp INV-1032 (7 days overdue), INV-1041 (Heads-up) 7 days overdue ap@acme.example None held View\"; \"Oct 15, 2026 Bluebird Ltd INV-1029 Final notice payables@bluebird.example nina@northwind.example held View\". Export CSV downloaded reminders-sent-2026-10-12-to-2026-10-18.csv: header \"date,customer,invoices,step,to,status,cc\", rows \"2026-10-15,Acme Corp,INV-1032; INV-1041,7 days overdue,ap@acme.example,held,\" and \"2026-10-15,Bluebird Ltd,INV-1029,Final notice,payables@bluebird.example,held,nina@northwind.example\"."
        },
        {
          "phase": 4,
          "text": "Signed in as Theo, both reports are visible, and both exports work.",
          "status": "pass",
          "evidence": "Signed in as Theo (menu: Invoices, Customers, Today's run, Needs a call, Aging report, Reminders sent), Aging report by customer shows the same 6 customers and Export CSV downloaded aging-by-customer-2026-10-15.csv (header plus 7 rows, last \"Total,11300.00,19600.00,900.00,0.00,0.00,31800.00\"); Reminders sent this week shows the 2 held emails and Export CSV downloaded reminders-sent-2026-10-12-to-2026-10-18.csv (header plus 2 rows)."
        }
      ]
    }
  ],
  "notTested": [
    "Production sign-in: a hook for a sign-in proxy limited to the company domain was built, but every check used the development \"sign in as\" switcher.",
    "Real email delivery: reminders were held in the outbox with the sending switch off, and the promise-broken and import emails were logged; no email provider was configured.",
    "The reminder job on a real scheduler: it ran from \"Run job now\" and POST /jobs/reminders with the development clock, not from a scheduler every 15 minutes.",
    "Hosting: the checks ran on localhost, not on a public https address.",
    "A real accounting export: the import used the sample file in section 12, not a CSV from QuickBooks, Xero or another package.",
    "Phone layout: one 390-pixel Chromium viewport was captured, where the run preview's invoice table is wider than the screen; no physical phone was used.",
    "Spec fixes that no acceptance check covers (People, customer editing, turned-off steps, due dates that move on import, CSV formula guarding) are covered only by the build's own choices and tests, or not at all."
  ]
}