Skip to content

fix(ci): stop search engines indexing design.wemeditate.com - #180

Merged
sydevs-bot merged 6 commits into
mainfrom
claude/fix-174-ladle-noindex
Oct 11, 2026
Merged

sydevs-bot merged 6 commits into
mainfrom
claude/fix-174-ladle-noindex

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The published Ladle library now sends X-Robots-Tag: noindex on every URL and serves a real robots.txt.
  • The files ship from .ladle/static/, not public/, 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.

 design.wemeditate.com                          Cloudflare Pages, project wm-design
-  GET /             → 200, no X-Robots-Tag
+  GET /             → 200, X-Robots-Tag: noindex
-  GET /meta.json    → 200, no X-Robots-Tag
+  GET /meta.json    → 200, X-Robots-Tag: noindex       # every URL, from `_headers` `/*`
-  GET /robots.txt   → 200 text/html — Ladle's SPA shell, there being no such file
+  GET /robots.txt   → 200 text/plain — `Disallow: /` for `*`, `Allow: /` for 14 link-preview bots

 wemeditate.com                                 Cloudflare Workers, unchanged
   GET /robots.txt   → the per-host file `server/sitemap.ts` builds
   GET /             → no X-Robots-Tag

A new responsibility in .ladle/: a directory whose contents are deploy material.

 .ladle/
+├── crawler-refusal.ts   # `ladle-crawler-refusal`: emits the refusal into Ladle's outDir
+├── static/              # read by Cloudflare Pages out of the build output, not by Ladle
+│   ├── robots.txt       # the policy, and the one place it is written down
+│   └── _headers         # `/*` → `X-Robots-Tag: noindex`
 ├── vite.config.ts       # registers the plugin beside the Tailwind one
 └── components.tsx

Preview

Test results

  • Lean gate: ✓ pnpm lint, tsc --noEmit, 812 unit tests
  • Targeted specs: 3 passed — tests/guards/ladle-crawler-refusal.test.ts. Confirmed it goes red on an inverted robots.txt (Allow: / on *, Disallow: / on a narrow agent) before restoring the file.
  • Build: ✓ pnpm ladle:build writes build/robots.txt and build/_headers, and still build/fonts/ and build/images/. ✓ pnpm build writes neither into dist/.

Manual verification

The ticket's checklist, against the Pages preview first and production after merge:

  1. curl -sSI https://design.wemeditate.com/ | grep -i x-robots-tag → noindex.
  2. curl -sSI 'https://design.wemeditate.com/?story=atoms-button--default' | grep -i x-robots-tag → noindex.
  3. curl -sS https://design.wemeditate.com/robots.txt → the refusal file, and its content-type is not text/html.
  4. curl -sSI https://wemeditate.com/ | grep -i x-robots-tag → nothing, and curl -sS https://wemeditate.com/robots.txt is unchanged.

Notes for reviewer

  • publicDir: '.ladle/static' is the obvious one-line alternative and it breaks the playground. Vite takes one publicDir, and Ladle needs the default: .ladle/components.tsx imports layouts/fonts.css, which fetches /fonts/raleway/* and /fonts/futura-book/*, and DiscoverMeditation renders url(/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.
  • Dropping robots.txt and shipping only the header was proposed and rejected: the ticket asks for a real refusal file at that URL, and design.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.
  • A <meta robots> is a reachable third signal, and is deliberately unused. Ladle injects .ladle/head.html into the index.html it generates, on the build as well — confirmed with a probe file that reached build/index.html. The tag reaches only the document, so it covers nothing X-Robots-Tag already covers, at the cost of one more place to keep in step.
  • The link-preview allow-group mirrors sydevs/SahajAtlasWeb's public/robots.txt token for token, per the ticket's third criterion. That file documents each token; this one points at it rather than restating it.
  • /security-review did not run — no path in the diff matches securityReview.triggerPattern.
Detail

Why a plugin rather than a copy step. The wemeditate-design Pages project's build command lives in the Cloudflare dashboard, which this repo cannot see, so a cp appended to the ladle:build script would stop working the day someone sets the command to a bare ladle build. generateBundle + emitFile runs under either, and follows Ladle's outDir rather than hardcoding build/.

Why .ladle/static/ and not a new top-level directory. Cloudflare's build watch paths include .ladle/* and * crosses /, and ci.yml's mirror regex matches ^\.ladle/ — so editing either file triggers a wm-design rebuild and a smoke run with no change to the dashboard list or to CI. A ladle-public/ would have needed both.

Path resolution. Ladle sets Vite's root inside its own package (getAppRoot()), so the plugin resolves .ladle/static/ from import.meta.url. Vite's config bundling preserves that per source file, which the real pnpm ladle:build confirms.

_headers in the app build. It is not shipped there at all, so the inert-but-fetchable /_headers the ticket flagged does not arise. Worker static assets are gaining _headers support, which would have made a public/ copy actively harmful rather than merely inert.

Also noticed, not changed. PageResult now exposes headers, which makes its location and contentType fields 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-toolkit is not installed here. Commit 2 carries their accepted findings: the repeated "not public/" rationale cut to one home, and two guards that could not have failed — the robots.txt group check and the _headers first-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's robots.txt group 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-Disallow cases were each confirmed red. The _headers parser 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

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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Deploying wemeditate-design with  Cloudflare Pages  Cloudflare Pages

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

View logs

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 10, 2026
@sydevs-bot

sydevs-bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 18:35Z address-review · attempt 1 · session · done
  • 18:35Z address-review · attempt 1 · session
  • 18:24Z review-pr · attempt 1 · session · done
  • 18:24Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 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's appendToHead and .ladle/head.html both reach the generated index.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 _headers parsing, where an exact substring pins the same groups.
  • consider — STORYBOOK.md:189 — the "not public/" 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]: the publicDir default; appendToHead and head.html; loadConfigFromFile loads the Vite config, so import.meta.url is injected per source file and the static/ lookup resolves.
  • sydevs/SahajAtlasWeb public/robots.txt: tokens and group shape.
  • ci.yml:71 — WATCH matches .ladle/, IGNORE neither new file, so both rebuild wm-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

Comment thread .ladle/static/robots.txt Resolved
Comment thread STORYBOOK.md Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 10, 2026
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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Three threads answered, pushed as 02deac7. Gate green: lint, tsc, 812 tests.

Adopted — the <meta robots> reason (4aef87f). A probe .ladle/head.html reached build/index.html on a real pnpm ladle:build. The false reason went from four files. The third signal stays unused, and the files now say why.

Adopted — the fourth public/ rationale (02deac7). STORYBOOK.md keeps its first sentence and the link.

Half rebutted — the guard parsers (c113f20). The robots.txt pair went, for two anchored regexes. headersFor stayed: the proposed substring reinstates the first-header coupling 815dfe9 removed on purpose.

Confirmed live on the branch's Pages preview — noindex on / and /meta.json, and /robots.txt is text/plain with Disallow: / under *.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 1c3796d Oct 11, 2026
63 of 67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(ci): stop search engines indexing design.wemeditate.com

3 participants