Repository navigation
chore(build): cut sahajatlas.com over to Workers and delete Pages — repo-side phase - #336
Conversation
The file existed for one consumer: the `sahajatlas` Pages project, which served `sahajatlas.com` and needed `/* /index.html 200` to answer a deep link. #283 moves the domain onto the app Worker and deletes that project, and a Worker takes the same behaviour from `assets.not_found_handling: "single-page-application"` instead. The header comment was all about Pages, so it goes with the rule. `build:worker` and `ladle:build` keep their `rm -f <dir>/_redirects`. Both are no-ops now, which is why `scripts/wrangler-config.test.ts` kept passing on `package.json` alone — the rationale comments said they were load-bearing, so they are rewritten rather than left to mislead. They stay because #252 plans to bring the file back with a `/map / 301` rule; that guard then has to drop the splat rather than the whole file, and the ⚠ now says so where whoever lands #252 will read it. `pnpm build` and `pnpm build:worker` stay two scripts: `build:worker` is the build command Workers Builds holds for the app, so collapsing them is a dashboard change, not a `package.json` one. The review server's trap 4 survives the deletion, with a different mechanism behind it: a leftover `vite preview` serves the SPA shell for an unknown path from its own `appType: 'spa'` fallback, not from the file. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EJEd44taTmZwV4feqXKTED
…ontract `sahajatlas.pages.dev` was the Cloudflare Pages default host for the `sahajatlas` project. #283 deletes that project, so the host serves nothing and must stop being offered as a place to load the script from. Two edits in the integrator guide: the CSP section's offer to add that host to `script-src` and `font-src` goes, and the "Two hosts serve the identical bundle" table names one host. The row whose cell reads `` `<host>` | the production domain `` stays in table form — `scripts/ci-workflows.test.ts` reads it to learn which host the production smoke lane is pinned to, and reshaping the table into prose fails that spec at collection. The CHANGELOG entry is required because a host can observe this twice: the origin disappears, and the CSP advice naming it disappears with it. It records that the host was released rather than redirected, so a request to it does not arrive here any more and anybody may claim the name. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EJEd44taTmZwV4feqXKTED
`docs/rules/deployment.md` is the one place the topology is written down, so it is the centre of this sweep and everything else points at it. Both sites are now Workers static assets; the `public/` deploy files are two, not three; and the site-wide `Access-Control-Allow-Origin: *` rule in `public/_headers` is the only source either site has, because Workers static assets add none of their own and Pages used to. What is kept rather than compressed away: #148's record of the `max-age=14400` / `max-age=0` divergence, now explicitly a measurement against a Pages-served custom domain; the first-come-first-served measurement in `docs/testing.md`; and the re-measure `docs/testing.md` asks for after the cutover, which is owed by this ticket's attended phase rather than rewritten away. Whether a Workers-served `sahajatlas.com` adds `X-Robots-Tag: noindex` of its own accord is still unknown, and no smoke assertion is weakened for it. `src/lib/report.sentry.test.ts`'s `code_file` fixture moves to `sahajatlas.com`. It stands for a `debug_meta` image from a production build, and no build is served from the old host any more. `docs/environment.md` no longer keys the app's variables per Pages environment: Workers Builds keys them per trigger, and a preview trigger inherits nothing from a production one. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EJEd44taTmZwV4feqXKTED
A review pass over the branch found the claim this ticket exists to retire — Pages serves `sahajatlas.com` — still standing in five files the sweep had not touched, three of them the ⚠ notes for couplings rewritten elsewhere in the same branch. Both halves disagreeing is worse than either, because each reads as current. - `wrangler.jsonc` said the Pages project still serves the domain from this same `dist/` and that #266's last child would move it. It is this Worker's own config and loads beside `docs/rules/deployment.md`. - `.github/workflows/ci.yml` said `pnpm build` must keep `_redirects` because Pages deploys the same `dist/` — the note whoever lands #252 reads, and the one `scripts/ci-workflows.test.ts` now contradicts. - `scripts/deploy-headers.test.ts` justified itself with "they read the Pages app — never the Worker". Both halves are false now, and it was this gate's whole stated reason for existing. Rewritten so the ⚠ says the stronger true thing: Workers static assets add no ACAO of their own, and that is the only platform either site runs on. - `wrangler.design.jsonc`, `scripts/assert-no-sourcemaps.mjs` and `scripts/assert-css-scoped.mjs` each defined something by reference to a Pages build. - `.github/workflows/production-smoke.yml` justified its `cloudflare` slug filter with "both the Workers Builds run and the Pages one". `docs/embedding.md` gains the notice the removal needed. A host whose CSP still allows `sahajatlas.pages.dev` has pre-authorised an origin anybody may now claim, so the guide says to treat a script still loaded from there as a third party — the CHANGELOG entry alone is not where an integrator debugging a dead script looks. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EJEd44taTmZwV4feqXKTED
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | 363ccd6 | Oct 26 2026, 08:50 PM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Right-sized for #283's repo-side phase. I checked the body's central claim mechanically rather than taking its word: the only non-comment change in the diff is public/_redirects's deletion, one Sentry fixture host, two it() titles and two dev-script strings. The contract edits land where AGENTS.md requires, the row ci-workflows.test.ts greps survives in table form, and nothing here should not exist.
Two shape questions. The retained rm -f …/_redirects guards are not a dormant no-op — they are armed against #252's own rule, and a comment is all that stands between. And the diff is written for a repo where the Pages project is already deleted, while the body asks to merge two phases before that happens.
Findings
- should-fix —
scripts/wrangler-config.test.ts:139: the pinnedrm -fwill delete #252's/maprule, and this spec passes either way. - should-fix —
docs/rules/deployment.md:28: asserts a deletion two phases after the merge the body asks for. - should-fix —
scripts/ci-workflows.test.ts:146::27-29,:41-42,docs/testing.md:153-154and.env:9/:21/:27unswept. - consider —
docs/embedding.md:963: a one-row table kept alive by a test regex.
What was checked
#283's own verification greps, on the branch: sahajatlas.pages.dev (5 hits, each past tense or the new changelog entry), _redirects across docs/ public/ scripts/ tests/, no .claude/ path touched, react-circle-flags untouched, file deleted. ci-workflows.test.ts:34's regex matched by hand against the new table row. Read whole: both wrangler*.jsonc, public/_headers, docs/rules/deployment.md, docs/testing.md, both scripts/*.test.ts, package.json's build scripts, docs/embedding.md §§ CSP and Where to load it from. No preview to open: the Workers comment lists sahajatlas-design only.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The review's point was that a comment is not a mechanism. `rm -f <dir>/_redirects` in `build:worker` and `ladle:build` deletes the whole file, which is harmless only while there is no file; #252 returns `public/_redirects` with a `/map / 301` rule a Worker accepts, and the blanket guard would strip that rule from every build while the existing pairing stayed green — it reads `package.json`, never the file. So the narrowing is an assertion now: the spec fails the moment `public/_redirects` exists, which is the moment the hazard becomes real. Watched it fail with the file present and pass without it. The guards themselves stay. Dropping them re-arms the API's 100324 rejection of the splat, which `pnpm check:wrangler` cannot catch, so a re-added splat would fail the whole Workers upload rather than be stripped from the output; and narrowing them now would be shell nothing can exercise, with no file to act on. `docs/rules/deployment.md` takes `public/_redirects` back into its `paths:`, so whoever adds the file loads the deploy rule — a glob for an absent file costs nothing and fires exactly on creation. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G34JBzpUXbptHUUFktGg6d
The body asks for this to merge at the cutover, whose own rule is a fifteen-minute rollback to Pages. Nine places asserted the Pages project was already deleted, so merged then they denied the rollback the ticket mandates: `sahajatlas.pages.dev` still answers with the project's last deployment until #283's final phase removes it, and that deployment is the rollback. Nothing now claims the deletion has happened. `docs/rules/deployment.md` states the sequencing once, as the one place the topology is written: the host is withdrawn at the cutover, the project goes at the last phase, and deletion is the one-way step. The other eight carry only what is true from the cutover on — the host is no longer an origin of ours, the name becomes claimable once the project behind it is gone. The host-facing pair says it in a host's terms: the old host is withdrawn rather than redirected, what it still answers with is a frozen copy, and a script loaded from there is a third party either way. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G34JBzpUXbptHUUFktGg6d
`ci-workflows.test.ts:27-29` read as though two hosts still served one build and two sets of headers; `:41-42` as though the app Worker and a live Pages project still shared a slug. `docs/testing.md` repeated the second verbatim. Both now say what the prefix rule is for once the Pages check run stops arriving: it is what told the two apart while both posted, so the `==` comparison stays. `.env` sent a reader to the Cloudflare Pages dashboard for the Sentry DSN, the source-map variables and the production Turnstile key. Workers Builds keys all three per trigger, and a preview trigger inherits nothing from a production one, which is the reason the body gives for sweeping `docs/environment.md`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G34JBzpUXbptHUUFktGg6d
`scripts/ci-workflows.test.ts:30-34` greps the production host out of the one-row table in § Where to load it from, so reshaping the row into prose fails that spec at collection — and nothing at the table said so. An HTML comment does, where whoever rewords the guide reads it rather than in the spec they will not open. The coupling itself is deliberate and stays: the guide is what decides which host "production" means (#244), and the lane reading it is what stops a one-sided rename aiming a green `Production Smoke` check at another host. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G34JBzpUXbptHUUFktGg6d
Deploying sahajatlas with
|
| Latest commit: |
03a03da
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fc7e5128.sahajatlas.pages.dev |
| Branch Preview URL: | https://claude-chore-283-pages-cutov.sahajatlas.pages.dev |
|
Four critic threads, all addressed. The branch was already level with
Lean gate ✓ 149 files, 1772 tests. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
public/_redirects, withdrawssahajatlas.pages.devfrom the host-facing contract, and rewrites every claim that Pages servessahajatlas.comas past tense.sahajatlas.com404s and no CI lane can see it —production-smoke.ymlfires onWorkers Builds: sahajatlas, which is not what serves the domain yet.rm -fnarrowing chore(build): cut every client over to sahajatlas.com and retire the legacy hosts #252 needs is an assertion, not a comment —scripts/wrangler-config.test.tsfails the momentpublic/_redirectsexists while both guards still delete the whole file.Change outline
The one shape that changed is the deploy contract. Nothing a visitor or a host executes changes — the Worker already had
assets.not_found_handling.Contract —
docs/embedding.md§ Where to load it from, § CSPOne rule per line, paraphrased.
The row whose cell reads
`<host>` | the production domainstays in table form.scripts/ci-workflows.test.ts:30-34matches it to learn which host the production lane reads; reshaping the table into prose fails that spec at collection. An HTML comment above the table now says so, where whoever rewords the guide reads it rather than in a spec they will not open.Files — the
public/deploy files go from three to twopublic/ -├── _redirects # /* /index.html 200 — the Pages app's SPA deep-link fallback ├── _headers # CORS + X-Robots-Tag + Cache-Control; now the ONLY ACAO source └── robots.txt # Disallow: /, plus the link-preview allow-groupThe fallback is no longer a file.
wrangler.jsonc'sassets.not_found_handling: "single-page-application"is it, unchanged by this PR —scripts/wrangler-config.test.ts:92already pinned it.Behaviour — the two
rm -fguards go dormant, and the trap is held by a specThis is the trap the ticket named, and a comment was all that stood between it and #252. The existing pairing at
scripts/wrangler-config.test.ts:131-139readspackage.json, never the file, so it holds over a no-op and would keep holding over a deleted redirect rule. A new assertion beside it fails the momentpublic/_redirectsexists while the guards are blanket — watched failing with the file present, passing without it — so whoever lands #252 has to narrow both guards to the splat first.The guards themselves stay. Dropping them re-arms the Workers API's rejection of the splat as an infinite loop (100324), which
pnpm check:wranglercannot catch, so a re-added splat would fail a whole upload instead of being stripped from the output; and narrowing them now would be shell nothing can exercise, with no file to act on.docs/rules/deployment.mdtakespublic/_redirectsback into itspaths:for the same reason: a glob for an absent file costs nothing and loads the deploy rule exactly on creation, which is when whoever re-adds the file needs it.Preview
Preview pending — the Cloudflare branch alias does not exist until this push deploys, and a per-commit alias goes stale, so none is linked. When it appears, the two paths worth opening are the only observable change in the diff:
/searchin a fresh tab, then refreshed — the SPA fallback withoutpublic/_redirects/this-does-not-exist— the shell, not a "not found" pageNeither needs a human:
tests/smoke/spa-fallback.smoke.test.tsasserts exactly this against the published preview on every run, which is what #299 built the lane for. Data: not seeded — the atlas reads SahajCloud, so there is nothing preview-local to seed.Contract impact
docs/embedding.mdandCHANGELOG.mdboth change, in this PR, asAGENTS.mdrequires for anything a host can observe. A withdrawn script origin is observable twice: the host disappears, and the CSP advice naming it disappears with it.In-tree consumers checked — neither names the withdrawn host, so neither needs an edit:
WeMeditateWeb/lib/atlas-embed.ts⚠ A host whose CSP still allows
sahajatlas.pages.devhas pre-authorised an origin anybody may claim once the project behind it is deleted. Cloudflare publishes no reservation for a released project name, anddocs/testing.md:80-83is this repo's own measurement that these names are first-come-first-served. The guide and the changelog now say to treat a script still loaded from there as a third party either way. Worth weighing at phase 5: keeping the project name claimed but empty costs nothing and closes this.Test results
.claude/skills/pr-prep/check.sh— lint, typecheck,test:run(149 files, 1772 tests); the build andpnpm sizepassed on the previous head and nothing in this round touches either inputscripts/ci-workflows.test.ts+scripts/wrangler-config.test.ts+scripts/deploy-headers.test.ts, 41 passed — the table reader, the_redirectspairing and its new tripwirepublic/_redirectspresent and green without it, so it is not vacuouscomment-lint.mjs --base origin/main, 16 changed files, no banned commentcomment-fingerprint.mjs --base origin/main— no FROZEN comment touched, every KEEP count level or higherpnpm check:wranglerandladle:buildleft to CI; both wrangler configs still parse, whichwrangler-config.test.tsprovesManual verification
Everything below is attended, and none of it can be done from a cloud run — it is Cloudflare, DNS and SahajCloud-admin work. Phases 2–6 of the ticket, in order:
sahajatlas.comand the quietest hour;sahajatlas.pages.dev's last-month request count as a number, read before the hostname comes off Pages — deletion destroys this one for good; the partner page and contact, from asahaj-atlas-client's Discovered Embeds plusmanagers/primaryContact, not from chore(build): cut every client over to sahajatlas.com and retire the legacy hosts #252's stale 2026-08-14 examples./searchfresh and refreshed;/this-does-not-exist;/auto.jsand/embed.jsfor all three headers and a JavaScript content type;PREVIEW_URL=https://sahajatlas.com pnpm test:smoke; theProduction Smokerun that starts on its own within the hour — it never appearing is a failure, not a pass.docs/testing.md:299-305is waiting for, which this PR deliberately leaves standing rather than rewriting away: the 17-case count re-measured against the Workers-servedsahajatlas.com, and whether that host addsX-Robots-Tag: noindexof its own accord. No smoke assertion was weakened for either — Preview checks build on GitHub Actions SahajCloud#903 owns the repair.docs/rules/deployment.md's sequencing stops describing anything pending.syatlas,atlas.sydevelopers.comandatlasreact.sydevelopers.comare chore(build): cut every client over to sahajatlas.com and retire the legacy hosts #252's — list them as accounted for elsewhere and do not touch them.Notes for reviewer
Refs #283, notCloses. Phases 2–6 above are acceptance criteria on that ticket, and no cloud run can meet them, so the ticket has to outlive this merge. Closing it here would drop the attended half silently — which is the one failure mode its own Phases section warns about.One decision, taken rather than asked, as the ticket requires in one line:
pnpm buildandpnpm build:workerstay two scripts.build:workeris the build command Workers Builds holds for the app andci.yml's publish job runs, so collapsing them is a dashboard change made at the cutover, not apackage.jsonchange made now..claude/workflow.json'sdeployTargetstill reads "sahajatlas.com stays on Cloudflare Pages … until #266's cutover". It is a Protected Path: a cloud run that writes it waits out its lease having written nothing. It needs an attended edit, and the ticket deliberately makes it not an acceptance criterion.The sweep compresses rather than clear-cuts, per
docs/rules/code-comments.md. Every⚠line and#NNNbreadcrumb on the-side of a hunk was checked one by one against the+side; #148's measurement record, the first-come-first-served measurement, and the #236/#266/#279/#280/#282/#295 breadcrumbs all survive.react-circle-flags.pages.devis untouched — third-party CDN. No file under.claude/was written.Detail
Review passes.
/code-review highpluscomment-lint.mjs; the toolkit plugin is not installed in a routine./simplify's four-agent fan-out was not run, and that is the step's non-interactive decision rather than an omission: the entire code change on this branch is five string literals and one filesystem assertion — twoit()titles, two messages in a loopback-only dev script, onecode_filefixture, and the_redirectstripwire — with no logic and nothing for reuse/simplification/efficiency/altitude lenses to find. The substance here is prose, whichcomment-lint.mjsand a read of the diff cover./code-review highfound no logic defect but found the sweep incomplete, which is the third commit:wrangler.jsonc,.github/workflows/ci.yml,scripts/deploy-headers.test.ts,wrangler.design.jsonc,scripts/assert-no-sourcemaps.mjs,scripts/assert-css-scoped.mjsand.github/workflows/production-smoke.yml. Nothing was dismissed. Its one non-finding, a lost prose wrap atdocs/embedding.md:969, is fixed.The adversarial review's four threads are answered in the last four commits. Three were adopted — the spec-held narrowing, the cutover wording, and the rest of the present-tense sweep (
scripts/ci-workflows.test.ts:27-29and:41-42,docs/testing.md:153-154, and.env's three pointers at a Pages dashboard that Workers Builds replaces per trigger). The fourth, on the one-row tableci-workflows.test.tsgreps, was rebutted and left coupled: the guide is what decides which host "production" means (#244), and the lane reading the guide is what stops a one-sided rename aiming a greenProduction Smokecheck at a host of someone else's choosing. Reading the host from somewhere the guide may reword freely would make two sources of truth for the one fact that pin exists for.Security review ran —
securityReview.triggerPatternmatchedpublic/_headers,public/_redirects,src/lib/report,wrangler*.jsoncand.env. Verified mechanically rather than asserted:comment-fingerprint.mjsreports the code hash ofwrangler.jsonc,wrangler.design.jsonc,.env,public/_headers,ci.ymlandproduction-smoke.ymlidentical tomain— no header rule, trigger, permission, secret reference or variable value moved in any of them, and the single site-wide ACAO rule is byte-identical. The only non-comment changes on the branch are the five literals and the tripwire above. No CSP directive gained a source;docs/embedding.mdonly removes one. The one finding is the released-name supply-chain risk under Contract impact, mitigated as far as this repo can reach.Why
scripts/deploy-headers.test.ts's comment changed more than tense. Its stated justification was "they read the Pages app — never the Worker, the one platform where a missing or invalid ACAO is fatal". Both halves went false at once, and it was the gate's whole reason for existing — a reader who checked it could have deleted the only mechanism holding the no-collision rule. Rewritten to the stronger true thing: Workers static assets add no ACAO of their own, and that is now the only platform either site runs on.src/lib/report.sentry.test.ts:339's fixture moves tosahajatlas.comrather than being annotated as a pinned literal. It stands for adebug_metaimage from a production build, and no build is served from the old host any more, so the live host is the accurate fixture.docs/environment.mdwas swept although the ticket's table does not list it. It keyed the app'sVITE_*variables per Pages environment and told a reader to set them there — a dashboard that will not exist. Workers Builds keys them per trigger, and a preview trigger inherits nothing from a production one..env's three comments said the same thing and are swept with it.docs/rules/deployment.md'spaths:frontmatter keepspublic/_redirects. An earlier commit here dropped it, on the reasoning that a glob for a deleted file loads nothing — true, and true at precisely the moment the rule is not needed. It fires again when the file is created, which is when #252's author needs the deploy rule and the splat hazard in front of them, so the glob is back.Refs #283
Generated by Claude Code