Bound handoff.py's Writes Whatever the Label State - #2266
Conversation
Copilot's review of promotion #2254 found that the owner and fork checks ran only where the handoff label was missing, so new or link against another owner's repository went on to write whenever that repository carried a handoff label, and an unregistered non-fork under the owner evaded the registry-drift refusal the same way. require_write_scope now runs before the label is read, for new and link only. A repository under another owner refuses with no call at all, and an unregistered repository of the owner's refuses unless it is a fork, the same in-process owner boundary pr_review.py keeps. The reads stay open, and a registered repository costs no extra request, since the fork answer is read once a run and shared with the missing-label path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The local strict review found "the reads stay open everywhere" false, since a read of an unlabeled repository under another owner still refuses on the missing-label path, and the pr_review.py comparison overstated parity, since that script reads its owner from origin and this one from the registry. Both now say what the code does, and link against a labeled unregistered non-fork gains its own case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2266 +/- ##
===========================================
+ Coverage 57.22% 57.31% +0.08%
===========================================
Files 16 16
Lines 7595 7611 +16
===========================================
+ Hits 4346 4362 +16
Misses 3249 3249
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Fork writes must verify issue availability before proceeding; two minor prose nits also remain.
Review effort: Lite
Findings: None
What changed in this PR
This PR restricts handoff.py writes to authorized repositories while updating tests and documentation.
Changes:
- Adds cached owner, registry, and fork validation before writes.
- Expands regression coverage.
- Updates canonical and generated handoff documentation.
| File | Summary |
|---|---|
tests/test_handoff.py |
Adds write-scope and caching coverage. |
scripts/README.md |
Documents write restrictions; one prose nit remains. |
scripts/handoff.py |
Enforces write scope; issue availability must also be checked for fork writes. |
.github/skills/session-handoff/SKILL.md |
Updates generated guidance. |
.claude-plugin/fleet-skills/skills/session-handoff/SKILL.md |
Updates generated guidance. |
.claude-plugin/fleet-skills/.source-digests/session-handoff |
Refreshes the source digest. |
.agents/skills/session-handoff/SKILL.md |
Updates canonical guidance; one prose nit remains. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Replies to the two notes in Copilot's overview:
|
…#2254) ## Summary Promotes develop to main, carrying the pull requests below. Each was already reviewed and merged into develop. - [#2253](#2253): Track Qodo's open-source login and state its star gate. - [#2259](#2259): Give install-tools a JSON report mode a program can read. Copilot could not review it, since Copilot code review has reached its weekly rate limit (#2261). CodeRabbit reviewed its head with no findings, and recorded local passes covered every push. - [#2263](#2263): Declare Python and Codecov on Blog's registry entry. - [#2265](#2265): Keep the fork iteration PR open and never merged in `upstream-contribution-workflow`, and let an unregistered fork under the owner host a handoff chain, with `handoff.py new --create-label` creating only the `handoff` label there. - [#2266](#2266): Bound `handoff.py`'s writes whatever the label state, refusing `new` and `link` against another owner's repository, or an unregistered non-fork, before the label is read. This answers Copilot's High finding on this promotion. - [#2267](#2267): State the install-tools JSON report in `docs/host-setup.md`, answering Copilot's previously-missed finding on #2259's report mode. - [#2269](#2269): Drop two false pointers from Blog's deploy-secret drift note, and recast every semicolon in the registry's driftNotes, answering Copilot's previously-missed finding on #2263's note. With the open-source login tracked, `qodo_open` double-counts that app's threaded findings and never clears them on PlexCleaner. That is a known, loud error, accepted for this promotion and tracked in #2252. Closes #1465 Closes #1645 Closes #2264 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified which review commands to use when a reviewer posts a skip notice. * Updated reviewer evaluation guidance to reflect when CodeRabbit and Qodo findings are recorded, including Qodo’s repository eligibility requirements. * **Bug Fixes** * Updated Qodo reviewer tracking to recognize its current open-source app identity, improving how its reviews and findings are identified. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Copilot's review of promotion PR #2254 (High) found that
handoff.pychecked the owner and fork status only when thehandofflabel was missing. That came in with #2265. Soneworlinkagainst another owner's repository still wrote there whenever that repository happened to carry ahandofflabel. An unregistered non-fork under the owner slipped past the registry-drift refusal the same way. These writes run asghsubprocesses, which the calling agent's write guard never sees, so the script has to enforce the boundary itself, the waypr_review.pyrefuses its own cross-owner writes.require_write_scopenow runs inmainbefore the label is read, and only for the two writing subcommands,newandlink:ghcall at allregistry/repos.jsongh repo viewthat the missing-label path reusesThe write scope bounds no read.
scripts/README.mdandsession-handoffare updated to match.Verification
tests/test_handoff.pypasses all 141 tests. A module-level patch now makeso/ra fleet repository by default, so existing write cases keep testing what they name. The newWriteScopeCasecovers:newandlink;newandlink;unittest discoverrun passes (1944 tests). mypy, ruff,prose_lint --diff origin/develop,spec/validate.py,build_dist.py --check, anddocker_lint.pyare all clean.local-strict-review: the first pass found 2 prose overclaims, both fixed. The second pass found nothing, and its receipt is recorded.🤖 Generated with Claude Code