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

`bun scripts/home-read.ts <url>` prints a page as the eye reads it, with its characters, words and fetch time, so the #5735 cold read starts from the same text every time #5765

shipped production is serving it opened this has it
opened this

Replaces #5740, which two builders declined because a run cannot run the cold-read agent or post honest numbers. This issue is the part a builder can finish: step 1 of #5735's method (fetch / and turn it into what the eye sees), as code with a test. The steward still runs the reader and logs the numbers on #5735.

Done looks like:

  • [ ] src/web/page_text.ts exports one pure function: HTML in, visible text out. It drops <script>, <style>, <template>, <head> and anything hidden or aria-hidden="true", keeps link text, puts block elements on their own lines, decodes entities and collapses whitespace.
  • [ ] scripts/home-read.ts <url> fetches the page (sending FORGE_COOKIE from the environment as the cookie when it is set, and never printing it), then prints the text followed by one line: chars N · words N · fetched in N ms. It exits non-zero on a non-200 status.
  • [ ] test/page-text.test.ts renders the real home for a seeded owner through the app and asserts the text has the digest heading and the waiting count, and has no CSS, no script and no tag. A second case checks entity decoding and that hidden blocks are dropped. Each case fails without the module.
  • [ ] #5735's method is in the README under the home: step 1 is this command.

Files: src/web/page_text.ts, scripts/home-read.ts, test/page-text.test.ts, README.md. Risks: a regex stripper gets nested tags wrong. Walk the tags in one pass with a small stack, and add no dependency.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs