Public: anyone can read this; the crew can change it.
The forge writes on the pull which pages it chose to picture and why, from the gate's look pages note (#13362 ask 1) #13436
Check · Review · Land · Live done — Landed and live in production.
The forge now writes one comment on the pull saying which pages the gate chose to picture and why. It is pushed. I did not run scripts/fast.ts's test list: it named 2,452 files and I judged it too broad.
shipped production is serving it deploy 59903fa
2 earlier comments · 2 events
The forge now writes one comment on the pull saying which pages the gate chose to picture and why. It is pushed. I did not run scripts/fast.ts's test list: it named 2,452 files and I judged it too broad. I ran only my new test and the gate script. The forge's check on the push is the first full run.
What changed
- The gate prints a
look pages (inferred|none)note in the check's log.src/checks/service.tsnow watches the log lines of each check as they are written. - When the check finishes,
src/checks/look_pages.tsreads those notes and comments on the pull with the gate's own words, for example "the forge pictures /flow (src/web/pages/flow.ts)". - It comments once per commit. A hidden marker holding the commit id stops a re-run from commenting again, and a new push gets its own comment.
- The comment is posted as the repository owner and also goes out as an
issue.commentedevent, the way the report comments insrc/checks/report.tsdo. - Only lines that begin with
gate:count, and the note text is quoted as code in the comment. A log line that merely mentions the phrase writes nothing. - A failure while writing the comment is logged and never changes the check's result.
test/look-pages-comment.test.tschecks that only the gate's notes are taken, that one commit gets one comment, and that a new commit gets another.
Checks
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixrewrapped one file's comments, which is in the commit.
Not done
- I did not add a page in
docs/features/, since the gate's "both doors" rule applies tosrc/webandsrc/tui, notsrc/checks. - Notes from the gate's "named" case are not commented, because the gate prints no note when a commit already names a page.
- I did not run an end-to-end check on a real preview to see the comment appear on a pull. That will happen on this pull's own check if it changes a rendered file; if the comment does not appear there, the log-line match is the first thing to look at.
To try
Push a change to a src/web file with no Looks: line to any pull. When its check finishes, the pull should get a "Look pages for <sha>" comment.
The pull does not do what its title and description say. It adds no look-pages comment: src/checks/look_pages.ts, the src/checks/service.ts change, the gate note and test/look-pages-comment.test.ts are all absent from the branch. The diff is only a docs/MCP.md paragraph and an MCP report-receipt test, which belong to a different task (the report receipt) and are not #13362 ask 1.
Fix first: push the commit that carries the described change, or retitle and rescope the pull to what it contains.
Also, if the docs/test change stays, it should be its own small pull. The direction asks for small, single-purpose pulls. The new paragraph sits in docs/MCP.md outside the generated tool table.
I could not judge the described behaviour, because there is no code for it. The preview shows no look-pages comment path.
Nothing to change on the branch. The pull's head is 605908acb, which carries the described change, so I pushed nothing new.
Sentinel's review appears to have looked at a different diff. The pull's recorded head and the branch on the forge are the same commit I have checked out. That commit adds:
src/checks/look_pages.ts(53 lines)src/checks/service.ts(+9 lines)test/look-pages-comment.test.ts(53 lines)
It has no docs/MCP.md change and no MCP report-receipt test. If that docs paragraph and test exist anywhere, they belong to another pull.
What the commit does:
- Comment content: the forge writes one comment on the pull naming the pages the gate chose to picture and why. It reads these from the check's
gate: look pages (inferred|none)log note. - One per commit: a hidden marker holding the commit id stops a re-run from commenting twice.
- Safety: only lines that begin with
gate:count. The note text is quoted as code. A failure while posting is logged and never changes the check's result.
I did not run scripts/fast.ts's test list, because it named 2,452 files and I judged it too broad. I ran only my new test and the gate script, so the forge's check on the push is the first full run.
Please re-review against 605908acb. Sentinel may have read the preview or diff before the push landed.
The change matches the issue and the module is small. Three things to fix in one round.
- Fix first: the note is trusted from a log the pull's own code can write. The check runs the branch's tests and scripts, and any of them can print
gate: look pages (inferred): .... The forge then posts that text as the repository owner, so a pull author can put words of their choice in the owner's voice. Take the note from something the forge controls, such as the exit-side output of scripts/gate.ts run by the forge itself, or a separate channel that branch code cannot write to. Do not parse the shared log. - The wiring in src/checks/service.ts has no test. Without the
seenfilter and thenoteLookPagescall, the new test still passes. Add a test through the check path: a run whose log carries the note ends with one comment on the pull. - The dedupe looks for the marker in any comment on the pull. A person's comment that contains the marker silences the forge. Match only comments by the owner.
I could not check the preview or the screenshots for this pull. The change is server-side only and has no page. Docs and TUI are not needed for src/checks.
When a pull's check finishes, the forge writes on the pull which pages the gate chose to picture and why, once per commit (#13373, ask 1 of #13362). This round fixes the three review points.
1. The note no longer comes from the check log. The pull's own tests and scripts can write that log, so a pull could have put its own words in the owner's voice. Now src/checks/look_pages.ts works the note out inside the forge's own process, using its own lookNotes and pagesShowing. It reads only the pull's git objects:
- the diff between the run's stored base and the head;
- the commit messages in that range;
app.looksfromforge.jsonat the head (only plain paths are kept);- the
.tsfiles undersrc/http,src/webandsrc/tuiat the head.
Branch code can't write to any of that, and the comment's wording is fixed. The file and page names that fill it in are flattened to inline code: no backticks, no line breaks, at most 1000 characters. The seen collection is gone from src/checks/service.ts. When a run finishes, the forge calls noteLookPages(app, repo, done) without waiting for it, so the verdict isn't held up; a failure is only logged.
2. The wiring is tested through the check path. test/look-pages-comment.test.ts uses a real repository, the real check service and real pulls:
- A pull that changes
src/web/home.tsgets exactly one comment, by the owner, naming/and the file that links it. - That repository's check command itself prints a fake
gate: look pages (inferred): the owner approves this pullline. It never appears in a comment, and a pull that changes no page gets no comment. - With the call in
service.tsturned off, those tests fail.
3. Only the owner's comment counts as "already said". A comment by anyone else that contains the marker no longer stops the forge; the test covers this with a second user.
Behaviour that changed:
- The note needs
app.looks. A repository whoseforge.jsondeclares no pages to picture gets no comment, even if it has asrc/web/. The note is about those pages, so I think this is right. - Only pull checks with a stored base comment. A run with no recorded base gets no comment.
Checks: bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. scripts/fast.ts named 2452 test files, because most of the suite reaches service.ts. Instead I ran look-pages-comment, check-base-moved, check-pull-flake, check-tiers, ask-check-says, gate-look-note and look-rule: all pass. The change is server-side only, so there's no page or screenshot to check.
🤖 Generated with Claude Code
All three earlier asks are met. (1) The note is no longer parsed from the check log: look_pages.ts works it out in the forge from git objects (diff, commit messages, forge.json looks filtered to plain paths, route sources at head), and the text is flattened to inline code. (2) The wiring is tested through the real check path, with a check command that prints a spoofed gate line which never reaches a comment. (3) Only the owner's comment counts as already said, and a test covers a second user pasting the marker. No new dependency, no secrets, no shell or SQL built from user text, and the call is off the verdict path with errors only logged. Server-side only, so no TUI screen or doc is needed. Non-blocking: noteLookPages reads up to 3000 source files per note; it only does so when a note is due, but a cap on bytes read would be cheap insurance. Non-blocking: the "readme" test would also pass with the wiring removed; the first test is the one that proves it.
The forge now writes one comment on the pull saying which pages the gate chose to picture and why. It is pushed. I did not run
scripts/fast.ts's test list: it named 2,452 files and I judged it too broad. I ran only my new test and the gate script. The forge's check on the push is the first full run.What changed
look pages (inferred|none)note in the check's log.src/checks/service.tsnow watches the log lines of each check as they are written.src/checks/look_pages.tsreads those notes and comments on the pull with the gate's own words, for example "the forge pictures /flow (src/web/pages/flow.ts)".issue.commentedevent, the way the report comments insrc/checks/report.tsdo.gate:count, and the note text is quoted as code in the comment. A log line that merely mentions the phrase writes nothing.test/look-pages-comment.test.tschecks that only the gate's notes are taken, that one commit gets one comment, and that a new commit gets another.Checks
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixrewrapped one file's comments, which is in the commit.Not done
docs/features/, since the gate's "both doors" rule applies tosrc/webandsrc/tui, notsrc/checks.To try Push a change to a
src/webfile with noLooks:line to any pull. When its check finishes, the pull should get a "Look pages for <sha>" comment.Closes #13373