Skip to content

feat(history): events.replay pages back with before and limit - #773

Merged
V3RON merged 19 commits into
feature/756-adrfrom
task/764
Oct 21, 2026
Merged

V3RON merged 19 commits into
feature/756-adrfrom
task/764

Conversation

@V3RON

@V3RON V3RON commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #764

GET /v1/events gains before and limit, so a client can page backwards through history.db, and limit alone returns the newest events. eventsPageQuery in the contract owns the parsing and bounds; replayPage returns events, not-kept or unavailable, and eventsPageAnswer maps them to 422 HISTORY_NOT_KEPT and 503 HISTORY_UNAVAILABLE. The protocol bumps by one.

Status

Implement: done (12/12 green) Review: round 2 passed Hardware: n/a Gate: waiting for the stack

Done when

  • pnpm test passes the touched tests, and node .agents/scripts/protocol-bump-check.mjs passes. Checked by the build and audit runs (pnpm test:changed, 6127 tests) and the fix run (121/121), plus protocol-bump-check in each.

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 4 blocking, 4 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 2 notes.
Rounds: 2. Tokens: 23.9M.
Runs: 9. Cost USD: 3.9993. Agent seconds: 2715.
Assessment: complete

Rejected:

  • spec: the dispatcher tests for limit alone duplicate the history test — [incorrect] they cover the dispatchers' routing condition, which the history test cannot reach.

Written by an agent.

@V3RON

V3RON commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Runs: 9. Cost USD: 3.9993. Agent seconds: 2715.
Tokens input 336, output 93169, cache read 8783407, cache write 536883.
- build implementer: claude-sonnet-5-5 786 s $1.1105
- audit implementer: claude-sonnet-5-5 359 s $0.2995
- review 1 reviewer: claude-sonnet-5-5 457 s $0.2826
- review 1 spec: claude-sonnet-5-5 41 s $0.1697
- review 1 code both: claude-opus-5-5 327 s $1.0964
- review 1 claims: claude-sonnet-5-5 62 s $0.1793
- fix 1 implementer: claude-sonnet-5-5 221 s $0.1647
- review 2 reviewer: claude-sonnet-5-5 265 s $0.1
- review 2 code tests: claude-opus-5-5 197 s $0.5966
Finding outcomes: {"fixed":4,"incorrect":1}. Classes: {"testing 10":1,"testing 3":3,"testing 7":1}.
{"findings":[
{"id":"R1","role":"code","class":"testing 3","outcome":"fixed","fix":"07097f74a8afb234f9411ef91b57a3c29e9860ed","path":"src/history/index.ts"},
{"id":"R2","role":"code","class":"testing 3","outcome":"fixed","fix":"07097f74a8afb234f9411ef91b57a3c29e9860ed","path":"src/history/index.ts"},
{"id":"R3","role":"code","class":"testing 10","outcome":"fixed","fix":"07097f74a8afb234f9411ef91b57a3c29e9860ed","path":"src/history/history.test.ts"},
{"id":"R4","role":"code","class":"testing 3","outcome":"fixed","fix":"07097f74a8afb234f9411ef91b57a3c29e9860ed","path":"src/gateway/dispatcher.ts"},
{"id":"R5","role":"spec","class":"testing 7","outcome":"incorrect","path":"src/daemon/dispatcher.test.ts"}
]}

Written by an agent.

@V3RON

V3RON commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • claims: docs/HTTP-API.md:1895,1898 name only GET /v1/stats as a source of HISTORY_NOT_KEPT and HISTORY_UNAVAILABLE; GET /v1/events?before= now raises them too.
  • claims: src/contract/events-page.test.ts — the test title leaves out two of the refused before values it checks.

Written by an agent.

V3RON added 19 commits October 21, 2026 15:40
…nd maps HISTORY_NOT_KEPT and HISTORY_UNAVAILABLE (#764)
@V3RON
V3RON merged commit 4b6a770 into main Oct 21, 2026
25 of 28 checks passed
@V3RON
V3RON deleted the task/764 branch October 21, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Events history pages backwards: GET /v1/events with before and limit

1 participant