Repository navigation
Comments: keep only those one rule allows, outside the files #11 changes - #15
Open
nissa-seru wants to merge 5 commits into
Open
nissa-seru wants to merge 5 commits into
nissa-seru wants to merge 5 commits into
Conversation
added 2 commits
October 27, 2026 09:44
The first of two commits that apply one rule to every comment in src/, test/ and scripts/, apart from the fourteen files an open pull request changes: src/feature-sets.ts, github-adapter.ts, index.ts, server.ts, tools-issues-pr.ts, tools-read.ts and types.ts, and test/githubAdapter, harness, integration, smoke, toolsRead, webhook and wp8-docs. A comment stays only as (a) a license header, (b) non-obvious behaviour forced by an outside dependency, platform or protocol (GitHub's REST and GraphQL APIs and webhooks, octokit, MCPL and @animalabs/mcpl-core, Node, npm, Markdown) that the code can't be reshaped to show without adding complexity, (c) a directive, (d) a doc comment defining a public contract, or (e) an issue or RFC link explaining a constraint the code can't express. For a server people run, (d) is what an operator sets or an agent meets that README.md, docs/ and deploy/github-mcpl.env.example don't state. This commit holds every hand-written line: - Comments that stay, cut to the part the list allows, and corrected where the review of every comment found them wrong. For example: the webhook endpoint's answers, which no doc lists in full; a state file that can't be read is reported and the server starts empty, with no promise of exactly one line, and a missing one starts empty without one; fake-host's --log holds the transcript, every command but quit, the server's notifications and the child's stderr, not every frame; Node writes to a pipe asynchronously on POSIX, not only on macOS. - Six reshapes that carry what a cut comment told its reader, with behaviour unchanged: an explicit createdAt on the pull request four poller tests seed, NO_CHECKPOINT_STORE (in the two tool tests that build that store), NEW_TEXT_KINDS, a named absent state file, HEAD_BACKLOG_DRAIN_PASSES for the head backlog's 200, and IDLE_BEFORE_INPUT_MS. Where a reshape carries a comment's meaning, that comment goes in this commit with it. The next commit removes every other comment and changes nothing else: with every comment stripped from both trees, this commit and the next are identical apart from blank lines.
Removes each comment the commit before this one left as main had it, apart from those that stay as written. With every comment stripped from both trees, and blank lines dropped on both sides, this commit's tree and its parent's are identical. Of 1,188 comments at c243333 in the files this pass covers (src 545, test 517, scripts 126), 103 stay: 53 in src, 40 in test and 10 in scripts.
There was a problem hiding this comment.
Automated review
Recommendation: needs a maintainer's decision. The project states too little to tell whether the change belongs.
Reviewed commit 8a33bab with claude-opus-5-5, by reading the code. It did not run the code or look at the checks.
Does this change belong in the project?
The project states too little to tell. This PR applies a comment policy the project never states. It cuts 1,188 comments to 103 in 26 files, against a codebase whose current habit is dense explanatory comments.
5 reasons with sources
Whether the project wants that policy is for the maintainers to decide, and nothing in the repository settles it.
- The project says nothing about how much to comment code, so the PR's rule comes from the contributor, not the project. README.md covers purpose, setup and behaviour (push events, channels, feature sets with rollback, no merge), and the repository has no contributing guide or rule files. docs/ only uses the word 'comment' for GitHub comments. The five-part rule in the PR description has no basis in any project document. (README.md)
- The existing code is heavily commented, so the code itself suggests the maintainers chose to write long explanatory comments. The 26 files held 1,188 comments before the change. Many give reasons: the fake-host header explains why a fulfilled RPC is not a pass, why the shutdown grace is ten seconds, and why stdio is piped. Others link to task IDs (TASK-SRHKG.1.10) and spec sections (§14.3). The PR removes these as a matter of policy. (scripts/e2e/fake-host.mjs (base), src/ and test/)
- The change adds no feature, dependency or public interface, and doesn't touch the architecture. Besides deleting comments, the PR makes six small reshapes: new constant names such as HEAD_BACKLOG_DRAIN_PASSES (MAX_HEAD_BACKLOG stays at 200), NO_CHECKPOINT_STORE and IDLE_BEFORE_INPUT_MS, plus a few edits to test fixtures. None of them changes the code's structure or behaviour. (src/poller.ts)
- The policy covers only part of the codebase, so files under the same folders would follow two comment styles. The PR leaves out 14 files in src/ and test/, including server.ts, index.ts, github-adapter.ts and harness.ts, because the open #11 changes them. Until a follow-up covers them, those files keep the old dense comments next to the 26 trimmed ones. (PR scope vs. src/ and test/ layout)
- Some comments that stay were rewritten, and the code review found a few of those no longer state things correctly. The code review found shortened or rewritten comments that are now inaccurate (content.ts:152-153, release-changelog.mjs:23-25, errors.ts:1-5). These are defects for the author to fix, not reasons for this verdict. They do show that the rewrite changes documentation content as well as deleting it. (src/content.ts, scripts/release-changelog.mjs, src/errors.ts)
Findings
No findings of medium or high severity.
4 more findings, less severe
- Low severity, documentation,
src/content.ts:152-153. Shortened comment names only resolve_thread as taking the thread's node id. The rewritten comment inrenderReviewThreadssayst.idis "the GraphQL node idresolve_threadtakes". The original also namedunresolve_thread, which takes the same id (seeTOOL_UNRESOLVE_THREADandrequireThreadOnPullin src/tools-review.ts). A reader may conclude that only one tool uses this id. - Low severity, documentation,
scripts/release-changelog.mjs:23-25. Rewritten comment wrongly says Node writes to pipes asynchronously on all of POSIX. The old comment said the stderr write to a pipe is asynchronous on macOS. The new one says "Node writes to a pipe asynchronously on POSIX". As I understand Node's process I/O notes, pipe writes on process.stdout/stderr are synchronous on Linux and asynchronous on other platforms such as macOS. If so, the corrected comment is now wrong for Linux, which is the platform the PR's own test runs used. Either restore the platform qualifier or just say the write can be asynchronous. - Low severity, documentation,
src/errors.ts:1-5. New errors.ts header garbles the rule it cites. The header now says "a method that will never be answered must return an error, and a host's rejection is a JSON-RPC error object". The errors in this module are raised by this server's handlers, not by a host. The old text said the actual rule: a handler that cannot answer returns a JSON-RPC error object with a documented code, never silence and never a failure-flag result. The rewrite makes it unclear who must do what. - Low severity, maintainability,
test/toolsIssuesPr.test.ts:19. NO_CHECKPOINT_STORE is duplicated across two test files. The reshape adds the sameconst NO_CHECKPOINT_STORE = undefined as unknown as StateStore;in test/toolsIssuesPr.test.ts and test/toolsReview.test.ts. Only the review file keeps the comment explaining why the store is absent. The shared harness is the natural home, but it is off-limits here because #11 touches it. Note this as a follow-up so the two copies don't drift.
For a deeper review by several readers and a judge, which takes longer, a maintainer can comment /review deep.
The comment kept in renderReviewThreads named only resolve_thread as taking t.id. unresolve_thread takes the same GraphQL node id. This changes that one comment and nothing else.
This was referenced Oct 27, 2026
added 2 commits
October 28, 2026 12:06
main now carries the faster test suite (anima-research#18), which edits code lines beside four comments this branch rewrites or removes. Each conflict keeps this branch's comment text with main's code: ReleaseError and DeliveryRing are exported, collectFragments takes the directory, and the listener's dedupCapacity getter stays without the section banner this branch removes.
The comment said what the fake's 'lost' answer does, which the server's handler shows: it reads the whole request and then destroys the socket. It names no behaviour the code can't show, so under the pass's rule it goes. The other comments main brought into the covered folders, in scripts/release-changelog.mjs, stay: they say why the main-module check compares real paths and tolerates an argv[1] that names no file, which is how Node sets argv[1] and import.meta.url.
This was referenced Oct 28, 2026
Merged
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.
This keeps a comment in
src/,test/andscripts/only where it says something the code can't show, under the rule below, and removes the rest: 1,189 comments in the 28 files it covers become 106. It leaves out the 14 files already onmainin those folders that the open #11 changes. Once comments are removed, the code in the 28 files is the same as onmain, apart from six small reshapes that put into code what a removed comment said.The rule
A comment stays only if it is one of these:
README.md,docs/anddeploy/github-mcpl.env.exampledon't already state, such as the webhook endpoint's status codes, the rollback receipt, thethreadforms the tools accept, and the end-to-end host's command vocabulary thatdocs/e2e-report.mdpoints to;@animalabs/mcpl-core, Node, npm or Markdown, where reshaping the code to show it would add complexity;The 28 files hold no license headers and no directives.
What changes
5642690holds every line written by hand, apart from5b73310's and the merge's. That's the comments that stay, cut down to the part the rule allows and corrected where they didn't match the code, and the six reshapes. Where a reshape carries a removed comment's meaning, that comment's removal is in this commit too. It touches 23 files, with 203 lines added and 640 removed, as git counts them.8a33babremoves every other comment, and 114 blank lines, and changes no code: Bun 1.4.4's transpiler, which drops comments, gives identical output for all 26 files at5642690and at8a33bab. The commit touches 26 files, with 1 line added and 2,013 removed. The added line ismaxCheckedPulls: 0,without its trailing comment.5b73310changes one comment that stays, inrenderReviewThreads(src/content.ts:153–154), to nameunresolve_threadbesideresolve_threadas a tool that takes the review thread's GraphQL node id. It touches 1 file, with 2 lines added and 2 removed.9c562c2mergesmainat7eaea03, which carries Report a write tool's outcome as unknown when GitHub's answer is lost or is a 5xx #17 and Run the test files in one process, and test the dedup ring and the changelog script in process #18, to resolve the conflicts Run the test files in one process, and test the dedup ring and the changelog script in process #18 made inscripts/release-changelog.mjsandsrc/webhook.ts.bd9f4bb: we judged the comments the merge brought into these files, five lines in two blocks, and this commit removes one block:FakeGitHubintest/lost-answer.test.tsgo. They said what the fake's'lost'answer does, and what it stands in for, "a connection that drops after GitHub stored a write", which fits none of the rule's items.isMaininscripts/release-changelog.mjsstay, as a note on behaviour that Node forces: "import.meta.url names the script's real path, and argv[1] the path it was run by, which a symlink can differ from".//line and each block comment as one comment. Of the 106 that stay, 53 are insrc/, 40 intest/and 13 inscripts/. This pull request changes 26 of the 28 files.scripts/release-changelog.d.mtsandtest/release-changelog.test.tshold no comments onmain.test/poller.test.tsseed their pull request withcreatedAt: '2026-10-01T00:00:00.000Z', the default thattest/harness.tsalready gives it;test/toolsIssuesPr.test.tsandtest/toolsReview.test.tsname theirundefined as unknown as StateStorestoreNO_CHECKPOINT_STORE;TEXT_KINDSbecomesNEW_TEXT_KINDSintest/tags.test.ts;test/state.test.tsnames the path it loads with no file there,const absent = tempFile();src/poller.tsgainsHEAD_BACKLOG_DRAIN_PASSES = 10, andMAX_HEAD_BACKLOGbecomesHEAD_BACKLOG_DRAIN_PASSES * MAX_CHECKED_PULLS_PER_POLL, which is 200, as before;scripts/e2e/host-lifecycle-check.mjsnames its 400 ms delayIDLE_BEFORE_INPUT_MS.README.md,docs/andCHANGELOG.md. There's no changelog fragment.Scope
The 14 files left out are
src/feature-sets.ts,src/github-adapter.ts,src/index.ts,src/server.ts,src/tools-issues-pr.ts,src/tools-read.ts,src/types.ts,test/githubAdapter.test.ts,test/harness.ts,test/integration.test.ts,test/smoke.test.ts,test/toolsRead.test.ts,test/webhook.test.tsandtest/wp8-docs.test.ts. #11 changes each of them at its head9127a61, and this pull request changes none of them, so the two change no file in common.Tests
main(7eaea03) and atbd9f4bbwith Bun 1.4.4's transpiler, which drops comments. 21 files give identical output. The 7 that differ are the files the six reshapes touch. No file outside the 28 changes.bd9f4bb, on Linux, in a clean checkout:npm ci,npm run typecheckandnpm run buildsucceed on Node 24.22.1. We ran the command thatnpm testruns, with a TAP reporter added, on Node 24.22.1 and on Node 22.12.0. Each run has 617 tests: 597 pass, 18 are skipped, and 2 fail.5b73310and atc243333, each in a clean checkout:npm ci,npm run typecheckandnpm run buildsucceed.npm testruns 606 tests at each, of which 586 pass, 18 are skipped and the same 2 fail.test/wp8-docs.test.ts: "the credential split creates both files at mode 600" and "an empty host reaches the registration script by following step 1". In the runs before the merge, the first stopped atjq: not found, and the second at git's "fatal: repository … does not exist" for the repository's own path.Not verified
scripts/e2e/host-lifecycle-check.mjs. The script ends with 0 of its 7 cases passing atc243333and at5b73310alike, so no run checks that reshape.FakeGitHubApiintest/harness.ts), andtest/githubAdapter.test.tsruns a fake GitHub HTTP server on 127.0.0.1.Ogden-2688 made the change and the merge of
main, and judged the merged-in comments with Agnes-984. Esther-2584 read5642690,8a33bab,5b73310and the merge. Daniel-2612 wrote this description.