Repository navigation
feat: implement issue #1905 — [qa-lead reach 3/3] persona-runner ignores surface=pull_request — the router-served qa-lead advisory loses its test-surface, budget and already-advised gates - #1909
Conversation
…res surface=pull_request — the router-served qa-lead advisory loses its test-surface, budget and already-advised gates
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (13)
📝 SummarySummary by CodeRabbit
WalkthroughThe runner now accepts event surface and action data, applies a persona pre-gate before downstream work, and shares qa-lead pull-request signal gathering with the local advisory workflow. Bats coverage and persona documentation are updated. ChangesPersona pull-request gating
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant ReusableRunner as persona-runner-reusable
participant EventGate as persona_event_pregate
participant SignalGate as qa_lead_pr_gather_and_decide
participant GitHub as GitHub API
participant Decision as qa_lead_gate_decision
participant Engine as Persona engine
ReusableRunner->>EventGate: Send persona and pull-request event data
EventGate->>SignalGate: Request qa-lead pull-request decision
SignalGate->>GitHub: Read pull-request signals
GitHub-->>SignalGate: Return signal data
SignalGate->>Decision: Evaluate collected signals
Decision-->>SignalGate: Return run or skip
SignalGate-->>EventGate: Return gate decision
EventGate-->>ReusableRunner: Return gate decision
ReusableRunner->>Engine: Start downstream work when decision is run
Merge Risk: 🔵 Low · up to If the gate function breaks silently, the local advisory workflow could skip without any failure signal. This is a narrow edge case with a one-line fix, so the PR is mergeable with minor follow-up. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Code Review
This pull request introduces a pre-gate mechanism for persona events to prevent the runner from posting on every trusted pull request. It adds signal gathering and decision-making logic in scripts/persona-pr-pregate.sh and scripts/qa-lead-pr-gate.sh, along with comprehensive unit tests in tests/test_persona_pr_pregate.bats. The feedback highlights a critical issue in scripts/qa-lead-pr-gate.sh where a standalone conditional expression under set -e can cause premature script termination. Additionally, it is recommended to replace generic non-zero exit code assertions in the test suite with specific expected exit codes to prevent masking unexpected test failures.
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-09-23T04:55:50Z. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 468fa3767f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-09-23T05:02:35Z. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e6cffbf9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Review completed against the latest diff
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
Dev-Lead — review-changes (partial)A commit was pushed, but not every requested change was applied. Per requested item:
The unaddressed items above still need work. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6739306fe9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-09-23T05:18:09Z. |
Superseded by automated re-review at
|
Superseded by automated re-review at
|
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: 6739306fe994dacf24db3e776431fb344afc73e3
Cascade: triage → audit (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: fable 5)
Summary
The PR adds a fail-closed pull_request pre-gate to the persona runner so router-served qa-lead advisories apply the same suppressors as the local surface. The only security-relevant delta — pull-requests:read + issues:read on the secrets:inherit path — was verified minimal, read-only, and correctly mirrored at all three call sites; inputs flow via env into quoted shell (no expression injection) and the PAT-posting isolation is unchanged. The failing template-drift check is NOT in the branch ruleset's required set (verified via GET /rules/branches/main: SonarCloud, CodeQL, agent-shield/AgentShield, dependency-audit/Detect ecosystems, duplicate-decl-gate — all green), so all gates pass.
Findings
- info: Added pull-requests:read and issues:read are least-privilege and mirrored at caller (persona-runner.yml), reusable (persona-runner-reusable.yml), and local advise job (qa-lead-pr-advisory.yml). Top-level permissions:{} retained; PAT selection/posting logic untouched; pre-gate uses only github.token and never posts.
- info: All dispatch-derived values (persona, surface, source_repo, item_number, event_action) enter the pre-gate step via env: and are quoted in shell — no ${{ }} interpolation inside run: blocks. gh api paths are built from these env vars but repository_dispatch already requires repo write access (trusted router), and calls are read-only GETs.
- info: template-drift is FAILURE at head, but it is NOT a required context per the main-branch ruleset (verified via gh api repos/.../rules/branches/main) and AGENTS.md documents it as routinely failing without blocking merge. The failure is pre-existing drift on petry-projects/repo-template stubs untouched by this PR. All five ruleset-required checks are SUCCESS.
- minor: Confirmed from deep review: serialization of the local vs router-served advisory depends on the external ADR-0009 router emitting source_repo identical to github.repository and empty comment_url for pull_request dispatches, so both land in the same reusable concurrency group. If it diverges, worst case is a duplicate advisory comment (noise), not a security exposure. Author has flagged post-merge verification; the already-advised marker recheck limits blast radius.
- minor: Confirmed from deep review: for a private SOURCE_REPO the github.token-based signal reads 403 and the gate fails closed, so routed advisories silently skip. Safe direction (no wrong post, no data exposure) and consistent with the documented public-source-repo assumption, but a silent functionality gap worth a follow-up issue for observability.
Reviewed by the PR-review cascade (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: fable 5). Reply if you need a human review.
|
pr-review approved on PARTIAL advisory evidence: 5/7 required advisory bots reported before the gate's head-age-timeout fallback proceeded. Recorded for the miss-rate metric (#1596). |
Dismissing approval due to a PR issue comment lacking a verified disposition (#1813)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-09-23T06:11:55Z. |
Resolved — the `needs-human-review` hold was lifted; dev-lead has picked this item up. Click to expand the prior hold notice.dev-lead is withholding action on this item. It is labeled To re-enable automated pickup: remove the |
don-petry
left a comment
There was a problem hiding this comment.
Maintainer review — two required changes, both line-anchored below. The first is why qa-lead's pull_request advisory has posted nothing since it shipped.
|
No description provided. |
|
No description provided. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No description provided. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ub rejects --slurp with --jq Test-Change-Justification: stub now mimics real gh rejecting --slurp with --jq (maintainer review on #1909); changed-files stub keyed on URL
…instead of running Test-Change-Justification: the three no-registered-gate tests encoded the generic-marker run behaviour the maintainer review on #1909 rejected; replaced with skip/no-gh-call/notice tests
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Dev-Lead — fix-reviews (partial)A commit was pushed, but not every requested change was applied. Per requested item:
The unaddressed items above still need work. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No description provided. |
|
|
No description provided. |
|
No description provided. |
|
CodeRabbit rate-limit notice: the code review was throttled by the free OSS tier limit, but the pre-merge checks all pass (5/5) and no actionable code findings are present in the comment. The change summary shows the implementation is working as designed. |



Problem
[qa-lead reach 3/3] persona-runner ignores surface=pull_request — the router-served qa-lead advisory loses its test-surface, budget and already-advised gates
From the issue: Epic #1643 (Phase 2), decision (b) in ADR-0009 (#1869): qa-lead's
pull_requestadvisory moves from the self-contained.github/workflows/qa-lead-pr-advisory.ymlto the sharedpersona-mentionrouter (petry-projects/.github#1165, PRpetry-projects/.github#1167). The router dispatchesrepository_dispatch: persona-mentionwithclient_payload[surface]=pull_requestinto.github/workflows/persona-runner.ymlhere.Risk
Medium — changes GitHub Actions workflow behavior, which is exercised only post-merge; verify via the affected workflow runs.
Test plan
Tests added/updated:
tests/test_persona_pr_pregate.bats. Verification:bash scripts/dev-lead-lint.sh(shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.Rollback
Revert this PR. No non-revertible side effects (no tags, migrations, or external state).
Monitoring
Watch the affected workflow run(s) in the Actions tab and this PR's Lint check for regressions.
Closes #1905