Public: anyone can read this; the crew can change it.

"Every repository you work on" is every one: the shipping and checks charts no longer drop the oldest, busiest repository #16336

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

On production the owner's "shipping throughput" chart said 19 pulls merged in 14 days, while trevato/forge alone merged 214 on one day of them. The count was right (pulls { repo: "trevato/forge", brief } answers 10, 64, 134, 234, 50, 214, 55 for the last seven days); the scope was not.

Notes

shipped production is serving it deploy 3fede26

opened this

On production the owner's "shipping throughput" chart said 19 pulls merged in 14 days, while trevato/forge alone merged 214 on one day of them. The count was right (pulls { repo: "trevato/forge", brief } answers 10, 64, 134, 234, 50, 214, 55 for the last seven days); the scope was not. With no repo, a widget read listReposWritableTo for the newest 100 repositories (SCOPE_REPOS, repo.id DESC), and an owner with more than 100 (trial apps, archived ones, org repositories) lost his oldest, which is the forge. The checks chart had the same cut.

scopeOf now answers ids, and with no repo every repository the person may write (everyWritableRepoId, src/core/repos.ts: REPO_WRITABLE, ids only, no page); both widgets already read those ids through their indexed time ranges. SCOPE_REPOS is gone. widgets.test adds 120 newer repositories beside alice's oldest, the one with the merges and checks, and asserts both charts still count it; on main's registry the test fails.

Try: on a preview with more than 100 repositories, ask Talk "show me shipping throughput": the chart counts the oldest repository's merges; compare pulls { repo, brief: true } for it No look: no page changes; the charts' numbers are now the whole of what they name No door: the terminal prints the same widget data (plainVoice); the scope is one function for every door Direction: a chart that drew a wrong number for the owner (widgets, #6009; Talk first, #10262), ahead of #6534

Co-Authored-By: Claude Fable 5 <[email protected]>

--- Found on production, 2026-11-24: the owner's "shipping throughput" chart said 19 pulls merged in 14 days while trevato/forge alone merged 10, 64, 134, 234, 50, 214 and 55 a day that week. With no repository named, the scope took the newest 100 repositories a person may write, and the owner's oldest, the forge itself, fell off the end. The checks chart had the same fault. One commit on main.

For the reviewer: with the cut at 100 gone, please check the cost of the two reads for a person who may write several hundred repositories.

🤖 Generated with Claude Code

Approved

The fix is right: the shipping and checks charts now read every repository the viewer may write, through one ids-only query on the same REPO_WRITABLE rule. A hidden repository can't leak in, and the SCOPE_REPOS cap is gone, so no new cap replaces it. The regression test adds 120 newer repositories, which would fail with the old limit of 100. The preview answers 200. This is a data-only change with no page surface, so the terminal and docs checks don't apply.

Two things I'd do next:

  1. Tidy src/widgets/registry.ts. Wrap the long one-line if (named === undefined) return ok({...}) in scopeOf, and drop the double blank line left where idsOf was removed.
  2. Check whether json_each over thousands of ids stays inside the 50 ms budget on the largest forge. If it doesn't, repo_id IN (SELECT id FROM repo WHERE <writable>) would do the same job without building the id list.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs