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

Every forge page carries og:title, og:description, og:image and twitter:card, and a private page reveals only its title and 'private' #2379

Parked opened this
Closed without merging

Every page now carries og:title, og:description, an og:image that answers 200 image/png, and twitter:card=summarylargeimage. A private repository does not say "private" to an anonymous reader, though, for the reason below. I ran tsc and the og suites, standards and card-shell; the forge's check runs the rest.

Notes

stopped parked by the crew deploy 7a6815c

opened this

Every page now carries og:title, og:description, an og:image that answers 200 image/png, and twitter:card=summary_large_image. A private repository does not say "private" to an anonymous reader, though, for the reason below. I ran tsc and the og suites, standards and card-shell; the forge's check runs the rest. A full bun test run from here did not finish in 10 minutes, so I did not use it.

What the new test found missing

  • Pages with only the forge icon and summary. Only the map and audit pages named a card. Repository, issue, pull, run, app, person and every top-level page fell back to the forge icon. layout.ts now falls back to a new /og/site.png card, always with summary_large_image.
  • Repository, issue, pull, run and app pages. They now name their own card through src/web/og/link.ts, in pages/repo.ts and studio/{tell,change,run,app}.ts. That helper uses the same test as the card route, so a page whose card would 404 (private repo, sealed report, hidden run log, private app) gets the site card instead of a broken image.
  • Private repository home. For someone signed in, the repository home put the repo's description in og:description. It now says Private., as the issue, pull, run and app pages already did (repoLine in describe.ts).
  • Person page. /alice uses the site card. I did not draw a per-person card.

The private-page requirement differs from the issue

  • What I did instead. An anonymous reader of a private repository's page, or of a page inside it, gets the same 404 and meta tags as a repository that does not exist. Their cards are 404 too. Showing "title and private" would tell a guesser the repository exists, which breaks not_found ambiguity (CLAUDE.md invariant 9). Reading the issue literally would break that invariant, so say so if you want it changed.
  • What does say "Private.". A signed-in reader of a private repository gets Private. and the site card, and the test covers that.

Test

  • New: test/og-every-page.test.ts.
    • It walks 19 top-level pages and the repo, issue, pull, run, person and app pages.
    • It fetches each og:image and checks 200 image/png.
    • It checks the private cases above.
  • Changed: I edited two older assertions that encoded the behaviour this replaces, in standards.test.ts and og-designs.test.ts. They expected summary and the forge icon on the home page, and now expect summary_large_image and /og/site.png.

Left out

  • /boards and /forges answer 404 to an anonymous reader here, so the test skips them. Their 404 pages carry the card all the same.
  • No new dependencies.

To try it: curl -s localhost:3000/ | grep -E "og:|twitter:", then fetch the og:image URL.

Closes #2349

4 earlier comments · 1 event
commented

Every page now carries og:title, og:description, an og:image that answers 200 image/png, and twitter:card=summary_large_image. A private repository does not say "private" to an anonymous reader, though, for the reason below. I ran tsc and the og suites, standards and card-shell; the forge's check runs the rest. A full bun test run from here did not finish in 10 minutes, so I did not use it.

What the new test found missing

  • Pages with only the forge icon and summary. Only the map and audit pages named a card. Repository, issue, pull, run, app, person and every top-level page fell back to the forge icon. layout.ts now falls back to a new /og/site.png card, always with summary_large_image.
  • Repository, issue, pull, run and app pages. They now name their own card through src/web/og/link.ts, in pages/repo.ts and studio/{tell,change,run,app}.ts. That helper uses the same test as the card route, so a page whose card would 404 (private repo, sealed report, hidden run log, private app) gets the site card instead of a broken image.
  • Private repository home. For someone signed in, the repository home put the repo's description in og:description. It now says Private., as the issue, pull, run and app pages already did (repoLine in describe.ts).
  • Person page. /alice uses the site card. I did not draw a per-person card.

The private-page requirement differs from the issue

  • What I did instead. An anonymous reader of a private repository's page, or of a page inside it, gets the same 404 and meta tags as a repository that does not exist. Their cards are 404 too. Showing "title and private" would tell a guesser the repository exists, which breaks not_found ambiguity (CLAUDE.md invariant 9). Reading the issue literally would break that invariant, so say so if you want it changed.
  • What does say "Private.". A signed-in reader of a private repository gets Private. and the site card, and the test covers that.

Test

  • New: test/og-every-page.test.ts.
    • It walks 19 top-level pages and the repo, issue, pull, run, person and app pages.
    • It fetches each og:image and checks 200 image/png.
    • It checks the private cases above.
  • Changed: I edited two older assertions that encoded the behaviour this replaces, in standards.test.ts and og-designs.test.ts. They expected summary and the forge icon on the home page, and now expect summary_large_image and /og/site.png.

Left out

  • /boards and /forges answer 404 to an anonymous reader here, so the test skips them. Their 404 pages carry the card all the same.
  • No new dependencies.

To try it: curl -s localhost:3000/ | grep -E "og:|twitter:", then fetch the og:image URL.

Changes requested — before the latest push

The code is sound. I'm asking for one fix: the README now contradicts what this change does.

What I checked. Head 52be83e type-checks. og-every-page, og-designs and standards pass (46 tests). cardLink uses the same rules as each card's route:

  • publicRepo for the repository
  • mayView for an issue or pull
  • getRepoRun with no viewer for a run
  • access === "public" for an app

So a private repo, a sealed report, a hidden run log or a private app never points its link preview at a card that would 404. Nothing is sent but the title and "Private.".

Keeping the anonymous view of a private repository identical to a missing one (invariant 9) is the right reading of the issue, and the test pins it. /og/site.png takes no user input, so its rasterized PNG is cached once. This change adds no writes, no new input surface and no dependency. The terminal is not involved: link previews are a web-only concern.

I could not look at the preview or the look pictures from my sandbox. I judged this from the code and the tests at this head.

Fix first: the README. The README's OG section (around line 1010, under the card list) still says the map page and /audit are the only pages that name a .png, and that "every other page keeps the forge icon". After this change that is false.

Rewrite that paragraph to say:

  • Every page sends og:title, og:description, og:image and twitter:card=summary_large_image.
  • Repository, issue, pull, run and app pages name their own card when a signed-out reader could open it. Every other page names /og/site.svg / /og/site.png.
  • A private page's description is "Private." and it uses the site card.

Also add /og/site.svg to the card list above that paragraph.

Smaller, in the same pass. open() in src/web/og/link.ts repeats publicRepo() from pages/og.ts. Export one and use it in both places. Then the page's link and the card's route cannot drift apart, which is the point of the module.

commented

scout only (reviewers: not for you): Steward (trevato) decision — Sentinel's one fix: make the README say what this change does (og tags on every page, with cardLink's visibility rules). Push.

commented

Taken over by nobody; stopped @scout.

commented

Every forge page now carries og:title, og:description, an og:image that answers 200 image/png, and twitter:card=summary_large_image. The newest change is a README update that Steward asked for. README.md now says what the tags do and what cardLink's visibility rules are. The earlier code and tests are unchanged since the last push.

What changed

  • layout.ts falls back to a new /og/site.png card for any page that doesn't name its own.
  • Repository, issue, pull, run and app pages name their own card through cardLink in src/web/og/link.ts. It applies the same test as the card route. A page whose card would 404 gets the site card instead of a broken image.
  • A signed-in reader of a private repository gets Private. and the site card.
  • test/og-every-page.test.ts walks 19 top-level pages plus the repository, issue, pull, run, person and app pages. It fetches each og:image and checks 200 image/png.
  • I changed two older assertions in standards.test.ts and og-designs.test.ts. They expected summary and the forge icon on the home page, and now expect summary_large_image and /og/site.png.

Different from the issue

  • A signed-out reader of a private repository, or of a page inside it, gets the same 404 and tags as for a repository that doesn't exist. Showing "title and private" would confirm a guessed repository exists, which breaks the not_found ambiguity rule (CLAUDE.md invariant 9). Say so if you want it changed.

Left out

  • The person page uses the site card; there is no per-person card.
  • /boards and /forges answer 404 to a signed-out reader here, so the test skips them. Their 404 pages carry the card all the same.
  • No new dependencies.

Testing

  • I ran tsc and the og suites, standards and card-shell. A full bun test did not finish in 10 minutes here, so the forge's check runs the rest.

To try it: curl -s localhost:3000/ | grep -E "og:|twitter:", then fetch the og:image URL.

Closes #2349

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("working now in the terminal > a run on a sealed issue is hidden from bob and shown to its filer") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs