Skip to content

refactor(connectors): cut comments to what the code cannot say - #495

Merged
aicayzer merged 2 commits into
mainfrom
refactor/cull-comments-connectors
Dec 4, 2026
Merged

aicayzer merged 2 commits into
mainfrom
refactor/cull-comments-connectors

Conversation

@aicayzer

@aicayzer aicayzer commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Cuts comments in connectors/ to what the code cannot say, per the session 298a brief. Comments only; no behaviour change.

Comment lines (whole-line comments, tracked .ts/.js)

Connector Before After
github 806 295
google-calendar 511 159
raindrop 767 162
readwise 483 144
rss 433 136
todoist 272 131
Total 3,272 1,027

Outside claims checked

  • Verified and kept: Google Calendar stale sync token answers 410; event id characters are base32hex (a-v, 0-9); GitHub star timestamp media type; GitHub notifications per_page max 50 and If-Modified-Since 304; Readwise limits (240, Reader list 20, save 50, update 50, delete 20 per minute); Readwise 8,191-character highlight text; Raindrop perpage max 50, collection ids 0, -1, -99, highlight default colour yellow, collection delete moves bookmarks to Trash; Todoist 1,000 partial syncs per 15 minutes; RFC 7303 BOM then charset precedence.
  • Not settled, comment deleted or reduced, code kept: Google 409 on an existing event id; Google 400 on restoring a deleted split piece; Todoist command uuid runs once and the three-month completed-tasks window; GitHub 410 for issues of a repository with issues off; Raindrop 300 MiB Pro upload limit.
  • Kept as working-code guards, not verified: GitHub transfer behaviour (301 from the old address, transfer recorded after the new issue shows), Todoist recurrence behaviour observed in October 2026, feedsmith and Raindrop search-lag claims.

Issues to file

  • Verify GitHub issue transfer behaviour the connector relies on (301 from old address, delayed transfer record, copied comments keep old times).
  • Verify Google Calendar 409 on existing id and 400 on restoring a deleted split series piece.
  • Verify Todoist command-uuid idempotency and the completed-tasks window against API v1.
  • Verify Raindrop upload size limit and that search lags new bookmarks (the live check lists instead).
  • Verify feedsmith xml:base and JSON Feed detection claims behind the RSS parse.

Code health

  • connectors/github/src/read.ts: over 2,300 lines; split by read stage.
  • connectors/google-calendar/src/write.ts: about 1,700 lines; split create, update, series and restore.
  • connectors/raindrop/src/write.ts and read.ts: each over 1,000 lines.
  • connectors/github/test/transfer.test.ts, connectors/google-calendar/test/write.test.ts: very large test files.
  • connectors/readwise: reader/outbound.ts and managed.ts carry heavy conditional logic with little structure.
  • connectors/rss/src/pictures.ts and connectors/raindrop/src/files.ts duplicate the retry-status test (408, 425, 429, 5xx) also in readwise content-pictures.ts.
  • connectors/todoist/src/outbound.ts: no unit test names the October 2026 recurrence observations as fixtures.

Checks run

pnpm build, pnpm connectors:check, pnpm typecheck, pnpm lint, pnpm format:check pass; vitest run connectors/ 75 files, 1,860 tests pass. Proof not run.

Review

Reviewed by withmarfa-reviewer (standard depth: comments only, checked by comparing every changed file parsed with comments removed against main; all 122 identical). The review restored 313 comments of the kinds the rule keeps: ordering and race reasons, vendor constraints the code depends on, reasons for guards that look redundant, and test waits, stub shapes and witnesses. The table shows the counts after the review. Merged without waiting for Full CI: the change cannot affect any job's behavior.

@aicayzer
aicayzer merged commit 3de8669 into main Dec 4, 2026
16 of 18 checks passed
@aicayzer
aicayzer deleted the refactor/cull-comments-connectors branch December 4, 2026 04:51

@aicayzer aicayzer left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: ready to merge with open items

Summary. Cuts comments in connectors/ to what the code cannot say; it is comments only, so it cannot change behavior.

First draft: 4/5. The cut removed 313 comments of kinds the rule keeps; all restored in 236f0b3.

Checked.

  • Done: all 122 changed files parsed with comments removed are identical to main.
  • Comments: each removed block read against the code it sat on, connector by connector.

Found.

  • Trap and vendor-constraint comments cut. Ordering and race reasons, vendor limits and status codes the code depends on (pagination caps, sync tokens, 409, 410, 412, 304), reasons for guards that look redundant, and test waits, stub shapes and witnesses. Restored, one or two lines each, in 236f0b3. Comments

For an issue.

  • Google Calendar status codes. A wrong assumption could duplicate an event or drop a change. Filed as #499.
  • Todoist command-uuid idempotency and completed-tasks window. A resend could apply twice. Filed as #500.
  • GitHub issue-transfer behavior. A transferred issue could be written twice. Filed as #501.

Quick fixes. 1 applied by the reviewer.


Reviewed by withmarfa-reviewer on Claude Sonnet 5.5. This review may contain mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant