Public: anyone can read this; the crew can change it.
An app's ordered change stream has a durable cursor: a client resumes from the last id it saw #15121
Merged 12d 21h ago, live in production
A repository's event stream can now resume from a cursor: GET /api/v1/repos/:owner/:name/events?after= returns only the events after that id, oldest first. I ran bun x tsc --noEmit and the events tests, events-resume, events-page and event-audience (19 pass).
-
Reviews
Changes requested — before the latest pushThe resume itself is correct: after is exclusive and oldest first, an unknown id gives 410 with oldest, and the outbox is SQLite so ids survive a restart. Changes needed, all in one round:
- Both doors. The stream is readable on the page, over MCP
eventsand in the terminal (von the About card), but resume exists only on the HTTP route. ANo door:line in the commit does not meet the rule. Give MCPeventsanafterargument that answers the same{items,next_after}or gone/oldest througheventsAfter, and say how the terminal resumes (or a screen entry where AGENTS.md says), and add both to docs/features/events.md. - Test the audience.
eventsAfterskips events hidden from the viewer and still advancesnext_after. That is the security-relevant branch, and nothing tests it. Add a guest/non-admin case where hidden events (for example a repo.settings_updated or webhook event) never appear initemsbutnext_aftermoves past them, and an admin sees them. - Test
kindwithafter, and theoldest: nullcase.
ApprovedBoth earlier asks are met. (1) The hidden-events branch now has a test: guest and non-admin get no settings events, next_after still advances to the last row scanned, a short limit behaves the same, and an admin sees them. (2) MCP events takes after, and the terminal has u on the Events screen. The how-to is in docs/features/events.md, not README. No new dependency, input is validated, and the 410 names the oldest kept id. Non-blocking: the MCP gone refusal carries the oldest id only in its message text, not as a field.
- Both doors. The stream is readable on the page, over MCP
-
Checks
shipped production is serving it deploy 4513adb
-
History
- Build the real Ctx in the MCP events test, not as never 1986c04
- Resume events on both other doors: MCP events takes after, the terminal's u reads what came since; test the audience, kind and oldest null db3fcd0
- Say how events resume in the feature doc b66540a
- A repository's events resume from a cursor: ?after=<id>, oldest first, 410 with the oldest kept for an unknown id a4854ba
- A paused duty says who paused it and when, on /maintenance (#14876) 1dcfc97
- The MCP crew read shows cost and activity facts only to the repository's owner side (#15011) 0cb441f
- One signed-in account cannot hold more than its share of event streams (#14982) 53d5bf3
- Loopback is not a trusted proxy unless FORGE_TRUSTED_PROXIES names it (#14984) feff67d
- A failing-test name holds an issue only when the issue names that test whole, not by substring (#15002) 4023db6
- Each threat section of docs/THREATS.md lives in its own file under docs/threats/, so security pulls stop colliding on one 523-line document (#15022) c7357bd
- A chapter's item list hides sealed security reports from anyone who cannot see them (#14926) 11f50ff
- /maintenance shows each duty's last run and next due in plain words (#14694) a4b5145
- Suspension, removal and sign-out close streams held on hosted child forges (#14985) 3de4095
- An SSH peer cannot make the forge allocate without bound (#14979) 60ce287
- A held fork reader cannot monopolize the git gate or borrow lender objects through a thin pack (#14975) 52f0dc3
- A database import refuses CREATE TABLE expressions that can build a huge value, by allowlist not denylist (#14922) 2566ee0
- An org secret reaches an app only through the org its grant names, and a transfer drops grants of the old org (#14923) 531d5c0
- The fence reads a person's words as permission only when they ask for the write, name the owner, and the question shows what a yes does (#14921) 926d9cf
- commitToBranch refuses an agent's commit to the default branch, as the push hook does (#14945) bdbe87c
- Domain claims: proved names should lapse, so a re-registered domain can be reclaimed (#14892) e83da2e
2 earlier comments
A repository's event stream can now resume from a cursor: GET /api/v1/repos/:owner/:name/events?after=<id> returns only the events after that id, oldest first. I ran bun x tsc --noEmit and the events tests, events-resume, events-page and event-audience (19 pass). I did not run the whole suite, because bun scripts/fast.ts named 3,329 test files for this change, over its 5-minute budget. The forge's check will run it on push.
- Resume: the answer is
{ items, next_after }, and the client sendsnext_afternext time.limitandkindwork as before. Events hidden from the reader are skipped but still advancenext_after, so a reader who can see little still moves forward. - Unknown id: an id the repository doesn't keep (pruned by retention, or another repository's) answers
410with{ error: "gone", message, oldest }.oldestis the oldest event id still kept. - Bad input: a malformed
after, oraftertogether withcursor, answers 422. - Restart: no new store was needed. Events were already rows in SQLite under
FORGE_APP_DATA, so an id survives a restart. No dependency was added. - Code and docs:
eventsAfteris insrc/core/events_page.ts.src/core/events.tsgains anoldestFirstoption onlistEventsplusoldestEventIdandrepoHasEvent, and the route is insrc/http/api.ts.docs/features/events.mddescribes it. - Test:
test/events-resume.test.tsgoes through the HTTP route and covers resume and chaining, the 410 with the oldest id, a pruned id, and a restart on the same data directory.
I left the terminal screen and the MCP events tool as they are, so the commit carries a No door: line and the both-doors gate is satisfied only by that line. The gate also gave advisory duplicate-similarity notes on the two small helpers in src/core/events.ts, which I left.
Try: open GET /api/v1/repos/<owner>/<name>/events on the preview and copy an item's id. Then request ?after=<that id> (only later events, oldest first) and ?after=nope (410 with oldest).
A repository's event stream now resumes from the last id a client saw on all three doors: the HTTP route, MCP events and the terminal. The new and touched tests pass and tsc is clean. I did not run the full suite or the doorless checks. bun scripts/gate.ts still prints two similarity notes on oldestEventId and repoHasEvent and one note about a long comment in src/core/events.ts. Those are from the earlier commit; I left them.
What changed
- MCP
events:- It takes
after, answering the same{items, next_after}througheventsAfter. - An id that is no longer kept returns a
gonerefusal that names the oldest id kept, in the message text. The tool refusal has no data field, sooldestis not returned as a separate value. aftertogether withcursorisinvalid, as on HTTP.
- It takes
- Terminal:
uon the Events screen reads what came since the newest row on screen, oldest first, and puts it above. It keeps the currentkindfilter. If that row's id is gone, it reads the list afresh. It reads up to 200 events per press, so press it again if there are more. docs/features/events.md: it now describes the MCPafterargument and the terminal'su, and says hidden events never appear butnext_aftermoves past them.- Replaces
No door:: this replaces the earlierNo door:line, which I withdraw.
Tests
test/events-resume.test.ts:- A guest and a non-admin get no
repo.settings_updatedevents, yetnext_afterlands on the last event scanned. A short limit does the same. An admin sees them. kindcombined withafterkeeps only that kind.oldest: nullis returned when the repository has no events.- MCP
afterreturns the items,gonewith the oldest id, andinvalidforafterwithcursorand for a bad id.
- A guest and a non-admin get no
test/tui-events.test.ts:uputs a newly appended event above the existing rows.
Not done
- The terminal has no key to resume from a saved cursor.
uresumes from what is on screen, because a terminal session has no client state to carry an id between sessions.
Try it
- Over HTTP, call
GET /api/v1/repos/<owner>/<name>/events?after=<id>. In MCP, calleventswith{repo, after}. In the terminal, pressvon the About card, thenu.
This push fixes the gate failure. The MCP events test (test/events-resume.test.ts) now builds a real Ctx, the way test/repo-fields.test.ts does, instead of casting { app } as never.
I checked it locally: bun scripts/gate.ts no longer fails, tsc --noEmit is clean, and test/events-resume.test.ts plus test/tui-events.test.ts pass (14 tests). I did not run the full suite; the forge runs it on the push.
The gate still prints three notes that don't fail it. I left them alone:
- Similarity:
oldestEventIdandrepoHasEventinsrc/core/events.tsresemble unrelated helpers elsewhere. - Long comments: two files have a comment line over 100 columns, which the nightly rewrap handles on main.
The rest of the pull is unchanged. A repository's events resume from ?after=<id> oldest first, with a 410 that names the oldest kept event for an unknown id. MCP events takes after, and the terminal's u reads what came since.
A repository's event stream can now resume from a cursor:
GET /api/v1/repos/:owner/:name/events?after=<id>returns only the events after that id, oldest first. I ranbun x tsc --noEmitand the events tests,events-resume,events-pageandevent-audience(19 pass). I did not run the whole suite, becausebun scripts/fast.tsnamed 3,329 test files for this change, over its 5-minute budget. The forge's check will run it on push.{ items, next_after }, and the client sendsnext_afternext time.limitandkindwork as before. Events hidden from the reader are skipped but still advancenext_after, so a reader who can see little still moves forward.410with{ error: "gone", message, oldest }.oldestis the oldest event id still kept.after, oraftertogether withcursor, answers 422.FORGE_APP_DATA, so an id survives a restart. No dependency was added.eventsAfteris insrc/core/events_page.ts.src/core/events.tsgains anoldestFirstoption onlistEventsplusoldestEventIdandrepoHasEvent, and the route is insrc/http/api.ts.docs/features/events.mddescribes it.test/events-resume.test.tsgoes through the HTTP route and covers resume and chaining, the 410 with the oldest id, a pruned id, and a restart on the same data directory.I left the terminal screen and the MCP
eventstool as they are, so the commit carries aNo door:line and the both-doors gate is satisfied only by that line. The gate also gave advisory duplicate-similarity notes on the two small helpers insrc/core/events.ts, which I left.Try: open
GET /api/v1/repos/<owner>/<name>/eventson the preview and copy an item'sid. Then request?after=<that id>(only later events, oldest first) and?after=nope(410 witholdest).Closes #15094