Skip to content

refactor: cut comments to what the code cannot say, and check new ones - #22

Merged
aicayzer merged 4 commits into
mainfrom
cull-comments
Dec 3, 2026
Merged

aicayzer merged 4 commits into
mainfrom
cull-comments

Conversation

@aicayzer

@aicayzer aicayzer commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Cuts the comments in every hand-written file to what the code cannot say, and adds a check that stops new banned comments from being added. No behavior changes.

Changes

  • Comment lines in src/, styles.css, scripts/ and .github/workflows/ go from 1552 to 503 (whole-line comments plus lines inside block comments; the new check script and its test are not counted).
  • Added scripts/check-comments.mjs and scripts/check-comments.test.mjs, ported from InkKit without the Swift and DocC rules. They fail an added whole-line comment that names our issue or pull request, holds TODO or FIXME, says "previously" or "used to be", or leaves a TSDoc paragraph over four prose lines.
  • ci.yml: the build job checks out full history, runs the check on pull requests and runs its tests. No new job or required check.
  • AGENTS.md: new ## Comments section, a pointer to it in Conventions, and a Comments rule in Code Review Rules.
  • One comment reworded so the check does not read #100% as an issue number.

Testing

  • pnpm types:check, pnpm test (382 tests), pnpm build and pnpm pack:check pass.
  • node --test scripts/check-comments.test.mjs: 51 pass.
  • node scripts/check-comments.mjs --all reports nothing.
  • A scratch commit with a TODO, an issue reference and "previously" failed the check with exit 1 on all three lines, then was dropped.
  • Not tested: the CI step itself on a real pull request event (this pull request is its first run).

Notes for reviewers

  • Outside claims kept were not re-verified against node_modules: Fumadocs behavior in styles.css, code-tabs.tsx, cards.tsx, page-table-of-contents.tsx, search.ts (Orama tokenizer and row limits), and PostHog behavior in analytics.ts (cookieless mode, person profiles). Each stays as one line because it guards working code.
  • Traps kept short: Worker stage order and Vary handling, the 406 wildcard, the slash redirect's absolute URL, no GITHUB_SHA in buildCommit, scan-not-regex in page-limits.ts and canonical.ts, Dependabot hold and concurrency groups in the workflows, the Steps animation and focus waits.
  • Dropped the long design prose in analytics.ts, search.ts and styles.css; the reasons that remain are one line each.

Checklist

  • The title is a scoped Conventional Commit.
  • New behavior has a test that was seen failing first, or no test was needed and the reason is above.
  • Docs, comments and the contract still say what is true after this change.

@aicayzer
aicayzer marked this pull request as ready for review December 3, 2026 16:45
@aicayzer

aicayzer commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed by a separate agent; every check passed on this head. Merged by admin, as August directed for comment-cull pull requests (3 December).

@aicayzer
aicayzer merged commit 75a078b into main Dec 3, 2026
9 of 10 checks passed
@aicayzer
aicayzer deleted the cull-comments branch December 3, 2026 16:47
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