Public: anyone can read this; the crew can change it.
Home's fork line reads parents and forks once, and a fork's offers upstream by the fork: home renders in 72-97 ms, not 156 #17674
Merged 12h 15m ago, live in production
Profiled on the stage rig's copy (2026-11-13 database and repositories, a throwaway --network none container on the host, signed in as the owner, warm, JSC-sampled over 20 requests; the copy deleted after): "/" took a median 156-171 ms, 630-689 statements and 124-152 ms of it inside SQLite; the HTML was under 1% a part…
-
Reviews
Changes requested — before the latest pushOne change, and it is a one-way-to-do-it miss. The perf work is sound and the semantics match visibleForks/forkParentFor.
listForksOfin src/core/repos.ts duplicates what already exists:visibleForksByParent(db, parents, viewer)(repos.ts ~918) already reads the forks of many parents in one query, groups them by parent id, and filters by canRead, with a cheaper path for public repos with standing owners. DeletelistForksOfand the hand-rolled grouping loop in fork_flows.ts; callvisibleForksByParent(db, mine, viewer)instead. That also drops a second chunking implementation next toforksOfMany.- Minor: the
CROSS JOINin sentOffers is an unexplained planner hint. Add a one-line comment saying it pins pull as the driving table so the new pull_head_repo index is used, or drop it if the index alone is enough.
The test would fail without the change and the migration and pin look right. No door change is needed: no behaviour changed. Re-run the test and design checks after the swap.
ApprovedApproved. The fork line now reads parents (getReposByIds) and forks (visibleForksByParent) once for all administered repos. Both are gated by canRead per viewer, so a guest still sees nothing private. forkOffers/sentOffers keep their signatures through defaulted parameters, so the other callers are unchanged. The new pull(head_repo_id, issue_id) index is additive, pinned, and matches the CROSS JOIN order in sentOffers. This is a core-only change with no page, action, API, MCP or TUI surface, so the both-doors rule has nothing to add. The statement-count test fails without the batching.
Non-blocking: (1) the test bound
six - one <= 5is loose; assert the exact per-repo cost the admin check adds, so a regression to one extra read per repo is caught. (2)Math.random()in repo names can in principle collide; use the loop index instead. -
Checks
shipped production is serving it deploy c4333e8
-
History
- Home's fork line reads parents and forks once, and a fork's offers upstream by the fork: home in 72-111 ms not 143-156, /forks/flows 54 not 123 9af569b
- The minute's statement tally takes a caller's stack only on a statement's first and slowest runs: 1 us of overhead a statement, not 12-15 (#17668) 0b3603a
- Cloud pages: the missing permission, one thing's price, and where tax is (#17651) 00083d2
- Merge pull request #17679 from sold/game-jars 2aa328e
- home-flow's proof tests write the proof of the release the process runs, so a stamped container passes them too (#17676) f1e9d16
- Desk: a crew run's note says Doing once, on the home and in the terminal (#17657) 515a0da
- The agent puts the proxy's pinned jars in place before an up (#17610) 96a9bc6
- Merge pull request #17673 from sold/game-proxywrite 270c1f1
- The game agent's proxy console answers again, and an answered sync is not called failed (#17610) 2fccc33
- The memory line says what is held: RSS and its anonymous part, and the allocator's churn as a rate, never "committed 126 GiB" (#17667) 59691dc
- Adopting data from before the migration table parses each migration once, not once per earlier one (#17671) 85b9aa9
- Every transaction on a forge's connection takes the write lock first, with the busy retry (#17643) b9554e8
- scripts/boot-profile.ts: boot a copy of a forge's data under the CPU profiler and say what held the thread (#17660) 05bf470
- The newest snapshot is read alone: the backup watch, drill, probe and standby parse one manifest, not fourteen (#17659) c10544f
- Game pages: an operator on a phone finds the five things they came for (#17664) 2d0f5f0
- The cost ledger's chain is walked in a worker: a boot no longer holds the loop 0.5-1 s for it (#17638) 7ce8163
- Merge pull request #17665 from sold/game-restore 07ec5c4
- A snapshot's files are cut off the serving thread: an unchanged hosted forge's stream pass holds the loop 0 ms, not 0.8 s (#17622) 574b021
- Merge main into sold/game-restore dffb002
- A game box's snapshot comes back as a game box, not a forge on its worlds (#17625) 275aa3a
Profiled on the stage rig's copy (2026-11-13 database and repositories, a throwaway --network none container on the host, signed in as the owner, warm, JSC-sampled over 20 requests; the copy deleted after): "/" took a median 156-171 ms, 630-689 statements and 124-152 ms of it inside SQLite; the HTML was under 1% a part. About 90% was one section, the fork flows line (studio/fork_line.ts -> core/fork_flows.ts), which walks every repository its owner administers: sentOffers 51% pulls into the parent whose head is this fork, joined from issue: with no index on pull.head_repo_id it walked the parent's issues (17,000 on trevato/forge) once a fork forkParentFor 17% two getRepoById a fork listForks (forkOffers) 13% one read a repository, almost all with no forks lastTookAt, the offers query, tip files: the rest
Now: an index on pull(head_repo_id, issue_id), and sentOffers reads from the fork's pulls first (CROSS JOIN fixes the order, so the planner cannot start from the parent's issues); forkFlows reads every parent in one getReposByIds and every fork of every repository in one listForksOf, checks what the viewer may read as forkParentFor and visibleForks did, and hands them to sentOffers and forkOffers (new optional arguments; every other caller reads as before). A repository with no parent and no forks costs the line nothing past its admin check.
The same copy, the same image (0.7.715), the files mounted over it: "/" 156 ms, 689 statements -> 72-97 ms, 325 statements "/?view=table" 115 ms, 676 statements -> 73 ms, 371 statements the index alone (old code on the indexed copy): "/" 125 ms, the table 104 ms What is left of home's SQL: sentOffers once per fork with a parent (32-37%), the stalled-runs read under the header (9-21%), forkOffers and lastTookAt.
test/fork-flows.test.ts: six plain repositories cost the line at most one read more each than one does (the old code: two each, 10 for five; it fails there). On runner-6, main plus this: 131 pass across the fork, schema, counts, page-budget and unused-exports files; tsc and the gate clean. The migration is pinned.
Direction: home's render is the page the owner opens most, and this line was 90% of it (#17629)
Co-Authored-By: Claude Fable 5 <[email protected]>
🤖 Generated with Claude Code