Skip to content

[3482 by Claude Opus 5.5] Read-only pull request readiness verdict with coded reasons - #3489

Merged
integry merged 4 commits into
3482-epic-integration-signals-100from
3482/claude-opus-5-5-read-only-pull-request-re-20261112-1226-anv
Nov 12, 2026
Merged

integry merged 4 commits into
3482-epic-integration-signals-100from
3482/claude-opus-5-5-read-only-pull-request-re-20261112-1226-anv

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3482

Branch: 3482/claude-opus-5-5-read-only-pull-request-re-20261112-1226-anv
Commits: ✅ Changes committed (2a50b68)


AI Processing Completed

Execution Details:

Summary:
Issue #3482 is implemented: one read-only call returns a PR's readiness verdict plus a coded reason for every gate, through REST, MCP and the CLI. The new tests and every regression suite I ran pass, including checkRunHandler (145/145) and the autoMerge* core suites, unchanged in behaviour.

Core (packages/core)

  • CI check: getCiMergeReadiness now uses a pure classifier, classifyCiMergeReadiness. A new readCiMergeReadiness reads the auto-merge:head-observed:* key but never writes or deletes it. The merge path still records and clears that key exactly as before.
  • Eligibility: evaluateAutoMergeEligibilityWithReason returns the eligibility plus a reason code. The old evaluateAutoMergeEligibility is now a thin wrapper, so its callers are untouched.
  • Active work: readActiveTasksForPR throws on a queue or database error, so the readiness read reports active_work_unavailable instead of "idle". getActiveTasksForPR keeps its old fail-open behaviour.
  • Evaluator: evaluatePullRequestReadiness(owner, repo, number, deps) lives in webhook/pullRequestReadiness.ts, with the per-gate logic as pure functions in pullRequestReadinessGates.ts. It runs as the GitHub App by default, and every dependency can be injected.
  • Exports: the core index exports these plus getUltrafixLoopState.

API and CLI

  • REST: GET /api/pull-requests/:number/readiness?repository=owner/repo is registered, documented with errors: 'envelope', and has a PullRequestReadiness zod schema. Errors are INVALID_INPUT (400), PULL_REQUEST_NOT_FOUND (404) and GITHUB_UNAVAILABLE (502).
  • MCP: get_pull_request_readiness (read scope, readOnly, args repository and number) first reads the PR with the caller's own GitHub access, as get_pull_request does, then evaluates as the App.
  • Score loader: it now returns goal_reached as a boolean or null.
  • CLI: propr pr readiness <number> [-p owner/repo] [--json].
  • Generated files: npm run gen:openapi output is regenerated, and gen:openapi:check passes.

Docs: docs/mcp.md, docs/mcp-coverage.md and the API reference describe the verdict rule and every gate and reason code. The CLI page lists the new command, and the new doc tokens are in the allow-list in mcpObservableSurface.test.ts.

Tests

  • Core: one test per gate and reason code, a ready-PR case, and a no-write test. That test fails on any non-GET GitHub call, on any merge or update-branch, and on any Redis set or delete, including the head-observation key.
  • REST: the handler is checked against the OpenAPI schema and the error envelope.
  • MCP: grant check, caller access versus App identity, and the not-found path.
  • CLI: arguments, options and output formatting.
  • Updated: the score-loader test now covers goal_reached.
  • Existing suites also pass: mcpPullRequests, mcpIntegration, mcpMergePreconditions, mcpOperatorSurface, mcpDocs, mcpToolInputBudget, mcpObservableSurface, openapiRouteCoverage, openapiResponseConformance, epicMergeProgressHandler and taskIntentWithdrawal.
  • Lint passes with zero warnings across the api and core packages.

Decisions to check in review

  • Extra reason codes: every gate needs a reason even when it passes or doesn't apply, so I added codes beyond the issue's table. These are pull_request_open, not_draft, mergeable, approved/no_changes_requested, no_active_work, ultrafix_pending, ultrafix_not_requested and auto_merge_not_requested. There are also three for unreadable data: review_state_unavailable, review_scores_unavailable and ultrafix_state_unavailable. All are documented and tested.
  • Extra field: autoMerge also carries the eligibility reason, which the issue's shape didn't include.
  • Behind base: branch_behind_base counts as a failure.
  • Blocked by protection: branch_protection_blocked only waits while checks or a required review are still pending; otherwise it fails. This stops a PR whose CI is still running from showing as blocked.
  • Plain reviews: a plain /review uses the instance ultrafix_rating_goal as its goal and must have no blockers to count as reaching it.
  • MCP test location: I put it in a new file, mcpPullRequestReadiness.test.ts, rather than extending the large mcpPullRequests.test.ts, and added it to the test:mcp list in package.json.

No visual previews: the change has no UI.

Detailed Logs:

  • Conversation: 286 messages
  • Session: ac7b5f07-f113-46e1-8049-c2b93c1b64fa

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3482-2026-11-12T13-01-32-041Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3482-2026-11-12T13-01-32-041Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: Issue #3482 is implemented: one read-only call returns a PR's readiness verdict plus a coded reason for every gate, through REST, MCP and the CLI. The new tests and every regression suite I ran pass, ...


This PR was created automatically by ProPR after processing issue #3482.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…ss verdict plus a coded reason for every gate, through REST, MCP and the CLI. The new tests and every regression suite I ran pass, including `checkRunHandler` (145/145) and the `autoMerge*` core suites, unchanged in behaviour.

Core (`packages/core`)
- CI check: `getCiMergeReadiness` now uses a pure classifier, `classifyCiMergeReadiness`. A new `readCiMergeReadiness` reads the `auto-merge:head-observed:*` key but never writes or deletes it. The merge path still records and clears that key exactly as before.
- Eligibility: `evaluateAutoMergeEligibilityWithReason` returns the eligibility plus a reason code. The old `evaluateAutoMergeEligibility` is now a thin wrapper, so its callers are untouched.
- Active work: `readActiveTasksForPR` throws on a queue or database error, so the readiness read reports `active_work_unavailable` instead of "idle". `getActiveTasksForPR` keeps its old fail-open behaviour.
- Evaluator: `evaluatePullRequestReadiness(owner, repo, number, deps)` lives in `webhook/pullRequestReadiness.ts`, with the per-gate logic as pure functions in `pullRequestReadinessGates.ts`. It runs as the GitHub App by default, and every dependency can be injected.
- Exports: the core index exports these plus `getUltrafixLoopState`.

API and CLI
- REST: `GET /api/pull-requests/:number/readiness?repository=owner/repo` is registered, documented with `errors: 'envelope'`, and has a `PullRequestReadiness` zod schema. Errors are `INVALID_INPUT` (400), `PULL_REQUEST_NOT_FOUND` (404) and `GITHUB_UNAVAILABLE` (502).
- MCP: `get_pull_request_readiness` (`read` scope, `readOnly`, args `repository` and `number`) first reads the PR with the caller's own GitHub access, as `get_pull_request` does, then evaluates as the App.
- Score loader: it now returns `goal_reached` as a boolean or null.
- CLI: `propr pr readiness <number> [-p owner/repo] [--json]`.
- Generated files: `npm run gen:openapi` output is regenerated, and `gen:openapi:check` passes.

Docs: `docs/mcp.md`, `docs/mcp-coverage.md` and the API reference describe the verdict rule and every gate and reason code. The CLI page lists the new command, and the new doc tokens are in the allow-list in `mcpObservableSurface.test.ts`.

Tests
- Core: one test per gate and reason code, a ready-PR case, and a no-write test. That test fails on any non-GET GitHub call, on any merge or update-branch, and on any Redis set or delete, including the head-observation key.
- REST: the handler is checked against the OpenAPI schema and the error envelope.
- MCP: grant check, caller access versus App identity, and the not-found path.
- CLI: arguments, options and output formatting.
- Updated: the score-loader test now covers `goal_reached`.
- Existing suites also pass: `mcpPullRequests`, `mcpIntegration`, `mcpMergePreconditions`, `mcpOperatorSurface`, `mcpDocs`, `mcpToolInputBudget`, `mcpObservableSurface`, `openapiRouteCoverage`, `openapiResponseConformance`, `epicMergeProgressHandler` and `taskIntentWithdrawal`.
- Lint passes with zero warnings across the api and core packages.

Decisions to check in review
- Extra reason codes: every gate needs a reason even when it passes or doesn't apply, so I added codes beyond the issue's table. These are `pull_request_open`, `not_draft`, `mergeable`, `approved`/`no_changes_requested`, `no_active_work`, `ultrafix_pending`, `ultrafix_not_requested` and `auto_merge_not_requested`. There are also three for unreadable data: `review_state_unavailable`, `review_scores_unavailable` and `ultrafix_state_unavailable`. All are documented and tested.
- Extra field: `autoMerge` also carries the eligibility `reason`, which the issue's shape didn't include.
- Behind base: `branch_behind_base` counts as a failure.
- Blocked by protection: `branch_protection_blocked` only waits while checks or a required review are still pending; otherwise it fails. This stops a PR whose CI is still running from showing as `blocked`.
- Plain reviews: a plain `/review` uses the instance `ultrafix_rating_goal` as its goal and must have no blockers to count as reaching it.
- MCP test location: I put it in a new file, `mcpPullRequestReadiness.test.ts`, rather than extending the large `mcpPullRequests.test.ts`, and added it to the `test:mcp` list in `package.json`.

No visual previews: the change has no UI.
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 12, 2026
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds a well-structured readiness evaluator across REST, MCP and CLI, but needs changes before merge: three paths can produce an incorrect readiness verdict.

✅ Read-only CI classification — The new reader reuses the CI classifier without setting or deleting head-observation keys.

✅ MCP access boundary — The tool checks the caller’s PR access before evaluating with the App identity.

✅ Explicit failure reporting — Queue and score-loading failures become unknown gates instead of silently reporting idle work or absent reviews.

This review is based on static tracing of the supplied diff and context; no commands were run. The supplied current-head status has no failures and three pending checks.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Paginate reviews before choosing reviewer verdicts

  • Required behavior: The human-review gate must reflect current reviewer decisions, rather than an incomplete historical prefix.

  • Evidence: packages/core/src/webhook/pullRequestReadiness.ts:readHumanReviews

    1. A PR has more than 100 reviews. A reviewer requests changes within the first 100, then approves in a subsequent page.
    2. The new reader requests only one page with per_page: 100 and builds its “latest” map from that page.
    3. GitHub’s GraphQL decision reports APPROVED, but the truncated map still lists that reviewer under changesRequestedBy.
    4. humanReviewGate prioritizes that stale change request over APPROVED, producing changes_requested and a blocked verdict for an otherwise ready PR.

    The GraphQL read does not protect this path because the gate explicitly ORs its decision with the historical map. The supplied review tests contain only single-page histories. Verification provenance — static trace: the single request, map construction and gate precedence demonstrate the failure; no test was executed.

  • Minimum fix: Paginate the review history before computing each reviewer’s latest verdict. If pagination cannot complete, report review_state_unavailable. Add a regression with a change request on page one and its superseding approval on page two.

F2: 🔴 Keep unreadable auto-merge intent unknown

  • Required behavior: An unreadable signal must not be treated as confirmed absence when it determines whether a readiness gate applies.

  • Evidence: packages/core/src/webhook/pullRequestReadiness.ts:evaluatePullRequestReadiness, the issueLabel, requested and policyGate(decision) path

    1. An otherwise ready PR has no direct auto-merge label, but its linked issue has that label. The repository policy disables auto-merge.
    2. Reading the linked issue fails, so readLinkedIssueAutoMergeLabel returns null.
    3. Eligibility correctly becomes transient with linked_issue_unavailable, but requested = hasLabel || issueLabel === true evaluates to false.
    4. The policy is skipped and its gate reports not_applicable / auto_merge_not_requested. With every other gate passing, the overall verdict is ready; neither reason list contains the unresolved intent.

    The eligibility result does not prevent this because decideVerdict examines only gates. The policy’s own failure handling is never reached. Verification provenance — static trace: the null result is collapsed into false before gate construction, despite the separately reported transient eligibility.

  • Minimum fix: Preserve three-state request detection. When no direct label exists and linked-issue intent is unavailable, return an unknown policy gate with a coded reason instead of auto_merge_not_requested. Test that this case cannot return ready.

F3: 🔴 Bind policy evaluation to the reported head

  • Required behavior: A verdict advertised for a particular head and base must not combine that snapshot’s checks with another snapshot’s policy decision.

  • Evidence: packages/core/src/webhook/pullRequestReadiness.ts:evaluatePullRequestReadiness, the call to evaluatePullRequestAutoMerge

    1. The initial PR read captures head H1, carrying auto-merge, with passing checks and a current successful review. H1 changes a protected path.
    2. While the evaluator awaits its parallel signal reads, another actor pushes H2, which removes that protected-path change.
    3. evaluatePullRequestAutoMerge subsequently fetches H2, evaluates its unprotected diff, and returns an armed decision together with H2’s snapshot.
    4. The readiness evaluator extracts only .decision. It returns H1 in head, H1’s successful checks and review, and H2’s passing policy result, yielding ready although H1’s policy should fail.

    The policy helper checks consistency within its own H2 reads; it never compares H2 with the readiness evaluator’s H1. The unchanged merge caller explicitly compares the returned pullRequest.headSha with its checked head, but this new caller omits that protection. No lock prevents an ordinary push during the awaited reads. Verification provenance — static trace: the supplied helper and both callers establish the mixed-snapshot path; no concurrency test was executed.

  • Minimum fix: Retain the policy snapshot and compare its head and base with the initial readiness snapshot. On mismatch, report an unknown gate or restart a bounded evaluation. Add a regression that changes the head between the initial read and policy evaluation.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The implementation has clear separation of responsibilities and substantial test coverage, but incomplete review history, unknown intent handling and mixed snapshots undermine the central verdict contract. These require localized corrections before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 59s
  • Tokens: 88,275 (86,712 in / 1,563 out)
  • Cost: $0.84

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 F3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b3abbb7

Addressed 1 AI review comment (IDs: 6824758515)

Addressed findings F1, F2, F3

Summary of Changes

F1, F2 and F3 are fixed in packages/core/src/webhook/pullRequestReadiness.ts, and each has a regression test. I ran the three new tests against the old source and they failed there; on the new code all 16 readiness tests pass.

F1: reviews are paginated. A new readAllReviews reads every page of 100 reviews, oldest first, before building each reviewer's latest verdict. If a page isn't a list, or the history runs past MAX_REVIEW_PAGES (30 pages, so 3,000 reviews), the gate reports review_state_unavailable instead of judging from a partial history. The regression puts a change request on page one and the same reviewer's approval on page two: the gate now passes with approved and the verdict is ready. A second case checks that a history longer than the cap is unknown.

F2: an unreadable auto-merge request stays unknown. Whether auto-merge is requested now has three states. If the PR has no auto-merge label and the linked issue can't be read, the policy gate is unknown with a new reason code, auto_merge_request_unavailable, and that code appears in waitingReasons. Previously this case was reported as auto_merge_not_requested. The regression combines an unreadable linked issue with a policy that disables auto-merge and confirms the verdict can't be ready.

F3: the policy decision must match the reported head. I kept the policy's snapshot and moved the policy step into a small readPolicy helper to stay under the lint complexity limit. If the policy saw a different head SHA or base branch from the one the readiness verdict reports, the gate is unknown with a new reason code, pull_request_changed, and autoMerge.policy is null. That stops the other snapshot's decision from leaking into the result. I didn't retry the evaluation: GitHub gives no way to lock out a push, so the race can't be closed, only detected. The regression is the scenario from the finding. Head H1 touches a protected path. The PR then moves to H2, which doesn't, and the policy would arm on H2. The verdict for H1 now comes back unknown, not ready. A second case covers a base-branch change.

Same assumption elsewhere: no other gate reads its own copy of the PR. Checks and the AI review are already tied to the initial head, and none of the other signals is read as a single page, so no other part of the PR's code needed the same fix.

Docs and schema: the two new codes are added to docs/mcp.md, docs/mcp-coverage.md, the API reference, the zod schema and the doc-token allow-list in mcpObservableSurface.test.ts. I regenerated the OpenAPI output, and gen:openapi:check passes.

Checks run:

  • Lint passes with zero warnings on the changed core and API source files (the core lint config doesn't cover test files, as before).
  • tsc passes for core and api.
  • 47 tests pass across mcpPullRequestReadiness, pullRequestReadinessRoutes, mcpObservableSurface, openapiResponseConformance, mcpDocs and autoMergeGate.

Separate issue, not fixed: in checkRunHelpers.ts, getCheckSignals fetches check runs (GET …/commits/{ref}/check-runs) without per_page or pagination, so GitHub returns only the first 30. On a head with more check runs, a failing or pending one could be missed. That code predates this PR and wasn't one of the selected findings, so I left it unchanged.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 8m 9s
  • Tokens: 1,789,200 (1,774,866 in / 14,334 out)
  • Cost: $1.02

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…equestReadiness.ts`, and each has a regression test. I ran the three new tests against the old source and they failed there; on the new code all 16 readiness tests pass.

F1, F2 and F3 are fixed in `packages/core/src/webhook/pullRequestReadiness.ts`, and each has a regression test. I ran the three new tests against the old source and they failed there; on the new code all 16 readiness tests pass.

**F1: reviews are paginated.** A new `readAllReviews` reads every page of 100 reviews, oldest first, before building each reviewer's latest verdict. If a page isn't a list, or the history runs past `MAX_REVIEW_PAGES` (30 pages, so 3,000 reviews), the gate reports `review_state_unavailable` instead of judging from a partial history. The regression puts a change request on page one and the same reviewer's approval on page two: the gate now passes with `approved` and the verdict is `ready`. A second case checks that a history longer than the cap is `unknown`.

**F2: an unreadable auto-merge request stays unknown.** Whether auto-merge is requested now has three states. If the PR has no `auto-merge` label and the linked issue can't be read, the policy gate is `unknown` with a new reason code, `auto_merge_request_unavailable`, and that code appears in `waitingReasons`. Previously this case was reported as `auto_merge_not_requested`. The regression combines an unreadable linked issue with a policy that disables auto-merge and confirms the verdict can't be `ready`.

**F3: the policy decision must match the reported head.** I kept the policy's snapshot and moved the policy step into a small `readPolicy` helper to stay under the lint complexity limit. If the policy saw a different head SHA or base branch from the one the readiness verdict reports, the gate is `unknown` with a new reason code, `pull_request_changed`, and `autoMerge.policy` is `null`. That stops the other snapshot's decision from leaking into the result. I didn't retry the evaluation: GitHub gives no way to lock out a push, so the race can't be closed, only detected. The regression is the scenario from the finding. Head H1 touches a protected path. The PR then moves to H2, which doesn't, and the policy would arm on H2. The verdict for H1 now comes back `unknown`, not `ready`. A second case covers a base-branch change.

**Same assumption elsewhere:** no other gate reads its own copy of the PR. Checks and the AI review are already tied to the initial head, and none of the other signals is read as a single page, so no other part of the PR's code needed the same fix.

**Docs and schema:** the two new codes are added to `docs/mcp.md`, `docs/mcp-coverage.md`, the API reference, the zod schema and the doc-token allow-list in `mcpObservableSurface.test.ts`. I regenerated the OpenAPI output, and `gen:openapi:check` passes.

**Checks run:**
- Lint passes with zero warnings on the changed core and API source files (the core lint config doesn't cover test files, as before).
- `tsc` passes for core and api.
- 47 tests pass across `mcpPullRequestReadiness`, `pullRequestReadinessRoutes`, `mcpObservableSurface`, `openapiResponseConformance`, `mcpDocs` and `autoMergeGate`.

**Separate issue, not fixed:** in `checkRunHelpers.ts`, `getCheckSignals` fetches check runs (`GET …/commits/{ref}/check-runs`) without `per_page` or pagination, so GitHub returns only the first 30. On a head with more check runs, a failing or pending one could be missed. That code predates this PR and wasn't one of the selected findings, so I left it unchanged.

PR: #3489
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-x64 package
  • Result: failure
  • Commit: b3abbb7df1dc (b3abbb7df1dc03084592a167f6690f06d36c0f9c)
  • Details: View CI failure

Failure evidence

.github:43
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b507e9f

Summary of Changes

I fixed the Validate unsigned linux-x64 package failure. It wasn't caused by this PR's code: nothing under apps/desktop changed, main has the same code, and the linux-arm64 and darwin-arm64 jobs passed on the same commit. The darwin-x64 job was cancelled. The cause is a gap in the packaged-acceptance test harness's CSP (Content Security Policy) check, so the fix is a small change there.

What failed: after a new account connects, the app swaps its CSP and reloads the page. Requests the old page makes in that gap are blocked on purpose. The harness accepts those blocked-request console errors only with matching proof from Chromium's DevTools protocol (CDP). In this run:

The fix, in apps/desktop/scripts/packaged-acceptance-csp-reload.mjs: the "page replaced before the report" entry now also covers demo-mode, but only for its "Connecting to … violates" console line. Everything else stays strict: the URL, page and test step must match exactly, the fetch must have happened once and never got a response, and the existing caps on how many errors are allowed per request still apply. "Fetch API cannot load" errors still need Chromium's report.

Tests, in packaged-acceptance-csp-reload.test.mjs:

  • New regression test: it replays the exact CI order of events and checks that the run ends with zero unexpected errors. A third demo-mode error, or an unrelated error, still fails. Against the old code this test fails.
  • Updated test: the earlier test that expected demo-mode to be refused now checks the narrower rule. A demo-mode "Fetch API cannot load" error is still refused, and evidence for one request can't excuse the other.

Checks:

  • That test file passes 51/51, and 52/52 with the real-Chromium boundary test turned on (PROPR_DESKTOP_REAL_CHROMIUM_BOUNDARY=1).
  • The full desktop unit suite (npm run desktop:test) passes: 1381 passed, 0 failed, 56 skipped.
  • Lint with zero warnings is clean on both files.

I couldn't run the full packaged acceptance (npm run desktop:acceptance) here: this container has no Xvfb, Electron package or keyring. The next linux-x64 run in CI is the real confirmation. The PR will now also touch these two desktop harness files, so reviewers will see a change outside the readiness feature.

There are no previews because nothing visible changed.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 8m 44s
  • Tokens: 1,218,826 (1,208,936 in / 9,890 out)
  • Cost: $0.76
  • Subscription usage: Weekly +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6825208801✓

…It wasn't caused by this PR's code: nothing under `apps/desktop` changed, `main` has the same code, and the linux-arm64 and darwin-arm64 jobs passed on the same commit. The darwin-x64 job was cancelled. The cause is a gap in the packaged-acceptance test harness's CSP (Content Security Policy) check, so the fix is a small change there.

I fixed the `Validate unsigned linux-x64 package` failure. It wasn't caused by this PR's code: nothing under `apps/desktop` changed, `main` has the same code, and the linux-arm64 and darwin-arm64 jobs passed on the same commit. The darwin-x64 job was cancelled. The cause is a gap in the packaged-acceptance test harness's CSP (Content Security Policy) check, so the fix is a small change there.

**What failed:** after a new account connects, the app swaps its CSP and reloads the page. Requests the old page makes in that gap are blocked on purpose. The harness accepts those blocked-request console errors only with matching proof from Chromium's DevTools protocol (CDP). In this run:
- **current-user request:** Chromium's CSP report arrived as usual, so its three console errors were fine.
- **demo-mode request:** the reload replaced the page before Chromium's report arrived. The harness did record a "page replaced before the report" entry for it.
- **The rejection:** the harness only accepted that kind of entry for the current-user request; that rule came from the earlier flake fix in #3376. It refused the demo-mode error, and one refusal throws out every exemption. So the run ended with 4 unexpected errors.

**The fix**, in `apps/desktop/scripts/packaged-acceptance-csp-reload.mjs`: the "page replaced before the report" entry now also covers demo-mode, but only for its "Connecting to … violates" console line. Everything else stays strict: the URL, page and test step must match exactly, the fetch must have happened once and never got a response, and the existing caps on how many errors are allowed per request still apply. "Fetch API cannot load" errors still need Chromium's report.

**Tests**, in `packaged-acceptance-csp-reload.test.mjs`:
- **New regression test:** it replays the exact CI order of events and checks that the run ends with zero unexpected errors. A third demo-mode error, or an unrelated error, still fails. Against the old code this test fails.
- **Updated test:** the earlier test that expected demo-mode to be refused now checks the narrower rule. A demo-mode "Fetch API cannot load" error is still refused, and evidence for one request can't excuse the other.

**Checks:**
- That test file passes 51/51, and 52/52 with the real-Chromium boundary test turned on (`PROPR_DESKTOP_REAL_CHROMIUM_BOUNDARY=1`).
- The full desktop unit suite (`npm run desktop:test`) passes: 1381 passed, 0 failed, 56 skipped.
- Lint with zero warnings is clean on both files.

I couldn't run the full packaged acceptance (`npm run desktop:acceptance`) here: this container has no Xvfb, Electron package or keyring. The next linux-x64 run in CI is the real confirmation. The PR will now also touch these two desktop harness files, so reviewers will see a change outside the readiness feature.

There are no previews because nothing visible changed.

PR: #3489
Comment by: @propr-dev[bot] (ID: 6825208801)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR delivers a shared readiness evaluator across REST, MCP and CLI, with clear gate classifications and substantial coverage. It needs a localized correctness fix before merge.

✅ Shared classification — CI readiness reuses a pure classifier while preserving the merge path’s observation writes.

✅ Explicit uncertainty — Queue and score-read failures produce unknown gates rather than falsely reporting idle work or absent reviews.

✅ Caller authorization — MCP checks the caller’s PR access before evaluating with the App identity.

This review is based on static tracing of the supplied code; no commands were run. Current checks show 32 passed, two pending and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F4: 🔴 Canonicalize repository identity before internal reads

  • Required behavior: Readiness must incorporate the target PR’s persisted reviews and active work consistently, regardless of valid capitalization in the repository argument.

  • Evidence: packages/core/src/webhook/pullRequestReadiness.ts, evaluatePullRequestReadiness; packages/api/routes/reviewScoreStats.ts, loadPullRequestScores; packages/core/src/webhook/checkRunHelpers.ts, readActiveTasksForPR.

    1. A PR in acme/app has passing GitHub checks but a persisted current-head review below its goal, stored under acme/app.
    2. The caller requests readiness with repository=ACME/app. GitHub repository lookup accepts this capitalization, and the new REST handler passes it through unchanged.
    3. The evaluator constructs repository directly from those arguments. The score loader queries repository_id = 'ACME/app'; the supplied SQLite schema uses an ordinary string column, so it does not match the stored acme/app row.
    4. The empty result becomes ai_review: not_applicable/no_review. With the other gates passing and no Ultrafix label, the response reports ready instead of blocked.
    5. The same identity mismatch affects active-work detection: database predicates and queued-job string comparisons also use the caller’s capitalization, allowing existing work to be reported as absent.

    Repository syntax validation does not canonicalize identity, and successful GitHub access does not normalize the arguments subsequently used for internal reads. The supplied tests consistently use identical repository spelling and therefore do not cover this sequence. Verification provenance: static trace of the new evaluator and its supplied persistence and queue readers; no tests executed.

  • Minimum fix: Resolve a canonical repository identity before internal lookups and use it consistently for review scores, active tasks, queued jobs and Redis state. Add a regression showing that differently capitalized requests return the same review and active-work gates.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The implementation is well structured and broadly tested, but repository identity handling can produce a false-ready verdict. The correction is localized; the two pending checks must also finish before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 6s
  • Tokens: 84,797 (83,632 in / 1,165 out)
  • Cost: $0.79

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F4

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 28e69ee

Addressed 1 AI review comment (IDs: 6825946545)

Addressed finding F4

Summary of Changes

F4 is fixed: the readiness evaluator now uses GitHub's spelling of the repository for every internal lookup, whatever capitalization the caller sends. A request for ACME/App now gets the same review, Ultrafix and active-work gates as one for acme/app.

The fix (packages/core/src/webhook/pullRequestReadiness.ts)

  • The evaluator already reads the PR from GitHub first. It now takes the owner and name from that response (base.repo.owner.login and base.repo.name). These match the spelling that webhooks store, so stored rows and keys line up with it.
  • After that first read, every lookup uses the canonical name. That covers review scores (repository_id), active tasks, queued jobs, the Ultrafix state key, the head-observation key, and the non-blocking-checks config. The repository field in the response also uses it.
  • If the response has no base.repo, it falls back to the caller's spelling.
  • REST and MCP both call this evaluator, so the one change fixes both. The score loader and readActiveTasksForPR didn't need changes: they were right to match exactly; they were just given the wrong spelling.

Regression test (in packages/core/test/pullRequestReadiness.test.ts)

  • The fake loaders only return data stored under acme/app: a review below its goal, a running task, and an active Ultrafix loop.
  • A request spelled ACME/App gets the same ai_review, ultrafix and active_work gates and the same blocked verdict as acme/app, and every internal read uses acme/app.
  • For a head with no CI, the check result comes from the observation stored under acme:app.
  • Against the old evaluator this test fails, as it should; with the fix all 17 readiness tests pass.

Other checks: core tsc passes, and lint passes with zero warnings on the changed source file and on all of packages/api. The REST and MCP readiness tests pass. ESLint has no config for core test files, so it skipped the test file.

Separate issue, not changed: queued jobs and tasks are matched by exact string. Any that were created with a non-standard spelling, for example a repository name typed by a user, would still not be counted as active work. That comes from how jobs are written, not from this PR, so I left it alone.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 5m 13s
  • Tokens: 1,100,396 (1,092,394 in / 8,002 out)
  • Cost: $0.67

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ling of the repository for every internal lookup, whatever capitalization the caller sends. A request for `ACME/App` now gets the same review, Ultrafix and active-work gates as one for `acme/app`.

F4 is fixed: the readiness evaluator now uses GitHub's spelling of the repository for every internal lookup, whatever capitalization the caller sends. A request for `ACME/App` now gets the same review, Ultrafix and active-work gates as one for `acme/app`.

**The fix** (`packages/core/src/webhook/pullRequestReadiness.ts`)
- The evaluator already reads the PR from GitHub first. It now takes the owner and name from that response (`base.repo.owner.login` and `base.repo.name`). These match the spelling that webhooks store, so stored rows and keys line up with it.
- After that first read, every lookup uses the canonical name. That covers review scores (`repository_id`), active tasks, queued jobs, the Ultrafix state key, the head-observation key, and the non-blocking-checks config. The `repository` field in the response also uses it.
- If the response has no `base.repo`, it falls back to the caller's spelling.
- REST and MCP both call this evaluator, so the one change fixes both. The score loader and `readActiveTasksForPR` didn't need changes: they were right to match exactly; they were just given the wrong spelling.

**Regression test** (in `packages/core/test/pullRequestReadiness.test.ts`)
- The fake loaders only return data stored under `acme/app`: a review below its goal, a running task, and an active Ultrafix loop.
- A request spelled `ACME/App` gets the same `ai_review`, `ultrafix` and `active_work` gates and the same `blocked` verdict as `acme/app`, and every internal read uses `acme/app`.
- For a head with no CI, the check result comes from the observation stored under `acme:app`.
- Against the old evaluator this test fails, as it should; with the fix all 17 readiness tests pass.

**Other checks:** core `tsc` passes, and lint passes with zero warnings on the changed source file and on all of `packages/api`. The REST and MCP readiness tests pass. ESLint has no config for core test files, so it skipped the test file.

**Separate issue, not changed:** queued jobs and tasks are matched by exact string. Any that were created with a non-standard spelling, for example a repository name typed by a user, would still not be counted as active work. That comes from how jobs are written, not from this PR, so I left it alone.

PR: #3489
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds a shared readiness evaluator across REST, MCP and CLI, with explicit gate statuses and documented reason codes. The supplied diff supports merge readiness within scope, conditional on the remaining validation check completing successfully.

✅ Read-only CI classification — The new reader shares classification logic with auto-merge while avoiding writes and deletes to the head-observation key.

✅ MCP authorization boundary — The tool verifies caller access before evaluating with the App identity; tests cover grant denial and differences between caller and App visibility.

✅ Conservative failure handling — Unreadable CI, scores and active work produce unknown gates instead of being treated as passing.

Review was limited to static analysis of the supplied code; no commands were run. Current checks show 34 passed, none failed and one pending.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise default read dependencies

The no-write test injects the observation store, active-work reader and Ultrafix-state reader. It verifies evaluator orchestration well, but does not exercise those production defaults together. An integration test observing Redis commands through the default dependency path would strengthen the read-only guarantee. This is additional coverage, not a demonstrated defect or merge requirement.

Score

The implementation has coherent contracts, substantial targeted coverage and no verified merge blockers in the supplied diff. The remaining validation check is pending; production-default integration coverage could further strengthen confidence.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 37s
  • Tokens: 85,948 (85,263 in / 685 out)
  • Cost: $0.78

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 12, 2026
@integry
integry merged commit 7b335a5 into 3482-epic-integration-signals-100 Nov 12, 2026
50 checks passed
@integry
integry deleted the 3482/claude-opus-5-5-read-only-pull-request-re-20261112-1226-anv branch November 12, 2026 16:01
@propr-dev propr-dev Bot mentioned this pull request Nov 12, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 13, 2026
…It wasn't caused by this PR's scheduler code: the PR changes nothing under `apps/desktop` or `.github`. The fix is in the packaged-acceptance test harness.

I fixed the `Validate unsigned linux-x64 package` failure. It wasn't caused by this PR's scheduler code: the PR changes nothing under `apps/desktop` or `.github`. The fix is in the packaged-acceptance test harness.

**Cause.** The job failed with `Packaged acceptance observed unexpected renderer errors`, with 4 records in the `csp-reload-pairing` phase. This is a known harness race (a timing gap in the test's check, not a product bug). The `current-user` request was denied by CSP (Content Security Policy) and Chromium reported it properly. The `demo-mode` request was cut off by the policy reload before Chromium reported its denial, so all the harness had for it was a `document-replaced` record. The check that decides which errors are expected only accepted that kind of record for `current-user`. Because it rejected one record, it rejected all four.

PR #3489 already fixed this exact case on 2026-11-12, but that fix is not on `main`. #3489's merge commit `7b335a5ba` is not part of `main`'s current history, and `main`'s copy of the file is identical to this branch's, without the fix. So it was lost from `main`, and this branch never got it.

**Fix.** I applied #3489's change to this branch unchanged:
- `apps/desktop/scripts/packaged-acceptance-csp-reload.mjs`: the `document-replaced` record can now explain a `connect-src` denial for `demo-mode` as well as `current-user`. The check stays strict otherwise: a "Fetch API cannot load" error still needs Chromium's own denial report, and every other existing limit still applies.
- `apps/desktop/scripts/packaged-acceptance-csp-reload.test.mjs`: #3489's test for this exact failure, plus stricter negative checks.

**Verification.** All 52 tests in `packaged-acceptance-csp-reload.test.mjs` pass, including the real-Chromium test that CI's axe-boundary job runs (`PROPR_DESKTOP_REAL_CHROMIUM_BOUNDARY=1`). I couldn't run the full packaged acceptance here, because the container has no Xvfb, packaged Electron app or gnome-keyring. The next CI run is the real check.

Because the fix went missing from `main`, other PRs can hit this same linux-x64 failure until `main` gets it back. When this PR merges, it will restore the fix on `main`.

There are no visual previews, since nothing a user sees has changed.

PR: #3500
Comment by: @propr-dev[bot] (ID: 6853481432)
Model: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant