Repository navigation
refactor(host,scripts): cut comments to what the code cannot say - #496
Merged
Merged
Conversation
aicayzer
marked this pull request as ready for review
December 4, 2026 04:52
aicayzer
commented
Dec 4, 2026
aicayzer
left a comment
Contributor
Author
There was a problem hiding this comment.
Review: ready to merge with open items
Summary. Cuts comments in host/ and scripts/, states the comment rule in AGENTS.md with a review line, and adds scripts/check-comments.ts to the Checks job; outside the new script and its test it is comments only.
First draft: 3/5. The cut deleted a security reason in host/src/permission-flags.ts and about 50 other comments of kept kinds; all restored in 14a32f6.
Checked.
- Done: the check ran in the real
Checksjob on this pull request; tried locally against made-up bad comments and on Node 22. - Comments: each removed block in
host/andscripts/read against its code; the new## Commentssection against the pattern in InkKit. - Every path: the
ci-changes.tsclassification of the new script.
Found.
- Worker
execArgvreason deleted as disproven. It is true on Node 26.13.1: a worker given its ownexecArgvreads past--permission, which Node's docs call intended. Without it, a later change could add--allow-worker. Restored in 14a32f6.Comments - Ordering, fence and race reasons cut in the supervisor, sandbox plan, proof stubs and release scripts. Restored in 14a32f6.
Comments - "no longer" flagged as history. On this tree it mostly states a present fact, so the check no longer bans it. Fixed in fc9220a.
Done
For an issue.
- Bare-version start-sequence record. A compatibility path the repository's rules do not allow. Filed as #497.
Quick fixes. 4 applied by the reviewer.
Reviewed by withmarfa-reviewer on Claude Sonnet 5.5. This review may contain mistakes.
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.
Summary
Cuts the comments in
host/andscripts/to what the code cannot say, adds the comment rule toAGENTS.md, and addsscripts/check-comments.ts, which fails a pull request whose added comments break the rule. No behavior change.Changes
.ts .mts .js .mjs .rs .sh):host/687 to 199,scripts/1,488 to 417 (the 13 extra lines over the cull alone are the new check and its test).AGENTS.md: a## Commentssection (same shape as InkKit's, in this repository's terms) replaces the one-line code-comment rule under Writing, and a Comments. bullet joins Code Review Rules.scripts/check-comments.tswithscripts/test/check-comments.test.ts(47 cases): ported from InkKit, in TypeScript onnode --experimental-strip-types. It reads the lines a change adds and flags our issue or pull request numbers, TODO/FIXME, "previously", "used to be", "no longer", and a doc paragraph over four prose lines. It skips vendored, built, generated and agent files, Markdown, and trailing comments; it passes# v4.2.0pin tags and links to outside trackers..github/workflows/ci.yml: a step in the existingChecksjob, on pull requests only, diffing against the base (the checkout getsfetch-depth: 0). It is not a new job or a required check.scripts/ci-changes.ts: the script is classed with the other check scripts (code,tests) and not "everything".Testing
pnpm build,pnpm connectors:check,pnpm typecheck,pnpm lint,pnpm format:checkpass;cargo fmt --checkonhost/sandboxpasses.vitestoncheck-comments,ci-changesandtreepasses (191 tests). On this Machost/tests that needsandbox-execinside a sandbox, the Nodelibnodedylib, orvendor/marfafail for environment reasons and were not run to green; CI covers them. The proof was not run, as briefed.git diff -U0with a filter for non-comment removals); three deletions that had taken code lines were restored.check-comments --allon this tree is clean forhost/,scripts/and.github/. A made-up trial commit withTODO ... #123,withmarfa/plugins#45, "no longer", a pin tag, a Node issue link and# fixes #77in a workflow: the check flagged the number, the repository reference, "no longer" and the workflow number (4 errors, exit 1) and passed the pin tag and the Node link.--allow-net(since v25.0.0) against Node 26.13.1 and the v26 permissions docs (host/node.jsonpins 26.14.0);node:sqliteandnode:ffiloading under--permission, by running it; Landlock ABI 6 scopes and ABI 9 pathname sockets against the kernel docs; seccomp, seatbelt, launchdKeepAliveand systemdRestart=on-failure; the nodejs/node release keys. Disproven: the claim that a worker'sexecArgvbypasses the flags (the v26 docs call it intended), deleted and the code kept. Unverifiable vendor observations in the GitHub, Todoist and Raindrop stubs were cut or kept short and dated.Notes for reviewers
execArgvclaim contradicts the v26 docs; the oldest-Marfa-release comment inconnector-plugins.tswas deleted unverified; the GitHub, Todoist and Raindrop stub observations are unverified live claims.host/src/start-sequence.tsstill parses a legacy version-only record;host/src/supervisor.tsslot state is over 1,100 lines;scripts/proof/github-stub.tsis about 3,000 lines and should be split; the Linux and macOS sandbox notes overlap betweenhost/src/sandbox-plan.tsandhost/src/inputs.ts;scripts/follow-release.shandfollow-node.shhold their argument docs only in comments.Checklist
Review
Reviewed by
withmarfa-reviewer, standard depth. Outside the new files the diff is comments only. The review restored about 50 comments of kept kinds, among them the--allow-workersecurity reason inhost/src/permission-flags.ts(run on Node 26.13.1: a worker given its ownexecArgvreads past--permission, which Node's docs call intended), the supervisor's ordering and fence reasons, and the reason for the bare-version branch inhost/src/start-sequence.ts. It also turned internal doc comments into//lines or cut them. The check ran in the realChecksjob on this pull request and passed. After a run over the whole tree, "no longer" is no longer a banned word: on this tree it mostly states a present fact ("Google no longer accepts the grant"), which matches InkKit's check. Merged without waiting forFull CI:Checks, the only job that runs the new script, passed, and the rest of the change is comments.