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:
@@ -3,7 +3,7 @@ phase: 03-event-write-back-pwa-install
|
||||
plan: 04
|
||||
type: tdd
|
||||
wave: 3
|
||||
depends_on: ["03-02", "03-03"]
|
||||
depends_on: ['03-02', '03-03']
|
||||
files_modified:
|
||||
- apps/api/src/broker/outboxWorker.ts
|
||||
- apps/api/src/index.ts
|
||||
@@ -14,33 +14,33 @@ user_setup: []
|
||||
|
||||
must_haves:
|
||||
truths:
|
||||
- "The worker drains pending outbox rows, builds the VEVENT, PUTs/DELETEs via the broker, and triggers a targeted single-calendar re-sync on success (D-06)"
|
||||
- "Transient failures (5xx/network/timeout) back off exponentially within a bounded window; max attempts → dead (D-07)"
|
||||
- "Hard failures (400/401/403) stop immediately as failed (D-07)"
|
||||
- "412 conflicts route OUT of the retry loop into the conflict flow: mark failed, re-sync, no overwrite (D-08)"
|
||||
- "Edit-as-move processes the create row before the linked delete row; create-fail aborts the delete (D-04)"
|
||||
- "The worker is started from index.ts as a sibling to the ctag poller"
|
||||
- 'The worker drains pending outbox rows, builds the VEVENT, PUTs/DELETEs via the broker, and triggers a targeted single-calendar re-sync on success (D-06)'
|
||||
- 'Transient failures (5xx/network/timeout) back off exponentially within a bounded window; max attempts → dead (D-07)'
|
||||
- 'Hard failures (400/401/403) stop immediately as failed (D-07)'
|
||||
- '412 conflicts route OUT of the retry loop into the conflict flow: mark failed, re-sync, no overwrite (D-08)'
|
||||
- 'Edit-as-move processes the create row before the linked delete row; create-fail aborts the delete (D-04)'
|
||||
- 'The worker is started from index.ts as a sibling to the ctag poller'
|
||||
artifacts:
|
||||
- path: "apps/api/src/broker/outboxWorker.ts"
|
||||
provides: "runOutboxDrain + startOutboxWorker (state machine, retry/backoff, re-sync)"
|
||||
exports: ["runOutboxDrain", "startOutboxWorker"]
|
||||
- path: 'apps/api/src/broker/outboxWorker.ts'
|
||||
provides: 'runOutboxDrain + startOutboxWorker (state machine, retry/backoff, re-sync)'
|
||||
exports: ['runOutboxDrain', 'startOutboxWorker']
|
||||
min_lines: 60
|
||||
- path: "apps/api/src/index.ts"
|
||||
provides: "startOutboxWorker() wired at startup"
|
||||
contains: "startOutboxWorker"
|
||||
- path: 'apps/api/src/index.ts'
|
||||
provides: 'startOutboxWorker() wired at startup'
|
||||
contains: 'startOutboxWorker'
|
||||
key_links:
|
||||
- from: "apps/api/src/broker/outboxWorker.ts"
|
||||
to: "broker/write.ts"
|
||||
via: "create/update/deleteCalendarEvent"
|
||||
pattern: "(create|update|delete)CalendarEvent"
|
||||
- from: "apps/api/src/broker/outboxWorker.ts"
|
||||
to: "broker/sync.ts syncCalendar"
|
||||
via: "targeted re-sync on confirm (D-06)"
|
||||
pattern: "syncCalendar"
|
||||
- from: "apps/api/src/index.ts"
|
||||
to: "startOutboxWorker"
|
||||
via: "background worker startup"
|
||||
pattern: "startOutboxWorker"
|
||||
- from: 'apps/api/src/broker/outboxWorker.ts'
|
||||
to: 'broker/write.ts'
|
||||
via: 'create/update/deleteCalendarEvent'
|
||||
pattern: '(create|update|delete)CalendarEvent'
|
||||
- from: 'apps/api/src/broker/outboxWorker.ts'
|
||||
to: 'broker/sync.ts syncCalendar'
|
||||
via: 'targeted re-sync on confirm (D-06)'
|
||||
pattern: 'syncCalendar'
|
||||
- from: 'apps/api/src/index.ts'
|
||||
to: 'startOutboxWorker'
|
||||
via: 'background worker startup'
|
||||
pattern: 'startOutboxWorker'
|
||||
---
|
||||
|
||||
<objective>
|
||||
@@ -132,21 +132,23 @@ Output: `outboxWorker.ts` GREEN against Plan 01's state-machine tests; worker st
|
||||
</tasks>
|
||||
|
||||
<threat_model>
|
||||
|
||||
## Trust Boundaries
|
||||
|
||||
| Boundary | Description |
|
||||
|----------|-------------|
|
||||
| worker → Fastmail | The worker is the only component that drains the outbox to Fastmail |
|
||||
| stored payload → VEVENT | Member-supplied payload is reconstructed into an ICS PUT |
|
||||
| Boundary | Description |
|
||||
| ----------------------- | ------------------------------------------------------------------- |
|
||||
| worker → Fastmail | The worker is the only component that drains the outbox to Fastmail |
|
||||
| stored payload → VEVENT | Member-supplied payload is reconstructed into an ICS PUT |
|
||||
|
||||
## STRIDE Threat Register
|
||||
|
||||
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|
||||
|-----------|----------|-----------|-------------|-----------------|
|
||||
| T-03-11 | Repudiation | silent last-write-wins on concurrent edit | mitigate | 412 If-Match conflict routes to conflict flow (re-sync + warn), never overwrites (D-08) |
|
||||
| T-03-12 | Denial of Service | a poison row retrying forever | mitigate | MAX_ATTEMPTS=5 then dead-letter; bounded backoff window (~30 min) per D-07 |
|
||||
| T-03-13 | Information Disclosure | logging decrypted app password during dispatch | mitigate | Per-item catch logs `err.message` only; never the credential (poller T-03-04 pattern) |
|
||||
| T-03-14 | Tampering | partial-failure data loss on edit-as-move | mitigate | create-before-delete ordering; create-fail aborts delete; delete-fail surfaces "remove manually" (D-04) |
|
||||
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|
||||
| --------- | ---------------------- | ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| T-03-11 | Repudiation | silent last-write-wins on concurrent edit | mitigate | 412 If-Match conflict routes to conflict flow (re-sync + warn), never overwrites (D-08) |
|
||||
| T-03-12 | Denial of Service | a poison row retrying forever | mitigate | MAX_ATTEMPTS=5 then dead-letter; bounded backoff window (~30 min) per D-07 |
|
||||
| T-03-13 | Information Disclosure | logging decrypted app password during dispatch | mitigate | Per-item catch logs `err.message` only; never the credential (poller T-03-04 pattern) |
|
||||
| T-03-14 | Tampering | partial-failure data loss on edit-as-move | mitigate | create-before-delete ordering; create-fail aborts delete; delete-fail surfaces "remove manually" (D-04) |
|
||||
|
||||
</threat_model>
|
||||
|
||||
<verification>
|
||||
@@ -156,9 +158,10 @@ Output: `outboxWorker.ts` GREEN against Plan 01's state-machine tests; worker st
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- End-to-end backend write loop closed: endpoint → outbox → worker → Fastmail → re-sync → cache authoritative.
|
||||
- D-04/D-06/D-07/D-08 all enforced and tested.
|
||||
</success_criteria>
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
Create `.planning/phases/03-event-write-back-pwa-install/03-04-SUMMARY.md` when done.
|
||||
|
||||
Reference in New Issue
Block a user