Repository navigation
fix(ci): stop search engines indexing design.wemeditate.com - #180
Conversation
design.wemeditate.com sent no X-Robots-Tag, served Ladle's SPA shell for /robots.txt, and carried no <meta robots>, so every page of the component library was indexable. Its sibling design.sahajatlas.com refuses crawlers two ways over, and server/sitemap.ts already claims a Ladle preview is a host that "must never be indexed". Ladle generates its own index.html, so only a header can carry the refusal. Cloudflare Pages reads robots.txt and _headers from the build output, and the files ship from .ladle/static rather than public/: public/ is copied into the Vike app's build as well, where Disallow: / would answer on wemeditate.com and drop the site from every index. A Vite plugin in .ladle/vite.config.ts emits both, so they land under `ladle build` as much as under `pnpm ladle:build` — the Pages project's build command lives in the Cloudflare dashboard, not in this repo. Confirmed locally: `pnpm ladle:build` writes build/robots.txt and build/_headers, and `pnpm build` writes neither into dist/. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012a69GbDuyuhuEZsNTWcJEx
/simplify and /code-review high over the branch. The three files each argued "not public/" in full; the reason now lives once, in robots.txt, with the plugin keeping only what a reader cannot re-derive: that Vite takes one publicDir, so repointing it would drop the fonts and the DiscoverMeditation background from the playground. The robots.txt guard asserted a Disallow anywhere after the first User-agent line, so `Allow: /` on `*` beside `Disallow: /` on a narrow agent passed it — the inversion the runbook is one step from. It now parses groups and pins the preview-scraper allowance too. The _headers guard no longer requires X-Robots-Tag to be the first header under `/*`, which a later Cache-Control rule would have broken. Confirmed the guard fails on an inverted robots.txt before restoring it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012a69GbDuyuhuEZsNTWcJEx
The two files are deploy material in a directory nobody would look in, and the trap they avoid is silent: `public/` reaches both builds, so a refusal there de-indexes wemeditate.com. Also carries the Storybook warning — Ladle copies `publicDir` for free and Storybook does not, so a move needs `staticDirs` and this plugin, or the playground goes back to being indexable. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012a69GbDuyuhuEZsNTWcJEx
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 02deac7 | Commit Preview URL Branch Preview URL |
Oct 10 2026, 06:43 PM |
Deploying wemeditate-design with
|
| Latest commit: |
02deac7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ec141806.wm-design.pages.dev |
| Branch Preview URL: | https://claude-fix-174-ladle-noindex.wm-design.pages.dev |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of #174 and carries nothing the ticket did not ask for. Both rejected one-liners are rejected for the right reason: Ladle defaults publicDir to <cwd>/public (vite-base.js:121), so public/ really does reach both builds, and repointing it really would unstyle every story. The allow-group matches SahajAtlasWeb's token for token, same order, so AC3 holds. AC4 holds by construction: public/, server/ and pages/ are untouched.
Worth your eye, not a defect: Disallow: / stops Googlebot ever fetching the noindex, so a URL-only listing stays possible. The file says so, and it is the sibling site's accepted trade-off.
One claim is wrong, in three committed places: a <meta robots> is reachable from this repo.
Findings
- should-fix —
.ladle/static/robots.txt:6— Ladle'sappendToHeadand.ladle/head.htmlboth reach the generatedindex.html. The reason given for shipping only two signals is false, and two more files repeat it. - consider —
tests/guards/ladle-crawler-refusal.test.ts:15— 40 lines of bespoke robots.txt and_headersparsing, where an exact substring pins the same groups. - consider —
STORYBOOK.md:189— the "notpublic/" rationale is now in four places.
What was checked
- Read whole:
.ladle/crawler-refusal.ts, both static files, both Ladle configs, the guard spec, both new smoke specs,preview.ts. - Unpacked
@ladle/[email protected]: thepublicDirdefault;appendToHeadandhead.html;loadConfigFromFileloads the Vite config, soimport.meta.urlis injected per source file and thestatic/lookup resolves. sydevs/SahajAtlasWebpublic/robots.txt: tokens and group shape.ci.yml:71— WATCH matches.ladle/, IGNORE neither new file, so both rebuildwm-design.- Not re-run: the gate, the build. No deployment to curl.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The two robots.txt group parsers went, for two anchored matches that pin the same facts. Anchoring is what carries the comment case the parsers were there for, and the blank line pins the group's end, so an `Allow: /` appended under `*` — which Google reads as the winning rule — still fails. Confirmed both, plus the narrow-agent inversion and a `Disallow: /` swapped under the scraper list. `headersFor` stays: an exact substring puts `X-Robots-Tag` back in first position under `/*`, which 815dfe9 loosened on purpose, so a later `Cache-Control` rule would break the guard rather than the policy. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FManLJY2ByACfcUaA7J7Zj
A `<meta robots>` was reachable all along: `ladle:core` registers in the prod Vite config unconditionally, and its `transformIndexHtml` injects `.ladle/head.html` into the generated `index.html`. Confirmed on a real `pnpm ladle:build` — a probe `head.html` reached `build/index.html`. So the claim that Ladle's generated document rules the tag out was false, in four places. The reason the header carries the policy is the one `_headers` already gave: `meta.json`, the hashed assets and the fonts have no document to carry a tag. The third signal stays unused, and the files now say so rather than claiming it is unavailable: it reaches only the document, so it covers nothing `X-Robots-Tag` misses, and adds a line to keep in step. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FManLJY2ByACfcUaA7J7Zj
AGENTS.md owns the repo-wide rule and docs/cloudflare-previews-ci.md owns the detail. This paragraph keeps what only it says — that the Ladle Vite config registers the plugin — and links for the rest. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FManLJY2ByACfcUaA7J7Zj
|
Three threads answered, pushed as 02deac7. Gate green: lint, Adopted — the Adopted — the fourth Half rebutted — the guard parsers (c113f20). The Confirmed live on the branch's Pages preview — 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
X-Robots-Tag: noindexon every URL and serves a realrobots.txt..ladle/static/, notpublic/, so the Vike app's own indexing is untouched.Change outline
What a crawler gets from each host. Measured before the change, on 2026-10-10.
A new responsibility in
.ladle/: a directory whose contents are deploy material.Preview
wm-designPages preview, https://claude-fix-174-ladle-noindex.wm-design.pages.dev —GET /andGET /meta.jsoneach answer200withx-robots-tag: noindex, andGET /robots.txtis200 text/plaincarryingDisallow: /under*.Smoke (ladle)asserts the same facts in CI.Test results
pnpm lint,tsc --noEmit, 812 unit teststests/guards/ladle-crawler-refusal.test.ts. Confirmed it goes red on an invertedrobots.txt(Allow: /on*,Disallow: /on a narrow agent) before restoring the file.pnpm ladle:buildwritesbuild/robots.txtandbuild/_headers, and stillbuild/fonts/andbuild/images/. ✓pnpm buildwrites neither intodist/.Manual verification
The ticket's checklist, against the Pages preview first and production after merge:
curl -sSI https://design.wemeditate.com/ | grep -i x-robots-tag→noindex.curl -sSI 'https://design.wemeditate.com/?story=atoms-button--default' | grep -i x-robots-tag→noindex.curl -sS https://design.wemeditate.com/robots.txt→ the refusal file, and itscontent-typeis nottext/html.curl -sSI https://wemeditate.com/ | grep -i x-robots-tag→ nothing, andcurl -sS https://wemeditate.com/robots.txtis unchanged.Notes for reviewer
publicDir: '.ladle/static'is the obvious one-line alternative and it breaks the playground. Vite takes onepublicDir, and Ladle needs the default:.ladle/components.tsximportslayouts/fonts.css, which fetches/fonts/raleway/*and/fonts/futura-book/*, andDiscoverMeditationrendersurl(/images/backgrounds/discover-meditation-background.webp). Repointing it would silently unstyle every story. The plugin's docblock records this so the next cleanup pass does not try it.robots.txtand shipping only the header was proposed and rejected: the ticket asks for a real refusal file at that URL, anddesign.sahajatlas.com's accepted trade-off is the same one. The file documents why the two signals do not stack, and carries the runbook for relaxing it.<meta robots>is a reachable third signal, and is deliberately unused. Ladle injects.ladle/head.htmlinto theindex.htmlit generates, on the build as well — confirmed with a probe file that reachedbuild/index.html. The tag reaches only the document, so it covers nothingX-Robots-Tagalready covers, at the cost of one more place to keep in step.sydevs/SahajAtlasWeb'spublic/robots.txttoken for token, per the ticket's third criterion. That file documents each token; this one points at it rather than restating it./security-reviewdid not run — no path in the diff matchessecurityReview.triggerPattern.Detail
Why a plugin rather than a copy step. The
wemeditate-designPages project's build command lives in the Cloudflare dashboard, which this repo cannot see, so acpappended to theladle:buildscript would stop working the day someone sets the command to a bareladle build.generateBundle+emitFileruns under either, and follows Ladle'soutDirrather than hardcodingbuild/.Why
.ladle/static/and not a new top-level directory. Cloudflare's build watch paths include.ladle/*and*crosses/, andci.yml's mirror regex matches^\.ladle/— so editing either file triggers awm-designrebuild and a smoke run with no change to the dashboard list or to CI. Aladle-public/would have needed both.Path resolution. Ladle sets Vite's
rootinside its own package (getAppRoot()), so the plugin resolves.ladle/static/fromimport.meta.url. Vite's config bundling preserves that per source file, which the realpnpm ladle:buildconfirms._headersin the app build. It is not shipped there at all, so the inert-but-fetchable/_headersthe ticket flagged does not arise. Worker static assets are gaining_headerssupport, which would have made apublic/copy actively harmful rather than merely inert.Also noticed, not changed.
PageResultnow exposesheaders, which makes itslocationandcontentTypefields derivable. Three accessors for one response's headers is worth collapsing, but every existing smoke spec uses the convenience fields, so it does not belong in this diff.Review passes.
/simplify(four lenses) and/code-review high;pr-review-toolkitis not installed here. Commit 2 carries their accepted findings: the repeated "notpublic/" rationale cut to one home, and two guards that could not have failed — therobots.txtgroup check and the_headersfirst-header-only check.The adversarial review. Commits 4 to 6 answer it. The
<meta robots>claim was wrong and went from four files, including a guard docblock the review did not list. Commit 2'srobots.txtgroup parsers went back to two anchored regexes, which pin adjacency and the group's end as tightly in two lines; the inverted, appended-Allow, commented-out and scraper-Disallowcases were each confirmed red. The_headersparser stayed, against the same simplification: an exact substring reinstates the first-header coupling commit 2 removed on purpose.Closes #174
🤖 Generated with Claude Code
https://claude.ai/code/session_012a69GbDuyuhuEZsNTWcJEx
Generated by Claude Code