[codex] fix(review): separate Ally evidence lanes - #1176
Conversation
|
Hey @kkroo! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
1 similar comment
|
Hey @kkroo! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: f6dca1d
Critical Issues (0)
Important Issues (1)
- [native-codex]
scripts/check-ally-review-consistency.mjs:225— A clean App review in the self-review case is necessarilyCOMMENTED: GitHub prohibits the App PR author from approving its own PR. This condition treats every cleanCOMMENTEDApp review as an I4 violation, so the required formal self-review for App-authored PRs can never pass the consistency guard.- Preserve
COMMENTEDas valid clean App evidence when the PR author isapp/allyblockcast; keepAPPROVEDmandatory for non-self App reviews and the separate user-seat lane.
- Preserve
Suggestions (0)
Strengths
- The lane separation and exact-head checks are clearly structured and regression-tested in the changed test matrix.
Recommended Action
- Address the Important issue before merge.
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 14fdcfd
Prior Findings Dispositioned (1)
- prior:f6dca1d important 1 — fixed —
scripts/check-ally-review-consistency.mjs:157— clean App self-reviews are now explicitly allowed to remainCOMMENTEDwhen the PR author isapp/allyblockcast.
Critical Issues (0)
Important Issues (1)
- [native-codex]
scripts/check-ally-review-consistency.mjs:146— Review lanes are inferred solely fromuser.login, so a review is counted as App or User-seat evidence without confirming GitHub'suser.type. The reviewer-identity policy requires Bot-typeallyblockcast[bot]for the App lane and User-typeallyblockcastfor the team lane; enforce those types when classifying reviews and add opposite-type regression cases.- Classify the complete
review.useridentity, not only its login, before using it for idempotency or lane invariants.
- Classify the complete
Suggestions (0)
Strengths
- The two-lane invariants and the App-authored self-review exception are clearly separated and covered by focused unit tests.
Recommended Action
- Address the Important issue before merge.
- Consider Suggestions opportunistically.
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: a44a2f3
Prior Findings Dispositioned (1)
- prior:14fdcfd important 1 — fixed —
scripts/check-ally-review-consistency.mjs:135— the App lane now requires the Bot-typeallyblockcast[bot]REST identity, andscripts/check-ally-review-consistency.mjs:141independently requires the User-typeallyblockcastidentity for the user-seat lane.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The implementation keeps App and user-seat evidence separate while preserving same-head duplicate and blocker checks.
- The focused tests cover opposite account types, independent lane duplicates, and the App-authored self-review exception.
Recommended Action
- Merge when the remaining required checks are green.
allyblockcast
left a comment
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: a44a2f3
Prior Findings Dispositioned (1)
- prior:14fdcfd important 1 — fixed —
scripts/check-ally-review-consistency.mjs:135— the App lane now requires the Bot-typeallyblockcast[bot]REST identity, andscripts/check-ally-review-consistency.mjs:141independently requires the User-typeallyblockcastidentity for the user-seat lane.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The implementation keeps App and user-seat evidence separate while preserving same-head duplicate and blocker checks.
- The focused tests cover opposite account types, independent lane duplicates, and the App-authored self-review exception.
Recommended Action
- Merge when the remaining required checks are green.
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: dad6004
The lane separation is sound and I verified it empirically: I ran both this head's guard and master's against all 144 open PRs. On #1269 master conflated the legitimate App+User approval pair into a bogus I1 duplicate; this revision correctly reports only the real I3 stale attestation. That is a genuine reduction in false positives, not just a refactor. All 73 unit tests pass on Node 24.
Critical Issues (0)
Important Issues (1)
- [native-codex]
scripts/check-ally-review-consistency.mjs:225—isRequiredApprovalPairrequires the App review to beAPPROVED, but this file's own I4 doc (lines 31–35) states that on an App-authored PR the App's clean self-review is necessarilyCOMMENTEDbecause GitHub bars self-approval. The predicate is therefore unsatisfiable for exactly the case the rest of this PR exists to accommodate — and that case is the dominant one: 106 of the 144 currently open PRs are authored byapp/allyblockcast. This arrived via the master merge indad6004dand is currently latent (the export has no consumer outside the test file; the shipped guard path infindPrViolationshandles the exception correctly at line 290), so nothing is broken today. But the name and the docstring — "The only permitted two-review shape" — actively invite wiring it into a merge gate, at which point every agent PR would block.- Either give it the same App-authored exception
isCleanAppSelfReviewencodes, or narrow the docstring to state explicitly that it describes the independently-authored-PR shape only and must not be applied to App-authored PRs. A regression test pinning the App-authored case would keep the two paths from drifting again.
- Either give it the same App-authored exception
Suggestions (2)
- [pr-review-toolkit]
deploy/helm/paperclip/tests/prometheus-rule.test.mjs:42— whitespace-only blank-line removals in a file unrelated to review-evidence lanes. Merge noise; dropping it keeps the diff to its stated subject. - [gstack/review]
scripts/check-ally-review-consistency.mjs:314— the I2 docstring promises "no operative APPROVED review coexisting with a blocking review in the other lane" (bidirectional), while I2b implements only seat-APPROVED-vs-App-blocking. The reverse direction is in fact covered — a blocking seat review trips I4, and an APPROVED seat body with findings trips I2a — so this is not a fail-open, but the comment overstates what this specific check does.
Strengths
- Lane separation is validated against real data, not just fixtures: the #1269 improvement above is measurable on the live fleet.
- The fail-closed asserts (
assertPrListComplete,assertHeadSha) are the right instinct for a guard, and the docstring onassertHeadShaexplains why a falsy head is fatal rather than merely asserting it. - Test coverage is genuinely adversarial — opposite account types, lookalike logins carrying the correct immutable ID, canonical logins with wrong IDs, and per-lane duplicates are all pinned.
- The I3 docstring revision correcting the force-push mechanism (vs. the earlier submit-time-binding claim) is an honest, well-evidenced correction.
Recommended Action
- Address the Important issue this cycle — clarify or fix
isRequiredApprovalPairbefore anything wires it to a gate. - Consider the Suggestions opportunistically.
- Unrelated to this diff:
Build,Canary Dry Run,General tests (server 2/4)and(workspaces-b)are all failing at the same pnpm install step on a missingpackages/plugins/sdk/dist/dev-cli.js, ~2m into four unrelated job types. Not attributable to these three files, but it needs to go green before merge. - Note the scheduled
Ally Review Consistency Guardis already red on master (11 violations) and remains red here (10). It is cron-only, not a PR gate, so it does not block this PR — but #1031 and #1316 need dispositioning separately.
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 247c05e
Prior Findings Dispositioned (1)
- prior:dad6004 important 1 — fixed —
scripts/check-ally-review-consistency.mjs:230— the App lane now recognizes a clean self-review only for an App-authored PR, while the normal App approval path remains required for independently authored PRs.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- App and User-seat evidence are classified into independent lanes with GitHub account-type checks.
- Exact-head, duplicate, stale-attestation, blocker-precedence, and self-review cases are covered by focused regression tests.
- The review preserves formal approval requirements for independently authored PRs while supporting the required App-authored self-review form.
Recommended Action
- Merge when the remaining required checks are green.
allyblockcast
left a comment
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 247c05e
Prior Findings Dispositioned (1)
- prior:dad6004 important 1 — fixed —
scripts/check-ally-review-consistency.mjs:230— the App lane now recognizes a clean self-review only for an App-authored PR, while the normal App approval path remains required for independently authored PRs.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- App and User-seat evidence are classified into independent lanes with GitHub account-type checks.
- Exact-head, duplicate, stale-attestation, blocker-precedence, and self-review cases are covered by focused regression tests.
- The review preserves formal approval requirements for independently authored PRs while supporting the required App-authored self-review form.
Recommended Action
- Merge when the remaining required checks are green.
…erdict Follow-up to the consolidated review on #1385. Three suggestions, all confirmed against the live repo. 1. `duplicateBodyAcrossIdentities` compared bodies with `===` alone, so two bodiless approvals under two seats (`null === null`) were reported as "one verdict, posted twice". That is the wrong diagnosis with the wrong remedy: there is no verdict, it is BLO-22916's Defect 2, and I2d already reports the missing attestation. Guard on a truthy body. 2. Document the parameter contract. Unlike its neighbour `isRequiredApprovalPair(reviews, headSha)`, this function takes an ALREADY-filtered operative set; passing a raw `pr.reviews` would compare dismissed and stale-head reviews and answer a different question. 3. Restore the `describe`/`it` line break collapsed when the new block was inserted above it. Verification: - `node --test scripts/check-ally-review-consistency.test.mjs` -> 70/70 pass (69 before; +1 pinning the bodiless case across null/""/undefined). - Mutation-checked: dropping the truthiness guard fails that test. - Live audit on this branch is byte-identical to the reviewed head's: 8 violations, #1176/#1073/#1031 duplicate-shape wording, #1316 (distinct bodies) unchanged. No real-world behavior change -- Defect 2 is fixed, so there are no bodiless approvals at head to re-label. Refs BLO-22916
247c05e to
3d68761
Compare
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 3d68761
Critical Issues (0)
Important Issues (1)
- [native-codex]
scripts/check-ally-review-consistency.mjs:174— The new lane classifier accepts only login plus account type, andfindPrViolationsuses that classifier directly. It never checksALLY_APP_REVIEWER_IDorALLY_USER_REVIEWER_ID;isRequiredApprovalPairstill checks them but is now unused by the runtime guard. Consequently, a review from another Bot/User account with the canonical login shape but a different REST id is treated as valid App/User-seat evidence, so the audit can report no violation despite its stated immutable-identity invariant.- Require the expected REST id when assigning an App or User-seat lane (or emit a violation for a mismatched id), and add runtime
findPrViolationscoverage for both mismatched-id lanes.
- Require the expected REST id when assigning an App or User-seat lane (or emit a violation for a mismatched id), and add runtime
Suggestions (0)
Strengths
- The App/User-seat split and account-type regressions make the intended evidence model substantially clearer.
- The focused suite passes all 83 tests at this head.
Recommended Action
- Address the Important issue before merge.
Keep App and User-seat reviews independent, validate reviewer account types, handle App-authored self-review evidence, and reject duplicate verdict bodies including whitespace-only variants. Co-Authored-By: Paperclip <noreply@paperclip.ing>
3d68761 to
6a67c31
Compare
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 6a67c31
Prior Findings Dispositioned (1)
- prior:3d68761 important 1 — still-present —
scripts/check-ally-review-consistency.mjs:182—operativeAllyReviewsclassifies a review usingallyReviewLane, which checks only login and account type;findPrViolationsconsumes that result at line 293 without enforcingALLY_APP_REVIEWER_IDorALLY_USER_REVIEWER_ID. A canonical-login review with an unexpected immutable REST ID can therefore satisfy the runtime lane checks.
Critical Issues (0)
Important Issues (1)
- [prior:native-codex]
scripts/check-ally-review-consistency.mjs:182— The runtime guard still accepts canonical Ally login/account-type pairs without checking the expected immutable REST IDs. A Bot/User lookalike with the canonical login shape but a different REST ID is treated as valid lane evidence, so the audit can report no violation for a review from the wrong principal.- Require the expected REST ID when assigning the App or User-seat lane, and add
findPrViolationsregression cases for mismatched IDs in both lanes.
- Require the expected REST ID when assigning the App or User-seat lane, and add
Suggestions (0)
Strengths
- The App and User-seat lanes are separated cleanly and account type is now considered during classification.
- Exact-head filtering, canonical App attestations, duplicate-body detection, blocker precedence, and App-authored self-review handling are covered by focused tests.
Recommended Action
- Address the Important issue this cycle.
- Consider Suggestions opportunistically.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
@ally please review exact head aaca48e Follow-up fixes review #4999241869: runtime lane classification now pins both canonical GitHub login/account type and immutable REST ID, with wrong-App-ID and wrong-User-seat-ID coverage. Focused test: |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: aaca48e
Prior Findings Dispositioned (1)
- prior:3d68761 important 1 — fixed —
scripts/check-ally-review-consistency.mjs:151—allyReviewIdentityShaperequires the canonical login and GitHub account type before assigning a lane, whileisAllyAppReviewerandisAllySeatReviewerrequire the corresponding immutable REST ID. The runtime guard also emits an explicit mismatch violation atscripts/check-ally-review-consistency.mjs:314.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The App and User-seat lanes now require canonical login, account type, and immutable REST identity before runtime evidence is accepted.
- The focused regression suite covers wrong account types, wrong App/User-seat IDs, duplicate lane submissions, stale attestations, blocker precedence, and App-authored self-review behavior.
- Exact-head App attestation remains distinct from the User-seat lane's formal exact-head approval semantics.
Recommended Action
- Merge when the remaining required checks are green.
|
@ally please satisfy the PR's two-lane consistency guard at exact head This PR is independently authored ( |
Thinking Path
Linked Issues or Issue Description
What happened
The scheduled Ally review-consistency guard reports valid paired App and user-seat approvals as duplicate evidence. The live run reports 22 false duplicate violations, even where each lane has exactly one clean approval on the same head.
Expected behavior
One formal, canonical exact-head approval is allowed in each lane. Duplicates or stale reviews within either lane, a comment-only clean App review, or a user-seat approval beside an App blocker must remain failures.
Steps to reproduce
allyblockcast[bot]App approval and oneallyblockcastuser-seat approval at the same head.scripts/check-ally-review-consistency.mjs.Paperclip version
Current
master; see the failing scheduled guard run.What Changed
APPROVED, not merelyCOMMENTED.Verification
node --test scripts/check-ally-review-consistency.test.mjs— 47 passed.pnpm typecheckpassed.git diff --checkpassed.Risks
COMMENTEDreviews plus stale/duplicate records require valid replacement evidence rather than suppression.Model Used
Checklist