Public: anyone can read this; the crew can change it.
A production that is not serving is skipped by the look sweep with its reason, never pictured through a public name #16687
Check · Review · Land · Live done — Landed and live in production.
The sweep now skips an app that isn't serving: no browser starts, and each look row records not serving as its reason. tsc is clean and test/looks.test.ts, test/look-browser-start.test.ts and test/look-backoff.test.ts pass, except for the real-Chromium capture test.
shipped production is serving it deploy 354c752
1 earlier comment · 1 event
The sweep now skips an app that isn't serving: no browser starts, and each look row records not serving as its reason. tsc is clean and test/looks.test.ts, test/look-browser-start.test.ts and test/look-backoff.test.ts pass, except for the real-Chromium capture test. That test needs the sandbox's Chromium and fails the same way on a clean checkout, so the forge's check will have to cover it.
- The skip (
src/looks/service.ts): before it opens a browser, the look probes the app's own port. A 404 or any 5xx now counts asnot serving, where before only 5xx counted and a 404 was pictured. - Silence stays as it was: an app that never answers still records the old
NOT_ANSWERINGreason. A skipped look goes through the existing doubling retry (failed(item)). - Reused: the existing
answered()poll andappAnswersprobe. The test seamanswersnow may also returnNOT_SERVING. - The target (
src/looks/capture.ts): the browser's host-resolver rule now maps the app's name to loopback and makes every other name fail to resolve (MAP * ~NOTFOUND, EXCLUDE 127.0.0.1). A bounce to an https public name now fails there instead of reaching a different server and producingERR_CERT_AUTHORITY_INVALID. The capture flow itself is unchanged. - Tests: a new test in
test/looks.test.tschecks that a 404 app gets no capture andnot servingon every row, and that a serving app is still pictured. The flag assertion intest/look-browser-start.test.tsnow expects the new rule string.
Left out:
- Other statuses: 401, 403 and redirects still count as serving, since a private app answers them.
- Hop test: no test drives a real https bounce through Chromium, because the sandbox can't run one.
- Wait before skipping: a 404 app is probed for the same 5 s window as a warming-up one before it is skipped, so a slow start isn't skipped by mistake.
To try it: point a production at a page that returns 404 and run a sweep. Its looks show not serving and no browser starts.
🤖 Generated with Claude Code
The skip and the resolver rule are the right shape, but box 3 is not met: no test fails if the 404 mapping is removed.
Fix first: the new test injects async () => NOT_SERVING through the answers seam, so it never runs appAnswers, which holds the only change that makes a 404 count as not serving (res.status === 404 || res.status >= 500). Delete that line's 404 clause and the test stays green. Add a test that starts a real Bun.serve answering 404 on a loopback port and checks that startLooks with no answers override (or appAnswers exported and called directly) records not serving and starts no browser. Add a 200 case to the same server so a serving app is still pictured through the real probe.
Smaller:
- In
test/look-browser-start.test.tstheexpect(flags).toContain(...)line is now over the wrap width. Runbun scripts/gate.ts --fixand commit what it rewraps. - The
NOT_SERVINGdoc comment insrc/looks/service.tsis a single long line. Rewrap it. - Box 2 rests on a Chromium rule string that nothing exercises. At minimum, add one assertion that
lookFlagsends the rules withEXCLUDE 127.0.0.1, so the DevTools port cannot be cut off by a later edit. Say in the pull that the real https bounce was not run.
Not a change request: 401, 403 and redirects staying serving is right for a private app.
I've pushed changes for each point in the review. tsc is clean and the targeted tests pass, apart from the real-Chromium capture test, which fails the same way on a clean checkout in this sandbox. The forge's check will have to cover it.
- Real probe test: the new
test/look-probe.test.tsrunsappAnswers, now exported, against real loopbackBun.serveservers.- A 404 and a 503 return
NOT_SERVING. - A 200 and a 302 return
true. - A closed port returns
false, so silence still records the oldNOT_ANSWERING. - Deleting the 404 clause in
appAnswersnow fails that test.
- A 404 and a 503 return
- Resolver rule: the same file asserts that
lookFlagsends its host-resolver rules withEXCLUDE 127.0.0.1and containsMAP * ~NOTFOUND, so a later edit can't cut off the DevTools port. - Wrapping: I rewrapped the
NOT_SERVINGcomment and the longtoContainline by hand, becausegate.ts --fixchanged nothing in either file. The gate also reports a 0.73 similarity betweenansweringTrialandtrialintest/looks.test.ts, which I left alone. - Not done: I did not drive the
answers-free path throughstartLooksitself. That test still injectsanswersand covers the wiring: a not-serving verdict recordsnot servingand starts no browser. The real probe is tested separately intest/look-probe.test.ts. RunningstartLooksend to end against a real server would need a runtime whoseenvStatusport points at that server, which the existing fixture doesn't offer. - Not run: the real https bounce through Chromium was not run here. The resolver rule is covered only by the string assertions above.
Both earlier asks are met. The real probe is now tested against loopback servers: 404 and 503 give not serving, 200 and 302 give serving, and a closed port gives silence. The resolver rule keeps EXCLUDE 127.0.0.1, so DevTools stays reachable, and a test pins that. I found nothing new in the lines that changed since 08f114ef303a. I did not run a real https bounce through Chromium, so the resolver rule is covered by its flag assertions only. Two things I would do next, both non-blocking: (1) Non-blocking: drive startLooks without the answers seam against a real 404 server, once the fixture can point envStatus at one. (2) Non-blocking: the answeringTrial and trial helpers in test/looks.test.ts are 0.73 similar, so fold them into one.
The sweep now skips an app that isn't serving: no browser starts, and each look row records
not servingas its reason.tscis clean andtest/looks.test.ts,test/look-browser-start.test.tsandtest/look-backoff.test.tspass, except for the real-Chromium capture test. That test needs the sandbox's Chromium and fails the same way on a clean checkout, so the forge's check will have to cover it.src/looks/service.ts): before it opens a browser, the look probes the app's own port. A 404 or any 5xx now counts asnot serving, where before only 5xx counted and a 404 was pictured.NOT_ANSWERINGreason. A skipped look goes through the existing doubling retry (failed(item)).answered()poll andappAnswersprobe. The test seamanswersnow may also returnNOT_SERVING.src/looks/capture.ts): the browser's host-resolver rule now maps the app's name to loopback and makes every other name fail to resolve (MAP * ~NOTFOUND, EXCLUDE 127.0.0.1). A bounce to an https public name now fails there instead of reaching a different server and producingERR_CERT_AUTHORITY_INVALID. The capture flow itself is unchanged.test/looks.test.tschecks that a 404 app gets no capture andnot servingon every row, and that a serving app is still pictured. The flag assertion intest/look-browser-start.test.tsnow expects the new rule string.Left out:
To try it: point a production at a page that returns 404 and run a sweep. Its looks show
not servingand no browser starts.🤖 Generated with Claude Code
Closes #16256