Repository navigation
Description
Problem
With the journal from the previous issue in place, a coordinator still needs a way to consume it: list events after a cursor, and block until something relevant happens instead of polling six reads.
What to build
Follow the wait_goal design (packages/api/services/goalWait.ts, packages/api/mcp/toolsGoalWait.ts, packages/shared/src/goalWait.ts).
- MCP
list_repository_events(scoperead): argsrepository,afterCursor?,domains?,types?,pullRequest?,planId?,limit(max 100). Returns{events, cursor, truncated}. - MCP
wait_repository_events(scoperead, blocking read that receives the abortsignal): same filters plustimeoutSeconds(default 15, max 30). Returns{outcome: events|timeout, events, cursor, waitedMs, timeoutSeconds}. Returns immediately when matching events already exist after the cursor. - REST
GET /api/repository-eventsandGET /api/repository-events/waitwith the same parameters, registered, documented and schema'd. - CLI
propr events listandpropr events wait(--json,--followloops on the cursor).
Cursor
Opaque string (rec1. + base64url of {r: repository, s: seq}). Errors: CURSOR_INVALID, CURSOR_WRONG_REPOSITORY, CURSOR_EXPIRED (cursor below the retention floor), WAIT_LIMIT, WAIT_ABORTED, INVALID_INPUT. A call without a cursor starts at the current end of the journal (it returns the current cursor and no history) unless fromStart: true is passed.
Behaviour
- At-least-once, ordered by
seq; a client resumes with the last cursor it processed. - Limit concurrent waits per owner per API process (same order of magnitude as goal waits) and reuse the in-process wake hub idea so an append in the same process wakes waiters at once; other processes are covered by the poll interval.
- Authorisation: the caller must have read access to the repository, the same check
list_pull_requestsapplies. Events of other repositories are never returned. - Event shape returned:
{cursor, domain, type, repository, pullRequest?, issueNumber?, planId?, entityId, head?, payload, occurredAt}.
Acceptance criteria
- Listing after a cursor returns exactly the later events in order; filters by domain, type, pull request and plan work.
- Wait returns immediately on existing events, wakes on a new matching event, ignores non-matching events, and times out with the unchanged cursor.
- Every cursor error is covered by a test; an expired cursor is distinguishable from an empty result.
- Wait limit and abort are covered.
- A caller without repository access gets the standard authorisation error.
npm run gen:openapioutput committed; OpenAPI coverage/conformance,mcpObservableSurface,mcpDocs,mcpToolInputBudgettests pass.docs/mcp.md,docs/mcp-coverage.mdand the API reference document both tools, the cursor contract, at-least-once delivery and a short "coordinator loop" example (wait for events, then readget_pull_request_readiness).
Implementation
- Shared constants and cursor codec in
packages/shared. packages/api/services/repositoryEventWait.tsmodelled ongoalWait.ts(poll interval, wake hub, per-owner limit, abort).- REST handlers + registry + route docs + schemas; MCP tools in a new
packages/api/mcp/toolsRepositoryEvents.tsregistered in the catalog. - CLI commands.
- Tests modelled on
packages/api/test/goalWait.test.ts,mcpGoalWait.test.tsand the goal wait harness. - Regenerate OpenAPI/client types; docs and allow-list updates.
Notes
Depends on the journal issue (table and listRepositoryEvents). The readiness tool from the first issue may not be on this branch's base if work is reordered; the docs example can reference it by name only if it exists in the catalog, otherwise leave the example to the readiness read's own docs (the mcpObservableSurface test rejects unknown tool names in docs/mcp.md).
Activity
propr-dev commentedon Nov 12, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53484/claude-opus-5-5-read-and-wait-on-reposito-20261112-2048-wgw3482-epic-integration-signals-100issue-3484-20261112-2048-claude-opus-5-5-wgw🔍 Track Task Execution
I've implemented #3484: coordinators can now list and wait on a repos…