Skip to content

chore: baseline for agent-assisted review (AGENTS.md, REVIEW.md, make verify) - #181

Draft
dg-dayhaysoos wants to merge 7 commits into
mainfrom
chore/agent-review-baseline
Draft

dg-dayhaysoos wants to merge 7 commits into
mainfrom
chore/agent-review-baseline

Conversation

@dg-dayhaysoos

@dg-dayhaysoos dg-dayhaysoos commented Dec 4, 2026 •

Copy link
Copy Markdown

Summary

A first step toward automated code review in this repo. It adds no reviewer and gives no agent any new authority. It writes down what a change is judged against, and gives people and coding agents one command that says what CI will say.

The repo's deterministic checks are already strong (contract tests for help parity, stream discipline, the manifest, import budget, the dependency allowlist). What was missing was the written standard a reviewer applies, and a local command that matches CI.

Changes

  • AGENTS.md (and a one-line CLAUDE.md that imports it): what the project guarantees and the test that enforces each guarantee, how to check a change, and where a coding agent's authority ends. Each guarantee is stated as its test checks it and no wider.
  • REVIEW.md: the review rubric. An agent's review is advisory; a person decides whether to merge.
    • Rules with IDs and default severities, plus a pre-existing label for a problem the PR did not introduce.
    • What not to raise, and the generated files to skip.
    • No limit on the size of a change. SCOPE-1 is about a PR with more than one purpose; size is not a finding.
    • The fields every finding carries. A review opens with a count by severity.
    • How a second review converges: only what changed, no repeated findings, a repeated mistake reported once, and no new findings after three rounds.
    • How the rubric changes.
  • make verify / make verify-fast (scripts/verify.py): format, lint, types, lockstep, generated READMEs, the manifest check and the test suite in one command.
    • Each failure is a finding: file, line, rule, message and the command that fixes it.
    • make verify ARGS="--json" prints one JSON document on stdout, described by docs/contracts/verify.schema.json.
    • A check's status comes from its command's exit code, so output the script can't parse is still a failure.
  • tests/unit/test_verify.py: besides the parsers, it holds the script's commands against .github/workflows/test.yml, and fails when a package's tests are missing from the workflow's hand-kept pytest list.
  • CI: the lint job now runs make readmes-check. Nothing ran it before, so a stale generated README was caught by nothing.
  • PR template: points at make verify, and asks for the change's risk and how to revert it.
  • Docs: CONTRIBUTING and the README's development block point at make verify.

For reviewers

  • The policy text is a proposal to edit, not settled: the "Where your authority ends" section of AGENTS.md, and in REVIEW.md the default severities, the ten-finding cap and the three-round limit on re-review.
  • The re-review limits, the files to skip, the pre-existing label and the two new PR template sections follow Anthropic's write-up of its own process, How the Claude Code team does code review.
  • make verify does not cover the package build, the lowest-dependency install or the npm launcher jobs. AGENTS.md says so.
  • Not in this PR: a reviewer workflow (that is ci(review): review pull requests and post findings as an advisory comment #182, stacked on this one), and any commit-message lint. Feature PRs land here as merge commits, so release-please reads each commit rather than the PR title; what to lint is a separate decision.

Test plan

  • make verify passes locally (macOS, Python 3.14), including the full test suite
  • make verify ARGS="--json" output parses and validates against the schema
  • A deliberately broken file is reported by the format, lint and types checks with file, line and rule
  • CI passed on 30bb79a, 65 of 65 check runs, across Linux, macOS, Windows and Python 3.10 to 3.14
  • CI on the three docs commits pushed after that

Risk

Low. Nothing in a shipped package changes. The one change that can fail someone else's PR is the new make readmes-check step in the lint job, which fails when a generated README is stale; make readmes fixes it.

How to revert

Reverting this PR is enough. Nothing here is released to users.

Related issues

None.

🤖 Generated with Claude Code

Nick DeJesus and others added 3 commits December 3, 2026 23:27
AGENTS.md lists what the project guarantees and the test that enforces
each guarantee, how to check a change, and where a coding agent's
authority ends. CLAUDE.md imports it so Claude Code loads it.

REVIEW.md is the rubric a review applies: rules with IDs and default
severities, what not to raise, the fields every finding carries, and how
the rubric changes. An agent's review is advisory; a person decides
whether to merge.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CONTRIBUTING asks contributors to run `make readmes`, and
`make readmes-check` exists, but no workflow ran it, so a stale generated
README was caught by nothing. Run it in the lint job, which the required
"All checks" rollup already waits on.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`make dev` skips the type check, the lockstep check and the README
check, and `make check` skips the tests, so no local command said what
CI's lint, lockstep and test jobs would say. `make verify` runs format,
lint, types, lockstep, READMEs, the manifest check and the test suite;
`make verify-fast` leaves the suite out.

Each failure is a finding with a file, a line, a rule and, where there is
one, the command that fixes it. `ARGS="--json"` prints the report as one
JSON document on stdout (docs/contracts/verify.schema.json), which is the
form a coding agent reads between fix attempts. A check's status comes
from its command's exit code, so output the script can't parse is still
a failure.

tests/unit/test_verify.py holds the script's commands against
.github/workflows/test.yml, and fails when a package's tests are missing
from the workflow's hand-kept pytest list.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

allowed_non_write_users detected

This PR adds or modifies allowed_non_write_users, which allows users without write access to trigger Claude Code Action workflows. This can introduce security risks.

If this is a new flow, please make sure you actually need allowed_non_write_users. If you are editing an existing workflow, double check that you are not adding new Claude permissions which might lead to a vulnerability.

See existing workflows in this repo for safe usage examples, or contact the AppSec team.

Nick DeJesus and others added 4 commits December 4, 2026 11:30
…label

A review opens with a count by severity. A second review covers only what
changed, does not repeat a posted finding, reports a repeated mistake once,
and stops raising findings after three rounds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The API-key rule read as a ban on the flag. Its test only checks that
shipped text never shows a key on a command line, and the root --api-key
option exists. A reviewer given the old wording raised a blocker against
that option.

Also name the tests behind the agent-hint, agent-detection and trust rules,
narrow the stdout rule to what the stream test checks, and say that a rule
with no test named is held by review.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
SCOPE-1 asked for a split of any diff over 800 changed lines, and AGENTS.md
asked for pull requests "small enough to read in one sitting". The 800 had no
measurement behind it: the median pull request written by a person in this
repository is larger than that, and a replay of the reviewer spent one of its
ten findings on SCOPE-1 for a change of 847 lines.

SCOPE-1 is now about purpose alone, and says that size is not a finding. A
reviewer is told to read the whole diff and every file it changes, however
large the change is.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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