Repository navigation
[3484 by Claude Opus 5.5] Read and wait on repository change events over REST, MCP and CLI - #3508
Conversation
…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.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a coherent shared implementation for repository event reads across MCP, REST, and CLI, but needs changes before merge because several paths can silently omit events or issue unusable cursors. ✅ Shared behavior — REST and MCP use the same pagination, filtering, cursor decoding, and wait service. ✅ Wait cleanup — Waiters release subscriptions and owner slots in ✅ Broad integration coverage — The changes include schemas, generated client types, documentation, and transport tests. Current checks report 34 passed, none failed, and one pending. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Fresh reads can issue expired cursors
F2: 🔴 Retention can silently remove unread events
F3: 🔴 Repository casing hides valid events
F4: 🔴 Cursorless list retries can skip changes
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe shared implementation and coverage are strong, but retention, repository identity, and retry handling still violate the central reliable-resumption contract. These require localized corrections despite the passing current checks. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 9169cd6
Summary of ChangesI'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 F1 – fresh reads issued expired cursors (
F2 – retention could silently remove unread events
F3 – repository casing hid valid events
F4 – cursorless list retries could skip changes (
Other checks: ESLint with zero warnings passes on the changed Separate findings, not changed:
There's nothing visual to preview. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
… 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
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR provides a well-integrated repository event API across MCP, REST, and CLI, but needs changes before merge. Two cursor recovery paths can prevent coordinators from consuming retained history or observing state changes. ✅ Consistent read implementation — MCP and REST share filtering, pagination, cursor validation, and wait behavior. ✅ Snapshot consistency — Retention checks and event reads occur in one transaction, preventing pruning between validation and page retrieval. ✅ Wait lifecycle coverage — Added tests cover cancellation, owner limits, grant revocation, wakeups, and retention during waits. The supplied current checks show 31 passed, none failed, and three pending. This review is based on static tracing; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F5: 🔴 Retained-history pagination returns expired cursors
F6: 🔴 Expiry recovery can silently miss changes
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Handle errors in coordinator examplesThe REST shell example assigns ScoreThe shared implementation and focused tests are strong, but retained-history pagination and expiry recovery need correction before merge. Pending checks alone do not lower this assessment. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 68b2f58
Summary of ChangesI'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
F6: recovery order
Verification: these all pass:
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 There's nothing visual to preview. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
… 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
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a shared repository-event reader across MCP, REST, and CLI, with substantial coverage of pagination, retention, authorization, and wakeups. It needs localized corrections before merge. ✅ Consistent read snapshots — Cursor validation, retention checks, bounds, and page reads share a transaction, preventing retention from deleting unread rows between those operations. ✅ Useful regression coverage — Tests cover case-insensitive repository identity, retained history below the floor, grant revocation, and waiter cleanup. The supplied current checks show 34 passed, none failed, and one pending. This review used static analysis only; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F7: 🔴 Filtered history advances past unreturned events
F8: 🔴 Ctrl-C does not stop CLI history draining
F9: 🔴 Disconnect during authorization leaves a waiter running
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Refresh the architecture introduction
ScoreThe shared implementation and regression coverage are strong, but cursor advancement and cancellation defects remain in the new behavior. These require localized fixes before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 90a586a
Summary of ChangesI 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 (
F8 – Ctrl-C didn't stop the CLI while it read history (
F9 – a disconnect during the access check left a wait running (
Checks: typecheck passes for Found separately, not changed: in the service's wait loop, if the wait is cancelled while the grant re-check ( 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…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
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a coherent shared implementation for repository event reads across MCP, REST, and CLI. It needs a localized input-validation correction before merge. ✅ Snapshot consistency — Cursor validation, retention metadata, and event pagination run within one transaction, preventing retention from deleting unread rows between validation and retrieval. ✅ Wait cleanup — Waiters release subscriptions and owner slots in ✅ Focused coverage — Added tests cover retained-history pagination, case-insensitive repository identity, cancellation, grant revocation, and CLI retry behavior. The supplied current checks show 31 passed, three pending, and no failures. This review uses static analysis only; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F10: 🔴 Reject empty REST cursors
SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Handle errors in coordinator exampleThe new shell loop in S4: 🟢 Refresh journal overview
ScoreThe implementation has substantial focused coverage and careful retention handling, but REST currently turns malformed cursor input into a successful boundary reset. The correction is localized; remaining checks are pending rather than failing. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit cb9e4dd
Summary of ChangesI fixed F10: an explicitly empty or wrongly shaped The fix (
Regression test (
Checks: Other paths I checked, which needed no change:
This change has nothing visual, so there's no preview. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…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
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
CI failed: Validate unsigned linux-x64 package Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 341672e Summary of ChangesI 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 Fix: I changed only Checks:
Other PRs will keep failing this check until There's nothing visual to preview. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…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
… nothing in this PR's own code caused them. I fixed both failing CI checks with a lockfile-only update; nothing in this PR's own code caused them. **Cause:** both package jobs failed at the "Audit committed dependency resolution" step. The audit flagged `@hono/node-server` 2.1.5, which two advisories published since the last green run cover (GHSA-qv5m-9pm6-hqp3 and GHSA-jpvv-r467-5p4w, both for versions below 2.1.6). Main's lockfile still has 2.1.5, so the failure isn't specific to this PR. Open PR #3508 has the same fix but isn't merged yet. **Fix:** in `package-lock.json`, `@hono/node-server` goes from 2.1.5 to 2.1.8. That's inside the range the project already allows, so no `package.json` change was needed and nothing else in the lockfile moved. I made the update with npm 11. **Checks:** - Re-running `npm install --package-lock-only` with npm 10 (the version CI uses on Node 22) leaves the lockfile byte-identical. - `npm run audit:runtime` and `npm run desktop:audit:packaging` both pass. Together these are the step that failed in CI. Whichever of this PR or #3508 merges second will either conflict on this one line or merge cleanly, since both make the same change. There is no visual change, so I didn't create a preview. PR: #3513 Comment by: @propr-dev[bot] (ID: 6839148834) Comment by: @propr-dev[bot] (ID: 6839149152) Model: Claude Opus 5.5
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a shared repository-event reader and bounded waiter across MCP, REST, and CLI. The implementation appears merge-ready within scope, conditional on the two pending checks completing successfully. This review was static; no commands were run or files modified. ✅ Consistent journal snapshots — Cursor validation, retention state, bounds, and page reads share a transaction, preventing retention from silently removing unread events between validation and retrieval. ✅ Careful waiter lifecycle — Waiters subscribe before reading, retain wake-ups during reads, support cancellation, and release listeners and owner slots in ✅ Targeted regression coverage — Added tests cover pagination below retention floors, mixed repository capitalization, grant revocation, cancellation, and non-replayable cursorless CLI requests. The supplied current-head status reports 32 passing checks, no failures, and two pending checks. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S5: 🟢 Initialize coordinator state explicitlyThe coordinator examples in S6: 🟢 Refresh the journal architecture introduction
ScoreThe implementation has strong coverage of cursor retention and asynchronous cleanup, with no verified merge blocker in the supplied diff. Final merge readiness remains conditional on the pending checks. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3484
Branch:
3484/claude-opus-5-5-read-and-wait-on-reposito-20261112-2048-wgwCommits: ✅ Changes committed (ff4dea3)
AI Processing Completed
Execution Details:
Summary:
I've implemented #3484: coordinators can now list and wait on a repository'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 fullnpm run test:mcprun had 460 of 467 passing. All 7 failures are inrelevanceServiceCommitand fail withEROFSbecause/tmp/git-processoris read-only in this container; that suite has nothing to do with this change.What was added
list_repository_eventsandwait_repository_events(read scope, in a newtoolsRepositoryEvents.ts). Repository access is checked the same way as forlist_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.GET /api/repository-eventsandGET /api/repository-events/wait, registered with documented schemas and the standard error format.npm run gen:openapioutput is regenerated and the up-to-date check passes.propr events listandpropr events waitwith filter options,--jsonand--follow. In follow mode,--jsonprints one JSON line per event, and Ctrl-C prints the cursor to resume from.docs/mcp.mdhas a new section with the cursor contract, at-least-once delivery, an error table and a coordinator loop that waits for events, then callsget_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 themcpObservableSurfaceallow-list.How it behaves
rec1.+ base64url of{r, s}, as specified. A call without a cursor returns the current cursor and no history unlessfromStartis set.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.subscribeRepositoryEventAppends.Decisions to check in review
list_pull_requestsroute 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 usualREPOSITORY_NOT_ACCESSIBLE(404). MCP returnsREPOSITORY_FORBIDDEN(403) from its normal grant check.limitdefaults to 50 (max 100).typesmust be a known event type, with at most 20 per request.openapi/schemasRepositoryEvents.ts, becauseschemas.tsis close to the 400-line lint limit. To support that,schemas.tsnow exports itscomponentandquerySethelpers.There's nothing visual to preview.
Detailed Logs:
e73ecab9-a01f-4a65-af76-a61fb6de4942Log files stored at:
/usr/src/app/logs/executions/issue-3484-2026-11-12T21-15-23-178Z-conversation.json/usr/src/app/logs/executions/issue-3484-2026-11-12T21-15-23-178Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3484.
💡 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!