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

Merged opened this in answer to

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

Merged

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.

Notes

shipped production is serving it deploy 8e1361f

opened this

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): reads router.add("GET", …) routes in src/http/server.ts and matches each to the module its handler comes from. A page of app.looks shows a changed file when its handler's static imports reach that file. :param routes match too.
  • src/kernel/look_rule.ts: lookProblems is now lookNotes and 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: and No look: lines still silence the note, and a stray Looks: path is mentioned in it.
  • scripts/gate.ts: lookRefusal became lookNote, runs beside wrapNote, and is dropped from the refusal list. readTui takes a root so the gate reads src/http, src/web and src/tui.
  • Tests: test/look-rule.test.ts is 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) or look 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.looks on 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.

Closes #13362

2 earlier comments · 1 event
commented

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): reads router.add("GET", …) routes in src/http/server.ts and matches each to the module its handler comes from. A page of app.looks shows a changed file when its handler's static imports reach that file. :param routes match too.
  • src/kernel/look_rule.ts: lookProblems is now lookNotes and 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: and No look: lines still silence the note, and a stray Looks: path is mentioned in it.
  • scripts/gate.ts: lookRefusal became lookNote, runs beside wrapNote, and is dropped from the refusal list. readTui takes a root so the gate reads src/http, src/web and src/tui.
  • Tests: test/look-rule.test.ts is 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) or look 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.looks on 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.

Changes requested — before the latest push

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:

  1. Test the gate wiring. lookNote in scripts/gate.ts and the new readTui(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 a look pages note.
  2. Make the 'none' note truthful. routeModules only matches import { named } plus router.add("GET", path, identifier). Inline arrow handlers (e.g. /assets/:name.css), wrapped handlers, default imports and import * as are 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.
  3. The routeFor fallback returns the first :param route that fits, so /preview-admin/sample/pulls/3 can resolve to a wrong module. Prefer the most specific match (most literal segments) and test it.
  4. 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.
commented

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.

  1. 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.

  1. 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.

  1. Most specific route: routeFor now takes the fitting :param route with the most literal segments. A test checks /preview-admin/sample/pulls/3 resolves to the pulls route over a generic one.
  2. 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) or look 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.

commented

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 vetHost and outboundFetch tests in shard 100. The ninth was the stranger-journey test, where the log shows the forge refusing kid--forge.test:443 for egress. None of these touch what this pull changes (the look rule, the gate note and readTui's optional root argument).
  • What I ran: the vetHost and outboundFetch tests pass on this branch, so I take shard 100 as load or ordering flakiness. spawn-stranger-cell is skipped in the sandbox, so I could not run the stranger journey. bun scripts/gate.ts --fix and bun x tsc --noEmit are clean.
  • Why the merge: main had 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.
Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs