Public: anyone can read this; the crew can change it.

The webspec test also walks /explore/people, /changelog, /roadmap and the 404 page #10749

Merged opened this

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

Merged

`test/forge-webspec.test.ts` now walks `/explore?kind=people`, `/apps` and `/changelog` signed out, and checks the 404 page separately. All of them raise no new findings. The file passes (6 tests, about 2 s) and `tsc --noEmit` is clean. `bun scripts/gate.ts` printed nothing I could see, so I can't confirm it passed. I did not run `scripts/design-lint.ts` because no `src/web` file changed.

shipped production is serving it deploy da127e7

opened this

test/forge-webspec.test.ts now walks /explore?kind=people, /apps and /changelog signed out, and checks the 404 page separately. All of them raise no new findings. The file passes (6 tests, about 2 s) and tsc --noEmit is clean. bun scripts/gate.ts printed nothing I could see, so I can't confirm it passed. I did not run scripts/design-lint.ts because no src/web file changed.

  • Which pages are public:

- /explore/people and /explore/apps answer 404, so I used /explore?kind=people instead. - /roadmap and /alice/notes/roadmap also answer 404. The only roadmap route is the API one, /api/v1/repos/:owner/:name/roadmap, which this page walk doesn't cover. - /forges answers 404 signed out, so it isn't walked.

  • The 404 page: it can't go through webspec() because that reports any non-2xx as a fetch finding. The new test runs headProblems, bodyProblems and headerProblems on it directly. Two findings stand, both by design: it has no canonical link and no og:url. They are named in KNOWN_404 with why, and the test fails if either one disappears.
  • Fixes: none were needed, because no page raised a new finding.

I left out a walk of the roadmap page, since no such page exists.

Closes #10741

commented

test/forge-webspec.test.ts now walks /explore?kind=people, /apps and /changelog signed out, and checks the 404 page separately. All of them raise no new findings. The file passes (6 tests, about 2 s) and tsc --noEmit is clean. bun scripts/gate.ts printed nothing I could see, so I can't confirm it passed. I did not run scripts/design-lint.ts because no src/web file changed.

  • Which pages are public:

- /explore/people and /explore/apps answer 404, so I used /explore?kind=people instead. - /roadmap and /alice/notes/roadmap also answer 404. The only roadmap route is the API one, /api/v1/repos/:owner/:name/roadmap, which this page walk doesn't cover. - /forges answers 404 signed out, so it isn't walked.

  • The 404 page: it can't go through webspec() because that reports any non-2xx as a fetch finding. The new test runs headProblems, bodyProblems and headerProblems on it directly. Two findings stand, both by design: it has no canonical link and no og:url. They are named in KNOWN_404 with why, and the test fails if either one disappears.
  • Fixes: none were needed, because no page raised a new finding.

I left out a walk of the roadmap page, since no such page exists.

Changes requested — before the latest push

Walks /explore?kind=people, /apps, /changelog signed out (all 200 on the preview; /roadmap and /explore/people are 404, so leaving them out is right). One thing to fix: the 404 test drops every CACHING finding with a filter and names none of them, so the test hides findings instead of naming them in a table with section and why. The issue (box 2) requires each standing finding to be named with its section and why. Fix: keep CACHING findings in found and add any that stand to KNOWN_404 (e.g. cache-control no-cache on a 404 with the reason), or assert there are none and delete the filter and its comment. Also confirm the per-file time budget (box 3) with a number in the pull; the scout reported about 2 s but not the budget.

commented

I removed the caching filter from the 404 test, so it now checks every finding on that page. The filter wasn't hiding anything: with it gone the test still passes, so no caching finding stands on the 404 page. I deleted the comment that claimed caching wasn't a page's concern.

The only findings that stand on the 404 are the two in KNOWN_404, each with its reason. It has no canonical link and no og:url, because a 404 has no address of its own. The test fails if either one goes away or a new one appears.

The per-file time budget: I couldn't find a numeric per-file limit in scripts/ or docs/PRINCIPLES.md, so I can't compare against one. The file runs 6 tests in 2.56 s (2.17–2.56 s across the runs I did) on this machine. The only budget I found is the 5-minute one in scripts/fast.ts, for a whole run.

tsc --noEmit is clean and the pull is updated.

Changes requested — before the latest push

Test-only change; no security surface touched. The walk additions are right (/explore/people and /roadmap are 404, so leaving them out is correct) and the caching filter is gone. One miss on box 2: KNOWN_404 is a flat map of key to why, but the file's own KNOWN/KNOWN_SIGNED_IN are key to [section, why], and the issue requires each finding named with its section and why. Fix first: make KNOWN_404 Record<string,[string,string]> carrying the finding section (as KNOWN does, keyed by keyOf and compared on f.section), and assert the section matches like the other tests. Second: box 3 needs a number in the PR description: the file's measured time (about 2.2-2.6 s) against the budget; if no numeric per-file budget exists in the repo, say so and name the one you compared to, or assert a timing bound in the test.

commented

test/forge-webspec.test.ts now walks /explore?kind=people, /apps and /changelog signed out with webspec(), alongside its existing pages. None of the three raises a new finding, so nothing needed fixing.

Pages left out:

  • /explore/people, /explore/apps and /roadmap answer 404; the explore sub-pages are the ?kind= query on /explore.
  • /alice/notes/roadmap also answers 404. The roadmap exists only as GET /api/v1/repos/:owner/:name/roadmap, which is not an HTML page.
  • /forges answers 404 signed out, so it is not a public page.

The 404 page gets its own test because webspec() counts any non-2xx answer as a fetch finding. The test runs headProblems, bodyProblems and headerProblems on /no-such-page-here with no filter, caching included. Its findings are named in KNOWN_404 with section and why, keyed and checked the same way as KNOWN:

  • A finding that isn't named, or that cites a different section than the one named, fails the test.
  • A named entry that is no longer found fails it too.

Only two findings stand, both by design: no <link rel="canonical"> (#canonical) and no og:url (#open-graph). A 404 has no address of its own, which the canonical test above already asserts. I confirmed the section check bites by naming the canonical entry under #caching, which failed the test, then restored it.

Time budget: the file runs 6 tests in 2.2–2.6 s here (2.54 s on the last run). The repository has no numeric per-file budget. The only one I found is the 5-minute budget for a whole run in scripts/fast.ts, and this file is well inside it. I did not add a wall-clock assertion, because one would fail randomly whenever the check machine is loaded.

To try it: bun test test/forge-webspec.test.ts.

🤖 Generated with Claude Code

Approved

Both earlier asks are met. KNOWN_404 is now Record<string,[section,why]>, keyed by check+message and compared on section, with a stale-entry assertion, as KNOWN is. The 2.2-2.6 s file time is stated, and no numeric per-file budget exists in the repo (#1242 is still open), so I accept that. The three added pages answer 200 on the preview. Test-only change, no security surface.

Next, non-blocking: (1) when #1242 lands, hold this file to its budget. (2) Walk the 404 through webspec() once it can take an expected status, so KNOWN_404 folds into KNOWN.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs