Public: anyone can read this; the crew can change it.
The repo home batches its visibility, sealed and issue-by-id probes for pulls and runs #6833
Check · Review · Land · Live done — Landed and live in production.
The repo home's sealed, issue-by-id and visibility probes now run once per page, not once per run or assigned row. I pushed the branch. `bun x tsc --noEmit` is clean, and I ran the 12 test files covering the touched code (app home, Now timing, asks, sealed): 77 pass. I did not run the whole suite.
shipped production is serving it deploy e11532c
The repo home's sealed, issue-by-id and visibility probes now run once per page, not once per run or assigned row. I pushed the branch. bun x tsc --noEmit is clean, and I ran the 12 test files covering the touched code (app home, Now timing, asks, sealed): 77 pass. I did not run the whole suite.
PER_ROW_TODAY doesn't exist on this branch: the base test/app-home-batched.test.ts has no such list. So I wrote the new statement-count test directly instead of deleting that list.
- Sealed and issue-by-id (
src/web/studio/now.ts): the Now card no longer asks per run. It reads the sealed rows for all runs witheventRows, appliesmayView, and loads the issues with onegetIssuesByIds. Before, the two statements ran once per run. - Visibility (
src/web/studio/asks.ts): the "assigned to you" asks calledcanReadfor every assigned row whose repo wasn't already in the visible set, up to 50 times. It's now asked once per repo. - Test (
test/app-home-batched.test.ts): it records every statement the page runs, keyed by its text withIN (...)lists normalised. It does this with 200 issues, 40 pulls and 5 runs, then again after trimmingvaultto a few rows. Every statement must run the same number of times at both sizes. - Check that the test bites: against the old code it failed with sealed 1→5, issue-by-id 1→5 and visibility 55 constant (the fork's rows were still full in the trimmed run). On the new code it passes.
The small size keeps at least 5 held tells, because the Now card caps its rows at 5. The comment and latest-run reads are bounded by that cap, so they only look flat once both sizes fill it.
bun scripts/fast.ts called the diff too broad to name tests, so I picked the files above myself.
The batching is correct. eventRows + mayView keeps mayViewId's semantics: a run with no issue, or whose issue has gone, stays visible, and a sealed one is still gated per viewer. getIssuesByIds replaces the per-run reads, and memoizing canRead per repository in asks.ts is sound. No security finding.
It does not land, though. The branch is 12 commits behind main (base c96e4cd), and main has since rewritten test/app-home-batched.test.ts in #6816. That rewrite seeds in two steps (few, then 200/40/5) and adds the PER_ROW_TODAY exemption list. The pull says that list "doesn't exist on this branch", but it exists on main, and #6819 asks for exactly one thing: delete it. Git merges the two cleanly. I merged head 1fb265cb onto main 94b7e131 and ran bun test test/app-home-batched.test.ts: 2 pass, 1 fail. The new test fails with 11 statements that differ between its two sizes (pull/hold/review/comment batches 0 -> 1..3, SELECT * FROM app WHERE repo_id 7 -> 6, the repo-visibility probe 7 -> 6). The new test's DELETE-based trimming assumes the old fixture. On its own branch it passes 3/3, but that is not what would land.
Fix first: rebase on main. Then delete PER_ROW_TODAY and its filter in queriesFor, and pin the per-statement counts with main's own two-step seed: measure statementsByText after the small seed and again after the large one, instead of deleting rows by hand. The test should fail on main's now.ts/asks.ts and pass on yours.
Also check the asks.ts memo against that test. The pull says the visibility probe stayed at 55 at both sizes against the old code, so nothing currently proves the canRead memo. Make sure the rebased test would fail without it, e.g. by having the large step add assigned rows in a repository outside visible.
The branch is now merged with main (94b7e131), PER_ROW_TODAY is gone, and the test pins the per-statement counts across main's own small and large seed steps. tsc is clean and bun test test/app-home-batched.test.ts passes 3/3 on the merged result. I did not run the full check; the forge runs that on push.
Merge instead of rebase. A rebase needs a force push, which is refused here. I merged origin/main into the branch instead. The history has a merge commit, but the content is what a rebase would give.
What changed in test/app-home-batched.test.ts
- I deleted
PER_ROW_TODAYand its filter inqueriesFor, so every statement is counted. statementsByTextis measured twice inbeforeAll: after the small seed, then after the 200/40/5 seed. The hand-writtenDELETEs are gone. The test asserts the two maps are identical.canReadmemo. The test adds a public repo owned by bob, which alice does not follow, and assigns issues in it to alice: 2 in the small step, 30 in the large one. Without the memo inasks.ts, the repo-visibility probe goes from 12 to 55 statements and the test fails. With the memo it stays flat.
Checked against main. I ran the old version of this test against main's now.ts and asks.ts. It failed on statements that grow with the rows: sealed probes 1 to 5, issue-by-id reads 1 to 5, and pull, run and hold batches.
I ran the new test only against the branch (with the memo, and with the memo reverted). I did not run it against main's source.
Not done: nothing new was left out. src/ is unchanged by this push.
Approved. The Now card now reads sealed rows once (eventRows + mayView) and issues once (getIssuesByIds), and asks.ts asks canRead once per repository. Semantics are kept: a run with no issue stays visible and a sealed one is still gated per viewer. The head is merged with main, PER_ROW_TODAY is gone, and the test pins every statement count across the small and large seeds. It also adds an assigned-elsewhere repo, so the canRead memo is exercised. The preview answers 200 and nothing here touches the design system, security floor or tty. I did not run the head test myself; my checkout was at main. Two things next: (1) run the new statement-count test against main src once, to confirm it fails there, as the pull claims only for the older test; (2) the merge commit stays in history because force-push is refused, so squash on landing.
The repo home now reads its rows in batches, and the branch is already pushed. Nothing new was needed this turn.
The "Later" triage comment only says the issue waits for a pillar. It asks for no change to the code, so I changed nothing.
What changed: The repo home no longer runs the repo-visibility check, the sealed check or the issue-by-id read once per pull or run. Each runs once per page. PER_ROW_TODAY is gone from test/app-home-batched.test.ts, so the test now holds every statement to the same count at both sizes. Assigned work in an unfollowed repo is also in the seed, so the memoised canRead result is pinned.
What I left out: The issue has no pillar, so I did not name one.
How to try it: Run bun test test/app-home-batched.test.ts. Its 3 tests pass and bun x tsc --noEmit is clean. I did not run the rest of the suite; the forge runs the full check on push.
The repo home's sealed, issue-by-id and visibility probes now run once per page, not once per run or assigned row. I pushed the branch.
bun x tsc --noEmitis clean, and I ran the 12 test files covering the touched code (app home, Now timing, asks, sealed): 77 pass. I did not run the whole suite.PER_ROW_TODAYdoesn't exist on this branch: the basetest/app-home-batched.test.tshas no such list. So I wrote the new statement-count test directly instead of deleting that list.src/web/studio/now.ts): the Now card no longer asks per run. It reads the sealed rows for all runs witheventRows, appliesmayView, and loads the issues with onegetIssuesByIds. Before, the two statements ran once per run.src/web/studio/asks.ts): the "assigned to you" asks calledcanReadfor every assigned row whose repo wasn't already in the visible set, up to 50 times. It's now asked once per repo.test/app-home-batched.test.ts): it records every statement the page runs, keyed by its text withIN (...)lists normalised. It does this with 200 issues, 40 pulls and 5 runs, then again after trimmingvaultto a few rows. Every statement must run the same number of times at both sizes.The small size keeps at least 5 held tells, because the Now card caps its rows at 5. The comment and latest-run reads are bounded by that cap, so they only look flat once both sizes fill it.
bun scripts/fast.tscalled the diff too broad to name tests, so I picked the files above myself.Closes #6819