Repository navigation
review kit: gate rules for state lines and changed paths, eval shape checks, doc follow-ups (#797, #914) - #955
Conversation
…checks, doc follow-ups (#797, #914) - plan --base reads the base config as bytes (not UTF-8 is refused as the gate refuses it) and the changed paths through the gate's head_check.changed_paths (every merge base, no global git config). - What counts as a state: line moves into gate code (review_judge.has_state_line); the kit imports it. - The eval refuses a malformed scores.json with a plain message, counts a run's sub-agent transcripts, and the example transcripts globs find sub-agent sessions. - Docs: run the kit at the pinned release; which of REVIEW.md's file or T3's reviewRules setting decides the runner; a fix past the last lens round; override author association, never edited and not hidden. - The fork's own kit settings (.github/fork-review-kit.json) point the kit at .github/fork-pr-queue.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: state · reviewer: state lens (Claude Opus 5.5) · read at: 984c853 |
|
lens: merge-path · reviewer: Claude Opus 5.5 (independent read-only lens) · read at: 984c853 Focus answers:
|
|
lens: code · reviewer: Claude Opus 5.5 (code lens) · read at: 984c853 |
Fixes #797, Fixes #914
Every point of both issues is done in this pull request. Each fix has a test that fails without it; see Verification.
#797 (K1 review kit lens minors)
plan --basewith a base config that is not UTF-8. The kit now hands the raw bytes fromgit show <base>:<config>to the gate'sconfig.parse, which refuses them ("not UTF-8 text") exactly as the gate does. Before, it decoded withreplaceand printed a normal plan. Test:plan.test.pytest_a_base_config_that_is_not_utf8_is_refused_as_the_gate_refuses_it.planran its owngit diff. With--base, the kit now resolves the base and HEAD to full shas and calls the gate'shead_check.changed_paths(every merge base, git's safe flags, no global config,--no-relative). Tests:test_base_reads_every_merge_base_as_the_gate_does(a criss-cross history: the old diff saw 2 paths, the gate 3) andtest_base_reads_paths_whatever_the_repository_git_settings(diff.relative=truewith--rootin a subfolder).comments.test.pytest_the_docs_say_to_run_the_kit_at_the_pinned_release.state:line rule lived only in the kit. The issue says to move it "when the gate starts enforcing it". This PR moves it now, because then nothing is left to do later:review_judge.has_state_lineis gate code, and the kit imports it (review_kit.has_state_line is review_judge.has_state_line). The gate still parsesstate_linewithout enforcing it, so the gate's behaviour does not change (release note added). Tests:review_judge.test.pyStateLine,comments.test.pytest_the_state_rule_is_the_gates, and a new red check that breaks the rule inside the gate'sreview_judge.pyand shows the kit's own tests then fail.scores.jsoncrashed the eval.scores_ofchecks the shape that judge_prompt.txt asks for. A wrong shape is refused with a plain message naming the case and the file ("judge the case again"), not a traceback. Test:eval.test.pytest_malformed_scores_are_a_plain_message(8 shapes; 4 of them crashed before and 4 passed silently).<session>/subagents/*.jsonlcount toward its cost, and each file counts once. The example config also globs~/.claude/projects/*/*/subagents/*.jsonl, so a run that was itself started as a sub-agent is found. Tests:test_sub_agent_transcripts_countandtest_the_example_config_finds_sub_agent_transcripts.server.reviewRulesyet (docs/fork/README.md says so), so today the repo file decides. Once T3 starts lenses itself, T3's setting decides the lenses T3 starts on that machine (the machine's half: which provider and model it has). The repo file decides lenses an agent starts by hand and whatplanprints. Keep the two the same; the gate reads neither, so a difference can change cost and recall but never what passes. This follows docs/fork/README.md's split (the setting is "the machine's half"). It is not a new owner decision; if the owner wants it the other way, it is one paragraph. Test:test_review_md_says_which_decides_the_runner. It also fails once T3's docs stop saying "Nothing reads it yet", so the paragraph gets read again then.#914 (#845 lens round 3 follow-ups)
test_the_skill_says_what_happens_to_a_fix_past_the_last_round.override.author_association) and adds "never edited and not hidden". COMMENTS.md's table says the same. Test:test_the_docs_say_which_override_counts_as_the_gate_reads_it. It also checks the gate'slens.Review.override_sharefuses an edited, a hidden, and another association's override..github/fork-review-kit.json(queue_config: .github/fork-pr-queue.json). It has thefork-prefix because the seam check treats other.githubfiles as upstream files, so the fork passes--settings .github/fork-review-kit.json(REVIEW.md and SKILL.md say so). The file is added to the gate rule of.github/fork-pr-queue.json, as the ForkConfig test requires for every.githubfile. Test:plan.test.pyFork.test_the_fork_settings_point_the_kit_at_the_forks_queue_config. Run on this branch,plan --settings .github/fork-review-kit.json --base origin/mainprints weight critical with lenses merge-path, state and code.State question
What happens when this runs again, stops half-way, or meets existing, old or empty state?
plan,checkand the eval only read. They write nothing in the repository or the eval folder except the eval's own output, which is the same as before. A second run prints the same plan.plan --baseruns git read-only (rev-parse,show, the gate'smerge-baseanddifffrom an empty temp folder, whichhead_checkremoves). Stopping leaves nothing behind.planwas run from one.scores.jsonfiles in the right shape read as before. A wrong shape is refused with a plain message, not a traceback.subagentsfolder costs as before.review_judge.has_state_line, which the gate does not call, so no pull request is judged differently..github/fork-pr-queue.jsononly adds a path to the critical gate rule. After merge, a change to the new kit settings file needs the critical lenses.General vs project
has_state_linein the gate, the eval's shape check and sub-agent transcripts, and all doc points..github/fork-review-kit.jsonand its line in.github/fork-pr-queue.json. These are the fork's own facts in the fork's own config, like any project's--settingsfile. The kit has no code that knows about the fork.Verification
fork-kit/review/tests/comments.test.py(42)eval.test.py(31)plan.test.py(31)fork-ci/actions/head-check/review_guide.test.py(34)fork-ci/actions/pr-queue/review_judge.test.py(55) andlens.test.py(80)head_check.test.py(262, 1 skipped).github/scripts/fork-contracts.test.py(716 ok)fork-head-gate-workflow.test.py(89 ok)vp fmt --check--no-upstream HEAD^1 HEAD)diff.relativecases give "2" or fewer paths instead of the gate's count; and the fork settings file is missing.has_state_lineis missing.RedCheck) break each new rule in a copy of the code: the base bytes, the gate's changed paths, sub-agent transcripts, the scores shape, and both state-line rules inside the gate'sreview_judge.py. Each shows its test then fails.🤖 Generated with Claude Code