Repository navigation
feat(code-tidying): stop new comments with a lint on added lines - #16297
Conversation
…n root The reader moves to scripts/comment-settings.sh so a git-hook entry and /code-tidying:tidy can read the comment posture without opening another skill's directory; skills/remove-comments/scripts/settings.sh stays as the skill-local entry point. It gains the team-only comment_lint level and a --list mode for comment_lint_allow, finds its lib beside itself in an installed hook copy, and starts child scripts with the running bash. Refs: #15647 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmfc5AyfmgUPS3tiv2d
/planning:plan lists each review-criteria file the plan's paths match in its Standards grounding table, and /implementation:implement-dispatch carries them in each brief as a Review criteria line, so an author reads the rule before the first edit. Pull-request prep hands the comment pass the base ref only (--pipeline --base), leaving the granularity to the comment pass's own comment_edit_scope; session-flow's pre-PR text no longer fixes the scope to added comments. Refs: #15647 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmfc5AyfmgUPS3tiv2d
…he posture /code-tidying:remove-comments takes --base <ref>: the scope is the branch's changed code files against the merge base, through scope-code-files.sh --branch-only, which never widens to the repository, and comment_edit_scope sets the granularity. The floor keeps the comment trailing a uses: line pinned to a full commit id. /code-tidying:tidy resolves comment_posture through its own entry point to the shared settings reader: under necessary it adds only a comment the keep list keeps, under none it adds none, and explanatory is unchanged. Refs: #15647 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmfc5AyfmgUPS3tiv2d
comment-lint judges the comment lines a change adds against the comment posture, through the pygments token stream the census uses: a comment outside the allowed shapes (directives, license cues, TODO(#issue), a pinned uses: line's trailer, doc comments, a linked note, an ignore marker, or a comment_lint_allow pattern) is a finding that names the fix. comment_lint sets the level (off by default, report, block); under explanatory it does not run. The entry registers under the check-placement contract: manifest, vendored installer and check lib, a lefthook remote config, setup's install action and the session drift probe. A python3 that cannot import pygments follows the missing-tool rule under the name pygments. sh-entries.test.sh now scans every entry's shell assets for a bash command and for syntax newer than bash 3.2, and reads every plugin's lefthook remote config. Refs: #15647 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmfc5AyfmgUPS3tiv2d
…nts in CI This repository sets comment_posture: necessary, comment_edit_scope: files and comment_lint: report, with allow patterns for the test-scope header. CI runs the comment lint over a pull request's whole diff through scripts/check-comment-lint.sh, which reads the level, posture and allow list from the merge base so a branch cannot lower its own level. ADR 0108 records that new comments are stopped by a lint on added lines and by review, not by a count, with the dry run over the last 50 merged pull requests: 631 findings, no false positive. The review rule and the upstream record say how the lint and the floor differ from her agent. Refs: #15647 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmfc5AyfmgUPS3tiv2d
The judge ends a comment run at a blank line, keeps a license header across blank-separated paragraphs, passes Go doc comments on grouped and member declarations, reads .mts and .cts as TypeScript, ignores a PowerShell # inside a word, and narrows the global and modeline directives. The CI gate takes the base's team file and refuses a head that is no commit id. ADR 0108 records that a second dry run over the same 50 commits changed no finding. Refs: #15647 Co-authored-by: Claude Fable 5.2 <[email protected]>
…c bits Two case statements had no default branch, one test printed a backtick from single quotes, and two fixtures that start with a shebang were mode 100644. Refs: #15647 Co-authored-by: Claude Fable 5.2 <[email protected]>
The plugin contract validator refuses < or > in a skill description. Refs: #15647 Co-authored-by: Claude Fable 5.2 <[email protected]>
Inside one block comment a blank or bare-star line did not end the run, so one link passed every paragraph of prose in the block. The link rule now reads the paragraph the line sits in. The dry run over the same 50 commits is unchanged at 631 findings. Refs: #15647 Co-authored-by: Claude Fable 5.2 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6acc48d1a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The comment lint's CI gate resolved the convention home in the head worktree, so a branch that renamed the base's home directory fell back to docs/conventions and the lint read as unset. The gate now resolves the home at the merge base. The test-lane planner gives lefthook to every plugin's lefthook-remote suite, not only the guardrails one, so the code-tidying suite's end-to-end cases run on whatever leg they land. Refs: #15647 Co-authored-by: Claude Fable 5.2 <[email protected]>
Lane run report
Failed GitHub API calls
|
Lane run report
Failed GitHub API calls
|
|
claude-security-review reviewed Security review: incremental, d3ddd6b..890d57eNo security issues found. This lane already reviewed an earlier head, so this review was blocking only: it reports only CRITICAL and IMPORTANT findings. I read every hunk of all 5 files in scope.
Notes
critical-findings: 0 |
|
claude-review reviewed claude-review: incremental review of No findings. The push fixes all three findings this lane posted on
Not reproduced: the author's test results. This lane has no shell. Verifier dropped 0 of 0 candidates. |
…les from the root The comment lint names each file it skips for a generated marker, so a skip shows at commit time and in the CI log. scope-code-files.sh --branch-only lists untracked files root-relative across the whole repository, as its diff half does. The pre-PR sequence runs the comment pass with --base, the scope prep uses. Refs: #15647 Co-authored-by: Claude Fable 5.2 <[email protected]>
Refs: #15647
Summary
Problem: issue 15647 asked for a no-comments posture, a default and a way to stop new comments, and none of it was locked. Intent: "That way, we're staged. We have all the tools, and then, going forward through PR reviews and additional changes, we'll slowly be removing these comments."
This pull request ships the comment lint, the posture settings and the review wiring, and sets the lint to
reporthere. Turning the commit-time hook on in this repository is a second pull request.Fix
code-tidyingshipscomment-lint, a language-agnostic git-hook entry that judges the comment lines a change adds through the pygments token stream and names the fix for each one outside the posture. Settings, team file only:comment_lint: off | report | block(defaultoff) andcomment_lint_allow.scripts/check-comment-lint.shruns the same entry inCI Status, reading the level, posture and allow list from the merge base, so a branch cannot lower its own level.comment_posture: necessary,comment_edit_scope: filesandcomment_lint: reportindocs/conventions/code-tidying.yaml./code-tidying:remove-commentstakes--base <ref>and keeps the version comment on an action pinned to a commit id;/code-tidying:tidyreads the posture.Reach: with
comment_lintunset the entry exits silent, so consumers see no change until they set it. Here the CI step prints findings and passes. Undo: removecomment_lintfrom the convention file.Verification
test_comment_lint.pyran 63 tests OK;comment-lint.test.shprinted45 passed, 0 failed;scripts/check-comment-lint.test.shprintedall checks passed(14 cases).Related
Acceptance criteria
docs/conventions/code-tidying.yamlholdscomment_posture: necessaryandcomment_edit_scope: filesand passes its schema.necessaryandnone, the comment pass keeps the version comment on a pinned action.necessary,/code-tidying:tidyadds no comment outside the keep list; underexplanatoryit is unchanged.docs/upstream/cursor-pstack.mdstates the three floor differences; the owner's user-scope plugin options holdcomment_posture: necessary.Remaining
🤖 Generated with Claude Code