Repository navigation
Fork review gate: enforce the owner's rules (#82, #99, #100) - #943
Conversation
The review block of .github/fork-pr-queue.json moves from shadow to enforce: workflow and gate-setting files need the merge-path and state lenses (#82), an open blocker or major fails the head (#99), the approach lens joins from round 3 and round 5 needs a person (#100). No override_authors yet (#78). A dry run over the newest merged pull requests showed the old .github/** rule made seam announcements and test-list lines critical, so plain app changes needed the gate lenses and no code lens. The gate rule now names the .github files one by one; the seam list and the test list stay normal, and a test fails when a new .github file is in neither list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: merge-path · reviewer: lens agent (Opus 5.5) · read at: 0795fae |
|
lens: state · reviewer: state lens agent (Opus 5.5) · read at: 0795fae |
…; fail closed on old releases - review_judge.judge and T3's planReview: the required lenses are those of every rule a path counted for, whatever its weight (#82: one extra review). An app change plus a gate file needs code, merge-path and state; before, the gate lenses alone passed it. The weight stays the heaviest hit. Shared vectors updated. - The fork config's gate rule adds fork-kit/review/** and fork-kit/gh-apps/**; a test sorts every fork-kit folder. - override_authors written out empty: ci/v20 and older refuse the config (fail closed) instead of enforcing the path rules without findings and rounds; ci/v21 and later accept it. - README: the rule, the ci/v21 floor, the fork's rollback (config line plus two tests, judged by the gate lenses), and what stays an agent's say until #78. Release notes entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: state r2 · reviewer: state lens agent (Opus 5.5) · read at: 8eee623 |
|
lens: state r2 · reviewer: state lens agent (Opus 5.5) · read at: 8eee623 |
|
lens: merge-path r2 · reviewer: lens agent (Opus 5.5) · read at: 8eee623 |
…he gate rule - plan.test.py, review_guide.test.py: expect the union of every rule hit (data-1, data-2, code) and the moved step 1 sentence. - pr-queue README and release notes: a caller of a config in enforce pins the first release after ci/v22; ci/v21 and ci/v22 judge mixed changes the old, looser way. The fork's gate caller (#81) starts at that floor. A test keeps the sentences in step with the release notes. - Step 5: ask for the critical lenses plus the lenses of every other rule the enforce pull request's paths hit. - docs/fork/gate-trust.md (the owner's commands for the gate App's key and tokens) joins the gate rule; the rest of docs/fork stays normal. Tests in review_judge.test.py and head_check.test.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #82, part of #99, part of #100 (see "Why not Fixes" below).
What
The
reviewblock of.github/fork-pr-queue.jsongoes fromshadowtoenforce, for exactly the rules the owner decided on 2026-11-14:gaterule (critical,min_lenses.critical2) needsmerge-pathandstate; everything else isnormaland needscode. A change that hits both needs all three (see "Fix round 1" below).blocker:ormajor:line, or has no findings section (findings: true). Only a person's override passes a wrong finding.approachlens is required from round 3 (rounds.approach_at3); past round 4 (rounds.max) only a person's override passes."override_authors": []. Agents still post from the owner's login, so no override counts yet. A wrong finding is fixed by a new clean report, not by an override.One rule change, found by the first dry run.
.github/**made two bookkeeping lists critical:.github/fork-seams.json(seam announcements) and.github/fork-ci-tests.txt(the test list). So the gate rule names the.githubfiles one by one:.github/*/*/**(every subfolder),*.md,*.td,*.yml,*.yamland each JSON or text setting file. A test walks.githuband fails when a new top-level file is in neither the gate rule nor the two-entry bookkeeping list.What enforce does on the fork today: nothing yet. No fork workflow calls the head gate. There is no gate App (#81) and no
head-gateenvironment, and themainruleset does not requirehead_check. The switch puts the config in its decided end state, so the gate enforces it from its first run once those parts exist.Fix round 1 (after the merge-path and state lens reports)
review_judge.judgetook the lenses of the heaviest rule hit only. So app code plus a gate file neededmerge-path+stateand nocode: the app code went unread by its own lens, against Owner question: extra reviewer for workflow and gate changes? #82's "one extra review". Now the weight is still the heaviest hit (unchanged for every other user of it:min_lenses, the summary line, the queue), but the required lenses are the union over every rule hit, in rule order. The TypeScript mirror (apps/server/src/fork/reviewRules/plan.ts) and the shared vectors (review.vectors.json) change the same way..github/workflows/**) counts for the first critical rule and for the rule it matches itself. Under a catch-allnormalrule that rule's lens is now also required. This only ever adds lenses; on the fork the protected paths sit in the gate rule, so nothing extra.fork-kit/review/**andfork-kit/gh-apps/**join the gate rule.fork-kit/reviewis the lens-format checker and the lens skill: it decides what a lens report looks like, which is what the gate reads (Owner question: should the merge gate block a PR when a reviewer reported a blocker or major finding? #99).fork-kit/gh-appshandles the gate App's key and tokens (Owner question: one gate App for both repos, or one each? #81): a change there changes who can post as the gate. A new test lists everyfork-kitfolder as gate or not and fails when a new folder is in neither list, the same drift pattern as.github."override_authors": []. Checked by running the old releases'head_checkon this config:review: unknown key 'override_authors'(checkout and bare mode). Before this key, ci/v15–v20 accepted the config and quietly skipped Owner question: should the merge gate block a PR when a reviewer reported a blocker or major finding? #99 and Owner question: cap review rounds at 4, then a person decides (override or close)? #100.ForkConfigRules.test_it_is_in_enforcenow pinsoverride_authors == []."mode"line plus the two tests that pin it (ForkConfigRules.test_it_is_in_enforceinhead_check.test.py,ForkConfig.test_it_parses_in_enforce_with_the_owners_numbers_and_no_person_yetinreview_judge.test.py). The rollback PR changes the config, so it is judged by the enforce rules of its base: it needs cleanmerge-pathandstatereports within the round cap. New testtest_the_rollback_to_shadow_needs_the_gate_lenses. If the gate itself is broken, the owner turns off the ruleset entry forhead_check(an owner step).Fix round 2 (after the round-2 merge-path and state lens reports)
Both round-2 reports said "not safe" only because CI was red; all five round-1 fixes held.
plan.test.pytest_a_critical_path_needs_two_independent_lenses: the kit's plan for a storage file plus an app file now listsdata-1, data-2, code, and checks each lens's prompt line.review_guide.test.pytest_findings_rounds_and_override_authors_come_after_the_same_release: expects the moved sentence "are inci/v21and later", with the version worked out from the fork-ci: enforce review findings, rounds and critical gate files #740 release note.test_the_enforce_pull_request_needs_only_the_input_lenses: the config alone now needsdata-1, data-2, code(it also counts for the catch-all), and the test checks both rules hit.enforcepins the first release after ci/v22 or later; ci/v21 and ci/v22 accept the config but judge mixed changes the old, looser way. The fork's gate caller (Owner question: one gate App for both repos, or one each? #81) starts at that floor. New testtest_a_caller_in_enforce_pins_the_release_with_every_rule_hitkeeps these sentences in step with the release note's "First in the release after" version.docs/fork/gate-trust.mdjoins the gate rule. It holds the owner's paste commands for the gate App's key and tokens, a gate setting likefork-kit/gh-apps. The rest ofdocs/forkstaysnormalwith thecodelens; no light, no-lens rule was added fordocs/forkor.github/fork-ci-tests.txt. Tests:test_only_the_gate_trust_page_of_docs_fork_is_criticaland the critical-path list inreview_judge.test.py; the head gate testtest_a_workflow_or_gate_change_needs_the_extra_reviewinhead_check.test.py.Not done (outside this round): one release-note line saying an old T3 build plans mixed changes without
code, so the gate asks for one more lens run (the state lens's minor 2; fails closed).State question for SkyRPG. The same action reads SkyRPG's
.github/pr-queue.json. It has noreviewblock, so the path rules are off there and the union changes none of its verdicts. Checked read-only.Dry run: the newest 20 merged fork pull requests
How it was run: the gate's own
head_check.decide(), with the config forced to each mode. Base = the squash commit's first parent, head = the PR head as merged. Comments and reviews came fromgh(read-only). "Before" = this PR's previous head (0795fae), "after" = this head.fork-kit/heavy,model-guard,pc-agentsapp files; onlymerge-pathandstateread it, nocodemerge-pathreported amajor:("Fixes" wording), never cleared (#99)statesays NOT SAFE (#99); shadow refuses toocodesays NOT SAFE (#99); shadow refuses toodeskandpc-agentsapp files; nocodereportmerge-path;stateandcodemissingbsays NOT SAFE; the owner-login override does not count (#78)fork-kit/review(now gate); lens nameda, round 3 withoutapproachstate;codemissingfork-kit/gh-apps(now gate); old free-format comments; shadow refuses toosecurity,state; the config namescodeTwo verdicts flip (#940, #920), both because app code was read only by the gate lenses. Fix round 2 changes no row: none of the 20 changed
docs/fork/gate-trust.md(#939, #928, #927, #874 and #827 change otherdocs/forkpages, which staynormal). Shadow refuses 6 of the 20 (#928 #927 #922 #909 #840 #835); they merged because the fork runs no gate.Cost, kept on purpose: a gate change that also adds a line to
.github/fork-ci-tests.txtor touchesdocs/forknow needscodetoo (#874, #835). No light, no-lens rule for them:docs/forkholds runbooks the owner and agents paste from, so a changed command would merge unread. A light rule for exactly.github/fork-ci-tests.txtwould be safe, but is not part of this PR.Tests
Each fix has a test that fails without it:
review_judge.py: 15 failures inreview_judge.test.py(4 subtests of the newtest_an_app_change_plus_a_gate_file_needs_the_code_lens_and_the_gate_lenses, 10 shared vectors, the summary line) and 5 inhead_check.test.py(among them the newtest_an_app_change_plus_a_gate_file_needs_the_code_lens_too: app + gate file with onlymerge-path+statefails with "required lens without a read: code").test_enforce_needs_the_lenses_of_every_rule_hitreplaces the test that pinned the old heaviest-rule behaviour.ForkConfigfailures (the newtest_every_fork_kit_folder_is_sortedand the critical-path test), andtest_it_is_in_enforceerrors.vitestonapps/server/src/fork/reviewRules: 60 passed (the TS mirror replays the same vectors)..githubentry sorted.State question
lens: <config name> · reviewer: … · read at: <head sha>format on its current head. A PR that mixes app code and gate files now also needs acodereport.Why not "Fixes"
Each issue is covered as config plus tests. On the fork, though, nothing enforces it until a gate caller, the shared gate App (#81) and a ruleset entry for
head_checkexist. The "a person's override" half of #99 and #100 waits on #78.Docs
fork-ci/actions/pr-queue/README.md: "How the gate judges" (the union), step 1 and step 5 (caller floor: the first release after ci/v22; the fork-kit gate folders anddocs/fork/gate-trust.mdand why; the enforce PR asks for every rule's lenses; the Owner question: may your own GitHub login leave the agent machine? #78 note), step 6 (the fork's rollback).fork-ci/actions/head-check/README.md: "Lenses by changed path" says every rule hit gives its lenses.fork-ci/RELEASE-NOTES.md: new entry with an upgrade note (including the caller floor).General vs project
review_judge.py, its TS mirror and the shared vectors apply to every project that uses the review rules. The README notes and the drift-test pattern (walk the folder, every entry sorted) apply to any project..github/fork-pr-queue.jsonand the tests that pin what it decides for the fork.Checks run
At head 20ab00c (fix round 2), every test that reads the review config, the README or the plan:
review_judge.test.py: 54 OKreview_config.test.py: 51 OKreview_glob.test.py: 8 OKlens.test.py: 80 OKpr_queue.test.py: 419 OK;pr_queue_laws.test.py: 3 OKhead_check.test.py: 262 OK, 1 skippedhead_gate.test.py: 108 OKreview_guide.test.py: 34 OKfork-kit/review/tests:plan.test.py27 OK,comments.test.py36 OK,eval.test.py28 OKfork-contracts.test.py: 716 ok;fork-owned-paths.test.py: 52 okvitestapps/server/src/fork/reviewRules: 60 passed (2 files)vp fmt --checkon the config, the release notes and the pr-queue README: cleanfork-gate-trust-docs.test.py: not run locally (that page did not change); CI runs it🤖 Generated with Claude Code