Public: anyone can read this; the crew can change it.
"before/after looks" is now the gate rule that fails most checks: a missing commit-message line should not cost a check and a builder run #13364
Check · Review · Land · Live done — Landed and live in production.
The "before/after looks" rule no longer fails a check; it now prints a note. The daily count and the comment written on the pull are not done. tsc is clean, test/look-rule.test.ts passes, and the design lint is clean.
shipped production is serving it deploy 8e1361f
2 earlier comments · 1 event
The "before/after looks" rule no longer fails a check; it now prints a note. The daily count and the comment written on the pull are not done. tsc is clean, test/look-rule.test.ts passes, and the design lint is clean. I did not run any other tests, and I did not use keep_plan or estimate.
What changed
src/kernel/look_pages.ts(new): readsrouter.add("GET", …)routes insrc/http/server.tsand matches each to the module its handler comes from. A page ofapp.looksshows a changed file when its handler's static imports reach that file.:paramroutes match too.src/kernel/look_rule.ts:lookProblemsis nowlookNotesand never fails. With no commit line, the note is one of two:
- look pages (inferred): … names up to three pages and the file that reaches them.
- look pages (none): … says no page of app.looks imports the change, as with epub.ts. It asks for a Looks: line naming the nearest page or a No look: line, and the reviewer decides.
- Override:
Looks:andNo look:lines still silence the note, and a strayLooks:path is mentioned in it. scripts/gate.ts:lookRefusalbecamelookNote, runs besidewrapNote, and is dropped from the refusal list.readTuitakes a root so the gate readssrc/http,src/webandsrc/tui.- Tests:
test/look-rule.test.tsis rewritten to cover the note, route mapping, deep imports and the override.
What I did not do
- Daily count: not built. The gate runs in the check sandbox and has nowhere to keep a day's tally. Each note starts with
look pages (inferred)orlook pages (none), so a day's log can be counted by grepping those prefixes. Counting "named by the builder" needs the forge side to log it. - Pull comment: the gate does not write on the pull; the note shows in the check log. The forge side would need to post it.
- Taking the pictures: already done. The looks service pictures every page of
app.lookson each preview, so a missing commit line never held the pictures back, only the check.
Trying it
Run FORGE_CHECK_BASE=<commit> bun scripts/gate.ts on a change under src/web/. On a three-commit range that touched chapters.ts and waves.ts, it printed look pages (none) because no page of app.looks reaches them.
Direction fit: the rule stops failing the check and prints a note, which is what the title asks. Preview: no UI change; the pictures are unchanged. Changes needed, all in one round:
- Test the gate wiring.
lookNotein scripts/gate.ts and the newreadTui(cwd, root)argument have no test. Nothing fails if someone puts the look note back in the refusal list, which is the behaviour this pull exists to change. Add a test (a temp repo or an injected-diff seam) that a changed screen with no Looks line gives exit 0 and alook pagesnote. - Make the 'none' note truthful.
routeModulesonly matchesimport { named }plusrouter.add("GET", path, identifier). Inline arrow handlers (e.g./assets/:name.css), wrapped handlers, default imports andimport * asare missed silently. The note then says 'no page of app.looks imports it', which is false. Either cover those forms or word the note as 'could not infer a page', and test one unmatched form. - The
routeForfallback returns the first:paramroute that fits, so/preview-admin/sample/pulls/3can resolve to a wrong module. Prefer the most specific match (most literal segments) and test it. - The issue's other asks are not done: the daily count and the comment on the pull. Open follow-up issues for both and link them, so they are not lost.
All four changes are made and pushed. tsc is clean and 211 tests across the gate and look files pass. Running bun scripts/gate.ts on this branch exits 0. I did not run the full suite; the forge's check does.
- Gate wiring test:
- scripts/gate.ts now has an exported gateVerdict(cwd) returning { notes, refusal }, and the gate's main block uses it.
- test/gate-look-note.test.ts builds a temp repo where a page imports a changed screen and checks three things:
- lookNote gives a look pages (inferred) note naming the page.
- gateVerdict carries that note in notes and nothing look-related in refusal. Putting the rule back in the refusal list now fails this test.
- readTui(cwd, root) reads the root it is given.
- I tested the verdict, not the process exit code. A bare temp repo fails other rules (its SLOW list names tests it lacks), so its exit code can never be 0.
- Truthful "none" note:
- routeModules now also places default imports and import * as ns with ns.handler.
- A page whose route cannot be traced (inline arrow or wrapped handler) is now reported as untraced. The note says "the forge could not trace the route of … so it could not infer a page" instead of "no page imports it". A test covers an inline /assets/:name.css handler.
- On this repo several app.looks pages are untraced, e.g. /settings/crew and the /preview-admin/... pages. So "none" will usually read "could not trace" here, which is accurate.
- Most specific route:
routeFornow takes the fitting:paramroute with the most literal segments. A test checks/preview-admin/sample/pulls/3resolves to the pulls route over a generic one. - Follow-ups: I opened #13372 for the daily count and #13373 for the comment on the pull. Both are linked as waiting on #13362. The gate runs in the check sandbox and keeps no state, so both need the forge side. For now each note starts with
look pages (inferred)orlook pages (none), so a day's log can be counted by grepping.
To try it, run FORGE_CHECK_BASE=<commit> bun scripts/gate.ts on a change under src/web/. A change no app.looks page reaches prints a look pages (none) note and does not fail the check.
I changed no code this round: I merged current main into the branch and pushed, to re-run the check. The nine failures don't come from this pull, and I could not reproduce any of them here.
- Failures: eight were the
vetHostandoutboundFetchtests in shard 100. The ninth was the stranger-journey test, where the log shows the forge refusingkid--forge.test:443for egress. None of these touch what this pull changes (the look rule, the gate note andreadTui's optionalrootargument). - What I ran: the
vetHostandoutboundFetchtests pass on this branch, so I take shard 100 as load or ordering flakiness.spawn-stranger-cellis skipped in the sandbox, so I could not run the stranger journey.bun scripts/gate.ts --fixandbun x tsc --noEmitare clean. - Why the merge:
mainhad moved on by about ten commits, including two "Full suite red" fixes, so the branch was behind. After the merge the look-rule, gate-look-note and outbound-gate tests pass. - If it fails again: if the stranger journey is still red, it needs a person to look at the egress refusal and the 120s timeout, because this pull gives them nothing to fix.
Earlier asks are met. (1) Gate wiring: gateVerdict is exported and test/gate-look-note.test.ts fails if the look rule goes back into the refusal list. (2) Truthful none note: untraced routes now say "could not trace", with a test. (3) routeFor picks the most specific :param route, with a test. (4) Follow-ups #13372 and #13373 are opened. The latest round only merged main, so there is nothing new to read. The pull turns a commit-message line from a failed check into a note, which is what the issue asked. It adds no new write path, no secrets and no dependency. The change touches no page, so there is nothing to judge on the phone or desktop screenshots. The look-rule, gate and note tests pass. I could not diff against 437bf0caea4b because the commit is not in this clone, so I judged by the pull thread. Two things I would do next. Non-blocking: wire the daily count (#13372) so the share of inferred pages against none can be tracked. Non-blocking: make the common inline or wrapped routes traceable (for example /settings/crew and /preview-admin), so the none note stops saying could not trace on this repo.
The "before/after looks" rule no longer fails a check; it now prints a note. The daily count and the comment written on the pull are not done.
tscis clean,test/look-rule.test.tspasses, and the design lint is clean. I did not run any other tests, and I did not usekeep_planorestimate.What changed
src/kernel/look_pages.ts(new): readsrouter.add("GET", …)routes insrc/http/server.tsand matches each to the module its handler comes from. A page ofapp.looksshows a changed file when its handler's static imports reach that file.:paramroutes match too.src/kernel/look_rule.ts:lookProblemsis nowlookNotesand never fails. With no commit line, the note is one of two:-
look pages (inferred): …names up to three pages and the file that reaches them. -look pages (none): …says no page ofapp.looksimports the change, as withepub.ts. It asks for aLooks:line naming the nearest page or aNo look:line, and the reviewer decides.Looks:andNo look:lines still silence the note, and a strayLooks:path is mentioned in it.scripts/gate.ts:lookRefusalbecamelookNote, runs besidewrapNote, and is dropped from the refusal list.readTuitakes a root so the gate readssrc/http,src/webandsrc/tui.test/look-rule.test.tsis rewritten to cover the note, route mapping, deep imports and the override.What I did not do
look pages (inferred)orlook pages (none), so a day's log can be counted by grepping those prefixes. Counting "named by the builder" needs the forge side to log it.app.lookson each preview, so a missing commit line never held the pictures back, only the check.Trying it Run
FORGE_CHECK_BASE=<commit> bun scripts/gate.tson a change undersrc/web/. On a three-commit range that touchedchapters.tsandwaves.ts, it printedlook pages (none)because no page ofapp.looksreaches them.Closes #13362