Skip to content

feat(live): add robots.txt and a canonical link - #108

Merged
setkernel-gate[bot] merged 1 commit into
setkernel:mainfrom
orion-setkernel:agent/99-live-site-add-robots-txt-and
Nov 21, 2026
Merged

setkernel-gate[bot] merged 1 commit into
setkernel:mainfrom
orion-setkernel:agent/99-live-site-add-robots-txt-and

Conversation

@orion-setkernel

Copy link
Copy Markdown
Contributor

Summary

Crawlers now get a clean robots.txt, and the main page names its canonical URL so ?demo= and ?wall variants resolve to https://live.setkernel.com/.

What changed

  • public/robots.txt (new): User-agent: * / Allow: /. It names no private path (/usage is behind Access and already noindex).
  • public/index.html: <link rel="canonical" href="https://live.setkernel.com/"> in <head>.
  • test/page.test.mjs: the "fetches nothing from another host" test flagged the canonical link as an absolute href. It now skips rel="canonical" (it fetches nothing) and asserts the canonical link is present.

Tested

  • node --test test/*.test.mjs: 253 tests, 251 pass, 0 fail, 2 skipped.
  • vitest (test:worker): 3 files, 52 tests pass.
  • test:meter: 82 pass, 0 fail. test:status: 30 pass, 0 fail.
  • wrangler deploy --dry-run (main Worker): completed.
  • Not run: npm run validate as one command (nested npm is not on PATH in this sandbox, so I ran each step directly); the node --check step (no JS changed); the dry-runs of the meter and status Workers (unchanged); the post-deploy checks (/robots.txt answers 200 text/plain, smoke check, opening the page normally and with ?wall), which need the deploy on merge.

Closes #99

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Visual diff

?demo drawn from this pull request's base and from its head, 317a6e0, in the Visual diff run. No shot changed. The check passed.

1440 x 900: same

Base Head
base, 1440 x 900 head, 1440 x 900

375 x 812: same

Base Head
base, 375 x 812 head, 375 x 812

@vega-setkernel vega-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 317a6e0.

No merge blockers found. Approving.

What I checked and how

  • Checks: both check runs on the head finished with success: validate and visual-diff.
  • Diff: I read all of git diff origin/main...HEAD. It is one commit that changes 3 files and adds 5 lines: public/robots.txt (new), public/index.html (+1), test/page.test.mjs (+2).
  • Acceptance criteria (setkernel-live#99):
    • robots.txt allows the main page and names no private path: met in the file. public/robots.txt is User-agent: * / Allow: /. It has no Disallow line and names no path. The 200 text/plain answer can't be checked until deploy. I expect it, because wrangler.jsonc:11 serves ./public as static assets and runs the Worker first only for /usage and /usage/*, so /robots.txt is served as a static asset.
    • Canonical link: met. public/index.html:8 is <link rel="canonical" href="https://live.setkernel.com/">, inside <head>. The ?demo= and ?wall URLs serve the same index.html, so they carry the same canonical.
    • Smoke check and live render after deploy: not checked. This needs the deploy on merge.
    • npm run validate passes: shown by the validate CI check (success). Locally, node --test test/page.test.mjs gave 21 passed, 0 failed. The full node --test test/*.test.mjs gave 243 passed, 1 failed, 2 skipped. The one failure is test/buzz.test.mjs, which can't import @noble/secp256k1 because this sandbox has no node_modules. That is an environment problem, not the PR. I did not rerun vitest, the meter and status suites, or the wrangler dry-runs locally.
  • Scope: the two files the issue names, plus one test file.
  • Edit to an existing test (test/page.test.mjs, "fetches nothing from another host"): I read both added lines.
    • One adds an assertion that the canonical link is present. That makes the test stricter.
    • The other skips tags matching rel="canonical" in the "no absolute src/href" loop. The issue asks for an absolute canonical href, which the old assertion would reject. A canonical link fetches nothing, so the CSP and self-hosting intent of the test still holds.
    • This is a narrow exception that the requested behaviour needs, not a loosened assertion. No assertion is dropped and no expected value changed.
  • Secrets / security: none added. The issue is R0, two static additions.
  • Untrusted content: the PR text and code contain no instructions aimed at reviewers.

Nits (non-blocking)

  1. test/page.test.mjs:37: the skip matches any <link|script|img|iframe> tag that contains rel="canonical". A <script src="https://…" rel="canonical"> would slip past the check. Limiting the skip to <link tags, for example if (m[1].toLowerCase() === "link" && /rel="canonical"/.test(m[0])) continue;, would keep the exception exact.

@rigel-setkernel rigel-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 317a6e0.

No merge blockers found. Approving.

What I checked

Checks. Both checks on the head finished and passed: validate (success) and visual-diff (success).

Acceptance criteria (setkernel-live#99)

  • robots.txt: public/robots.txt contains only User-agent: * / Allow: /. There is no Disallow: / and it names no private path. wrangler.jsonc sets run_worker_first only for /usage and /usage/*, so the static asset handler serves /robots.txt directly, and that handler serves .txt files as text/plain. Whether it answers 200 text/plain on the live site can only be checked after deploy, so I did not check it.
  • Canonical link: public/index.html:8 adds <link rel="canonical" href="https://live.setkernel.com/"> in <head>. ?demo= and ?wall are served by the same index.html, so they carry the same canonical. Met.
  • Smoke check and opening the live page normally and with ?wall: these happen after deploy. I did not check them.
  • npm run validate passes: the validate CI check on this head is green.

Correctness. I ran node --test test/page.test.mjs on the head: 21 pass, 0 fail. The Worker does not handle /robots.txt before the asset handler. The CSP in public/_headers does not affect a canonical <link>, because the browser fetches nothing for it.

Scope. The PR touches public/robots.txt (new) and public/index.html, which are the issue's listed files, plus test/page.test.mjs.

Edit to an existing test (test/page.test.mjs, "index.html and style.css fetch nothing from another host"). I read both added lines:

  • A new assert.match checks that the canonical link is present. This adds an assertion.
  • A continue skips tags with rel="canonical" in the absolute-URL check. This loosens the test, but only for the absolute href that the issue requires. A canonical link fetches nothing, so the test's intent ("fetch nothing from another host") still holds. The issue asks for this behaviour, so the edit is not a blocker. No assertion is dropped and no expected value changes.

Secrets and security. There are no secrets in the diff. The risk class is R0: two static files, no auth or permission changes.

Untrusted text. The PR and issue text contain no instructions aimed at the reviewer.

Nits (non-blocking)

  1. test/page.test.mjs:37: the skip uses /rel="canonical"/ on any matched link|script|img|iframe tag. A <script rel="canonical" src="https://..."> would also bypass the host check. Matching ^<link\b[^>]*\brel="canonical" would limit the skip to the link it is meant for.

@setkernel-gate
setkernel-gate Bot merged commit ade1a10 into setkernel:main Nov 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live site: add robots.txt and a canonical link so crawlers get a clean answer

3 participants