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

opened this in answer to

Merged 20d 17h ago, 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.

Notes

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

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.
  2. 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.
  3. 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.
  4. 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.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs