Repository navigation
ci: hold a pin pr to the wheel copy its app-repo port started from - #37419
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the check only runs in CI, adds a requirement to pin PRs alone, and a revert undoes it cleanly. Notes
[DESIGN-REVIEWED] 84be922 Description read[DESCRIPTION-READ] 09be410f6460869c615c51555bf25ac5ddf8af64a91de6ecbf2511cedeaa2c90 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the description names three stale pins as the defect, and the new drift guard runs inside the existing PR Hygiene step and reads its existing What this change shipsInventory (6 items) — 6 justifiedIntent: stop a pin PR from landing an app-repo commit that is missing wheel-copy changes made on main since its port started. This is an ADDITION (a CI gate).
[FIRST-PRINCIPLES-REVIEWED] 84be922 Description read[DESCRIPTION-READ] db718a6205bdb4574de1e6c81e05528179ce75d4902f1bba2261184f787f5b42 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 20% chance that this change introduces a defect, above the 12% limit for approving on its own. Adds a pin drift guard to PR Hygiene: PRs that add or change an adoption-pins.json row must name a An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
68cf0f5 to
a05e70c
Compare
|
self-added: yes
|
|
self-added: yes
|
|
Round note for a05e70c (rebased onto main 3397952). Re the code-change approver's two points on 68cf0f5: both are the stale-base class the Opus lane raised. It is fixed by narrowing the claims, not by adding a re-run on main: the CI doc, the pr-hygiene.yml step comment, app-kit-platform.md and the script docstring now say the check holds against the base tip at the PR's last event, and that whoever approves a pin PR edits the body (or pushes) right before approving, which re-runs it against the current tip. Dispositions: #issuecomment-6886779504 (Opus), #issuecomment-6886779685 (GPT). Backend Tests (3.12) shards 1/2/8 and Coverage Gate on the previous head: these are the unowned main red from #36640 vs #29423 (the row-scrub tests), not this diff, which touches no backend code. The fix is #37423 (auto-merge armed, not merged yet). This branch will be rebased onto it once it lands. |
a05e70c to
413c945
Compare
A pin went stale three times while its pin PR was open, because the wheel copy kept changing on main and the pinned app-repo commit never took the later change. PR Hygiene's adopted-wheel-copy step now asks a PR that adds or changes a pin row for a 'Wheel-copy base: <app>@<sha>' line per changed row and fails while that app's non-test wheel copy at the base tip differs from the one at the named base, so the change has to reach the app repository and the pin before the PR can land.
413c945 to
84be922
Compare
|
|
Green-age note for head 84be922: |
buluoray
left a comment
There was a problem hiding this comment.
Approve on 84be922. This PR makes PR Hygiene hold a pin PR until the app's wheel copy on main still matches the core commit its app-repo port started from, so a stale pin can no longer drop a wheel-copy fix for adopted users. The new check acts only on PRs that add or change a row of the pin table, so unrelated PRs are not affected. It fails closed when the base tip is missing, the named commit cannot be read, or the table is unreadable. The workflow still runs on pull_request with read-only contents permission, the PR body reaches the script only as an environment variable, the script is still read from the base ref, and the named commit is checked as lower-case hex before it reaches git. The script names no specific app. The CI doc and the owning spec changed in the same commit. All 43 tests in the touched test file pass, and seven mutations of the new logic each turned at least one named test red. One non-blocking follow-up: the spec says the named commit must be in the head's or the base tip's history, but the job's history is a partial clone, so git fetches an unknown full commit id from the repository on demand. This adds no bypass, because a named commit passes only when its wheel copy equals the base tip's, which naming the base tip already allows. The spec sentence and the history script's "later steps never fetch" comment should be corrected. The other limit, that the check sees the base tip only as of the PR's last event, is documented with a manual step for the approver. Decisive lines: .github/scripts/adopted_wheel_copy_check.py:166-171 (changed_rows), .github/scripts/adopted_wheel_copy_check.py:195-215 (git_wheel_copy_drift fails closed), .github/scripts/adopted_wheel_copy_check.py:218-246 (check_bases), .github/scripts/adopted_wheel_copy_check.py:259-292 (main), .github/workflows/pr-hygiene.yml:12-17 and 253-275, docs/system-specs/modules/app-kit-platform.md:7304-7320
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Reviewed head 84be922. The new pin drift guard runs the related tests green, and the new tests fail when the script is reverted. I also replayed the guard on real history: a pin row whose named base comes before the app's latest wheel-copy change is held, an up-to-date base passes, and an unknown commit or a missing base line fails closed. Only hex commit ids from the body reach git, paths come after the separator, and the script is still read from the base ref, so a branch cannot weaken its own check. The re-run-before-approving limit is documented and is a design choice, not a defect, so nothing blocks.
Problem / Motivation
Goal: A pin PR cannot land while the app's wheel copy has changed since the commit its app-repo port started from.
Part of #26967. Three times a pin went stale while its pin PR was open: the wheel copy kept changing on main, the pinned app-repo commit never took the later change, and adopting the pin would have dropped it for every adopted user. PR Hygiene's adopted-wheel-copy step checks a change made to a pinned wheel copy, but nothing checked that a pin PR's pinned commit still matches the wheel copy it lands next to.
Why it matters
The campaign's hard rule is zero impact on current users. A stale pin swaps an adopted host onto a tree that lacks a fix or feature the wheel copy already shipped, silently, at the next restart. Catching it by hand failed three times; the two pin PRs open today (#37411, #36446) both carry drift this check reports (see Manual verification).
Not a goal
app.jsonversion, which a first pin must equal, D12), and the existingApp repo:line already covers the PR's own wheel-copy changes.What changed (motivation → approach → change)
A pin PR now names, per pin row it adds or changes, the core commit its app-repo port started from:
Wheel-copy base: <app>@<sha>alone on a line. The PR Hygiene step fails while that app's non-test wheel copy at the base tip differs from the one at the named commit, deletions included. The base tip is the one at the PR's last event: PR Hygiene does not re-run when main moves, so the docs tell whoever approves a pin PR to edit its body (or push) right before approving, which re-runs the check against the current tip. A drift it finds holds the PR until the app repository takes the change, the row is re-pinned and the line names the newer base.A row counts as changed when the head table's row differs from the merge base's. The comparison is
git diff-treeon two trees, which the job's blobless history already holds, and an unreadable base fails closed. The check lives in.github/scripts/adopted_wheel_copy_check.py, still read from the base ref. It reads the base tip from the step's existingBASE_TIPenv, so.github/workflows/pr-hygiene.ymlchanges only its comment;.github/scripts/code-review-history.shgains one comment line saying a later step now reads history trees. Docs: docs/ci/ci-and-reviews.md and app-kit-platform.md § 33.Backwards compatibility
Breaking: a PR that adds or changes a row of
src/kiro_crew/apps/adoption-pins.jsonfails PR Hygiene until its body carries aWheel-copy base:line per changed row and that app's wheel copy at the base tip equals the base's. Writer sweep re-run on origin/main @ f8d7751: the only writers are pin PRs; the one open today is #37411, fixed by a body edit (no push) once its app repo carries the drift reported below. #36446 merged before this guard; merged pin PRs are not re-checked.Removes nothing: the existing
App repo:rule and every other PR Hygiene step are unchanged; only pin PRs gain a requirement.Tests
test/test_adopted_wheel_copy_check.py:TestPinDriftGuard: an added or changed row needs a base line; an unchanged, dropped or base-tip-only row needs none; each changed row needs its own line; two different bases fail; malformed lines do not count; drift reported by the comparer fails.TestGitCompare(a real git repo in tmp_path): a later wheel-copy change or deletion is reported, test files and sibling paths are not, an unknown base or a missing base tip fails closed.TestCli: the end-to-end red and green against a real repo, the pin PR's ownapp.jsonbump is not drift, a missingBASE_TIPfails.TestWiring: the step passesBASE_TIPto the script.With the script and workflow reverted to origin/main, 17 of the new tests fail. Determinism: the file passed 3 repeats under
-n 4and once in a shuffled order (seed 7,-n0); no clock, sleep, port or network.Manual verification
Replayed the new script on real history:
papyrus/backend/gitops.py.aws_control/backend/backup_parts/retention.py.auto_improvement/spine/driver.pyand siblings.Related Issues
Part of #26967
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)