Repository navigation
[Epic] Integration signals - #3495
Conversation
…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.
…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
…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
…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
…pull-request-re-20261112-1226-anv [3482 by Claude Opus 5.5] Read-only pull request readiness verdict with coded reasons
…LL-DONE" line is the run completing, which I already covered above: 40 of 41 files passed. The one failure was `test/planIssueManager.ultrafix.test.ts`, which now passes (8/8) after I stubbed the journal module in it. Nothing else needs doing.
…ests fail on the previous branch code and pass now; the full set of 20 tests in the three journal suites passes. Typecheck (core and api) and lint with zero warnings pass on the changed files.
I fixed F1–F4 and each has a regression test. All six new tests fail on the previous branch code and pass now; the full set of 20 tests in the three journal suites passes. Typecheck (core and api) and lint with zero warnings pass on the changed files.
**F1 – Retention deleted unexpired events.** `pruneRepositoryEvents` now deletes only rows older than the 30-day cutoff. The floor (the cursor-expiration boundary) is still one past the highest deleted `seq` and never moves backwards. A cursor below it may have missed pruned events, and unexpired rows below it stay readable. New test: recent events, then an older-stamped late event at a higher `seq`, then another recent one. Only the late event is deleted.
**F2 – Repeated transitions within one second were lost.** Status events no longer use a timestamp-based dedupe key. Each event is identified by its own `seq`. A write that doesn't change the status (a redelivered webhook) is skipped by comparing the row's actual previous status. New test: five transitions with no timestamp manipulation, including `processing → under_review` twice, produce five events.
**F3 – Status events could describe the wrong row or prior status.** A new helper, `updatePlanIssuesWithStatusJournal` in `planIssueStatusJournal.ts`, does three things in one transaction: reads the affected rows and their prior statuses using the writer's own filters (including the linked-review guard), updates exactly those rows, and appends one event per row that actually changed. All three writers use it: `updatePlanIssue`, `updatePlanIssueStatus` and `updatePlanIssueByPR`.
- The production database opens transactions with `BEGIN IMMEDIATE`, so this holds across processes too.
- `stillApplies` still runs before the transaction, because it can do its own database work.
New tests cover a write landing between another writer's lookup and its update, a newest row held by its linked review while an older row is updated, and a PR update matching several rows.
**F4 – A force-push back to an earlier head was dropped.** `head_changed` is now keyed by the GitHub delivery ID: `pr:{n}:head_changed:delivery:{id}`. A redelivery carries the same ID, while a new push is a new delivery. The ID now reaches the journal from both entry points:
- **Direct webhook:** `server.ts` passes it to `processWebhookEvent`.
- **Routing relay:** `RoutingWebSocketIntakeService` passes it the same way.
Without a delivery ID the event is written without a key, because neither the commit nor the before/after pair identifies one occurrence. In production both paths always have an ID. New test: B → C → B → C → B is fully recorded, a redelivery adds nothing, and the last recorded head matches the PR.
**Other changes:**
- `docs/docs/architecture/repository-event-journal.md` is updated to the new retention, status-event and dedupe-key behaviour.
- The fake database in `test/planIssueManager.ultrafix.test.ts` now supports transactions; it passes 8/8.
- To keep `handlePlanIssueTracking` under the four-parameter lint limit, it now builds its own logger from the correlation ID.
**Wider check:** 42 test files that touch these paths, including the plan issue, webhook, routing intake and epic queue suites, pass except one. `packages/core/test/planPRClosedRecovery.test.ts` passes every test it runs but never exits and times out. It does the same on the base code, so this change didn't cause it.
**Separate discovery (not changed):** `linkPRToPlanIssue` sets a plan issue's status to `under_review` but writes no journal event. It was never one of the three journaled writers, so I left it.
There's no visual change, so I made no previews.
PR: #3496
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…one test was still checking the old wiring text.
I fixed the Shard 4/4 failure. The PR's code wasn't wrong; one test was still checking the old wiring text.
**What failed:** one subtest, `the daemon wires the same startLoop, unwrapped` in `test/ultrafixBootstrap.test.ts`. The other 248 test files in the shard passed. The test reads `src/daemon.ts` as text and looks for an inline `setUltrafixDeps({ ... startLoop, ... })` block. This branch changed the daemon to call `setUltrafixDeps(createUltrafixDeps())`, so it also installs the journal writer. The regex therefore matched nothing and the assertion failed on an empty string.
**Fix (test only):** the test now checks the new wiring while still covering what it was meant to protect:
- `src/daemon.ts` imports `createUltrafixDeps` from `./jobs/ultrafixBootstrap.js` and calls `setUltrafixDeps(createUltrafixDeps())`.
- `createUltrafixDeps().startLoop` is the same function as the real `startLoop` from `ultrafixOrchestrationService.js`. So the loop still receives every field unwrapped, including the instructions and the user who started it.
**Verification:**
- `test/ultrafixBootstrap.test.ts` passes 3/3 locally.
- `test/ultrafixDaemonResumeSweep.test.ts`, the other root test that reads `daemon.ts`, passes 3/3.
- The only other test that reads `daemon.ts` (`packages/core/test/fleetDataPlane.test.ts`) checks for symbols this PR doesn't touch, so I didn't run it.
- ESLint isn't set up to lint root test files, so there was no lint check to run on this file.
There's nothing to see on screen, so I didn't make a preview.
PR: #3496
Comment by: @propr-dev[bot] (ID: 6830820488)
Model: Claude Opus 5.5
…ckages/core/test/planPRClosedRecovery.test.ts`. The PR's code wasn't wrong: in CI all 11 of its tests passed, but the process never exited and was killed at the 180s limit. I fixed the Shard 2/4 failure. The only failed unit was `packages/core/test/planPRClosedRecovery.test.ts`. The PR's code wasn't wrong: in CI all 11 of its tests passed, but the process never exited and was killed at the 180s limit. **Cause:** this branch made `planIssueTracking.ts` call the new `journalPullRequestWebhook`. That module imports the real `db/connection.js`, and the open database handle kept the test process alive after the tests finished. I reproduced the hang locally: all 11 passed, then it hung until killed. **Fix:** in `packages/core/test/planPRClosedRecovery.test.ts`, I stubbed `../src/webhook/pullRequestJournalEvents.js` before the module under test is imported, with a comment explaining why. The stub doesn't hide anything this suite tests: it only sends `closed` and `reopened` events, and the journal ignores those (it only records `opened` and `synchronize`). The earlier `planIssueManager.ultrafix` failure was fixed the same way. **Check:** the suite now passes 11/11 and exits in about 0.3s. I didn't run the full shard again. ESLint skips this file under the core package's config, so there was nothing to lint. The Node.js 20 deprecation message in the failure evidence is only a warning from `actions/checkout` and didn't cause the failure. PR: #3496 Comment by: @propr-dev[bot] (ID: 6831399750) Model: Claude Opus 5.5
…s. After rebuilding `@propr/shared`, `tsc --noEmit` in `propr-ui` passes, ESLint passes with zero warnings on the three changed files, and the 49 related UI unit tests pass. I fixed the UI typecheck failure that broke Validate Changes. After rebuilding `@propr/shared`, `tsc --noEmit` in `propr-ui` passes, ESLint passes with zero warnings on the three changed files, and the 49 related UI unit tests pass. **Cause:** this branch added `'pull_request'` to the list of activity domains in `packages/shared/src/activityEvents.ts`. The UI checks incoming events against arrays typed with an older, shorter domain list from `@propr/shared`, which doesn't include `'pull_request'`. Those arrays had `'system'` added by hand to cover the gap, so they rejected the new value. **Fix:** in `useLiveResource.ts`, `useHeaderStats.ts` and `Dashboard/useSectionRefreshTokens.ts`, the arrays are now typed `readonly (ActivityDomain | ScopedActivityDomain)[]`. `ScopedActivityDomain` is imported from `@propr/shared/dist/activityEvents.js`, the same place these files already get the newer event type. Any domain added to that list later is accepted automatically, so this won't break again the same way. No component's behaviour changes; none of them subscribes to `pull_request` yet. The "Slow Test" note about `e2e/creation-short-window.pw.ts` taking 10.3 minutes was only a timing warning, not a cause of the failure, so I left it alone. This is a type-only change with nothing visible in the UI, so there are no previews. PR: #3496 Comment by: @github-actions[bot] (ID: 6832965638) Comment by: @propr-dev[bot] (ID: 6832965826) Model: Claude Opus 5.5
…ournal an event by comparing against the reason it reads inside its own transaction, not against the snapshot it took earlier. So going back to an earlier explanation (S → R) is now recorded. I fixed F5. A blocked-reason write now decides whether to journal an event by comparing against the reason it reads inside its own transaction, not against the snapshot it took earlier. So going back to an earlier explanation (S → R) is now recorded. **What changed** - **`setEpicQueueBlocked`** (`packages/core/src/services/taskPlanning/epicQueueJournal.ts`): inside the transaction it reads the row's current `blocked_reason` and `updated_at`, builds the `blocked` event from that row, and writes only if both values are still what it read. If another write landed in between, it re-reads and tries again, up to 5 times. The extra check matters for databases without SQLite's single-connection serialization; there is no row lock, so a write that keeps losing changes nothing after 5 tries. - **Same defect in the other writers:** - `markEpicQueueHeadBlocked` (`epicQueueBlockedHead.ts`) also built its event before the transaction. It now calls the same helper. It keeps the queue row's own cursor in the guard (the parallel-child event still names the child), and keeps its `:<issue>` dedupe suffix. - `markEpicQueueAwaitingHumanMerge` and the three `setEpicQueueBlocked` callers in `epicExecutionQueue.ts` (merge wait, missing issue, start failure) all go through the helper, so they're fixed too. - **One small side effect:** agent-blocker events now get `occurredAt` set to the row's update time. Before, it was left to the default. **Regression tests** (`packages/core/test/epicExecutionQueueJournal.test.ts`) - Three tests let another writer commit between the first writer's lookup and its transaction: - human-merge → agent blocker → human-merge - agent blocker → human-merge → agent blocker - merge wait (from `advanceEpicQueue`) → human-merge → merge wait Each expects 3 `blocked` events and the final persisted reason. All three fail on the previous code. - One test changes the reason between the in-transaction read and the update. It checks that the retry compares against the new reason. It fails if the read-state check is removed. **Verification** - The journal suite passes 9/9. - `epicQueueBlockedHead`, `epicExecutionQueue`, `autoMergeGate` and `autoMergeGateJournal` pass 69/69. - Core `tsc --noEmit` passes, and ESLint passes with zero warnings on the changed source files. Core's lint config doesn't cover `test/`. - I type-checked the test file separately: the only errors are missing type declarations for the migration imports, and the file already has those on HEAD. There's nothing visual in this change, so no previews. PR: #3496 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
…ls on the previous branch code and passes now. I fixed both F6 and F7. Each has a regression test that fails on the previous branch code and passes now. **F6: repeated blocked transitions disappeared.** The blocked event's dedupe key was built from cursor, `updated_at` and a hash of the reason. If the queue went A→B→A→B within one clock tick, the second A→B produced the same key, and the unique index silently dropped that event. - **Fix:** blocked events no longer have a dedupe key. In `setEpicQueueBlocked`, only the writer whose update actually changes the row appends the event, and only when the reason it read differs from the one it writes. That already makes each event unique, so the key wasn't needed. - **Cleanup:** I removed the now-pointless `dedupeSuffix` option and its one caller in `epicQueueBlockedHead.ts`. `epicQueueEvent` now accepts a null key. - **Callers covered:** all four go through `setEpicQueueBlocked`, so they're all fixed: human-merge, agent blocker, merge-wait, and the missing-issue/start-failure explanations. - **Test:** in `epicExecutionQueueJournal.test.ts`, with the clock frozen, it writes human-merge, agent blocker, human-merge, agent blocker, and then the agent blocker once more. It asserts four events, so the repeated write still adds nothing. **F7: an event in a nested transaction was announced before it was durably committed.** In `publishAfterCommit`, the activity hint is now sent only after the append's own transaction and every enclosing one up to the outermost have committed. If any of them rolls back, including the append's own savepoint, nothing is published. Knex's own `parentTransaction` link on each transaction is enough to find the enclosing ones. - **Test:** in `repositoryEventJournal.test.ts`, it covers two cases: - An inner transaction finishes with nothing published, then the outer one rolls back and still nothing is published, with no row left behind. - Inside one committed outer transaction, an inner block that rolls back isn't announced, while a sibling inner block that succeeds is. **Checks run:** - The two journal suites (20 tests) and all epic-queue suites (82 tests in total) pass. - The review-score, PR webhook and auto-merge journal suites pass. The plan-issue-status journal suite passes with `PROPR_DEMO_MODE=true`; without it, it fails on the GitHub-auth banner, which is a container issue. - `tsc --noEmit` for core passes, and ESLint with zero warnings passes on the changed source files. The ESLint config ignores the two test files, so they weren't linted. **Found separately, not changed:** `appendPullRequestOutcomeEvent` in `reviewScoreStore.ts` keys each close as `pr:N:closed:<closedAt>`. If a PR is closed, reopened and closed again within GitHub's one-second timestamp resolution, the second close would be dropped. This is a different case from F6: the key there identifies an outside webhook event so that GitHub's redeliveries are ignored, rather than standing in for a state change the code itself guards. I left it alone because it's outside F6/F7. No previews, since nothing here is visible in the UI. PR: #3496 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
…ange-event-jour-20261112-1601-vhp [3483 by Claude Opus 5.5] Durable change-event journal for pull requests and epic queues
…itory's change events over MCP, REST and the CLI, using the same cursor and error rules everywhere. The new tests pass, along with the OpenAPI, `mcpObservableSurface`, `mcpDocs`, `mcpToolInputBudget`, goal-wait, readiness, socket and core journal suites. The full `npm run test:mcp` run had 460 of 467 passing. All 7 failures are in `relevanceServiceCommit` and fail with `EROFS` because `/tmp/git-processor` is read-only in this container; that suite has nothing to do with this change.
What was added
- MCP: `list_repository_events` and `wait_repository_events` (read scope, in a new `toolsRepositoryEvents.ts`). Repository access is checked the same way as for `list_pull_requests`. The wait receives the request's abort signal, so cancelling the call releases it, and the grant is re-checked before each further read.
- REST: `GET /api/repository-events` and `GET /api/repository-events/wait`, registered with documented schemas and the standard error format. `npm run gen:openapi` output is regenerated and the up-to-date check passes.
- CLI: `propr events list` and `propr events wait` with filter options, `--json` and `--follow`. In follow mode, `--json` prints one JSON line per event, and Ctrl-C prints the cursor to resume from.
- Docs: `docs/mcp.md` has a new section with the cursor contract, at-least-once delivery, an error table and a coordinator loop that waits for events, then calls `get_pull_request_readiness` (which is in the catalog). `docs/mcp-coverage.md`, the API reference and the CLI page are updated, and the new tokens are in the `mcpObservableSurface` allow-list.
How it behaves
- The cursor is `rec1.` + base64url of `{r, s}`, as specified. A call without a cursor returns the current cursor and no history unless `fromStart` is set.
- Cursor errors:
- `CURSOR_INVALID` (400): malformed, or a position this instance never issued.
- `CURSOR_WRONG_REPOSITORY` (400).
- `CURSOR_EXPIRED` (410): below the repository's retention floor. It is never returned as an empty result.
- A wait returns at once if matching events already exist, ignores non-matching ones, and on timeout returns the cursor it started from, unchanged.
- Each owner can have at most 16 waits open per API process, counted across REST and MCP (the same limit as goal waits).
- Waking waiters:
- An append in the same process wakes them at once. This needed a small new hook in core, `subscribeRepositoryEventAppends`.
- An append in another process wakes them through the socket relay, which wakes any message naming a repository.
- The 2.5 s poll interval catches anything else.
Decisions to check in review
- Cursor after non-matching events: the returned cursor is the last event actually returned, or the starting point if none were returned. It never skips ahead past non-matching events. That gives the literal "times out with the unchanged cursor" and keeps resuming safe if you change filters. The cost is that a filtered read can re-scan the same non-matching events each time.
- REST access check: REST has no `list_pull_requests` route to copy, so it uses the existing GitHub access check. The repository must be configured and enabled, and the caller must be able to read it on GitHub. Otherwise the answer is the usual `REPOSITORY_NOT_ACCESSIBLE` (404). MCP returns `REPOSITORY_FORBIDDEN` (403) from its normal grant check.
- Repository spelling: queries use the configured spelling of the repository, matched case-insensitively. Events written under a different capitalisation than the configuration would not be found.
- Defaults: `limit` defaults to 50 (max 100). `types` must be a known event type, with at most 20 per request.
- Two things I moved or exported: the new OpenAPI schemas are in their own file, `openapi/schemasRepositoryEvents.ts`, because `schemas.ts` is close to the 400-line lint limit. To support that, `schemas.ts` now exports its `component` and `querySet` helpers.
There's nothing visual to preview.
… new test fails on the previous code and passes now: 16/16 in `repositoryEventWait.test.ts` and 5/5 in `eventCommands.test.ts`. I've fixed F1–F4. Each fix has a regression test, and every new test fails on the previous code and passes now: 16/16 in `repositoryEventWait.test.ts` and 5/5 in `eventCommands.test.ts`. **F1 – fresh reads issued expired cursors** (`packages/api/services/repositoryEventWait.ts`) - The current position is now the newest `seq` or `floor − 1` (the retention watermark), whichever is higher. A repository whose events were all pruned no longer issues cursor 0. - If a page isn't truncated, its cursor is never below `floor − 1`. This covers empty `fromStart` reads, `fromStart` reads that only return old events still kept below the floor, and cursorless wait timeouts. - A wait that started with a cursor still times out returning that same cursor; for any valid cursor the new rule changes nothing. **F2 – retention could silently remove unread events** - Each read now runs in one transaction. The cursor check, the retention-floor lookup, the bound and the page all come from the same database snapshot. - Every wait iteration does this again. Before it sleeps, the wait sets its starting position to the cursor it would return. A `fromStart` wait still reads from 0 on its first pass, as intended. Pruning past that position during the wait now gives `CURSOR_EXPIRED`. - The regression test runs retention exactly between the floor lookup and the page read. Before the fix the page silently skipped the deleted event; now it doesn't. **F3 – repository casing hid valid events** - The bound, the page reads, the retention-floor lookup and the "never issued" check now all match the repository name case-insensitively (`COLLATE NOCASE`). - The floor is the highest one recorded under any spelling, because retention keeps a separate floor for each stored spelling. - Returned events now show the configured spelling of the repository rather than the stored one. - I added a migration, `20261113000000_add_repository_events_nocase_index.js`, with a case-insensitive `(repository, seq)` index. Without it, the existing index can't be used for these lookups and every wait poll would scan the whole table. I checked with `EXPLAIN QUERY PLAN` that both queries now use the index. - I also corrected the MCP comment that claimed the journal stores the configured spelling. **F4 – cursorless list retries could skip changes** (`packages/cli/src/api/repositoryEvents.ts`) - `listRepositoryEvents` now sends a list with neither a cursor nor `--from-start` exactly once, so a failure is reported instead of a retry quietly moving the starting point. Lists with a cursor or `--from-start` still retry (3 attempts); the test checks both cases. - In follow mode, both page continuations and wait iterations always pass a cursor, so they keep their retries. **Other checks:** ESLint with zero warnings passes on the changed `packages/api` files; the CLI files aren't covered by any ESLint config. `tsc --noEmit` passes for `packages/api` and `packages/cli`. `mcpRepositoryEvents`, the core journal, OpenAPI route coverage and the migration-gate tests pass. No docs mention the old casing or cursor behaviour, so none needed changes. **Separate findings, not changed:** - **Pre-existing test failure:** `mcpObservableSurface.test.ts` fails here with `Cannot read properties of undefined (reading 'stage')`. It fails the same way with my changes reverted, so it predates this work. The original PR summary reported it passing, so it may depend on a stale build of `@propr/core`. - **Remaining expired-cursor case:** a truncated `fromStart` page can still issue an expired cursor. It needs events still kept below the floor that are more than `limit` in number. The cursor format can't tell "nothing after this was pruned" from "events after this were pruned" in that range, so I didn't widen F1 to cover it. - **Conservative retry setting:** the CLI wait helper also disables retries for cursorless `fromStart` waits, which could safely be retried. I left it as is. There's nothing visual to preview. PR: #3508 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
… on the previous code and passes now. I've fixed F5 and F6. Each has a regression test that fails on the previous code and passes now. **F5: paging through retained history below the floor** - A cursor inside retained history below the retention floor now also records a short "retention generation". That generation is a digest of the repository's `repository_event_floors` rows (floor and `pruned_at`) under every spelling of its name, read in the same transaction as the page (`packages/api/services/repositoryEventWait.ts`). Such a cursor stays valid below the floor while the generation is unchanged. - **Expiry detection still works:** - A plain cursor below `floor - 1`, or one with a forged generation, still gets `CURSOR_EXPIRED`. - Any later prune of the repository rewrites `pruned_at`, even one that only deletes events below the floor without moving it. So the history cursor then expires instead of silently skipping an event that aged out. - This errs on the safe side: a prune that only deleted events before the cursor also expires it, and the client starts the `fromStart` read again. - **Same problem fixed in related paths:** - The per-event cursors in a page had the same problem; they now carry the generation too, so resuming from the last event processed works. - A wait's internal position keeps the generation between re-reads. - The REST routes and the CLI `list --from-start --follow` loop treat the cursor as opaque, so they work without changes. - The shared cursor codec (`packages/shared/src/repositoryEventWait.ts`) accepts an optional, length- and character-checked `g` field. - **New tests** (`repositoryEventWait.test.ts`): - three retained events below the floor, paged with `limit: 1` - a per-event cursor resumes, while a cursor with no generation or a forged one expires - a prune that leaves the floor where it is still expires a history cursor, and starting over works - a truncated `fromStart` wait resumes **F6: recovery order** - The `CURSOR_EXPIRED` hint (sent as REST `hint` and in MCP error details), the MCP `CURSOR_CONTRACT` in both tool descriptions, `docs/mcp.md` and the API reference now give the same order: list without `afterCursor` and save that cursor, then re-read the state, then resume from the saved cursor. - `CURSOR_INVALID` had the same ambiguous "omit, then read" wording, so its hint and docs row now point to the same steps. - The new assertion in `mcpRepositoryEvents.test.ts` checks this order in the REST hint and both tool descriptions. - The docs now also explain paging retained history with `truncated` and when a history cursor expires (`docs/mcp.md`, `api-reference.md`, `repository-event-journal.md`). **Verification:** these all pass: - `repositoryEventWait` 19/19 - `mcpRepositoryEvents` - `mcpDocs` - `mcpObservableSurface` - `mcpToolInputBudget` - CLI `eventCommands` 5/5 - the `packages/api` typecheck and ESLint with zero warnings - `gen:openapi:check` **Something I noticed but didn't change:** when a wait that started from a history cursor times out, the cursor it returns has been moved up to `floor - 1`, so it isn't strictly "unchanged". Nothing is skipped by this, because a page that isn't truncated has already covered everything up to there. It isn't part of F5 or F6. There's nothing visual to preview. PR: #3508 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
…fails on the previous code and passes now.
I fixed F7, F8 and F9. Each one has a regression test that fails on the previous code and passes now.
**F7 – filtered reads skipped retained events** (`packages/api/services/repositoryEventWait.ts`)
- The returned cursor used to jump to the retention floor whenever a page wasn't truncated. But "truncated" only counts events that match the filter, so a read filtered to `opened` could skip a retained `merged` event.
- Now, in the same database snapshot as the read, the cursor moves up to the floor only when no retained event of the repository (matching the filter or not) lies between the last returned position and the floor. Otherwise it stays at the last returned event, or at the starting position if nothing matched. A cursor left below the floor carries the retention generation.
- List and wait both use this one position, including the position a wait keeps between its reads.
- New test: your scenario (opened at 1, merged at 2, pruned event at 3). It covers a complete filtered page, an empty filtered page, the same reads as waits, and resuming with a different filter. On the old code the cursor came back as 3 instead of 1.
**F8 – Ctrl-C didn't stop the CLI while it read history** (`packages/cli/src/commands/eventCommands.ts`, `packages/cli/src/api/repositoryEvents.ts`)
- `listRepositoryEvents` now takes `{ client, signal }` and passes the abort signal to the request.
- The paging loop stops as soon as Ctrl-C is pressed.
- One `interrupted()` helper now handles every interrupted exit: a cancelled request, `--follow` ending, or a response that arrives just as Ctrl-C is pressed. Each prints `Resume with --after-cursor <last processed cursor>` and exits with 130.
- The command body is exported as `runEventsCommand` so tests can pass in a client and configuration.
- New tests cover Ctrl-C:
- during the second history page: no further requests are sent, and the cursor of the page already printed is shown.
- during a single `list`.
- during a followed `wait`.
- With the old behaviour, the first case hangs on the request that never gets cancelled.
**F9 – a disconnect during the access check left a wait running** (`packages/api/routes/repositoryEventRoutes.ts`)
- The route now attaches its `close` listener before it awaits authorization.
- After authorization, it checks whether the connection is already gone and, if so, returns without starting a wait.
- The listener is removed in `finally`, so every exit path cleans it up.
- New file `packages/api/test/repositoryEventRoutes.test.ts`, added to `test:mcp` in `package.json`. It checks that:
- a disconnect while the access check is pending starts no wait and leaves the owner's only wait slot free for the next request.
- a connection already closed starts no wait.
- a disconnect during the wait releases it.
- the listener is removed after a denied request and after an unexpected error.
- The first two fail on the old route.
**Checks:** typecheck passes for `packages/api` and `packages/cli`, and ESLint with zero warnings passes on the changed API files (`packages/cli` has no ESLint setup). These suites all pass: `repositoryEventWait` (20 tests), `repositoryEventRoutes` (3), `mcpRepositoryEvents`, the OpenAPI tests and `eventCommands` (8).
**Found separately, not changed:** in the service's wait loop, if the wait is cancelled while the grant re-check (`authorize`) is running, it still makes one more journal read before it notices. If events exist, it returns them to a caller that has already gone. That costs one wasted read and loses nothing.
PR: #3508
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…rsor` now gets a cursor error on both REST endpoints. Before, it was quietly treated as "no cursor" and returned the newest cursor, which would skip unread events.
I fixed F10: an explicitly empty or wrongly shaped `afterCursor` now gets a cursor error on both REST endpoints. Before, it was quietly treated as "no cursor" and returned the newest cursor, which would skip unread events.
**The fix** (`packages/api/routes/repositoryEventRoutes.ts`)
- `afterCursor` no longer goes through `single()`, which turns empty values into "absent". A new `cursor()` helper only treats the cursor as absent when the key is actually missing from the query.
- If the key is present but holds an empty string (`?afterCursor=` or a bare `?afterCursor`) or something that isn't a string (`?afterCursor[x]=y`), the request gets `400 CURSOR_INVALID` with the usual hint and no cursor. This uses the same error and recovery text as the journal's own cursor decoder.
- The check runs while the query is parsed, before any read or wait starts. So the wait endpoint never opens a waiter, and the response handler's close listener is still removed on this path.
- Two existing behaviours are unchanged: a repeated cursor still gets "may be given once", and one over 512 characters still gets "too long" (both `INVALID_INPUT`).
**Regression test** (`packages/api/test/repositoryEventRoutes.test.ts`)
- The test adds an unread event, then sends `''`, `['']`, `{x:'y'}` and `[{x:'y'}]` as `afterCursor` to both endpoints.
- For each, it checks for a 400 `CURSOR_INVALID` with a hint, no replacement cursor, the journal never being read, and no close listener left behind. It then repeats the empty-cursor case against the real journal service.
- Finally, it checks that leaving `afterCursor` out entirely still starts at the current end.
- The test fails on the previous route code and passes now.
**Checks:** `repositoryEventRoutes`, `repositoryEventWait` and `mcpRepositoryEvents` pass 25/25. ESLint with `--max-warnings 0` is clean on both changed files, and the `packages/api` typecheck shows no errors in these files. That typecheck doesn't cover test files, so the new test is only checked by running it.
**Other paths I checked, which needed no change:**
- **MCP:** it already rejects an empty cursor (`z.string().min(1)`).
- **CLI:** it sends `--after-cursor ""` to the server as `afterCursor=` instead of dropping it, so the fix covers it.
- **Other REST parameters:** `single()` still treats empty `planId`, `limit` and similar values as absent. That doesn't lose events, so I left it alone.
This change has nothing visual, so there's no preview.
PR: #3508
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…ass locally. Nothing in this PR's code caused the failure. I fixed the failing check, and the two audits it runs now pass locally. Nothing in this PR's code caused the failure. **Cause:** The failing step was "Audit committed dependency resolution", which runs `npm run audit:runtime` and then `npm run desktop:audit:packaging`. It failed with `Blocking vulnerabilities: @hono/node-server` because two moderate advisories were published recently: GHSA-qv5m-9pm6-hqp3 and GHSA-jpvv-r467-5p4w. Both cover versions 2.0.0 to 2.1.5. The lockfile pinned 2.1.5, which is the same version `main` has, so `main` will fail this check too. **Fix:** I changed only `package-lock.json`, moving `@hono/node-server` from 2.1.5 to 2.1.8. That version is already allowed by the ranges that `@modelcontextprotocol/node` and `@modelcontextprotocol/sdk` declare, so no `package.json` changed and no other package moved. I didn't add any audit exceptions. **Checks:** - `npm run audit:runtime` and `npm run desktop:audit:packaging` both pass. - Running `npm install --package-lock-only` with npm 10, the version CI uses, leaves the new lockfile exactly as it is. - Regenerating the third-party license notices changed nothing except the generated date, so I left `THIRD_PARTY_LICENSES.md` as it was. Other PRs will keep failing this check until `main` gets the same lockfile bump. There's nothing visual to preview. PR: #3508 Comment by: @propr-dev[bot] (ID: 6838882742) Model: Claude Opus 5.5
…ait-on-reposito-20261112-2048-wgw [3484 by Claude Opus 5.5] Read and wait on repository change events over REST, MCP and CLI
…h submission task pointers, the OpenAPI spec and client types pin the lineage fields, and there's one "Idempotency and retries" section in the MCP guide and in the API reference. Lint, typecheck and `npm run gen:openapi:check` are clean. All the suites I touched or that read the changed queries pass, including `mcpObservableSurface`, `mcpDocs`, `mcpToolInputBudget` and the OpenAPI coverage/conformance tests. I did not run the whole API suite. MCP task reads - `get_task` now returns a `lineage` object with the fields the issue asked for. `attempts` appears only when the lineage has more than one attempt, so a single-attempt task gets `attemptNumber: 1` and no `attempts`. - `list_tasks` rows of a replacement lineage gain `attemptNumber`, `replacesTaskId` and `replacedByTaskId`; first-and-only attempts are unchanged. - Naming: these three row fields are camelCase as the issue specified, while the rest of the row is snake_case. - Side effect: `get_work_overview` uses the same task listing, so its rows gain the three fields too. - The shared code is in `packages/api/routes/taskAttemptLineage.ts`, as the issue asked. Submission reads - `get_task_submission`, `list_task_submissions` and REST `GET /api/task-submissions/:key` (plus submit and retry) now return `firstTaskId` and `latestTaskId`. - `taskId` is unchanged, but it means different things on each side, and the docs now say so. Over MCP it has always been the latest attempt. Over REST it is the first execution. - I made one change beyond the issue: a `get_operation` receipt that has already resolved now shows the current `latestTaskId` on every read. This value is not written back to the stored receipt, because rewriting a finished receipt would change its recorded finish time. OpenAPI - `taskInfo` now has an explicit schema with the lineage fields and `attemptLineage`. I made it closed rather than tolerant of extra fields: every field the three response paths send is listed, so any new field fails conformance until it's added. Lineage fields are optional because live tasks from Redis or the queue have no stored row yet. - `schemas.ts` went over the 400-line lint limit, so the task-history schemas moved to a new file, `openapi/schemasTaskHistory.ts`. - `POST /api/goals` is now documented (it was undocumented before), with the required `Idempotency-Key` header and its 200 replay, 409 conflict and 503 responses. Its operation id is now `createGoal`. - I regenerated the spec and the client types. Docs - The new section is in `docs/mcp.md` and `docs/docs/operations/api-reference.md`, with a cross-link added in `docs/mcp-coverage.md`. - It covers everything item 4 of the issue lists. I checked each tool, code, skip reason and response status against the code. Tests - New `mcpTaskLineage.test.ts`: - lineage is consistent from both the replaced task and its replacement. - single-attempt tasks have no `attempts`. - list rows carry the three fields only for lineage tasks. - a full 100-row page of large lineage rows stays under the 256 KiB result limit. - `mcpTaskSubmissions.test.ts` covers a submission whose task was replaced, including a third attempt after the receipt resolved. I confirmed that check fails without the receipt fix. - The conformance test now covers lineage and a replaced REST submission. - I updated four existing tests for the new fields: - `mcpIntegration` builds its own tables, so it now applies the lineage migration. - a REST deep-equal in `taskSubmissionIntakeRoutes`. - the typed submission fixture in the client tests. - the doc-token allow-list in `mcpObservableSurface`. The CLI needed no change, and since nothing here is visible in the UI there are no previews.
…t wasn't this PR's code. The step that failed was "Audit committed dependency resolution", which flagged `hono` as a blocking vulnerability. The root `package.json` pins `hono` to 4.13.12 in its `overrides`. Three advisories have since been published that cover that version (GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq and GHSA-3gg2-335m-rxc6); 4.13.16 is the first fixed version. `main` has the same 4.13.12 pin, so other open PRs will hit this until the fix lands on `main`. I fixed both failing checks. They had the same cause, and it wasn't this PR's code. The step that failed was "Audit committed dependency resolution", which flagged `hono` as a blocking vulnerability. The root `package.json` pins `hono` to 4.13.12 in its `overrides`. Three advisories have since been published that cover that version (GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq and GHSA-3gg2-335m-rxc6); 4.13.16 is the first fixed version. `main` has the same 4.13.12 pin, so other open PRs will hit this until the fix lands on `main`. **Change:** I moved the override from 4.13.12 to 4.13.18, the latest 4.13.x patch, in `package.json`, and updated the matching `node_modules/hono` entry in `package-lock.json`. Nothing else in the lock changed. **Checks:** - `npm run audit:runtime` and `npm run desktop:audit:packaging` both pass locally. These are the two commands the failing step runs. - I re-resolved the lock with CI's npm 10 and it came out byte-identical, so `npm ci` in CI will use the same lock. I didn't install 4.13.18 into the local `node_modules` or run any test suites against it. It's a patch release within the same minor line. The darwin job's "longer queue times" message is only GitHub's macOS capacity notice; it didn't cause the failure. Nothing here is visible in the UI, so there are no previews. PR: #3517 Comment by: @propr-dev[bot] (ID: 6840510365) Comment by: @propr-dev[bot] (ID: 6840510709) Model: Claude Opus 5.5
…ry-lineage-in-m-20261113-0031-wu6 [3485 by Claude Opus 5.5] Expose retry lineage in MCP and OpenAPI and document idempotency contracts
✅ Epic ready for final merge: Integration signalsAll 4 child PRs have been merged into this epic branch. This epic PR is ready for final review and merge. Posted automatically by ProPR |
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds readiness verdicts, a durable repository journal, REST/MCP/CLI event consumption, and retry lineage. It needs changes before merge because the REST readiness endpoint lacks repository authorization and cursors do not enforce their documented instance binding. ✅ Snapshot-consistent event reads — Retention validation, journal bounds, and page selection share a transaction, preventing pruning from silently creating gaps during a read. ✅ Explicit read-only classification — Readiness separates CI observation reads from writes and reports unavailable active-work data as unknown. The supplied checks report 30 passed, none failed or pending. This review is static; no commands were run. The linked issue descriptions are abbreviated, so unseen acceptance criteria were not assessed. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Authorize REST readiness repository access
F2: 🔴 Bind cursors to the issuing journal
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Update the journal documentation introduction
ScoreThe implementation includes substantial targeted coverage and careful retention handling, with all reported current checks passing. The authorization gap and silent acceptance of foreign cursors require correction before merge. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryI resolved all six conflicted files and no conflict markers are left anywhere in the repo. In every case the PR branch and What each side added
Per-file resolution
Checks
I didn't run the full test suite. 🤖 Resolution Details
System-triggered merge conflict resolution |
…-100 Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - docs/docs/features/propr-cli.md - docs/static/openapi/propr-api.yaml - packages/api/openapi/routeDocs.ts - packages/api/routes/index.ts - packages/api/server.ts - packages/cli/src/api/index.ts PR: #3495 Model: Claude Opus 5.5
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds readiness verdicts, a durable repository event journal, REST/MCP/CLI event consumption, and retry-lineage visibility. The implementation is substantial and well tested, but needs changes before merge. ✅ Consistent readiness classification — Pure gate classifiers provide explicit reasons, and unreadable active work becomes unknown rather than idle. ✅ Snapshot-safe event reads — Retention validation and event pagination share a database transaction, preventing pruning between validation and retrieval. ✅ Cancellation coverage — Tests cover disconnected clients, released wait slots, and MCP grant revocation. The supplied current-head status has no failures and two pending checks. The issue specifications contain truncated passages, so requirements hidden in those passages could not be assessed. This review uses static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F3: 🔴 Authorize REST readiness repository access
F4: 🔴 Bind cursors to their issuing journal
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Update journal documentation availability
ScoreThe snapshot handling and targeted tests are strong, but repository authorization and cursor identity need correction before merge. Current checks show no failures, with two still pending. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/fix all |
|
✅ Applied the requested follow-up changes in commit e35bb22
Summary of ChangesI've fixed F1–F4 and updated the journal docs (S1, S2). The new tests pass. One suite passed its only test but then hung at exit and was killed by my timeout (details below). F1/F3 — readiness now checks the caller's repository access
F2/F4 — cursors now name the journal that issued them
S1/S2 — docs
Test results
I found no other problems outside the selected records. There's nothing visual in this change, so there are no previews. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
… new tests pass. One suite passed its only test but then hung at exit and was killed by my timeout (details below). I've fixed F1–F4 and updated the journal docs (S1, S2). The new tests pass. One suite passed its only test but then hung at exit and was killed by my timeout (details below). **F1/F3 — readiness now checks the caller's repository access** - `GET /api/pull-requests/:number/readiness` now checks the caller's own GitHub read access before it runs the App-backed evaluator. It uses the same check as the repository-event routes (`resolveGitHubMetadataToken` + `verifyGitHubRepositoryAccess`). - When GitHub answers 403 or 404, the caller gets a `REPOSITORY_NOT_ACCESSIBLE` (404) error. When GitHub fails with a 5xx, the caller gets `GITHUB_UNAVAILABLE` (502). Missing GitHub credentials give the existing `GITHUB_AUTHORIZATION_REQUIRED` error. - New tests in `packages/api/test/pullRequestReadinessRoutes.test.ts` cover denied callers (403 and 404), an outage during the access check, and a member with no GitHub token. Each one confirms the evaluator never runs and the App makes no GitHub calls. Access is granted only when the check passes. - I checked the other places that read through the App. The MCP readiness tool and the event routes already check access, and `propr pr readiness` goes through this REST route. - I also added the new 404 to the route's OpenAPI docs and regenerated `docs/static/openapi/propr-api.yaml`. **F2/F4 — cursors now name the journal that issued them** - A new migration, `20261113000200_create_repository_event_journal_identity.js`, creates one random journal ID per database, once. - Every cursor now carries that ID. The decoder rejects a cursor from any other journal with `CURSOR_INVALID` before the sequence number is looked at. The encode/decode functions in `packages/shared` now take the journal ID. REST and MCP both use the one service, so both are covered. - **Cursors issued before this change are no longer accepted.** They have no journal ID, so clients get `CURSOR_INVALID` and must start over as its recovery hint says. - New test: two databases with overlapping sequence ranges. A cursor from one is rejected by the other, in both list and wait, even when the position is inside the local range. A cursor with no journal ID is rejected too, and a local cursor at the same position still resumes normally. The MCP/REST suite also checks that a foreign cursor is rejected by REST list and wait and by MCP wait. **S1/S2 — docs** - In `repository-event-journal.md`, the "comes in a follow-up" sentence now links to the API reference section (REST and MCP) and to the CLI reference. - I also added a paragraph on the journal ID, and updated the error lists for readiness and `CURSOR_INVALID` in `api-reference.md`. **Test results** - `repositoryEventWait.test.ts`: 21/21 passed. - `pullRequestReadinessRoutes.test.ts`: 4/4 passed. - `mcpRepositoryEvents.test.ts`: its one test passed, then the process wouldn't exit and was killed by my timeout. That fits the known packages/api exit hang, but I didn't confirm it happens on the unchanged code. - Also passing: core `repositoryEventJournal.test.ts` (10/10), the OpenAPI coverage and conformance tests (25/25), `gen:openapi:check`, lint with zero warnings, and typechecks for api (including the changed tests) and shared. - I didn't build the docs site, so the new anchor links haven't been checked by a docs build. I found no other problems outside the selected records. There's nothing visual in this change, so there are no previews. PR: #3495 Comment by: @integry (ID: 6854320021) Model: Claude Opus 5.5
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds read-only readiness verdicts, a durable repository event journal with REST/MCP/CLI consumers, and retry-lineage visibility. The supplied diff appears merge-ready within the visible scope, conditional on pending checks completing successfully. ✅ Read-only evaluation — Readiness uses a separate CI reader that does not write head observations, and reports unavailable active-work reads as unknown. ✅ Resumable journal reads — Snapshot transactions, journal-bound cursors, retention generations, and explicit expiration errors protect pagination across retention and instance boundaries. ✅ Focused regression coverage — Added tests cover authorization, cancellation cleanup, nested transaction publication, repeated status transitions, and replacement lineage. Review was static; no commands or tests were run. The linked issue specifications contain truncation notices, so requirements hidden by those notices could not be assessed. The supplied current-head status reports zero failures and 15 pending checks; historical failures were not treated as current. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Normalize journal deduplication identityReaders match repository names case-insensitively, but the unique ScoreThe visible implementation has substantial correctness coverage and no verified merge blocker. Pending checks still need to complete, and the truncated issue specifications limit requirements verification. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
CI failed: Full Test Suite Shard 2/4 Please investigate and fix this CI failure.
Failure evidence
|
Full Test Suite ResultsValidation failed during: Test shard (shard 2).
View shard 2/4 outputDetails truncated; see the uploaded artifacts for complete failure rows and logs. |
|
CI failed: Run Full Test Suite Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 5fef8af Summary of ChangesI've fixed the Shard 2/4 failure; it was a mismatch between a test from main and this branch's migrations, not a code bug. Only one of the shard's 259 test runs failed: Cause: Main added the migration Fix: In Checks:
The other three shards' results weren't part of this request, so I didn't look at them. No preview, since nothing visible changed. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
… a test from main and this branch's migrations, not a code bug. Only one of the shard's 259 test runs failed: `test/llmExecutionUuidMigration.test.ts`, at "the migration rolls back" (`true !== false`). I've fixed the Shard 2/4 failure; it was a mismatch between a test from main and this branch's migrations, not a code bug. Only one of the shard's 259 test runs failed: `test/llmExecutionUuidMigration.test.ts`, at "the migration rolls back" (`true !== false`). **Cause:** Main added the migration `20261113000100_add_llm_execution_uuid.js` and this test. The test calls `db.migrate.down()` with no name, which rolls back only the newest migration, and assumes that is the `execution_uuid` one. On this branch it isn't: `20261113000200_create_repository_event_journal_identity.js` sorts after it. So the rollback removed the journal migration, the `execution_uuid` column stayed, and the check failed. **Fix:** In `test/llmExecutionUuidMigration.test.ts:37`, the rollback now names the migration (`name: '20261113000100_add_llm_execution_uuid.js'`), the same way `test/agentAutonomy.test.ts` does. No migrations were renamed or reordered. **Checks:** - The fixed test passes locally, 3 of 3. - The unchanged version from HEAD fails locally the same way it did in CI. The other three shards' results weren't part of this request, so I didn't look at them. No preview, since nothing visible changed. PR: #3495 Comment by: @propr-dev[bot] (ID: 6855479148) Model: Claude Opus 5.5
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot], @github-actions[bot] Analysis SummaryI made no changes for this request: the branch already contains the fix. The failure was reported for commit What went wrong: The fix in HEAD: Checked now:
The Full Test Suite needs to run on No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 24e2115 Processed 2 comments:
Summary of ChangesI fixed the Validate Changes failure. API Lint was the only stage that failed: Fix: The two dependency fields for this branch's routes ( Checks run locally:
The file is now exactly at the 400-line limit, so any route added to it later, from this branch or from main, will trip the lint again. This change can't be seen in the UI, so there are no visual previews. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
… stage that failed: `packages/api/routeRegistry.ts` was at 402 code lines, two over the 400-line `max-lines` limit. Running ESLint on the branch gives the same warning, so this was not a merge-ref difference with main. I fixed the Validate Changes failure. API Lint was the only stage that failed: `packages/api/routeRegistry.ts` was at 402 code lines, two over the 400-line `max-lines` limit. Running ESLint on the branch gives the same warning, so this was not a merge-ref difference with main. **Fix:** The two dependency fields for this branch's routes (`pullRequestReadinessRoutes`, `repositoryEventRoutes`) were declared in two places. They were in `OperationalRouteDeps` in `routeRegistry.ts`, and again in `IntegrationSignalRouteDeps` in `integrationSignalRouteRegistry.ts`. I exported `IntegrationSignalRouteDeps`, made `OperationalRouteDeps` extend it, and removed the two duplicate fields from `routeRegistry.ts`. Routes and their behaviour are unchanged. **Checks run locally:** - ESLint on both files is clean, and `npm run lint` in `packages/api` passes. That script runs plain `eslint .`, not the `--max-warnings 0` check CI uses; the ESLint run on both files is what shows zero warnings. - `tsc --noEmit` for `packages/api` passes. - `openapiRouteCoverage.test.ts` and `taskAssignmentRoutes.test.ts` pass, 44 of 44. The "Validation Failed" stack trace in that output is logged by a test that expects that error. The file is now exactly at the 400-line limit, so any route added to it later, from this branch or from main, will trip the lint again. This change can't be seen in the UI, so there are no visual previews. PR: #3495 Comment by: @github-actions[bot] (ID: 6857222469) Comment by: @propr-dev[bot] (ID: 6857222703) Model: Claude Opus 5.5
✅ Epic merged: Integration signalsEpic PR #3495 has been merged into main. 4 out of 4 PRs merged into main through this epic PR. All planned epic work is now merged. Posted automatically by ProPR |
… was API Lint, the same one as last time: `packages/api/routeRegistry.ts` was at 402 lines, two over the 400-line `max-lines` limit. I fixed the Validate Changes failure. The only failing gate was API Lint, the same one as last time: `packages/api/routeRegistry.ts` was at 402 lines, two over the 400-line `max-lines` limit. The other items in the failure evidence don't need a fix. The Playwright smoke run passed (884 tests), and "slow test file `creation-short-window.pw.ts` (10.3m)" was only a warning. **Why it came back:** PR #3495 has since merged into main, bringing its own trim of this file, and main's copy is now at exactly 400 lines. This branch adds three execution-queue routes (blocked-events, skip, retry), so the merge here put the file back over the limit. The earlier workaround that joined two names onto one line (`costExportRoutes, statsRoutes`) wasn't enough. **Fix:** - **New file `packages/api/epicQueueRouteRegistry.ts`:** it holds the five epic execution-queue routes (get queue, queue remaining, blocked events, skip, retry). It is modelled on the existing `integrationSignalRouteRegistry.ts`. - **`routeRegistry.ts`:** it now pulls those routes in at the position where they used to be listed, so the order routes are registered in is unchanged. I also undid the one-line join, so the file matches main's formatting again. It is now exactly 400 lines. **Checks run locally, all passing:** - `npm run lint -w @propr/api -- --max-warnings 0` - `npm run build -w @propr/api` - `npm run gen:openapi:check`: up to date, 316 routes - `npm run check:client-contract` - The route authorization, OpenAPI route coverage and demo-viewer authorization tests: 28 of 28 pass. They need `PROPR_DEMO_MODE=true` here because the container has no GitHub credentials. There's nothing visual in this change, so I didn't create a preview. PR: #3500 Comment by: @propr-dev[bot] (ID: 6861043801) Model: Claude Opus 5.5
Integration signals
This Epic PR aggregates all changes for the plan: Integration signals
Issues in this Epic
Auto-close
When this PR is merged, the following issues will be automatically closed:
Fixes #3482
Fixes #3483
Fixes #3484
Fixes #3485
Created automatically by ProPR