test: fixture-test the recurrence engine; typecheck now blocking (audit bucket 4b — H2 part 2, M3) - #5
Merged
Conversation
…cking (audit H2 part 2, M3) Extract rawParser's recurring-event expansion into a pure recurrence.ts (parseEvents): RRULE window, EXDATE exclusion, RECURRENCE-ID rescheduled overrides, tzid-aware time reconstruction. 'now' is injectable and settings are passed in; rawParser is now a thin parse+delegate wrapper. Algorithm unchanged — recurrence.test.ts proves it against real .ics fixtures parsed by node-ical (weekly expansion, EXDATE, rescheduled override, window, cancelled). With the engine extracted and the remaining index.ts adapter functions given light type annotations, tsc --noEmit is clean (65 -> 0 errors), so the CI typecheck job flips from informational to a blocking gate (audit M3). Full suite: 37 tests green; typecheck: 0 errors. Build verified via CI (arm64 host can't build the native deps). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019cVCdCtNzUJmy1yen3JyBk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Audit bucket 4, part 2 (finding H2), and closes out M3.
recurrence.ts— extractedrawParser's recurring-event expansion into a pureparseEvents: RRULE window, EXDATE exclusion, RECURRENCE-ID rescheduled overrides, tzid-aware time reconstruction.nowis injectable; settings are passed in.rawParseris now a thin parse+delegate wrapper. Algorithm unchanged.recurrence.test.ts— parses real.icsfixtures with node-ical and asserts on the expanded output (weekly expansion, EXDATE, rescheduled override, window bounds, cancelled filtering). Suite is now 37 tests.typecheckis now a blocking CI gate — with the engine extracted and the remainingindex.tsadapter functions lightly annotated,tsc --noEmitis clean: 65 → 0 errors (audit M3).continue-on-errorremoved from the typecheck job.Why
H2: the recurrence/timezone logic was the highest-risk, wholly-untested code. It's now isolated, deterministic (injectable
now), and covered by fixture tests. M3: the whole codebase type-checks strict-clean, so the gate can enforce it.Testing
npm test: 37 passed (31 parsing + 6 recurrence).npm run typecheck: 0 errors.Note
Only-type annotations were added to the
index.tsadapter functions — no runtime logic changed. The recurrence algorithm was ported verbatim; the fixture tests are the proof of behavior-preservation.Reviewer note
No automated PR reviewer configured; self-reviewed — extraction is behavior-preserving, tests assert on real node-ical output, no secrets, blast radius is the parse path.
🤖 Generated with Claude Code
https://claude.ai/code/session_019cVCdCtNzUJmy1yen3JyBk