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

Full suite red: 6 files in check run 01m7y71e9c2x5gysb3m6f1yk33 #15150

Merged opened this in answer to

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

Merged

Five of the six files were red from one cause, and they are fixed. The sixth, test/preview-looks.test.ts, passed alone here, so I did nothing for it. The five files and the type check pass here; I did not run the wider set scripts/fast.ts named (2,399 files), so the forge's full check is the first run of that.

Notes

shipped production is serving it deploy cfe12e4

opened this

Five of the six files were red from one cause, and they are fixed. The sixth, test/preview-looks.test.ts, passed alone here, so I did nothing for it. The five files and the type check pass here; I did not run the wider set scripts/fast.ts named (2,399 files), so the forge's full check is the first run of that.

Cause. #15053 (4b0992ff2) changed reportsClosed from an in-memory set to a report_closed read on every call, so other processes see a close at once. A repository page asks that three times (the report line, the JSON-LD, the standards links), so each page cost 3 more statements than the budgets allowed.

Fix.

  • Once per request: src/web/reports_closed.ts adds reportsClosedFor(ctx, repoId), which reads the row once per request and remembers the answer for that request only. The five web callers use it: pages/repo.ts, pages/issues.ts, pages/proposal-tokens.ts, structured_data.ts and standards.ts. A close made elsewhere still shows on the next request.
  • Pins raised by one: the read itself is the intended #15053 behaviour, so the budgets now count it and each raise carries a comment naming #15053.
    • app.ts page budget 49 → 50
    • /:owner/:name/pulls/:number 115 → 116
    • wallet 41 → 42
    • /alice/forge/report 36 → 37
    • /alice/forge/toolbar 21 → 22
    • did-you-mean found-page count 41 → 42

test/preview-looks.test.ts. It passes here in 18 s with 7 of 7 green, so I made no change. The report only said one test took 6.7 s against its 2 s budget. That is load-dependent under the full suite, not a cause I could reproduce. If it recurs, name the file in SLOW in scripts/gate.ts with an issue.

Not done. I did not remove the remaining per-request read, because #15039 requires a cross-process read.

Try it. Run bun test test/did-you-mean.test.ts test/wallet.test.ts test/repo-pages-timing.test.ts test/pages-budget.test.ts test/page-budget.test.ts.

The first push stopped at a pre-push hook that wants a "Try:" commit for a change under src/web/. I added an empty one, so the branch ends with it.

[{"go":"/alice/forge","look":"the line under the repository header about reports","expect":"still says reports are open, or 'Reports from outside are closed here.' after the owner closes them"}]

Closes #15144

6 earlier comments · 1 event
commented

Five of the six files were red from one cause, and they are fixed. The sixth, test/preview-looks.test.ts, passed alone here, so I did nothing for it. The five files and the type check pass here; I did not run the wider set scripts/fast.ts named (2,399 files), so the forge's full check is the first run of that.

Cause. #15053 (4b0992ff2) changed reportsClosed from an in-memory set to a report_closed read on every call, so other processes see a close at once. A repository page asks that three times (the report line, the JSON-LD, the standards links), so each page cost 3 more statements than the budgets allowed.

Fix.

  • Once per request: src/web/reports_closed.ts adds reportsClosedFor(ctx, repoId), which reads the row once per request and remembers the answer for that request only. The five web callers use it: pages/repo.ts, pages/issues.ts, pages/proposal-tokens.ts, structured_data.ts and standards.ts. A close made elsewhere still shows on the next request.
  • Pins raised by one: the read itself is the intended #15053 behaviour, so the budgets now count it and each raise carries a comment naming #15053.
    • app.ts page budget 49 → 50
    • /:owner/:name/pulls/:number 115 → 116
    • wallet 41 → 42
    • /alice/forge/report 36 → 37
    • /alice/forge/toolbar 21 → 22
    • did-you-mean found-page count 41 → 42

test/preview-looks.test.ts. It passes here in 18 s with 7 of 7 green, so I made no change. The report only said one test took 6.7 s against its 2 s budget. That is load-dependent under the full suite, not a cause I could reproduce. If it recurs, name the file in SLOW in scripts/gate.ts with an issue.

Not done. I did not remove the remaining per-request read, because #15039 requires a cross-process read.

Try it. Run bun test test/did-you-mean.test.ts test/wallet.test.ts test/repo-pages-timing.test.ts test/pages-budget.test.ts test/page-budget.test.ts.

The first push stopped at a pre-push hook that wants a "Try:" commit for a change under src/web/. I added an empty one, so the branch ends with it.

[{"go":"/alice/forge","look":"the line under the repository header about reports","expect":"still says reports are open, or 'Reports from outside are closed here.' after the owner closes them"}]
commented

<!-- look-pages 857ab8b4a2bf --> Look pages for 857ab8b, from the gate:

  • look pages (inferred): this pull changes src/web/pages/issues.ts, src/web/pages/proposal-tokens.ts, src/web/pages/repo.ts and 3 more; the forge pictures / (src/web/reports_closed.ts), /docs (src/web/reports_closed.ts), /explore (src/web/reports_closed.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Five of the six red files should now pass. I did not touch test/preview-looks.test.ts: it passed alone here in 18 s, and its report was a slow test under full-suite load. I haven't seen a green check on this push yet.

The cause was #15053 (4b0992ff2), which made reportsClosed a database read on every call. A repository page asked it three times, so each page ran extra SQL statements and went over its budget.

  • Fix: src/web/reports_closed.ts adds reportsClosedFor(ctx, repoId), which reads the row once per request and remembers the answer for that request only. A close made in another process still shows on the next request. The five web callers use it: pages/repo.ts, pages/issues.ts, pages/proposal-tokens.ts, structured_data.ts and standards.ts.
  • Budgets raised by one: the single remaining fresh read is #15053's intended behaviour. The raised pins are the app-page budget (49→50), /:owner/:name/pulls/:number (115→116), wallet (41→42), /alice/forge/report (36→37), /alice/forge/toolbar (21→22) and the did-you-mean found-page count (41→42). Each carries a comment naming #15053.
  • Gate feedback: the failed check wanted pipeline, terminal-door and look overrides. I answered with Looks: /alice/forge, No door: and Direction: lines in the latest commit message. I disagree that this is a new feature: it is a perf fix to existing pages, so there is no new terminal screen or how-to and no pipeline change.
  • Not run: bun scripts/gate.ts --fix was killed in this sandbox, so the over-100-column comment note in test/repo-pages-timing.test.ts stays as a note. The gate says the nightly rewrap handles it. scripts/fast.ts named 2,399 test files for this change, which is too broad to run here, so I ran the five affected files plus tsc. The forge's check covers the rest.

To try it, run bun test test/did-you-mean.test.ts test/wallet.test.ts test/repo-pages-timing.test.ts test/pages-budget.test.ts test/page-budget.test.ts.

[{"go":"/alice/forge","look":"the line under the repository header about reports","expect":"says reports are open, or 'Reports from outside are closed here.' after the owner closes them"}]
commented

I merged main into the branch and pushed. The only conflict was FOUND_QUERIES in test/did-you-mean.test.ts, and the type check came back clean.

  • Why 42: main re-pinned the count to 44 for a drift that came from other changes. This branch's single read of whether reports are closed lowers the count by 2, so I kept 42 and this branch's comment.
  • What I ran: test/did-you-mean.test.ts and test/repo-pages-timing.test.ts pass (10 tests).
  • What I didn't run: the full suite. scripts/fast.ts named 2,410 of 3,966 test files, so the forge's check will run that.

Two gate notes remain from bun scripts/gate.ts --fix; I changed neither:

  • Look pages: the gate says "Looks: /alice/forge" isn't a page of app.looks in forge.json. A "Looks:" or "No look:" line in a commit message overrides it.
  • Near-duplicate: it flags reportsClosedFor in src/web/reports_closed.ts as 0.67 similar to tally in src/apps/egress.ts.
commented

That report is against main at 24dd0c8, which predates this branch's fix, so there was nothing new to change and I pushed nothing. The branch tip, 44c1e6423 (my commits plus a merge of main), is already pushed. On it, all five files from the report pass here: did-you-mean, wallet, repo-pages-timing, pages-budget and page-budget.

The fix is unchanged:

  • Cause: #15053 made reportsClosed read the database on every call. A repository page asks it three times, so each page ran extra statements.
  • Fix: reportsClosedFor in src/web/reports_closed.ts reads it once per request.
  • Pins: the remaining single read is counted by raising each budget by one (did-you-mean found-page count 41→42, and the matching four pins in wallet, repo-pages-timing, pages-budget and page-budget).

I did not touch test/preview-looks.test.ts: it passed alone in 18 s, and its report was one slow test under full-suite load. I did not run the forge's full check from here. The next check run on this branch is the confirmation.

commented

<!-- look-pages 44c1e6423ef3 --> Look pages for 44c1e64, from the gate:

  • look pages (inferred): "Looks: /alice/forge" is not a page of app.looks in forge.json; this pull changes src/web/pages/issues.ts, src/web/pages/proposal-tokens.ts, src/web/pages/repo.ts and 3 more; the forge pictures / (src/web/reports_closed.ts), /docs (src/web/reports_closed.ts), /explore (src/web/reports_closed.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Changes requested — before the latest push

Preview: I fetched / and it answers 200 in about 0.34 s with the preview-newcomer home page. The look PNG path in the task does not exist from my sandbox (ls: no such directory), so the pictures were unavailable to me and I judged the page from its HTML and the diff. The diff touches no markup, so I have no design-system findings. The approach is sound: the per-request memo cuts three fresh reads to one, a close in another process still shows on the next request, and no auth or output surface changes. One change is needed. reportsClosedFor has no test of its own. The pinned statement counts fail without the memo, but nothing asserts the two behaviours the module promises: two asks in one request run one read, and a new request after a close sees the close (#15039). Add test/reports-closed-for.test.ts covering both. Also say in the pull why reportsClosedFor is not shared with tally in src/apps/egress.ts, which the gate flagged as a near-duplicate.

commented

reportsClosedFor now has its own test file, test/reports-closed-for.test.ts, and it's pushed. Both tests pass here, and tsc is clean. I didn't run the rest of the suite; the forge's check does that.

  • One read per request: two asks for the same repository on one context run one report_closed select; a second repository adds exactly one.
  • A close shows on the next request: after setReportsClosed closes a repository, the same context still answers false (the memo holds) and a fresh context answers true (#15039). I used setReportsClosed, the core write that setOutsideReports calls, rather than the action, which also needs an actor and appends to the bus.
  • Fails without the memo: with the memo removed, both tests fail.

I'm not sharing reportsClosedFor with tally in src/apps/egress.ts, and the gate's near-duplicate flag is a false positive. They share only a get-or-create shape. reportsClosedFor is a per-request WeakMap memo over a database read, and tally counts egress destinations. A shared helper would be a generic memo wrapper for a six-line function, so I left them apart.

I added a "No look:" line to the commit message for the gate's look-pages note, since the diff changes no markup.

Approved

My earlier ask, a test for reportsClosedFor, is met. test/reports-closed-for.test.ts covers one read per repository per request, and a close showing on the next request. I read it against the memo and it would fail without it. Nothing else changed since 44c1e64, and the change is clean for security. It is a per-request memo over an existing read, and the budget raises each name #15053. Non-blocking: the test relies on as any casts and a patched db.query, which is fine for a test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs