Skip to content

chore(build): serve the atlas app from a Cloudflare Worker - #297

Merged
sydevs-bot merged 8 commits into
mainfrom
claude/chore-280-app-worker
Oct 14, 2026
Merged

sydevs-bot merged 8 commits into
mainfrom
claude/chore-280-app-worker

Conversation

@sydevs-bot

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

Copy link
Copy Markdown
Contributor

Summary

Change outline

The app becomes a second deploy target out of one build. Nothing a visitor reaches moves:
sahajatlas.com is still the Pages project, and public/_redirects and public/_headers are
byte-identical to main.

Files

 repo root
 ├── wrangler.design.jsonc    # sahajatlas-design, assets from build/
+├── wrangler.jsonc           # sahajatlas, assets from dist/ — the bare default name is the app's
 └── package.json
+    build:worker             # pnpm build, then rm -f dist/_redirects — the Worker's command
-    check:wrangler           # dry-run the design config
+    check:wrangler           # dry-run both, app first

 scripts/
+├── wrangler-config.test.ts          # the gate's only reader
~└── get-cloudflare-preview-url.mjs   # runProject anchors the integration prefix, not the slug

Contract — the app Worker's config

A new shape, under the config it was copied from. Every key is load-bearing; three are not
wrangler defaults.

{
  "name": "sahajatlas",
  "compatibility_date": "2026-10-06",
  "assets": { "directory": "dist", "not_found_handling": "single-page-application" },
  "preview_urls": true,
  "previews": {}
}
  • no main — assets only, no Worker code
  • not_found_handling is the Worker's only deep-link fallback — see the build split below
  • preview_urls defaults to false in wrangler's own schema
  • previews is undocumented but schema-defined; cloudflare/wrangler-action throws without it

Behaviour — one dist/, two platforms that disagree about one file

This is the substance of the change, and it is why the app needs its own build script where the
playground did not.

 pnpm build  →  dist/            # KEEPS _redirects
   └── Cloudflare Pages → sahajatlas.com          # needs the splat; this is what visitors get
+
+pnpm build:worker  →  dist/     # pnpm build, then rm -f dist/_redirects
+  └── Workers static assets → <worker>.workers.dev
+        a Worker READS _redirects and its API rejects `/* /index.html 200`
+        as an infinite loop (100324) — the whole deploy fails, not just that route

ladle:build already does this for build/ (#295). dist/ could not copy that shape, because
Pages deploys the same directory and depends on the line — hence a separate script rather than a
change to pnpm build.

Behaviour — the name sahajatlas now belongs to two deploys

The Worker takes the Pages project's own name, and one Cloudflare App posts a check run for
each. get-cloudflare-preview-url.mjs matched a run to this project by the trailing slug of its
name, so both were this project's run:

 check runs on one commit
   Cloudflare Pages: sahajatlas          # the preview the Smoke lane reads
   Workers Builds: sahajatlas            # a different platform, same slug
-  runProject(name) = /:\s*([a-z0-9-]+)\s*$/   # both → "sahajatlas"
+  runProject(name) = /^cloudflare pages:\s*([a-z0-9-]+)\s*$/

failure and deployment are last-write-wins inside that loop, so a failed Worker build set
failed for a Pages preview that deployed fine — the one status whose advice is that re-running
cannot help. The Worker's run still counts as evidence a deploy exists, exactly as the -design
sibling already did; it just cannot be concluded from. CF_PROJECT names a pages.dev host and
pick() admits no other, so Pages is the only integration this script may conclude from today,
and #266's last child moves both together.

Behaviour — what the gate can and cannot see

The dry run validates a config against wrangler's schema and fails on a missing
assets.directory. Two things it cannot see, both now pinned by scripts/wrangler-config.test.ts:

 pnpm check:wrangler
+  wrangler deploy --dry-run --config wrangler.jsonc        # needs dist/
   wrangler deploy --dry-run --config wrangler.design.jsonc # needs build/
+
+ scripts/wrangler-config.test.ts
+   every wrangler*.{json,jsonc,toml} in the root is named by the gate   # a set, not a list
+   the gate is joined by `&&` only                                     # no `;`, no `|| true`
+   every dry run keeps its `--dry-run`                                 # the gate deploys nothing
+   per config: no main, an output, SPA fallback, previews, a date      # both targets, not one
+   the targets are distinct in name AND output, and the app serves dist/
+   each config is paired with the script that drops _redirects from its directory
+   `pnpm build` is free of that deletion                               # Pages depends on it

The second group exists because the dry run never reaches the API that rejects the file, and a
script that dry-runs one config exits 0.

Contract — the deploy docs

AGENTS.md § Deployment stays the one authority; README.md and docs/architecture.md stay
pointers. The merge took main's measured text wholesale and added only what is the app's.

 AGENTS.md § Deployment
-  sahajatlas — the app, on Pages; it has no `wrangler` config
+  sahajatlas — one build into dist/, deployed by BOTH
+    Pages      → sahajatlas.com, what a visitor gets, until #266's last child
+    a Worker   → its own workers.dev host, nowhere a visitor goes
+  ⚠ the app cannot delete _redirects in `pnpm build` — Pages serves that same dist/
+    so the Worker's Builds command is `pnpm build:worker`, not `pnpm build`
 AGENTS.md § Essential commands
+  pnpm build:worker          # the command a person types into Workers Builds
 docs/testing.md
-  evidence must come from the run matching CF_PROJECT's own slug
+  ⚠ the slug alone is not that match — runProject anchors the integration prefix too
 docs/environment.md
-  VITE_MAPBOX_ACCESSTOKEN  | .env.local
+  VITE_MAPBOX_ACCESSTOKEN  | .env.local + Cloudflare   # absent from .env, inlined at build
-  runbook step 3: add all three Sentry variables to the `sahajatlas` Pages project
+  runbook step 3: … to every target that builds the app; Pages keys per environment,
+                  Workers Builds per trigger, and a preview trigger inherits nothing

Preview

Nothing in this diff is observable on a preview: it adds a config and a script no CI job
deploys, extends a dry run, narrows a discovery gate, and edits prose.

  • Data: not seeded yet — no preview page shows this change.

Test results

  • Lean gate: ✓ pnpm lint && pnpm typecheck && pnpm test:run — 1738 tests, 142 files
  • Targeted specs: 61 passed (scripts/wrangler-config.test.ts 21, scripts/get-cloudflare-preview-url.test.ts 40)
  • Build: ✓ pnpm build, pnpm build:worker, pnpm ladle:build, pnpm size (standalone 309.1/318, loader 2.8/3.5, embed 310.9/318 KiB)
  • Gate: ✓ pnpm check:wrangler over both configs
  • The build split was verified by looking, not inferred: after pnpm build, dist/_redirects
    exists; after pnpm build:worker, it does not; after pnpm ladle:build, build/_redirects
    does not.
Every assertion was watched fail, against the defect it names

Each defect was reintroduced on its own, at the site that would cause it. Only the assertions
written for it went red:

Defect Caught by
gate drops --config wrangler.jsonc dry-runs every config
a third config arrives, ungated dry-runs every config
a wrangler.embed.toml arrives, ungated %s is JSON the shape assertions can read
gate chained with ; fails on the first config that fails
gate swallows failure with || true same
gate drops --dry-run from one segment deploys nothing
app config gains a main serves assets only
app assets.directory drifts to build distinct in name and output; serves the app out of dist
app assets.directory removed names a Worker and an output directory
design config loses preview_urls keeps preview URLs and a previews block
design config loses previews same
design config loses the SPA fallback falls back to the shell
design config loses compatibility_date declares a compatibility date
app config copied wholesale from the design one distinct in name and output
a config is malformed JSONC readConfig throws, naming the file and the reason
build:worker stops dropping dist/_redirects wrangler.jsonc is filled by a script that drops it
ladle:build stops dropping build/_redirects same, for wrangler.design.jsonc
pnpm build starts deleting it leaves pnpm build free of the deletion
runProject matches the trailing slug alone all three runProject cases

The four design-config rows are coverage the first version of this spec did not have: it
asserted the app's keys only, so flipping preview_urls off one file over passed both the dry
run and the spec.

Two forms that are legal and must not go red were checked too: --config=<file>, and a
trailing comma in a config (legal JSONC that wrangler accepts and JSON.parse does not).

Separately, the dry run itself was watched fail with assets.directory pointed at dist-nope:
exit 1, The directory specified by the "assets.directory" field in your configuration file does not exist.

Manual verification

Phase 2 of #280 is attended Cloudflare work, and no cloud run can do any of it. The list is in
#280 under Attended, A → H. Three changes to it from main and from this PR:

  1. The Workers Builds build command for the app is pnpm build:worker, not pnpm build.
    With pnpm build the first deploy fails with 100324 before anything else can be checked.
  2. Finding D is answered by docs(deploy): record the design Worker's first build and smoke measurement #296: the image honours .node-version and packageManager
    ([email protected], [email protected]).
  3. Finding F is answered, negatively by docs(deploy): record the design Worker's first build and smoke measurement #296: Workers Builds branch rules take a literal
    name or a lone * and refuse gh-readonly-queue/* with 12002. The merge-queue exclusion
    chore(build): serve the atlas app from a Cloudflare Worker #280 asks for cannot be configured as it is on Pages.

Still owed, and only a person can take them: the variable list written off the Pages project
before anything is entered, both trigger sets entered and read back name by name, the
source-map upload line in the first build log, the smoke count against the app's Worker host,
and whether Cloudflare accepts the Worker name sahajatlas.

Notes for reviewer

  • This PR sat conflicted for ~8 hours and therefore ran zero CI — the documented trap. The
    merge commit is the fix; CI can schedule from this push on.
  • ## Open questions is gone because both were answered, neither by me:
  • Two findings chore(build): serve the atlas app from a Cloudflare Worker #280 lists as unmeasured are now answered by observation, off the design
    Worker's builds on this very PR: Workers Builds does post a GitHub check run, named
    Workers Builds: sahajatlas-design, so the name identifies which Worker built (finding H);
    and a Worker may take a live Pages project's name — Workers Builds: sahajatlas-design
    and Cloudflare Pages: sahajatlas-design both ran on the same commit. That second
    observation is what the discovery fix above rests on.
  • Two staleness items left on purpose, both under .github/, which chore(build): serve the atlas app from a Cloudflare Worker #280 forbids editing:
    ci.yml:46-50 still calls the gate step "the design Worker's config" and claims nothing else
    reads it; and ci.yml:52-54 justifies its position by ladle:build/build/ alone, though it
    now also needs pnpm build's dist/. That second one has teeth: ci.yml runs pnpm build
    twice, so deleting the first as a duplicate would make the gate fail cold.
  • .claude/workflow.json is a protected path, so deployTarget and
    securityReview.triggerPattern (which matches no wrangler* path) stay stale — an attended
    edit at Our Cloudflare Pages sites move to Cloudflare Workers, at no extra cost #266's last child, per chore(build): serve the atlas app from a Cloudflare Worker #280's Notes.
  • Security review: no findings. The Worker serves byte-identically to what Pages already
    serves publicly from the same build, preview_urls: true was already main's posture, both
    wrangler invocations are explicit --dry-run with no Cloudflare credential anywhere in CI,
    and no secret value entered the diff. The two gates this PR narrows — the check-run anchor and
    the pinned --dry-run — both move in the safe direction: strictly less is admitted, and
    nothing that was refused before is admitted now.
  • Dismissed, with reasons: running the two dry runs concurrently (2.86 s saved, but it needs
    hand-rolled shell job control where a mis-written wait exits 0 on failure); sharing one
    config via env (moves the selector into a dashboard command no spec can see).
Detail

Why a spec and not just the dry run. scripts/deploy-headers.test.ts exists for the same
reason one level over: public/_headers is inert text no local gate can execute. Here the inert
things are the gate's argument list and the config→script pairing. Nothing else in this repo
deploys from either wrangler config — Workers Builds holds the dashboard's copy of each path.

The parser. ts.parseConfigFileTextToJson replaced a hand-rolled line-comment strip. A
trailing comma is legal JSONC that wrangler accepts (allowTrailingCommas in its own schema)
and JSON.parse rejects, so the strip could have gone red on a config that was fine.
TypeScript is already a devDependency and src/test-support/source-ast.ts already imports it.
Measured: the lane's wall clock stayed inside the band it already occupied.

The fixture pre-mortem. The spec reads the two real configs and the real package.json
rather than fixtures, so its only assumption is that a wrangler config is JSON-ish — asserted
rather than assumed, so a .toml fails by name instead of skipping the shape checks silently.

--dry-run is pinned for a cost it does not yet carry. Nothing in this repo holds a
Cloudflare credential today, so dropping the flag would only make a red gate noisy. The spec
pins it because #266's child adds cloudflare/wrangler-action and a token, and the same script
would deploy from CI — the spec is the gate's only reader either way.

public/_redirects and public/_headers carry no change from this branch, and no ⚠,
#NNN breadcrumb or cross-repo pointer was dropped by the sweep or the merge — checked by
diffing the counts per file in both directions against the new base.

Closes #280

🤖 Generated with Claude Code

https://claude.ai/code/session_01GWfwsqh3etS8AgAGQRFp5s

`wrangler.jsonc` is the `sahajatlas` app as a Workers static-assets Worker:
assets-only out of `dist/`, `not_found_handling` in place of the
`public/_redirects` splat the Worker never reads, previews on, and the
`previews` block `cloudflare/wrangler-action` refuses to run without.

`pnpm check:wrangler` named `wrangler.design.jsonc` alone, and nothing else
in this repo reads either file — Workers Builds holds the dashboard's copy
of the path. A config added without extending the gate is the exact drift
#279 built the gate against, so the script now dry-runs both. Watched fail
with `assets.directory` pointed at a directory `pnpm build` does not write:
exit 1, naming the field.

`scripts/wrangler-config.test.ts` covers the half the dry run cannot. A
script that dry-runs one config exits 0, so the gate's own coverage has no
second reader. Each of its nine assertions was watched fail against the
defect it names.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GWfwsqh3etS8AgAGQRFp5s
`AGENTS.md` § Deployment stays the one authority, and `README.md` and
`docs/architecture.md` stay pointers to it. What changed under it: the app
is two targets, not one. The same `dist/` is served by the Pages project
that answers `sahajatlas.com` and by a Worker at its own `workers.dev`
host, so the `sahajatlas` bullet no longer claims the app has no `wrangler`
config, and `_redirects` is now described as read by a platform rather than
by a build — the app Worker ignores the very file the Pages app honours out
of the same output.

The variable docs follow from that: Pages keys its copies per environment,
Workers Builds per trigger, and a preview trigger inherits nothing, so each
`VITE_*` value is entered on every target. The Sentry runbook's step 3 said
"the `sahajatlas` Pages project", which would now leave the Worker
uploading nothing while deploying green.

`docs/environment.md`'s `VITE_MAPBOX_ACCESSTOKEN` row said `.env.local`
alone. The token is absent from the committed `.env` and inlined at build
time, so Pages Production must already hold it or `sahajatlas.com` would
draw no tiles. A variable list built from that table would have missed the
map.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GWfwsqh3etS8AgAGQRFp5s
The spec enumerates the configs on disk instead of listing two, so a third
target cannot arrive ungated, and applies the shared static-assets
invariants to every config rather than the app's alone — flipping
`preview_urls` off in `wrangler.design.jsonc` passed both the dry run and
the first version of this spec, which is the hole it was written to close
one file over. `ts.parseConfigFileTextToJson` replaces a hand-rolled
comment strip: a trailing comma is legal JSONC that wrangler accepts and
`JSON.parse` does not, so the strip could go red on a config that is fine.
Measured: the `typescript` import leaves the lane's wall clock inside the
band it already occupied, 30.08s against 28.9-31.2s.

Dropped an assertion that proved nothing: `dist` is Vite's default
`outDir`, and `vite.config.ts` sets none, so pinning `build` to contain
`vite build` tied the config to nothing.

Comment and doc compressions, no fact removed: the filename convention,
the prefix hazard, the `previews` rationale and the `_redirects`
behaviour were each stated twice over, once here and once in the file or
authority that already owned them. `AGENTS.md` keeps the topology fact
that generates the doubled variable entry and `docs/environment.md` keeps
the per-variable consequence, so neither points at the other for a rule
both state. `AGENTS.md`'s "run last" was wrong — `ci.yml` runs `pnpm build`
again after the gate.

Two claims corrected rather than compressed. Nothing else in this repo
*deploys from* either wrangler config; `scripts/wrangler-config.test.ts`
now reads both, so "nothing else reads" had become false. And
`docs/testing.md` still credited the design Worker alone with
`not_found_handling`, 90 lines under an edit that generalised it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GWfwsqh3etS8AgAGQRFp5s
This ticket's Approach 3 rests on a false premise, and the docs this branch
already touched had copied it into the authority. `wrangler`'s
`getAssetsOptions` reads `_redirects` and `_headers` through the same
`maybeGetFile` pair and uploads each as a deployment module — which is
precisely why `_headers` governs the playground Worker, as AGENTS.md
already claimed. `createAssetsIgnoreFunction` keeps both out of the asset
manifest, so neither is SERVED; #279 read that as "never read at all".
`.assetsignore` cannot suppress either, because the read is unconditional.

So `dist/`'s `/*  /index.html  200` is in play on the app Worker, and what
it does there is unmeasured. Cloudflare documents, for BOTH platforms, that
"Redirects are always followed, regardless of whether or not an asset
matches the incoming request" — and that sentence does not describe Pages.
Measured against `sahajatlas.com` today, with the splat live: `/embed.js`
and `/auto.js` answer `application/javascript`, `/robots.txt` answers
`text/plain`, and only an unbuilt path falls through to the shell. An asset
wins there. So the sentence predicts neither platform reliably, and the
ticket's two predictions — that `robots.smoke.test.ts` passes and that no
asset can be shadowed — are not evidence.

Nothing here changes `public/_redirects`, and no fix is guessed at: the
measurement comes first, on a Worker host, which is what the ticket's own
acceptance criteria already ask a person to do.

Two gate holes from the same review. Naming both configs was half a check:
`;` or `|| true` between the dry runs kept the name list intact while a
failing config exited 0. And the enumeration matched `.jsonc` alone, so a
`wrangler.embed.toml` would have been invisible to "no target arrives
ungated". Both now fail against their own defect.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GWfwsqh3etS8AgAGQRFp5s
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 13, 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 Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 4778bbe Oct 14 2026, 12:52 AM

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

⚠ Behind main, and red for it. Workers Builds: sahajatlas-design failed on 784011d.

main moved to 498b6ff (#295) at 15:56Z, four minutes after I branched. It answers open question 1, as neither option I listed. Workers static assets do read _redirects, and the Workers API rejects /* /index.html 200 as an infinite loop (code 100324), failing the deploy. It does not shadow assets, and check:wrangler cannot see it: the dry run never reaches the API.

  1. This branch lacks fix(build): drop _redirects from the Ladle build the design Worker deploys #295's rm -f build/_redirects in ladle:build — why the design build is red. The base merge ports it.
  2. wrangler.jsonc would fail the same way. It deploys dist/, which carries _redirects. AGENTS.md on main now says the app's move "must drop the line rather than ship it" — and dist/ also feeds the Pages app serving sahajatlas.com, so pnpm build must not delete it. A Worker-only build step is a scope call, not a port.
  3. My doc edits and fix(build): drop _redirects from the Ladle build the design Worker deploys #295's touch the same lines in three files.

My lease on #280 is released; the push is the dispatcher's.

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


Generated by Claude Code

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

This draft has had no CI activity for hours and no session holds it. Comment or push to wake me.

🤖 sydevs dispatcher

`main` answered this branch's open question while it sat conflicted. #295
measured what I had only narrowed: a Worker reads `_redirects`, and the
Workers API rejects `/*  /index.html  200` as an infinite loop (100324),
so the deploy fails outright rather than shadowing assets. #296 then
measured the first build — the image honours `.node-version` and
`packageManager`, and branch rules refuse prefix wildcards (12002).

Conflicts, both in the half this branch and `main` each rewrote:

- `package.json` — took `main`'s `ladle:build` with its `rm -f`, kept this
  branch's two-config `check:wrangler`.
- `AGENTS.md` § Deployment — took `main`'s measured text wholesale and
  dropped my hedged version of the same facts, then added only what is the
  app's: that `dist/` cannot be cleaned by `pnpm build`.

That last point is the one new thing here. `main` says the app's Worker
move "must drop the line rather than ship it", and `ladle:build` shows the
shape — but `dist/` is not `build/`: the Pages project serving
sahajatlas.com deploys that same directory and needs the splat. So the
deletion cannot live in `pnpm build`. `build:worker` is `build` plus the
same `rm -f`, and it, not `build`, is the app Worker's Builds command.

Verified: `pnpm build` leaves `dist/_redirects` in place, `pnpm
build:worker` removes it. `check:wrangler` cannot catch a regression —
the dry run never reaches the API that rejects the file — so the spec
pins each config to the script that fills its directory, and pins
`pnpm build` as free of the deletion. All three watched fail.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GWfwsqh3etS8AgAGQRFp5s
@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: a9e5cf2
Status: ✅  Deploy successful!
Preview URL: https://f51fb3e2.sahajatlas.pages.dev
Branch Preview URL: https://claude-chore-280-app-worker.sahajatlas.pages.dev

View logs

@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 14, 2026
@sydevs-bot

sydevs-bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 01:03Z address-review · attempt 1 · session · done
  • 01:03Z address-review · attempt 1 · session
  • 00:53Z review-pr · attempt 1 · session · done
  • 00:53Z review-pr · attempt 1 · session

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

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Unblocked and pushed 4778bbe. The orphan notice was a conflicted PR, which schedules zero CI runs — nothing moved since 16:49Z.

Merged main (be5d533), which answered both open questions while the branch sat stuck, so that section is gone:

New here: ladle:build drops _redirects from build/, but dist/ cannot copy that — Pages serves the same directory and needs the line. So pnpm build:worker is pnpm build plus the rm -f, and that is the app Worker's Builds command. Verified by looking: build leaves the file, build:worker removes it. The spec pins each config to the script filling its directory, and pnpm build as free of the deletion — all three watched fail.

Gates green: lint, typecheck, 1734 tests, both builds, check:wrangler.

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


Generated by Claude Code

@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 matches #280's phase 1 and is no bigger than it: one config, a two-command gate, one build script, a doc sweep. build:worker is forced by #295, not invented here. The 158-line spec guards a two-command script, but its per-config block earns that — flipping preview_urls on one file alone passes the dry run. No contract surface moves: docs/embedding.md, public/_headers and public/_redirects are untouched.

One finding has teeth, and it is about the name, not the config.

Findings

  • should-fix wrangler.jsonc:7 — Workers Builds: sahajatlas matches runProject's exact-slug gate, so the app Worker's build can set failure and deployment for the Pages run. Red Smoke on healthy PRs from attended B onward, not from child 4.
  • should-fix scripts/wrangler-config.test.ts:78 — the gate's --dry-run is unpinned.
  • consider AGENTS.md:105 — pnpm build:worker is absent from Essential commands.

Named in the PR body, routed nowhere, not fixable on this branch:

  • #280 attended B still says build command pnpm build. That ticket is the runbook a person follows; this PR body is not.
  • ci.yml:46-54 — the gate comment still reads design-only, and the first pnpm build is now load-bearing for the gate with nothing saying so.

What was checked

#280 and #266 bodies; the whole diff; both wrangler configs whole; package.json scripts; the new spec against vitest.config.ts's **/*.test.ts include and eslint.config.js's readdirSync ban (scoped to src/, so scripts/ is clear); ci.yml order — build → size → ladle:build → gate, so both output directories exist; get-cloudflare-preview-url.mjs:244-254,700-770 and its spec; grep for any other wrangler invocation (none). No preview: the body is right that nothing here shows on one.

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


Generated by Claude Code

Comment thread wrangler.jsonc Resolved
Comment thread scripts/wrangler-config.test.ts Resolved
Comment thread AGENTS.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 14, 2026
`runProject` matched the trailing slug of a check run's name, so with the
app Worker named `sahajatlas` — the Pages project's own name, which
`wrangler.jsonc` gives it — `Workers Builds: sahajatlas` and
`Cloudflare Pages: sahajatlas` were both read as this project's run. One
Cloudflare App posts both, so the slug gate admitted the Worker's run to
the conclusion block, where `failure` and `deployment` are
last-write-wins. A failed Worker build would then report the Pages
preview as `failed`, the one status whose advice is that re-running
cannot help, on a PR whose preview deployed fine.

The name-only evidence path is unchanged: a Worker run still counts as a
Cloudflare deploy signal, as the `-design` sibling already did. It just
cannot be concluded from. `CF_PROJECT` names a `pages.dev` host and
`pick()` admits no other, so Pages is the only integration this script
may conclude from today; #266's last child moves both together.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PgAVPfgGikcJastAwMwoUm
The spec is the gate's only reader and pinned `--config` and the `&&`
joining, but not the flag that keeps `wrangler deploy` offline and
credential-free. Dropped, every case still passed. Today that only makes
a red gate noisy; once #266's child adds `cloudflare/wrangler-action`
and a Cloudflare token to this repo, the same script would deploy from
CI. Watched fail with the flag removed from one segment.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PgAVPfgGikcJastAwMwoUm
The block is the repo's command inventory, and `build:worker` is also
the command a person types into Workers Builds for the app. It appeared
only in § Deployment.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PgAVPfgGikcJastAwMwoUm
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Three findings, three commits, all adopted. Pushed a9e5cf2.

  • wrangler.jsonc:7 — runProject matched a check run's trailing slug, so Workers Builds: sahajatlas read as the Pages run and a failed Worker build would report a healthy preview as failed. 6ba297f anchors ^cloudflare pages:; the Worker's run stays evidence, never a conclusion. This also corrects my own "only in its evidence" answer to that open question — it was half of it.
  • wrangler-config.test.ts:78 — db10341 pins --dry-run in every && segment.
  • AGENTS.md:105 — a9e5cf2 lists pnpm build:worker.

Four new cases, each watched fail at the site that would cause it. Lean gate green: 1738 tests, 142 files.

Body refreshed where this push made it false, that open-question note included.

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


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 14, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 14, 2026 01:23
@sydevs-bot
sydevs-bot requested a review from Ardnived October 14, 2026 01:23
@sydevs-bot sydevs-bot moved this from Revising to Approved in SYDevelopers Technical Roadmap Oct 14, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit ddc574d Oct 14, 2026
61 of 65 checks passed
@sydevs-bot
sydevs-bot deleted the claude/chore-280-app-worker branch October 14, 2026 15:56
@sydevs-bot sydevs-bot moved this from Approved to Done in SYDevelopers Technical Roadmap Oct 14, 2026
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.

chore(build): serve the atlas app from a Cloudflare Worker

3 participants