style(13-03): apply Prettier formatting across repo

Mechanical reformat — no logic changes. 398 files changed, 19125
insertions(+), 16457 deletions(-). Prettier 3.8.4 with .prettierrc
(singleQuote:true, semi:true, tabWidth:2, trailingComma:all,
printWidth:100). Isolated per D-13-08 for reviewability.
This commit is contained in:
Lucas Berger
2026-06-11 20:35:18 -04:00
parent 4bc0445173
commit 982438dc10
398 changed files with 19050 additions and 16382 deletions
@@ -1,6 +1,6 @@
---
phase: 03-event-write-back-pwa-install
plan: "10"
plan: '10'
subsystem: api-broker
tags: [tdd, gap-closure, ics-builder, outbox-worker, vevent, rfc5545, credentials]
dependency_graph:
@@ -20,13 +20,13 @@ dependency_graph:
tech_stack:
added: []
patterns:
- "TDD RED→GREEN per task"
- "vi.hoisted() + per-test crypto mock for loadClientForUser failure scenarios"
- "Table-differentiated db select mock (credential vs outbox queries)"
- 'TDD RED→GREEN per task'
- 'vi.hoisted() + per-test crypto mock for loadClientForUser failure scenarios'
- 'Table-differentiated db select mock (credential vs outbox queries)'
decisions:
- "WR-04 owning boundary is vevent.ts only — form/routes pass inclusive end unchanged"
- "CR-03: loadClientForUser throws propagate to outer catch (row stays pending); no empty-cred fallback"
- "WR-01: backoff index is row.attemptCount (the failed attempt, 0-based) not nextAttemptCount"
- 'WR-04 owning boundary is vevent.ts only — form/routes pass inclusive end unchanged'
- 'CR-03: loadClientForUser throws propagate to outer catch (row stays pending); no empty-cred fallback'
- 'WR-01: backoff index is row.attemptCount (the failed attempt, 0-based) not nextAttemptCount'
key_files:
modified:
- apps/api/src/broker/outboxWorker.ts
@@ -36,7 +36,7 @@ key_files:
- apps/api/tests/broker/vevent.test.ts
metrics:
duration_minutes: 6
completed_date: "2026-06-06"
completed_date: '2026-06-06'
tasks_completed: 2
files_modified: 5
---
@@ -47,12 +47,12 @@ Wire the VEVENT builder into the outbox worker dispatch path, pin the D-13 DATE/
## Tasks Completed
| Task | Name | Commit | Files |
|------|------|--------|-------|
| 1 RED | Add D-13 contract + ICS wiring test (vevent + worker) | 813a7ba | vevent.test.ts, outboxWorker.test.ts |
| 1 GREEN | Wire buildVeventString, fix all-day DTEND+1 (CR-02, WR-04) | c03b479 | outboxWorker.ts, vevent.ts |
| 2 RED | Add CR-03 + WR-01 RED tests (crypto mock, backoff timing) | c178dce | outboxWorker.test.ts |
| 2 GREEN | Fail closed on bad creds, fix backoff index, explicit randomUUID | c21b040 | outboxWorker.ts, events.ts |
| Task | Name | Commit | Files |
| ------- | ---------------------------------------------------------------- | ------- | ------------------------------------ |
| 1 RED | Add D-13 contract + ICS wiring test (vevent + worker) | 813a7ba | vevent.test.ts, outboxWorker.test.ts |
| 1 GREEN | Wire buildVeventString, fix all-day DTEND+1 (CR-02, WR-04) | c03b479 | outboxWorker.ts, vevent.ts |
| 2 RED | Add CR-03 + WR-01 RED tests (crypto mock, backoff timing) | c178dce | outboxWorker.test.ts |
| 2 GREEN | Fail closed on bad creds, fix backoff index, explicit randomUUID | c21b040 | outboxWorker.ts, events.ts |
## Verification
@@ -73,10 +73,12 @@ Wire the VEVENT builder into the outbox worker dispatch path, pin the D-13 DATE/
## TDD Gate Compliance
Both tasks followed strict RED→GREEN:
- Task 1: `test(03-10)` commit (813a7ba) → `feat(03-10)` commit (c03b479)
- Task 2: `test(03-10)` commit (c178dce) → `feat(03-10)` commit (c21b040)
RED confirmed failing for correct reasons before each GREEN commit:
- Task 1 RED: vevent DTEND=20260610 not 20260611; worker passed raw JSON not BEGIN:VCALENDAR
- Task 2 RED: CR-03 worker updated row to 'done' via empty-cred path; WR-01 backoff was 60s not 15s
@@ -94,14 +96,14 @@ The existing db mock in `outboxWorker.test.ts` returned the same rows for any `d
## Issues Closed
| ID | Description |
|----|-------------|
| CR-02 | Worker was passing raw form JSON to CalDAV PUT — now builds VCALENDAR via buildVeventString |
| CR-03 | Worker fell back to empty-cred createFastmailClient on any credential error — removed fallback |
| ID | Description |
| ----- | ------------------------------------------------------------------------------------------------- |
| CR-02 | Worker was passing raw form JSON to CalDAV PUT — now builds VCALENDAR via buildVeventString |
| CR-03 | Worker fell back to empty-cred createFastmailClient on any credential error — removed fallback |
| WR-01 | First transient retry used BACKOFF_SECONDS[1]=60s instead of BACKOFF_SECONDS[0]=15s — fixed index |
| WR-04 | All-day events emitted DTEND = DTSTART (no +1 day) — fixed in vevent.ts (owning boundary) |
| WR-08 | events.ts used bare crypto.randomUUID() — replaced with import { randomUUID } from 'node:crypto' |
| IN-01 | buildVeventString was dead code (never called outside vevent.ts) — now has 2 live call sites |
| WR-04 | All-day events emitted DTEND = DTSTART (no +1 day) — fixed in vevent.ts (owning boundary) |
| WR-08 | events.ts used bare crypto.randomUUID() — replaced with import { randomUUID } from 'node:crypto' |
| IN-01 | buildVeventString was dead code (never called outside vevent.ts) — now has 2 live call sites |
## Known Stubs