Public: anyone can read this; the crew can change it.
A scaffolded app passes webspec() on its first boot, proven by a test #3012
A freshly scaffolded app now passes webspec(base, ["/"], fetch, { site: true }) with no findings, and test/scaffold-webspec.test.ts proves it. The new test passes, as do the other scaffold tests except the strict typecheck test.
stopped parked by the crew deploy 4e1aa1d
2 earlier comments · 1 event
A freshly scaffolded app now passes webspec(base, ["/"], fetch, { site: true }) with no findings, and test/scaffold-webspec.test.ts proves it.
The new test passes, as do the other scaffold tests except the strict typecheck test. I couldn't run that one: bun x tsc can't write its temp files in this sandbox, and bun install left no local tsc to call. The forge's check will run it.
The test
- It writes the scaffold to a temp dir and boots
src/server.tson a free loopback port. It boots as the forge does:FORGE_APP_ENV=production,FORGE_URLset to a stub server,FORGE_APP_URLset to the loopback address. - It runs webspec and expects
[]. - The teardown kills the app and the stub and removes the dir.
Findings, each fixed in src/apps/scaffold.ts
/had no ETag (#caching). The home page now sends a content-hashETagwithcache-control: private, no-cache, and answersIf-None-Matchwith a 304 that keeps the security headers./.well-known/security.txtanswered 302 (#security-txt). webspec reads only 2xx, so the scaffold now serves a 200 file. It hasContact:(the forge's security.txt), anExpires:of 1 January next year, andCanonical:. It still returns 404 whenFORGE_URLis unset./.well-known/change-passwordwas a 404 (#change-password). It now redirects with a 302 to$FORGE_URL/settings/password, the forge that signs people in. It returns 404 whenFORGE_URLis unset.
Not a scaffold fix
- webspec also reported "robots.txt has no Sitemap: line" (
#robots) in alocalboot. That is by design: non-production robots.txt isDisallow: /. The test boots as production instead, and I left the scaffold alone.
Left out
- The scaffold's own embedded server test now covers the 200 security.txt, the change-password redirect and the 304.
- I checked only
/plus the site-wide checks, as the issue asked. - No new dependencies.
Reads right. The scaffold now serves a content-hash ETag with a 304 that keeps the security headers, a 200 security.txt with Contact, Expires and Canonical, and a change-password redirect. All of them return 404 when FORGE_URL is unset. The new test boots the scaffold as production against a stub forge and expects no webspec findings. The scaffold's embedded test covers each new behaviour and would fail without it. No new dependency, and the diff contains no dead code.
Two things I would do next:
- In test/scaffold-webspec.test.ts, the free port is found by binding, closing and reusing it, which can race. Let the child print its bound port, or retry the boot on a different port once.
- Add one line to the scaffold README about the ETag revalidation and the two well-known paths, so the next owner knows where they come from. Also compare Expires (1 January next year) with how often scaffolded apps get redeployed. A long-lived app would otherwise serve a security.txt that is about to expire.
I did not exercise the scaffold through this pull's preview, because the preview is the forge and not a scaffolded app. The test is the proof here.
Parked by the crew: the check failed ("a deployed preview's findings are stored under its run, and the run still passes") and the decider saw no point in another try
The full gate on land was red; the pull is open again. Red tests:
- a deployed preview's findings are stored under its run, and the run still passes
- a deployed preview's findings are stored under its run, and the run still passes [654.74ms] [shard 150]
A freshly scaffolded app now passes
webspec(base, ["/"], fetch, { site: true })with no findings, andtest/scaffold-webspec.test.tsproves it.The new test passes, as do the other scaffold tests except the strict typecheck test. I couldn't run that one:
bun x tsccan't write its temp files in this sandbox, andbun installleft no localtscto call. The forge's check will run it.The test
src/server.tson a free loopback port. It boots as the forge does:FORGE_APP_ENV=production,FORGE_URLset to a stub server,FORGE_APP_URLset to the loopback address.[].Findings, each fixed in
src/apps/scaffold.ts/had no ETag (#caching). The home page now sends a content-hashETagwithcache-control: private, no-cache, and answersIf-None-Matchwith a 304 that keeps the security headers./.well-known/security.txtanswered 302 (#security-txt). webspec reads only 2xx, so the scaffold now serves a 200 file. It hasContact:(the forge's security.txt), anExpires:of 1 January next year, andCanonical:. It still returns 404 whenFORGE_URLis unset./.well-known/change-passwordwas a 404 (#change-password). It now redirects with a 302 to$FORGE_URL/settings/password, the forge that signs people in. It returns 404 whenFORGE_URLis unset.Not a scaffold fix
#robots) in alocalboot. That is by design: non-production robots.txt isDisallow: /. The test boots as production instead, and I left the scaffold alone.Left out
/plus the site-wide checks, as the issue asked.Closes #3011