Share one PR facts read between the two hosted review lanes
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github-actions, javascript, python, shell
- Lĩnh vực
- ci-cd, developer-experience, devops, testing
Hướng nghiên cứu
Start by reading .github/workflows/pr-review-hosted.yml, .github/workflows/pr-review-security-hosted.yml, and the referenced owner decision rows 311 and 444. Then trace the lane readers, ci-status, reconcile, and babysit evidence paths named in the issue; the acceptance criteria define the checks, including fallback tests and measured API-call savings. This spans two phases, many files, and unresolved design choices.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
Owner row 311 of melodic-software/architecture docs/owner-decisions.md (line 311), verbatim:
The review-lane trigger change recorded just above is revised: nothing is built now. The Wait For Refine poll stays (about 4 GITHUB_TOKEN calls per waiting run, at most about 1,120 a day); refine cannot fire workflow_run, because runs started by GITHUB_TOKEN fire no events except dispatch, and a dispatched review would move the trust boundary and lose the pull_request run that ci-status requires. The shared start check (about 1,430 calls a day, needing both lanes in one workflow and a ci-status and reconcile rewrite) comes next only if the GITHUB_TOKEN pool still runs dry after melodic-software/claude-code-plugins#18017 and #18025 (GitHub Optimization), 2026-11-21 by ~20:5xZ (3:5x PM EST), answered in the GitHub Optimization session in melodic-software/claude-code-plugins and relayed to the hub through GitHub Work. Question (as relayed): "keep the Wait For Refine poll, build nothing now; the shared start check is next only if the GITHUB_TOKEN pool still runs dry after #18017 and #18025". Answer: the owner invoked /session-flow:go-with-recommendations.
The condition holds: #18017 and #18025 merged on 2026-11-21, and on 2026-11-25 the kill-switch defer gate held both review lanes on 7 or more heads.
Measured in #19233 (2026-11-26 00:00-01:00Z): each lane's PR Review / Review Subscription and PR Review Security / Review Subscription job spends 7.2 core calls per run, 9.4 per head for the two (4.4% of the window). The reads are the same in both lanes. Per run, over 5 samples: compare 2.6, pulls/{n}/files 1.8 (with the page-2 calls), issues/{n}/comments 1, pulls/{n} 1, contents 0.8. They come from ci-workflows resolve-review-scope/scope.cjs (listComments, listFiles, pulls.get, compareCommitsWithBasehead), build-review-diff, and the Find executables and archives step of pr-review-cli.yml.
Constraint, owner row 444 (line 444): the two hosted review lanes keep their gate-only Check Kill Switch jobs. The kill-switch gate's steps, its proceed formula, its defer behavior (defer: "true", defer-job: review) and its fail-closed outcomes (the Report the kill switch notice, and the Stop on upstream status failure) stay exactly as they are.
Why one workflow: a read can be shared only inside one workflow run. The model jobs run with cache-mode: none (pr-review-cli.yml:151), so they share no Actions cache. Downloading an artifact from another run would need a run lookup, and it would trust an artifact that any workflow on a pull request branch could upload.
Proposed work
Phase 1, ci-workflows (one PR):
- A new composite action,
read-pr-facts, run in a job that holds no model credential and runs no head code. It reads once:pulls.get(live head,changed_files),listFiles(filename, previous_filename, status, patch), everygithub-actions[bot]comment that starts with a lane marker, and the<base_ref>...<head>merge base. It writes them topr-facts.jsonwith the head SHA it read for, and uploads that throughscan-upload. - A new optional
pr-facts-artifactinput onpr-review-cli.yml. When it is set, the generated key, subscription and fallback jobs download the artifact.scope.cjs,build-review-diffand the executables step then read from it instead of the API. A missing or unparseable file, or one written for another head, falls back to today's API reads. A fallback never adds a skip. scope.cjskeeps its rule that the file list and the live-head check come from one snapshot. A skip still trusts the list only when the snapshot's live head is the run's head.
Phase 2, claude-code-plugins (one PR, or two if pr-size requires it):
- Fold
pr-review-security-hosted.ymlintopr-review-hosted.yml, and keep the path of the code lane, which most readers already key on. Jobs:check-kill-switch: unchanged.check-kill-switch-security: the security lane's gate, steps unchanged, display name to be decided (open question 1).read-pr-facts: has noneeds, so it runs in parallel with the gates and adds no queue step before a review.pr-review: needs [check-kill-switch, read-pr-facts].pr-review-security: needs [check-kill-switch-security, read-pr-facts].- The caller job display names stay
PR ReviewandPR Review Security, so the check namesPR Review / ...andPR Review Security / ...stay the same.
- Keep the workflow-level concurrency group, so a round's facts are read only after both lanes' previous round has published its markers.
- Change each reader from a one-lane-per-workflow map to one keyed by workflow and job:
.github/lane-registry.json: the footer moves per caller job..github/scripts/lib/lane-binding.mjs,plugins/review/lib/lane-binding.mjs,plugins/work-items/lib/lane-binding.mjs..github/source-control-settings.json(caller=) and the marker'scaller=line. The first round after the switch reviews in full, a one-time cost.pr-require-checks.ymlci-statuslanes=andlane_run/lane_at: lane state is read from the lane's own jobs, never from the run's status or conclusion.merge-holds.mjs(the cost-hold and status-name maps).rerun-ci-status.sh: there is no sibling workflow left to wait for.pr-dispatch-feedback.yml: theworkflow_runlist dropsPR Review Security Hosted.resolve-config/lane-rules.json,lane-funding.json,pr-run-activity-*.yml,pr-unblock/feedback-dispatch.mjs,pr-merge/clear-escalations.mjs,scripts/sync-hold-floor.py(hold-paths),upstream-apply-changelog.mjsandscripts/lane-transcripts/pull.mjs.- The docs under
docs/conventions/pr-pipeline/anddocs/contracts/loop-lane/posting-lanes.md.
- Reconcile and reset-tick (
maintenance-reconcile-lost-runs/reconcile.mjsREVIEW_SWITCHES,GATE_JOBS,REVIEW_JOB_PREFIXES, and the whole-run re-run of a kill-switch-stopped review): re-run one lane throughPOST /actions/jobs/{job_id}/rerunon that lane's gate job. GitHub's docs say this re-runs "a job and its dependent jobs" (docs), so the other lane andread-pr-factsare not re-run. A whole-run re-run would review the other lane a second time. babysit_review_evidence.py(_bindattempt and conclusion rules,_lane_job,_kill_switch_stopped,_caller_skipped), withbabysit_merge_policy.pyandbabysit_gh.pylane-run listing. Today a lane binds only when the run concluded success at run attempt 1 or 2. In one run, the other lane's failure or re-run would change both. The rules move to the lane's own jobs: their conclusion, and how many times that lane's gate job ran.
Expected saving: the second lane's reads go, about 4.8 of its 7.2 core calls per run. At 0.65 lane runs per head, that is about 3.1 core calls per head. One Rerun CI Status per review round also goes (1.2 calls a run, about 0.8 per head). Total about 3.9 of the 9.4 calls per head, about 90 calls in a busy hour of 23 heads (about 1.8% of the window). Row 311's own estimate is about 1,430 a day.
Open questions (rows 311 and 444 do not settle them):
- Row 444 keeps both Check Kill Switch jobs. In one workflow the second one needs a different display name (for example
Check Kill Switch Security), and ci-status, reconcile and babysit read the gate by that name. Recommended: allow the rename and keep the steps byte for byte the same. Alternative: keep two workflow files, which leaves no shared read at all. - The cost found in this design was not in row 311's wording: the merge gate's evidence binding ties a review to the run's attempt number and conclusion, and so does ci-status's
run_status. Both need a per-lane rewrite, a change to merge-gate evidence. Recommended: decide before phase 2 whether to build all of it, or first cut the duplicatepulls.getand comments reads inside each lane. That smaller cut touches only ci-workflowsscope.cjsand saves about 2.6 calls per head; phase 2 would then come only if the pool still runs dry.
Acceptance criteria
- On one pull request head, the hosted review workflow's API-call notices show the PR facts read once:
read-pr-factsreads them, and neither lane's review job listspulls/{n}/files,pulls/{n}orissues/{n}/comments. - Both lanes' Check Kill Switch jobs have unchanged steps,
proceedformula, defer settings and fail-closed outcomes (diff against main shows only the job id or display name). - A lane with its facts artifact deleted or corrupted reviews as it does today: the API fallback, never a skip. A test proves it.
- With one lane's switch set (
CLAUDE_SECURITY_REVIEW_DISABLED=true), the other lane reviews, and ci-status reports the stopped lane asstoppedand the other from its own jobs. - The reconciler re-runs only the deferred lane's gate job and its dependents. The other lane's review job keeps its attempt-1 run. A test covers it, and one live re-run is observed.
- The babysit merge gate binds a lane that passed when the other lane failed or was re-run, and still refuses a lane past its allowed re-runs.
- No job that holds a model credential gains a permission, a cache, or a head-code execution step.
read-pr-factshascontents: readandpull-requests: readonly. - On a later busy hour, the measured core calls per head for the review lanes fall by at least 3, with the numbers in the closing PR.
References
- Refs: #19233
- Owner rows 311 and 444 (links above). Row 310 is the trigger change that row 311 revises.
- ci-workflows#1235 and #19243 change the same review-lane files. This work starts after they merge.
- ci-workflows
.github/workflows/pr-review-cli.yml,.github/actions/resolve-review-scope/scope.cjs. .github/workflows/pr-review-hosted.yml,.github/workflows/pr-review-security-hosted.yml,.github/workflows/pr-require-checks.yml,.github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs,plugins/source-control/skills/babysit-prs/scripts/babysit_review_evidence.py.
- Ngôn ngữ chính
- Shell
- Star
- 22
- Fork
- 2
- Merge trung bình
- 2 giờ
- Pull request đã merge (30 ngày)
- 960
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của melodic-software/claude-code-plugins
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
melodic-software/claude-code-plugins#19225 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
melodic-software/claude-code-plugins#17779 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
recurring
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
melodic-software/claude-code-plugins#19274 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
melodic-software/claude-code-plugins#19270 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 53/100
melodic-software/claude-code-plugins#19269 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của melodic-software/claude-code-plugins
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nais/attest-sign#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
check_for_release: the /opt/*_version.txt migration gives the app's version to any componentĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
community-scripts/core#303 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
severity: low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
luainkernel/lunatik#2727 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[quality] release publish.mjs integrity guards have no unit testCó thể đã có người làm @robarnold đã nhận hôm nay. Đang mởagent/quality stage/040-covered-by-pr testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
marinatedconcrete/config#1155 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug report-to-upstream
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
flatpark/flatpark#1585 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày