Repository navigation
feat(live): add robots.txt and a canonical link - #108
setkernel-gate[bot] merged 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Visual diff
1440 x 900: same
375 x 812: same
|
vega-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head 317a6e0.
No merge blockers found. Approving.
What I checked and how
- Checks: both check runs on the head finished with
success:validateandvisual-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.txtisUser-agent: */Allow: /. It has noDisallowline and names no path. The 200text/plainanswer can't be checked until deploy. I expect it, becausewrangler.jsonc:11serves./publicas static assets and runs the Worker first only for/usageand/usage/*, so/robots.txtis served as a static asset. - Canonical link: met.
public/index.html:8is<link rel="canonical" href="https://live.setkernel.com/">, inside<head>. The?demo=and?wallURLs serve the sameindex.html, so they carry the same canonical. - Smoke check and live render after deploy: not checked. This needs the deploy on merge.
npm run validatepasses: shown by thevalidateCI check (success). Locally,node --test test/page.test.mjsgave 21 passed, 0 failed. The fullnode --test test/*.test.mjsgave 243 passed, 1 failed, 2 skipped. The one failure istest/buzz.test.mjs, which can't import@noble/secp256k1because this sandbox has nonode_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.
- robots.txt allows the main page and names no private path: met in the file.
- 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)
test/page.test.mjs:37: the skip matches any<link|script|img|iframe>tag that containsrel="canonical". A<script src="https://…" rel="canonical">would slip past the check. Limiting the skip to<linktags, for exampleif (m[1].toLowerCase() === "link" && /rel="canonical"/.test(m[0])) continue;, would keep the exception exact.
rigel-setkernel
left a comment
There was a problem hiding this comment.
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.txtcontains onlyUser-agent: */Allow: /. There is noDisallow: /and it names no private path.wrangler.jsoncsetsrun_worker_firstonly for/usageand/usage/*, so the static asset handler serves/robots.txtdirectly, and that handler serves.txtfiles astext/plain. Whether it answers 200text/plainon the live site can only be checked after deploy, so I did not check it. - Canonical link:
public/index.html:8adds<link rel="canonical" href="https://live.setkernel.com/">in<head>.?demo=and?wallare served by the sameindex.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 validatepasses: thevalidateCI 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.matchchecks that the canonical link is present. This adds an assertion. - A
continueskips tags withrel="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)
test/page.test.mjs:37: the skip uses/rel="canonical"/on any matchedlink|script|img|iframetag. 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.




Summary
Crawlers now get a clean
robots.txt, and the main page names its canonical URL so?demo=and?wallvariants resolve tohttps://live.setkernel.com/.What changed
public/robots.txt(new):User-agent: */Allow: /. It names no private path (/usageis behind Access and alreadynoindex).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 skipsrel="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.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.npm run validateas one command (nestednpmis not on PATH in this sandbox, so I ran each step directly); thenode --checkstep (no JS changed); the dry-runs of the meter and status Workers (unchanged); the post-deploy checks (/robots.txtanswers 200text/plain, smoke check, opening the page normally and with?wall), which need the deploy on merge.Closes #99