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

A public page prints the morning paper's latest edition date, so the v1 probe can prove schedules ran #15394

Merged opened this

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

Merged

GET /edition is a new public, anonymous page that prints when the newest morning paper ran, as . docs/OPERATING.md now names it as the --edition URL. Passing checks: test/edition.test.ts (new), test/doorless.test.ts, test/dotfiles-route.test.ts and the robots tests pass.

Notes

shipped production is serving it deploy 3fede26

opened this

GET /edition is a new public, anonymous page that prints when the newest morning paper ran, as <time datetime="2026-…Z">. docs/OPERATING.md now names it as the --edition URL.

Passing checks:

  • test/edition.test.ts (new), test/doorless.test.ts, test/dotfiles-route.test.ts and the robots tests pass.
  • bun x tsc --noEmit and bun scripts/gate.ts are clean.
  • I did not run the wider suite: scripts/fast.ts named 3,301 test files, so I left that to the forge's check.

What changed

  • src/core/edition.ts reads the newest last_at across every person's paper row in talk_routine.
  • src/http/edition.ts renders it with the lean page. The page shows only that instant, with no thread id, names or text, and <time> uses the shared time() helper. Before any paper has run it says so and prints no <time>.
  • The route is added in src/http/server.ts and cached for 60 seconds.
  • test/edition.test.ts fails if the stamp is missing, if the page redirects or asks for sign-in, or if it shows another routine's time or the thread id.

Left alone

  • scripts/v1-probe.ts in this tree has no --edition flag, because #15390 is not on this branch. I did not add it. I did not run the probe against the preview either.
  • There is no terminal screen or feature doc. The commit says No door: and No look: with reasons, since this is a machine-read timestamp and no existing page changed.
  • I did not call keep_plan or estimate: neither was among my tools.

Try it: open /edition signed out on the preview. Once a paper has run, it prints the <time>.

🤖 Generated with Claude Code

Closes #15393

3 earlier comments · 1 event
commented

/edition is now registered everywhere the forge checks a new page, and the seven test files behind the check's failures pass locally (67 tests). I ran those seven files plus bun x tsc --noEmit, and scripts/gate.ts --fix changed nothing. I did not run the full suite; the forge's check does that on this push.

The first commit added the page but skipped the places that list every page:

  • Route marks: added src/http/marks/edition.json, marking /edition as open.
  • Reserved names: added edition to src/core/reserved.ts, so no profile can take it.
  • Design audit: /edition is now on the not-a-page list in test/design-audit.test.ts, since it is a bare timestamp page rather than a designed screen. That keeps it out of docs/design/audit.md and leaves the page count at 119.
  • Looks: /edition is on the not-a-page list in test/forge-looks.test.ts, with a note that test/edition.test.ts covers it.
  • Server-Timing: src/http/edition.ts now names session and render phases. I did this instead of adding the page to the sweep's debt list.

The ten "landing past a broken gate" failures were in test/gate-bypass.test.ts. They did not reproduce locally after these fixes, and I did not trace them separately.

commented

/edition now carries a weak ETag and a Last-Modified date, so a repeat read gets an empty 304. That was the failing /edition case in test/etag.test.ts. The tag is built from the newest run's timestamp, and the 304 reuses the page's own headers and securityFloor.

test/etag.test.ts, test/edition.test.ts, test/gate-bypass.test.ts and the blob tests pass locally (196 tests), and bun x tsc --noEmit is clean. The nine "landing past a broken gate" failures and the blob-switch failure did not reproduce here, and I made no change aimed at them. I did not run the full suite.

I did not fold the process boot id into the tag the way pageTag does. A deploy that changes the page's markup while the newest run stays the same could therefore answer 304 to a copy drawn by the older build, until the next run changes the tag.

Changes requested — before the latest push

The preview answers 200 and the page leaks only a timestamp, but two things need fixing in one round.

  1. ETag staleness (medium, fix first): the tag is built only from the newest run instant, with no build id. After a deploy that changes the markup, a client holding the old copy gets a 304 until the next paper runs. Fold the boot id in as pageTag does. Add a test that a different build id changes the tag.
  2. Missing tests: nothing covers the 304 path (If-None-Match returns an empty 304 that still carries the security floor headers), the Cache-Control header, or latestEdition ignoring a malformed last_at and returning null. Add them to test/edition.test.ts.
  3. Both doors: there is no src/tui/ screen or docs/features/edition.md. Either add them, or state in the pull why a probe-only timestamp page is exempt. The OPERATING.md note is fine, but it is not a feature how-to.
  4. Clean: readFlash and taggable are imported only to gate caching. Keep that gate, and say why an anonymous-only page needs the flash check.
commented

The /edition ETag now folds in the build id. I added the missing tests and a short feature note, and pushed to the same branch. bun x tsc --noEmit is clean and test/edition.test.ts passes (5 tests). bun scripts/gate.ts --fix rewrapped comments in one file, and that rewrap is in the commit. I did not run the full suite; the forge runs it on this push.

  • ETag staleness: editionTag(at, boot) in src/http/edition.ts builds the tag from the boot id and the newest run instant. The boot id is the same one pageTag uses; I exported it from src/web/page_tag.ts as BOOT. A new build no longer answers 304 to an old render.
  • Tests: test/edition.test.ts now covers the following.
    • A held If-None-Match returns an empty 304 that still carries X-Content-Type-Options, Referrer-Policy and Content-Security-Policy.
    • Cache-Control is public, max-age=60.
    • A different build id changes the tag, and so does a newer paper.
    • latestEdition ignores a malformed last_at and returns null.
  • Both doors: I added docs/features/edition.md. I did not add a src/tui/ screen, because the page exists only so an outside probe can read a timestamp, and the terminal already shows the paper itself.
  • Flash and taggable gate: kept, with a comment saying why. The page has no signed-in content of its own, but a signed-in reader or a flash notice drawn from the request cookie sees bytes that are theirs. Those responses are never tagged.
commented

I removed docs/features/edition.md and pushed (510be2f89). The gate now passes in the sandbox, and I have not seen the forge's re-run of the check yet.

The gate caps a feature that goes ahead of the pipeline at two added feature files. Mine added three: src/core/edition.ts, src/http/edition.ts and the new docs/features/edition.md. I dropped the doc because it was the only one of the three I had added in response to review rather than to the issue.

This undoes sentinel's request for a feature how-to. The OPERATING.md note now carries what the doc said: /edition prints the newest run, the ETag holds the run and the build, and signed-in and flash responses are never tagged. It is not a standalone how-to. The src/tui/ screen is still not added, because the page exists only so the v1 probe can read a timestamp.

Splitting the pull would have been the other way out, but it is one purpose. I did not re-run the tests this round: the diff only removes the doc and edits OPERATING.md, and test/edition.test.ts passed on the previous commit.

Approved

Approved. I opened the preview and saw what it serves: GET /edition answers 200 with an h1, one sentence and one <time datetime="2026-11-21T07:00:28.312Z"> (12h ago), the security headers present, no thread text, no sign-in. The screenshot files are not on disk in my sandbox, so the look is judged from that served markup: a bare heading and sentence, no accent, no boxes. Earlier asks: the ETag/build staleness and the tests are met. The feature how-to and a src/tui/ screen are not added. The doc went because the gate caps pipeline-ahead pulls at two feature files, and OPERATING.md carries its content. The page exists only for the v1 probe, so I accept both. Non-blocking: the public Cache-Control is also set on signed-in or flash responses that are never tagged; make it private there.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs