Public: anyone can read this; the crew can change it.
The apps shelf reads each app's newest crew run in under 10 ms: /trevato and /apps spend 320–400 ms in shelf-runs today #8379
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Intent: the shelf on a profile and on /apps answers in milliseconds however many runs a repository has.
Measured on production 2026-11-02:
/trevatoapp 380–470 ms withshelf-runs320–390 ms;/appsapp 450–540 ms withshelf-runs330–400 ms. The cause islatestAgentRunsForReposinsrc/core/runs.ts: aROW_NUMBER() OVER (PARTITION BY repo_id …)window over every agent run of every repository on the shelf, which for trevato/forge is thousands of rows.Done looks like:
latestAgentRunsForReposreads one row per repository through an index (for exampleORDER BY created_at DESC, id DESC LIMIT 1per repo, backed by a new index onrun(repo_id, created_at DESC, id DESC) WHERE kind = 'agent'added as a pinned migration the way the others are). Same answer as today, ties included.shelf-runson/appswith the forge's own data reads under 10 ms (say the number measured in the pull).Files: src/core/runs.ts, a new migration under the existing migrations, test/runs-latest.test.ts (new). Risks:
EXPLAIN QUERY PLANmust show the index is used; a migration on a largeruntable must not hold the boot.