Skip to content

refactor(host,scripts): cut comments to what the code cannot say - #496

Merged
aicayzer merged 6 commits into
mainfrom
refactor/cull-comments-host-scripts
Dec 4, 2026
Merged

aicayzer merged 6 commits into
mainfrom
refactor/cull-comments-host-scripts

Conversation

@aicayzer

@aicayzer aicayzer commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Cuts the comments in host/ and scripts/ to what the code cannot say, adds the comment rule to AGENTS.md, and adds scripts/check-comments.ts, which fails a pull request whose added comments break the rule. No behavior change.

Changes

  • Comment lines (whole-line, .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).
  • Kept: ordering, race and workaround reasons, test waits, fixed clocks and witnesses, public refusals and conditions, the sandbox and platform constraints, and the workflow pin tags. Removed: narration, restating, history words, our issue numbers, people, TODO/FIXME and docs on internal items.
  • AGENTS.md: a ## Comments section (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.ts with scripts/test/check-comments.test.ts (47 cases): ported from InkKit, in TypeScript on node --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.0 pin tags and links to outside trackers.
  • .github/workflows/ci.yml: a step in the existing Checks job, on pull requests only, diffing against the base (the checkout gets fetch-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:check pass; cargo fmt --check on host/sandbox passes.
  • vitest on check-comments, ci-changes and tree passes (191 tests). On this Mac host/ tests that need sandbox-exec inside a sandbox, the Node libnode dylib, or vendor/marfa fail for environment reasons and were not run to green; CI covers them. The proof was not run, as briefed.
  • Every removed line was checked to be a comment (git diff -U0 with a filter for non-comment removals); three deletions that had taken code lines were restored.
  • check-comments --all on this tree is clean for host/, scripts/ and .github/. A made-up trial commit with TODO ... #123, withmarfa/plugins#45, "no longer", a pin tag, a Node issue link and # fixes #77 in 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.
  • Outside claims checked: Node permission flags and --allow-net (since v25.0.0) against Node 26.13.1 and the v26 permissions docs (host/node.json pins 26.14.0); node:sqlite and node:ffi loading under --permission, by running it; Landlock ABI 6 scopes and ABI 9 pathname sockets against the kernel docs; seccomp, seatbelt, launchd KeepAlive and systemd Restart=on-failure; the nodejs/node release keys. Disproven: the claim that a worker's execArgv bypasses 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

  • Review depth: comments only, so the risk is a cut comment that guarded a trap. Read the diff for those.
  • To file as issues: the worker execArgv claim contradicts the v26 docs; the oldest-Marfa-release comment in connector-plugins.ts was deleted unverified; the GitHub, Todoist and Raindrop stub observations are unverified live claims.
  • Code health, not fixed here: host/src/start-sequence.ts still parses a legacy version-only record; host/src/supervisor.ts slot state is over 1,100 lines; scripts/proof/github-stub.ts is about 3,000 lines and should be split; the Linux and macOS sandbox notes overlap between host/src/sandbox-plan.ts and host/src/inputs.ts; scripts/follow-release.sh and follow-node.sh hold their argument docs only in comments.

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.

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-worker security reason in host/src/permission-flags.ts (run on Node 26.13.1: a worker given its own execArgv reads past --permission, which Node's docs call intended), the supervisor's ordering and fence reasons, and the reason for the bare-version branch in host/src/start-sequence.ts. It also turned internal doc comments into // lines or cut them. The check ran in the real Checks job 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 for Full CI: Checks, the only job that runs the new script, passed, and the rest of the change is comments.

@aicayzer
aicayzer marked this pull request as ready for review December 4, 2026 04:52
@aicayzer
aicayzer merged commit 33b8ef0 into main Dec 4, 2026
2 of 3 checks passed
@aicayzer
aicayzer deleted the refactor/cull-comments-host-scripts branch December 4, 2026 04:57

@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 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 Checks job on this pull request; tried locally against made-up bad comments and on Node 22.
  • Comments: each removed block in host/ and scripts/ read against its code; the new ## Comments section against the pattern in InkKit.
  • Every path: the ci-changes.ts classification of the new script.

Found.

  • Worker execArgv reason deleted as disproven. It is true on Node 26.13.1: a worker given its own execArgv reads 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.

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