7.6 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 03-event-write-back-pwa-install | 01 | database, testing, infra |
|
|
|
|
|
|
|
|
|
~45min | 2026-06-05 |
Phase 03 Plan 01: Foundation Scaffold Summary
calendarOutbox table + calendarEvents.objectUrl pushed live to MariaDB, vite-plugin-pwa installed, and five Wave 0 RED test files covering all Phase 3 write-back and PWA behaviors
Performance
- Duration: ~45 min
- Started: 2026-06-05T21:18Z
- Completed: 2026-06-05T22:10Z
- Tasks: 5 (Tasks 1-5; Task 1 was human-verify gate, Task 5 was human-action gate)
- Files modified: 8
Accomplishments
- Extended Drizzle schema with
calendarOutboxtable (12 columns, 3 indexes: idx_outbox_user_status, idx_outbox_next_attempt, idx_outbox_uid) andcalendarEvents.objectUrlcolumn; both live in MariaDB - Populated
objectUrl: obj.url ?? nullin both.values()and.onDuplicateKeyUpdate()blocks of the calendarEvents upsert in sync.ts — enables If-Match writes (D-08) - Installed
vite-plugin-pwa(legitimacy-gated via Task 1 supply-chain checkpoint T-03-SC) - Created five Wave 0 RED test files covering every Phase 3 behavior: VEVENT builder, CalDAV write layer, outbox state machine, events API routes, and PWA InstallPrompt
Task Commits
- Task 1: Supply-chain gate T-03-SC — no commit (verification-only checkpoint)
- Task 2: Extend Drizzle schema + install vite-plugin-pwa —
78f0dee(feat) - Task 3: Populate calendarEvents.objectUrl in sync.ts —
0c0bcef(feat) - Task 4: Wave 0 RED test scaffold —
bbfccda(test) - Task 5: Push schema to MariaDB — hand-applied DDL by orchestrator (no code commit; DB verified)
Files Created/Modified
apps/api/src/db/schema.ts— added mysqlEnum import, calendarOutbox table definition, groupId column, 3 indexes; added objectUrl column to calendarEventsapps/api/src/broker/sync.ts— setobjectUrl: obj.url ?? nullin values and onDuplicateKeyUpdate blocksapps/api/tests/broker/vevent.test.ts— RED: VCALENDAR/VEVENT builder tests (timed, all-day D-13, RRULE)apps/api/tests/broker/write.test.ts— RED: createCalendarEvent, updateCalendarEvent (If-Match), deleteCalendarEventapps/api/tests/broker/outboxWorker.test.ts— RED: outbox state machine (pending→done/failed/backoff/dead), edit-as-move ordering (D-04)apps/api/tests/routes/events.test.ts— extended with POST create, PATCH edit, DELETE, sync-status, writable-calendars, D-03 access controlapps/pwa/src/components/InstallPrompt.test.tsx— RED: isIOSSafariNonStandalone(), useAndroidInstallPromptapps/pwa/package.json— added vite-plugin-pwa dependency
Decisions Made
- D-Task5-DDL:
drizzle-kit pushwith themysqldialect against a live MariaDB 11 instance produces a FALSE destructive diff — it misreads MariaDB-11 metadata and schedulestruncate tableoncalendars,calendar_events, andusers(503 events at risk). The two genuinely additive statements were hand-applied by the orchestrator and verified. A follow-up todo (.planning/todos/pending/adopt-drizzle-migrations-workflow.md) tracks migrating todrizzle-kit generate+drizzle-kit migratebefore any future schema change. Nodrizzle-kit pushshould be run against this instance again.
Deviations from Plan
Task 5: drizzle-kit push replaced by hand-applied additive DDL
Category: Orchestrator-resolved deviation (not a Rule 1–4 auto-fix; resolved by human operator per gate instructions)
- Found during: Task 5 (blocking human-action gate)
- Issue:
drizzle-kit pushwith the Drizzlemysqldialect against MariaDB 11 misread database metadata and reported a destructive plan includingtruncate tableoncalendars,calendar_events, andusers. This is a known incompatibility — drizzle-kit 0.31.10 has nomariadbdialect; themysqldialect misinterprets MariaDB-11 server metadata. - Fix: Orchestrator manually ran only the two additive statements:
CREATE TABLE calendar_outbox (...)matching schema.ts exactly, andALTER TABLE calendar_events ADD COLUMN object_url varchar(1024). Data verified intact (calendars=1, calendar_events=503). - Files modified: None (DB DDL only; schema.ts was already correct)
- Verification:
SHOW TABLES LIKE 'calendar_outbox'→ 1 row;SHOW COLUMNS FROM calendar_events LIKE 'object_url'→ 1 row - Follow-up:
.planning/todos/pending/adopt-drizzle-migrations-workflow.mdcreated to track migrating to generate+migrate workflow
Total deviations: 1 (Task 5 DDL approach replaced; resolved by operator at the blocking gate) Impact on plan: No scope creep. Schema is correct. Must-haves fully satisfied. Follow-up todo prevents recurrence.
Issues Encountered
None beyond the Task 5 drizzle-kit deviation documented above.
User Setup Required
None — no external service configuration required for this plan. The schema push was a one-time operation handled by the orchestrator at the Task 5 gate.
Next Phase Readiness
- Wave 0 RED scaffold is in place — plans 03-02 through 03-08 can proceed to GREEN implementation
calendarOutboxandcalendarEvents.objectUrlare live; outbox worker and write routes can reference them immediatelyvite-plugin-pwais installed; PWA manifest configuration (Plan 03-06) can proceed- Action before next schema change: Adopt
drizzle-kit generate+drizzle-kit migrate(see pending todo) — do NOT rundrizzle-kit pushagain
Phase: 03-event-write-back-pwa-install Completed: 2026-06-05