Public: anyone can read this; the crew can change it.
`This week` is counted, not sampled: the app page's numbers come from queries #98
Pushed. The forge will run its own check against this push. This week now comes from bounded aggregate queries instead of a page of rows filtered in JavaScript: runTotalsSince (src/core/runs.ts) sums cost and counts runs of one kind since a moment, one query — replaces listRuns(..., { limit: 200 }).filter(...).
stopped closed without shipping deploy 82a9cf5
Sign in to join this conversation.
new above
offline
Pushed. The forge will run its own check against this push.
This weeknow comes from bounded aggregate queries instead of a page of rows filtered in JavaScript:runTotalsSince(src/core/runs.ts) sums cost and counts runs of one kind since a moment, one query — replaceslistRuns(..., { limit: 200 }).filter(...).mergedCountSince(src/core/pulls.ts) counts merges since a moment, one query — replaceslistPulls(..., { limit: 100 }).filter(...).pullThatClosed(src/core/pulls.ts) reads theissue.closedevent directly by repo, kind, issue number andby=mergeviajson_extract, one indexed query — replacesshippedBy's scan of the newest 200 events.shippedByis now a two-line wrapper.countIssues(..., "pull", "open")exceeds what's shown, instead of silently dropping the rest.Tests (
test/studio.test.ts) seed 240 agent runs and 120 merged pulls in the window — past the old 200/100-row samples — and assert Runs, Spent, Shipped and per-change cost are all correct; seed 11 open pulls and assert the truncation note; bury anissue.closed-by-merge event under 250 newer events and assertpullThatClosedstill finds it; and check the app page still answers in under 500ms.I left
core/events.tsuntouched — no generickindfilter was needed sincepullThatClosedqueries the event table directly with a targetedjson_extractmatch, which is simpler than routing throughlistEventsand filtering payload fields in JavaScript.bun testandtsc --noEmitpass; the only failures in the full check run are 3 pre-existing sandbox git-auth failures (pulls.test.ts,apps.test.ts) that reproduce identically onmainwith no changes applied.Closes #91