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:
@@ -1,17 +1,25 @@
|
||||
---
|
||||
phase: 02-calendar-display
|
||||
plan: "01"
|
||||
plan: '01'
|
||||
subsystem: api-schema, api-auth, pwa-test
|
||||
tags: [schema-migration, dev-auth, test-harness, ics-fixtures, red-stubs]
|
||||
dependency_graph:
|
||||
requires: [01-foundation-broker-spike]
|
||||
provides: [calendar_events.hasRrule, calendars.isShared, devAuthBypass, pwa-vitest-jsdom, ics-fixtures, red-test-stubs]
|
||||
provides:
|
||||
[
|
||||
calendar_events.hasRrule,
|
||||
calendars.isShared,
|
||||
devAuthBypass,
|
||||
pwa-vitest-jsdom,
|
||||
ics-fixtures,
|
||||
red-test-stubs,
|
||||
]
|
||||
affects: [02-02, 02-03, 02-04, 02-05]
|
||||
tech_stack:
|
||||
added:
|
||||
- vitest@^4.1.8 (PWA devDependency)
|
||||
- "@testing-library/react@^16.3.0 (PWA devDependency)"
|
||||
- "@testing-library/jest-dom@^6.6.3 (PWA devDependency)"
|
||||
- '@testing-library/react@^16.3.0 (PWA devDependency)'
|
||||
- '@testing-library/jest-dom@^6.6.3 (PWA devDependency)'
|
||||
- jsdom@^26.1.0 (PWA devDependency)
|
||||
patterns:
|
||||
- Drizzle boolean column + index pattern (hasRrule, isShared)
|
||||
@@ -36,12 +44,12 @@ key_files:
|
||||
- .env.example
|
||||
- docs/deployment.md
|
||||
decisions:
|
||||
- "Applied ALTER TABLE directly instead of drizzle-kit push due to non-TTY interactive prompt — false-positive int(11) vs int type warning on existing rows"
|
||||
- "devAuthBypass evaluates env vars at call time (process start) not request time — intentional so auth mode is fixed for the lifetime of the process"
|
||||
- "RED test stubs reference not-yet-built modules to ensure compile-time failure (concrete RED state), not just assertion failure"
|
||||
- 'Applied ALTER TABLE directly instead of drizzle-kit push due to non-TTY interactive prompt — false-positive int(11) vs int type warning on existing rows'
|
||||
- 'devAuthBypass evaluates env vars at call time (process start) not request time — intentional so auth mode is fixed for the lifetime of the process'
|
||||
- 'RED test stubs reference not-yet-built modules to ensure compile-time failure (concrete RED state), not just assertion failure'
|
||||
metrics:
|
||||
duration: "8m 25s"
|
||||
completed: "2026-06-05"
|
||||
duration: '8m 25s'
|
||||
completed: '2026-06-05'
|
||||
tasks_completed: 3
|
||||
files_created: 10
|
||||
files_modified: 5
|
||||
@@ -56,6 +64,7 @@ Horizontal foundation for Phase 2 calendar slice: two schema columns pushed to l
|
||||
### Schema Changes (Task 1)
|
||||
|
||||
Added to `apps/api/src/db/schema.ts`:
|
||||
|
||||
- `calendarEvents.hasRrule`: `boolean('has_rrule').default(false).notNull()` — pre-filter flag for recurring event masters (RESEARCH.md §Pitfall 5)
|
||||
- `calendarEvents`: new index `idx_calendar_events_has_rrule` matching style of `idx_calendar_events_dtstart_utc`
|
||||
- `calendars.isShared`: `boolean('is_shared').default(false).notNull()` — operator-marked shared-family calendar flag
|
||||
@@ -72,6 +81,7 @@ Both columns pushed to live MariaDB (503-event cache intact). `SHOW COLUMNS` con
|
||||
### ICS Fixtures (Task 1)
|
||||
|
||||
Three fixtures created at `apps/api/tests/fixtures/`:
|
||||
|
||||
- `weekly-dst.ics`: weekly VEVENT at `DTSTART;TZID=America/New_York:20260301T100000` with full VTIMEZONE block (STANDARD + DAYLIGHT subcomponents for March 2026 EST→EDT transition)
|
||||
- `allday-birthday.ics`: `DTSTART;VALUE=DATE:20260615` with `RRULE:FREQ=YEARLY`, no DTEND — pure DATE type
|
||||
- `exdate-series.ics`: `RRULE:FREQ=WEEKLY;COUNT=5` with `EXDATE;TZID=America/New_York:20260615T090000` — exactly one occurrence excluded
|
||||
@@ -83,6 +93,7 @@ All three fixtures parse via `ICAL.parse()` without throwing.
|
||||
Four test stubs with concrete behavioral contracts (not bare failing imports):
|
||||
|
||||
**expand.test.ts**: Three behavioral contracts —
|
||||
|
||||
1. DST wall-clock: every occurrence in March 2026 window has `T10:00:00` in the ISO start string, regardless of EST/EDT offset. Tests both pre-transition (2026-03-01) and post-transition (2026-03-15) occurrences.
|
||||
2. All-day: `allDay:true` and `start === '2026-06-15'` (no `T` component)
|
||||
3. EXDATE: length === 4 (not 5), June 15 occurrence absent
|
||||
@@ -98,6 +109,7 @@ All RED stubs fail at import resolution (module not built yet) — correct RED s
|
||||
### Dev-Auth Bypass (Task 2)
|
||||
|
||||
Created `apps/api/src/auth/devBypass.ts`:
|
||||
|
||||
- Exports `devAuthBypass(): MiddlewareHandler`
|
||||
- First conditional is `NODE_ENV === 'production'` — hard guard (T-02-01 mitigation)
|
||||
- Returns no-op passthrough when production OR bypass flag unset
|
||||
@@ -115,6 +127,7 @@ All three devBypass.test.ts cases pass: production guard, unset-flag passthrough
|
||||
### Auto-fixed Issues
|
||||
|
||||
**1. [Rule 3 - Blocker] drizzle-kit push replaced with direct ALTER TABLE**
|
||||
|
||||
- **Found during:** Task 3
|
||||
- **Issue:** `drizzle-kit push` emitted a non-TTY interactive prompt. The "data-loss" warnings were false positives — MariaDB stores int as `int(11)` display width but drizzle-kit 0.31.x sees this as a type change on existing rows. The prompt cannot be auto-confirmed without TTY.
|
||||
- **Fix:** Applied the two actual new columns directly via `ALTER TABLE calendar_events ADD COLUMN IF NOT EXISTS has_rrule tinyint(1) NOT NULL DEFAULT 0` and `ALTER TABLE calendars ADD COLUMN IF NOT EXISTS is_shared tinyint(1) NOT NULL DEFAULT 0`, plus the index. Outcome is identical to what drizzle-kit push would have done for the new columns.
|
||||
@@ -125,6 +138,7 @@ All three devBypass.test.ts cases pass: production guard, unset-flag passthrough
|
||||
## Known Stubs
|
||||
|
||||
The following test stubs are intentionally RED (modules not yet built):
|
||||
|
||||
- `apps/api/tests/broker/expand.test.ts` — awaits `apps/api/src/broker/expand.ts` (Plan 02)
|
||||
- `apps/api/tests/routes/events.test.ts` — awaits evolved `apps/api/src/routes/events.ts` (Plan 02)
|
||||
- `apps/pwa/src/lib/hydrateEvents.test.ts` — awaits `apps/pwa/src/lib/hydrateEvents.ts` (Plan 03)
|
||||
@@ -139,6 +153,7 @@ No new threat surface introduced beyond what is already in the plan's threat mod
|
||||
## Self-Check: PASSED
|
||||
|
||||
Files created:
|
||||
|
||||
- [x] apps/api/src/auth/devBypass.ts — FOUND
|
||||
- [x] apps/pwa/vitest.config.ts — FOUND
|
||||
- [x] apps/api/tests/fixtures/weekly-dst.ics — FOUND
|
||||
@@ -151,10 +166,12 @@ Files created:
|
||||
- [x] apps/pwa/src/lib/calendarConfig.test.ts — FOUND
|
||||
|
||||
Commits:
|
||||
|
||||
- [x] 75252eb — Task 1 feat
|
||||
- [x] 8bd44b3 — Task 2 feat
|
||||
|
||||
DB state:
|
||||
|
||||
- [x] SHOW COLUMNS FROM calendar_events LIKE 'has_rrule' — returns 1 row
|
||||
- [x] SHOW COLUMNS FROM calendars LIKE 'is_shared' — returns 1 row
|
||||
- [x] 503 events intact
|
||||
|
||||
Reference in New Issue
Block a user