Repository navigation
[#752] feat: realign stale PRs and revalidate their heads - #769
Conversation
rucka
left a comment
There was a problem hiding this comment.
Verdict
CHANGES-REQUESTED · risk:red · cost:yellow
Open findings: 5. Adopted delivery skips alignment.
PR: #769 · Story: #752 · Author: rucka · Review: Pair · 2026-11-28 · feature
Reviewed head: 76a7d5ceed5ce750810f502e8a40510831c5aa62
Context: How-to 11 · staff-engineer · GitHub Projects via gh
Tier: 1 reviewer · 2 working days · extended checklist · explicit human approval required by the red tier.
Identity: session · Light row: n-a — no identity (session mode)
Classification matrix
- Criticality green (adopted Low)
- Diff yellow (shared engine)
- Impact red (core workflow)
- Security yellow (Git publication)
- Coupling yellow (gate handoff)
Assessments
Security — Input validation
Yellow. The helper validates refs and SHAs. The adapter drops the gate's base identity before dispatch.
Evidence
The helper checks the supplied repository, refs, remote values and worktree. The caller needs to bind those values to the gate decision (F3).
Security — Output handling
Green. The Git helper passes arguments directly and returns JSON.
Evidence
Verified argument arrays, the structured handoff and commit-ID validation in the CLI launcher.
Security — Authentication
Green. Git and GitHub retain the configured credentials.
Evidence
The diff adds no credential store, dependency or authentication path.
Security — Authorization
Yellow. The push uses a remote head lease. Gate permission is tied only to the head.
Evidence
F3 covers authorization to begin alignment. F5 covers the missing host read-back in the session runner.
Security — Introduced vulnerabilities
Yellow. The new policy-binding gap is tracked in F3. Zero introduced red findings identified.
Evidence
Checked command construction, remote repository matching and commit custody.
Cost
Yellow. Alignment adds review and CI runs on existing providers.
Evidence
Delivery declares three alignment attempts. F4 shows a configured process retry can exceed a declared limit.
Architecture (Coupling)
Yellow. Git policy, workflow state and publication depend on the same target.
Evidence
The adapter boundary is appropriate. A typed decision shared by both runners would close F3 and F5.
Bug fix — Red test before fix
Not applicable. Feature PR.
Details
Findings by severity
Major (blocking, all new in this first review)
- F1. Release changeset is missing. GitHub's
Changeset presentjobs failed. The diff adds no.changeset/*.md, and the PR has nono-changesetlabel. Add the changeset for the release-facing CLI behavior. .github/workflows/ci.yml:43 - F2. The normal delivery command skips alignment. The built locator selects the tracked adoption file, which has neither
base-currentnoralign. The integration fixture explicitly loads the dataset copy. Update the adopted workflow and exercise named resolution (AC1/AC7). .pair/adoption/tech/workflows/delivery.yaml:34 - F3. Alignment reuses a decision after the PR base changes.
pr-alignmentrechecks H and accepts the latest target. If the PR moves from strict B to non-strict C at the same H, the earlier decision still permits a push against C. Bind launch to the gated base ref/SHA or recheck policy before dispatch (AC2/AC3). workflow-facts.mjs:171 - F4. Process retries bypass the operation limits. A return with
max: 1andretries: 1produced attempt 2 with one saved charge. Fix retries use the same path around reservation. Enforce and persist the limits before a process retry (AC6). engine/index.ts:1081 - F5. Session alignment lacks host facts and verification.
/pair-workflow-runsends the generic packet without required PR/base refs and base SHA. Session record lacks the CLI remote read-back. Share alignment preparation and result verification across runners (AC3/AC5). session.ts:595
Positive feedback
Disposable Git fixtures cover lease refusal, remote movement and conflict rollback.
Functionality and requirements
AC4 passes the conflict fixtures. AC1–3 and AC5–7 remain open through F2–F5. Card closure requires green gates and explicit approval.
Testing and quality gates
pnpm build and pnpm gate:review passed in a detached worktree matching the reviewed head. The gate passed 3,925 tests, type checks, lint, and CSS, skills and docs checks.
The 157 focused tests passed. GitHub's changeset gate failed on the reviewed head. Review enforcement is advisory under the repository's adopted settings. Mutation was not measured.
Adoption compliance
Level 1. No new dependencies or infrastructure. ADR-037 records bounded return. F1–F5 cover release and workflow compliance. Regeneration verified all 24 changed mirror files.
Tech debt
The shipped definitions retain an exhaustion-triggered final-review alongside the loop's exhaustion stop. The fresh review occurs inside the loop.
Documentation
The schema, kind reference, example and ADR describe bounded return. The adopted definition lags the example (F2).
Performance and deployment
Extra GitHub reads and Git operations run on the delivery path. No datastore or migration change. Git fixtures cover conflict abort and denied publication.
rucka
left a comment
There was a problem hiding this comment.
Verdict
APPROVED · risk:red · cost:yellow · zero open findings on 0976d9fe5887f9be408462788c9fcbb9dfb0418a.
- F11 resolved. A head change detected in session preflight records a typed failure without reserving an alignment attempt or starting the agent. The shipped bundle regression passes.
- F14 resolved. The twelve packaged and installed GitHub adapters have the same SHA-256. The workflow dry-run gate passed.
- F13 remains resolved on current main. The combination preserves workflow supervision and alignment returns, and the merge tree is clean.
- F2 and F5 retain their resolution across integration. The CLI tests run the adopted delivery workflow and its Ready selector, and the session tests refuse a claimed head without publication. The positive path rechecks the published head before approval and merge.
- F1, F3–F4, F6–F10 and F12 retain their recorded resolutions. The current domain check passes after retiring a suppression removed from the fixture during integration.
GitHub CI passed on the reviewed head, including the domain baseline and both smoke runners. The complete local gate encountered process and browser timeouts under load. Focused workflow, CLI, policy and browser suites passed separately. Mutation was not measured.
PR Information
Story: #752
Type: Feature
Assignee: @rucka
Merge strategy: squash
Closes #752
Summary
Delivery can realign a PR when repository policy requires an updated base, then revalidate the published head before approval. Covers AC1–AC7.
Changes Made
Services to Release
@pair/pair-cli: delivery host integration.@pair/workflows: validation, execution and gate routing.Testing
pnpm quality-gate: passed at closing.Classification
risk:red·cost:yellowReview matrix for 1704ae9
Cost is yellow for extra review and CI runs bounded by the workflow limits. Confidence is high for the inspected diff.
Reviewer Guide
Inspect lease and conflict handling, independent budgets across replay and resume, and invalidation of review and check evidence after head movement.