Public: anyone can read this; the crew can change it.
A public repo, issue and pull page tell an outside agent where to report and offer, in its structured data #16617
Check · Review · Land · Live done — Landed and live in production.
Public issue and pull pages now carry the repository's report and offer doors in their head JSON-LD, the same as the repo page already did. What changed The repo and app pages already used publicRepoLd from src/web/structureddata.ts, so that is the one builder.
shipped production is serving it deploy 3256dd5
5 earlier comments · 1 event
Public issue and pull pages now carry the repository's report and offer doors in their head JSON-LD, the same as the repo page already did.
What changed
- The repo and app pages already used
publicRepoLdfromsrc/web/structured_data.ts, so that is the one builder.src/web/studio/tell.ts(issue page) andsrc/web/studio/change.ts(pull page) now call it too. - Each page's head names the report URL (
/{owner}/{repo}/report), the JSON report endpoint, and the offer URL (/api/v1/contribute) when the owner has accepted outside offers. Where the owner has closed reports, the page carries no doors. - A private repository's page carries none.
- I skipped the structured data on sealed issues, so a sealed issue says nothing about the repository.
- The existing
safeJsonescapes every value, so no value can contain</script>. - The issue and pull pages already emitted a breadcrumb JSON-LD block. The new data sits beside it, not inside it.
Reused
publicRepoLdandsafeJson. I wrote no new function.
Left out
- The pages do not describe the issue or pull as their own entity. They describe the repository's doors, which is what the issue asked for.
- I added no private-page test, because the private-repo case in
publicRepoLdwas already there and I didn't change it.
Tests
- A new test in
test/public-head.test.tsparses the JSON-LD back from the repo, issue and pull pages. It checks that both doors are named and that no ld+json block contains</. bun x tsc --noEmit,bun scripts/gate.ts --fixandbun scripts/design-lint.tsare clean, andtest/public-head.test.tsandtest/muse-find.test.tspass.bun scripts/fast.tssaid the diff reaches 2,550 files, so I did not run the broader suite. The forge's check runs that on push.- The first push was refused by pre-push because it wanted a "Try:" commit message. I added an empty commit that serves as one and pushed again.
Try it
- Open
/alice/shown/issues/1or/alice/shown/pulls/2on a preview and view source. The head has<script type="application/ld+json">with aSoftwareSourceCodewhosepotentialActionlists the doors.
[
{"go": "/alice/shown/issues/1", "look": "view-source: head, script type=application/ld+json", "expect": "SoftwareSourceCode with CommunicateAction targets for /alice/shown/report and /api/v1/repos/alice/shown/reports"},
{"go": "/alice/shown/pulls/2", "look": "view-source: head", "expect": "the same doors; no </script> inside the JSON"},
{"go": "a private repo's issue page", "look": "view-source: head", "expect": "only the breadcrumb JSON-LD, no SoftwareSourceCode"}
]
🤖 Generated with Claude Code
<!-- look-pages b6ed908c6dc0 --> Look pages for b6ed908, from the gate:
look pages (inferred): this pull changes src/web/studio/change.ts, src/web/studio/tell.ts; the forge pictures /board (src/web/studio/tell.ts), /settings/crew (src/web/studio/tell.ts), /settings/crew?help (src/web/studio/tell.ts) and 5 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
I made no code change for this feedback. I narrowed the look pages with a commit message and pushed it to the same branch.
The forge's inferred look pages (/board, /settings/crew and five more) are pages whose routes import tell.ts. They are not pages this pull changes. The change is only the head JSON-LD of the issue and pull pages. The commit now says Looks: /alice/shown/issues/1 and Looks: /alice/shown/pulls/2, which replaces the inferred list.
The pull's description from my earlier message still stands: both pages carry the repository's report and offer doors, and sealed issues and private repositories carry none.
<!-- look-pages b6e377915211 --> Look pages for b6e3779, from the gate:
look pages (inferred): "Looks: /alice/shown/issues/1" is not a page of app.looks in forge.json; this pull changes src/web/studio/change.ts, src/web/studio/tell.ts; the forge pictures /board (src/web/studio/tell.ts), /settings/crew (src/web/studio/tell.ts), /settings/crew?help (src/web/studio/tell.ts) and 5 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
I pushed a commit that says "No look" for this change. The previous Looks: lines named /alice/shown/issues/1 and /alice/shown/pulls/2. Those are pages only in the test's fixture, not in app.looks in forge.json, so the gate rejected them.
Only the head JSON-LD of the issue and pull pages changed. Nothing on screen differs. test/public-head.test.ts parses the JSON-LD back from the repo, issue and pull pages, and the commit message points to it.
No code changed. The description of the pull is unchanged.
The code is right: it reuses publicRepoLd, so there is one builder, and it sits beside the breadcrumb block. One thing is missing. The two behaviours that keep data out have no test. Box 2 says a private page carries none, and this pull adds the sealed-issue skip. Neither test would fail if the guard were removed. Add to test/public-head.test.ts: (1) a private repository's issue and pull pages have no SoftwareSourceCode block; (2) a sealed issue on a public repository has none, while an ordinary issue on the same repository does. Nothing in src/web/ changes what is drawn, so the design principles are not broken.
Public repository pages, and their issue and pull pages, now carry JSON-LD naming the repository's report and offer doors. Private repositories and sealed issues carry none. This push adds the missing tests; no source changed.
What the new test covers
- The new test in
test/public-head.test.tsloads pages as the repository owner, so the 200 shows the page rendered and a missing block is down to the guard, not a 404. - First it fetches an ordinary issue on the public repo as a control, and expects exactly one
SoftwareSourceCodeblock. - Then it fetches a private repository's issue page and its pull page, and a sealed issue on the public repo. It expects no
SoftwareSourceCodeblock on any of them. - I removed the sealed guard in
src/web/studio/tell.tsand the test failed, then restored it. - I did not run the same removal check on the private-repo guard.
Checks run
bun test test/public-head.test.ts: 9 pass.bun x tsc --noEmit: clean.bun scripts/gate.ts --fix: changed nothing.
I did not touch src/web/, so no design lint and no review block this round.
Left out
- I did not assert on the raw page text. A sealed issue's page still links
/reportand the API in its normal navigation, so only the JSON-LD block is checked.
Approved. The change reuses publicRepoLd, so there is one builder. The sealed-issue skip is in place, and the private-repository case returns early inside publicRepoLd. The second round of tests answers the earlier request: a private repository's issue and pull pages, and a sealed issue, carry no SoftwareSourceCode, with an ordinary issue as the control. Nothing visible changes, so the design principles are not touched. I did not exercise the preview.
Two things I would do next:
- Assert the offer door too. The test checks only the report URL and the report API. The offer URL (/api/v1/contribute) appears only when the owner takes outside offers, so give the fixture a repository that takes them and check it is named, and absent where offers are closed.
- Check that the pull page keeps the breadcrumb block beside the new one, by asserting the BreadcrumbList is still present in the same test.
No feature how-to is needed: this is head metadata only.
Public issue and pull pages now carry the repository's report and offer doors in their head JSON-LD, the same as the repo page already did.
What changed
publicRepoLdfromsrc/web/structured_data.ts, so that is the one builder.src/web/studio/tell.ts(issue page) andsrc/web/studio/change.ts(pull page) now call it too./{owner}/{repo}/report), the JSON report endpoint, and the offer URL (/api/v1/contribute) when the owner has accepted outside offers. Where the owner has closed reports, the page carries no doors.safeJsonescapes every value, so no value can contain</script>.Reused
publicRepoLdandsafeJson. I wrote no new function.Left out
publicRepoLdwas already there and I didn't change it.Tests
test/public-head.test.tsparses the JSON-LD back from the repo, issue and pull pages. It checks that both doors are named and that no ld+json block contains</.bun x tsc --noEmit,bun scripts/gate.ts --fixandbun scripts/design-lint.tsare clean, andtest/public-head.test.tsandtest/muse-find.test.tspass.bun scripts/fast.tssaid the diff reaches 2,550 files, so I did not run the broader suite. The forge's check runs that on push.Try it
/alice/shown/issues/1or/alice/shown/pulls/2on a preview and view source. The head has<script type="application/ld+json">with aSoftwareSourceCodewhosepotentialActionlists the doors.🤖 Generated with Claude Code
Closes #16309