4.5 KiB
4.5 KiB
Tasks — add-events-ics-export
1. Spec authoring
- 1.1 Confirm shipped
openspec/specs/api-plugin-events/spec.mdis the canonical baseline (already folded byadd-api-plugin-eventsarchive) - 1.2 Author
proposal.mdwith## Why,## What changes,## Source mapping(each row citing RFC 5545 section or existing event-schema field) - 1.3 Author
specs/api-plugin-events/spec.mdwith## ADDED Requirementsfor the ICS endpoint, escape rules, line-folding, RSVP attendees, new error code, OTel counters - 1.4 Every
### Requirementcarries a**Verified by:**line naming planned test files (authored at draft time per §0c)
2. Implementation — ICS builder
- 2.1
src/ics/ics-builder/ics-builder.ts—buildVCalendar,foldLine,escapeText,formatDateUtc,mapStatus,mapAttendeeStatus - 2.2
src/ics/ics-builder/ics-builder.types.ts— public types (BuildVCalendarInput,IcsAttendee,IcsEventStatus) - 2.3
src/ics/ics-builder/ics-builder.md— ≥200-word sibling doc (Purpose / Features / Basic / Advanced / API Reference / Implementation Notes) - 2.4
src/ics/ics-builder/ics-builder.test.ts— byte-level fold, escape, CRLF, UTC date format, status / PARTSTAT maps, with-rsvps body - 2.5
src/ics/ics-builder/index.ts— explicit named re-exports
3. Implementation — error code, OTel, routes
- 3.1 Extend
EVENTS_PLUGIN_CODESwithICS_INVALID_QUERY - 3.2 Extend
EventsInstrumentswithicsServedTotal+icsFailedTotal - 3.3
src/routes/ics-export/ics-export.ts—createIcsExportRoutes({ eventRepository, rsvpRepository, clock, instruments? }) - 3.4
src/routes/ics-export/ics-export.types.ts—IcsExportRoutesConfig - 3.5
src/routes/ics-export/ics-export.md— ≥200-word sibling doc - 3.6
src/routes/ics-export/ics-export.test.ts— 200 / 401 / 404 / 403 / 422 paths, header asserts, OTel asserts - 3.7
src/routes/ics-export/index.ts— explicit named re-exports
4. Wire-up
- 4.1
plugin.tsonReadymountscreateIcsExportRoutesalongsidecreateEventRoutesunder the samebasePath - 4.2
plugin.test.tsextended to assert the ICS route is mounted - 4.3
src/index.tsre-exportscreateIcsExportRoutes,buildVCalendar,BuildVCalendarInput,IcsAttendee,IcsExportRoutesConfig,IcsEventStatus - 4.4
package.json— add./ics/ics-builder/ics-builderand./routes/ics-export/ics-exportsubpath exports - 4.5
README.md— add Modules entries; add ICS quickstart snippet
5. Tests
- 5.1
src/error-codes/error-codes.test.ts— pinICS_INVALID_QUERYis reachable from a realthrow/returnsite - 5.2
src/otel/instruments.test.ts— extend withicsServedTotal+icsFailedTotalassertions - 5.3
src/api-plugin-events.spec-conformance.test.ts— pincreateIcsExportRoutes,buildVCalendarre-exports - 5.4 Every new
it(...)carries{ timeout: 5000 }(or 30000 for genuinely async)
6. Pre-archive verification — 5-gate triple
- 6.1
bunx biome check src/— clean - 6.2
bunx turbo lint typecheck test --filter=@suaveplan/api-plugin-events— green - 6.3
bunx turbo test:coverage --filter=@suaveplan/api-plugin-events— 100 / 100 / 100 / 100 - 6.4
bun scripts/openspec-conformance.ts @suaveplan/api-plugin-events— 0 errors - 6.5
bunx turbo build --filter=@suaveplan/api-plugin-events— green
7. Pre-archive 9-row checklist (AGENTS.md §13)
- 7.1 Spec reconciliation — every
### Requirementwalked, every**Verified by:**test exists - 7.2 Banned-pattern scan — zero
TODO|FIXME|ts-ignore|ts-expect-error|.skip|.only - 7.3 Barrel-shape scan — no
export *in featureindex.ts - 7.4 Test-runner imports — every test file imports only from
@suaveplan/testing/runner - 7.5 Missing
.mdscan — every implementation.tshas a sibling.md - 7.6 Bare version check — no bare semver in
package.json - 7.7 Subpath export count — matches feature-module count
- 7.8 Security scan — no hardcoded secrets
- 7.9 No biome-ignore suppressions in new code
8. Archive
- 8.1 Fold spec delta into
openspec/specs/api-plugin-events/spec.md - 8.2 Move
openspec/changes/add-events-ics-export/→openspec/archive/2026-05-20-add-events-ics-export/ - 8.3 One commit
feat(api-plugin-events): add ICS export endpoint (was §4-deferred)— pre-pull-rebase first, never--no-verify, never force-push