Skip to content

feat(code-tidying): keep a one-line ADR pointer in remove-comments - #16553

Merged
kyle-sexton merged 2 commits into
mainfrom
feat/remove-comments-adr-pointer-keep
Nov 16, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
feat/remove-comments-adr-pointer-keep

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: owner decision to keep one-line ADR pointers in remove-comments; no tracking issue was filed.

Summary

/code-tidying:remove-comments had no keep for a one-line comment that points at an ADR, and criterion 2 treated a reason held in the repository's ADR folder as recoverable, so a pointer such as # See docs/adr/0042 was most likely deleted. This PR makes such a pointer a recognized keep.

Fix

  • The shipped keep list (reference/keep-list.md) gains an ADR pointer: one line, names an existing decision record by the repository's id or path form, restates none of its reason, and sits at a module header or a non-obvious decision line. A pointer to a missing record is class A.
  • explanatory keeps it too: reference/triage.md criterion 2 and actions/remove.md step 5 say a pointer carries no rationale and passes. none still keeps only the floor. A comment that restates the ADR's reason stays ordinary rationale.
  • reference/safety.md gets an "ADR pointers" section; triage.md gets two worked examples and a note that a pointer is not a ticket back-reference. README and the comment_keep_list option description name the new keep.
  • Two eval cases, remove-adr-pointer-kept-necessary and remove-adr-pointer-kept-explanatory, seed a repository with docs/adr/0007-*.md and grade that the header pointer stays, the reason-restating pointer and a restating comment go, and code is unchanged.

Verification

  • python3 plugins/evals/skills/validate/scripts/validate-cases.py plugins/code-tidying/evals: no FAIL; the new cases carry only the allowed_tools warnings every case in the folder has.
  • bash plugins/code-tidying/scripts/comment-settings.test.sh: all checks passed. scripts/check-changelog-fragments.sh --check, check-fixture-git-isolation.sh, check-orphaned-fixtures.sh, check-as-of-recheck.sh pass; the pre-push check-affected passed.
  • Left out: running the two eval cases live (they spend model time; CI's eval lanes decide that).

Related

  • The code-tidying comment-lint git hook still fails a kept ADR pointer under necessary unless it carries a URL or remove-comments-ignore, the same gap it already has for outside-constraint notes; the README now says so.

session: AI Hero

🤖 Generated with Claude Code

The shipped keep list gains an ADR pointer: one line naming an
existing decision record of the repository by its id or path form,
restating none of its reason, at a module header or a non-obvious
decision line. `necessary` keeps it through the keep list;
`explanatory` keeps it because a pointer passes criterion 2, since
the record it names is where the reasoning lives; `none` still keeps
only the floor. A pointer to a missing record is class A, and a
pointer that restates the record's reason stays ordinary rationale.

Two eval cases cover the keep under `necessary` and `explanatory`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWmASNT5Knyq99gphnV6B2
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 16, 2026 15:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T15:48:43.347203Z ad7ce0e Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Criterion 2 checks the decision-record folder where the repository
declares one, so the seed now carries a CLAUDE.md naming docs/adr/.
Without it the explanatory case could keep the reason-restating
pointer and fail its grader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWmASNT5Knyq99gphnV6B2
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed f9700f0cdb1ab5e5941d1d4e5f9e8c15c9671e33: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental): PR #16553, ad7ce0e → f9700f0

I found no security issues. This lane already reviewed an earlier head, so this pass reported only blocking findings (CRITICAL and IMPORTANT), and there were none.

Scope: one file, plugins/code-tidying/evals/fixtures/adr-pointer-seed.sh. I read its whole change in the incremental diff.

What changed:

  • The eval seed script now uses printf to write a fixed three-line CLAUDE.md into the eval sandbox's scratch repository. The file says that ADRs live in docs/adr/.
  • The script adds that file to the existing git add line, so the fixture commit includes it.
  • It takes no outside input, uses no network and handles no secrets.
  • The CLAUDE.md is created only inside the throwaway eval repository. It is not a CLAUDE.md in this repository, so it changes no standing instruction that the lanes or users load. The text is fixed and only declares where the ADR folder is; it holds no directive that would widen what the eval agent may do.

Checked and not applicable:

  • Trust controls and manifests: the change touches none.
  • Instruction-surface lens: no guardrail is deleted, narrowed or softened.

Prior findings: the only earlier post is the no-findings summary for the earlier head. Nothing is carried forward.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed f9700f0cdb1ab5e5941d1d4e5f9e8c15c9671e33: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #16553, since ad7ce0e

This lane already reviewed an earlier head, so this pass posts only blocking findings. I read the whole incremental change: one file, plugins/code-tidying/evals/fixtures/adr-pointer-seed.sh, with both hunks.

What changed

  • New file: the seed now writes a CLAUDE.md into the eval repo. It declares docs/adr/ as the place where architecture decision records live, one file per record, named NNNN-slug.md.
  • Commit: the fixture commit now includes that CLAUDE.md.

What I checked

  • The fix: this closes the calibration risk I raised in the last review. The skill's "where one is declared" wording could let a model skip the ADR folder, and the fixture now declares it. The explanatory case's deletion of the comment that restates the reason now rests on a declared ADR folder.
  • No overwrite: the chained comment-tooling-seed.sh writes no files into the working tree; it only installs Python packages. So the new CLAUDE.md replaces nothing.
  • Order and naming: git init still runs before any file is written, and git add names all three files. The record's name, 0007-retry-budget.md, follows the NNNN-slug.md pattern the new CLAUDE.md states.
  • Both cases still work: two scaffolds call this seed, remove-adr-pointer-kept-explanatory and remove-adr-pointer-kept-necessary. Neither is affected beyond gaining the declaration.

Not verified: I ran nothing, and the eval cases have not been run live against the new fixture.

No embedded instructions were found in the diff or the prior findings.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 9d3a3f3 Nov 16, 2026
45 checks passed
@kyle-sexton
kyle-sexton deleted the feat/remove-comments-adr-pointer-keep branch November 16, 2026 16:04
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant