Repository navigation
CR4: cron-starter becomes an Orun baseline - #5
Merged
Merged
Conversation
The repository is now a baseline: blueprint.yaml (the console card) and repo-blueprint.yaml (the build) take a new product from nothing to live on stage and prod in TWO phases, cirrus-baseline v22's one-landing shape: - 01-product places every module (root files, CI, tooling, the KV root, the Worker with its page, API routes and Cron Triggers, its tests), retouches, brands, re-tenants, strips the work tree, defers prod's promotion gate and dev's push lanes, lands it as one pull request after reconciling CLOUDFLARE_API_TOKEN (workers-deploy: Workers Scripts and KV Storage) and CLOUDFLARE_ACCOUNT_ID, then watches the convergence, checks WIRING_CLOUDFLARE_KV exists on stage and prod, and probes both URLs. - 02-docs is hook-only: restores the two deferrals, renders the deployment record (with each environment's last recorded cron run), lands it. Infra before app: apps/web depends on cloudflare-kv with mode: enforced on github-push-main and advisory on pull requests. The product's own push-to-main plan puts the KV applies at lane level 0 and each web deploy at level 1, waiting on its own environment's apply alone. The cron path: the scheduled handler lives in the committed custom entry worker.ts (OpenNext's fetch + scheduled) and the seven triggers in the template the build re-renders, so both survive a lane's build in the staged job tree. The deploy's smoke now proves the cron's effect: it reads /api/data/1m and requires a fetchedAt from the last ten minutes, a run the every-minute trigger recorded through the scheduled handler (the composition retries it ~4.5 min; the watch resumes failed lanes; risk CR-J). The card, BOOTSTRAP and the product's docs say the account needs Workers Paid (14 triggers; Free allows 5 per account). Fixed on the way, latent since CR1 because no Orun lane had run: - wrangler.jsonc is committed as the fixture render; the composition's verify-app-structure checks it exists BEFORE the build. - dev, which no root applies to, renders the fixture (live.mjs --fixture --fixture-envs dev). - the page's <title> and description go through _app's own <Head>: @vercel/examples-ui's layout <Head> does not reach the server render. Also: packages/ (a required discovery root), stack-tectonic 0.19.0, the orun lane pin v2.78.4, checks.yml on pull requests only, the ci.yml ws_CHANGE_ME gate, the lib/site.ts identity seam, the Open Graph image absolute on the request's origin (getServerSideProps; no SITE_URL), .wrangler/ out of lint, keyed task contracts, the KV root's Cirrus prose. Tests (testing/, baseline.yml): manifest, phases, coverage, rebrand, retouch, bootstrap-defer, wire, leak, placement (both phases offline, the product's own plans, the cron entry and triggers kept) and e2e (the stage lane's steps incl. verify-app-structure in the staged job tree with a stage wiring document; wrangler dev --test-scheduled; the component's own smoke refused before any trigger fired; all seven expressions fired through /__scheduled and each record read back; the smoke then passes; every route). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
Cloudflare counts Cron Triggers per ACCOUNT, five on Workers Free, and the platform cannot check a plan before it deploys: seven triggers per Worker, fourteen per product, made a Free account refuse the first deploy. The Worker now registers ONE trigger, `* * * * *` (TRIGGER in lib/crons.ts, the only entry in triggers.crons), two per product, inside Free's five. The scheduled handler evaluates the seven schedules in lib/crons.ts (the template's vercel.json expressions, verbatim, and still the ones the page shows) against the trigger's scheduledTime in UTC, with a small five-field matcher: 1m every minute, 10m when minute % 10 == 0, 1h at minute 0, 12h at 00:00 and 12:00, 1d at 00:00, 1w at 00:00 on Sunday (`0 0 * * 0`), 1mo at 00:00 on the 1st. Each due schedule runs /api/cron/<interval> through the OpenNext fetch handler, as before, one after another; a failing route does not stop the rest, and the invocation then fails naming each. The page and /api/data/<interval> are unchanged; the smoke still reads /api/data/1m. Tests: the matcher and the dispatcher at crafted times (34 unit tests); the placement tier asserts the one trigger in the product's template and committed render; the e2e fires /__scheduled?cron=*+*+*+*+* on the clock and the trigger at eight crafted scheduled times through wrangler's local trigger route (/cdn-cgi/local/scheduled?cron=…&time=…; /__scheduled always stamps the present), asserting exactly the due schedules ran and the rest stayed, then reads every record back. "Workers Paid" is gone from the card, BOOTSTRAP and the product's docs; risk CR-B resolved, CR-N added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
ruehowl
marked this pull request as ready for review
October 15, 2026 20:12
ruehowl
added a commit
that referenced
this pull request
Oct 21, 2026
…text pack (#6) * CR5: the cirrus standard — no kiox, generated component docs, the context pack - Remove kiox.yaml/kiox.lock and their two blueprint modules: nothing ran the kiox pin (v2.15.0); every workflow pins orun through orun-action. - Generate docs/{overview,architecture,runbook}.md for every component from what it declares (tooling/catalog/gen-component-docs.py), and fail Baseline CI when they drift (--check). - Add ai/context/{current,decisions,open-risks}.md (this repository's own; nothing places them). - Close out CR4 (shipped in #5, tagged baseline-v1) and record CR5 (CR-6). - Make the docs say what CR4 built: the epic README's summary and the status file's "Vercel Cron → Cron Triggers" describe one every-minute trigger dispatching the seven schedules (no seven triggers, no intervalFor); "Versions" no longer calls apps/web/README.md upstream's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha * Regenerate component docs: prettier-padded tables, accurate wording The generator now lays tables out the way prettier does (an app whose lint is `prettier --check` accepts the pages as written), lists the WIRING_* failure only for Workers that take wiring, and no longer claims a package holds no credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha * Component docs: list optional and per-environment secrets The generator now reads `optionalSecretEnv` (listed as "(optional)") and secrets declared per environment under `subscribe.environments[]`, so a page no longer leaves out a secret its component declares. Its tables are laid out as prettier lays them out, the WIRING_* failure is listed only for Workers that take wiring, and a package is no longer said to hold no credentials. Every starter now carries the identical generator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha --------- Co-authored-by: Claude <noreply@anthropic.com>
ruehowl
added a commit
that referenced
this pull request
Oct 21, 2026
* CR5: the cirrus standard — no kiox, generated component docs, the context pack
- Remove kiox.yaml/kiox.lock and their two blueprint modules: nothing ran
the kiox pin (v2.15.0); every workflow pins orun through orun-action.
- Generate docs/{overview,architecture,runbook}.md for every component
from what it declares (tooling/catalog/gen-component-docs.py), and fail
Baseline CI when they drift (--check).
- Add ai/context/{current,decisions,open-risks}.md (this repository's own;
nothing places them).
- Close out CR4 (shipped in #5, tagged baseline-v1) and record CR5 (CR-6).
- Make the docs say what CR4 built: the epic README's summary and the
status file's "Vercel Cron → Cron Triggers" describe one every-minute
trigger dispatching the seven schedules (no seven triggers, no
intervalFor); "Versions" no longer calls apps/web/README.md upstream's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Regenerate component docs: prettier-padded tables, accurate wording
The generator now lays tables out the way prettier does (an app whose lint
is `prettier --check` accepts the pages as written), lists the WIRING_*
failure only for Workers that take wiring, and no longer claims a package
holds no credentials.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Component docs: list optional and per-environment secrets
The generator now reads `optionalSecretEnv` (listed as "(optional)") and
secrets declared per environment under `subscribe.environments[]`, so a
page no longer leaves out a secret its component declares. Its tables are
laid out as prettier lays them out, the WIRING_* failure is listed only
for Workers that take wiring, and a package is no longer said to hold no
credentials. Every starter now carries the identical generator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* CR5: read the workers.dev subdomain from the Cloudflare connection
- blueprint.yaml: the subdomain input declares
`from: connection.cloudflare.workersSubdomain`; the console fills it from
the connection the build is bound to (the one CLOUDFLARE_ACCOUNT_ID and
the deploy tokens mint from) and renders no field for it
- testing/manifest.test.sh: cirrus-baseline's check, byte for byte — a
`connection.<provider>.<fact>` source is accepted only when
spec.requires.integrations lists the provider (mutation-checked)
- repo-blueprint.yaml, BOOTSTRAP.md, docs/phases/README.md: a hand-run
build still passes --set subdomain
- records: CR-7 joins CR5; status, plan, epic index, current.md and
decisions.md say CR5 ships as baseline-v2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
---------
Co-authored-by: Claude <noreply@anthropic.com>
ruehowl
added a commit
that referenced
this pull request
Oct 22, 2026
* CR5: the cirrus standard — no kiox, generated component docs, the context pack
- Remove kiox.yaml/kiox.lock and their two blueprint modules: nothing ran
the kiox pin (v2.15.0); every workflow pins orun through orun-action.
- Generate docs/{overview,architecture,runbook}.md for every component
from what it declares (tooling/catalog/gen-component-docs.py), and fail
Baseline CI when they drift (--check).
- Add ai/context/{current,decisions,open-risks}.md (this repository's own;
nothing places them).
- Close out CR4 (shipped in #5, tagged baseline-v1) and record CR5 (CR-6).
- Make the docs say what CR4 built: the epic README's summary and the
status file's "Vercel Cron → Cron Triggers" describe one every-minute
trigger dispatching the seven schedules (no seven triggers, no
intervalFor); "Versions" no longer calls apps/web/README.md upstream's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Regenerate component docs: prettier-padded tables, accurate wording
The generator now lays tables out the way prettier does (an app whose lint
is `prettier --check` accepts the pages as written), lists the WIRING_*
failure only for Workers that take wiring, and no longer claims a package
holds no credentials.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Component docs: list optional and per-environment secrets
The generator now reads `optionalSecretEnv` (listed as "(optional)") and
secrets declared per environment under `subscribe.environments[]`, so a
page no longer leaves out a secret its component declares. Its tables are
laid out as prettier lays them out, the WIRING_* failure is listed only
for Workers that take wiring, and a package is no longer said to hold no
credentials. Every starter now carries the identical generator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* CR5: read the workers.dev subdomain from the Cloudflare connection
- blueprint.yaml: the subdomain input declares
`from: connection.cloudflare.workersSubdomain`; the console fills it from
the connection the build is bound to (the one CLOUDFLARE_ACCOUNT_ID and
the deploy tokens mint from) and renders no field for it
- testing/manifest.test.sh: cirrus-baseline's check, byte for byte — a
`connection.<provider>.<fact>` source is accepted only when
spec.requires.integrations lists the provider (mutation-checked)
- repo-blueprint.yaml, BOOTSTRAP.md, docs/phases/README.md: a hand-run
build still passes --set subdomain
- records: CR-7 joins CR5; status, plan, epic index, current.md and
decisions.md say CR5 ships as baseline-v2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* CR6: the console asks for no domain — the domain is set later
The site goes live on workers.dev from its first deploy and nothing in the
build needs a domain — the page builds its absolute links from the request
it answers, and the Cron Triggers need no hostname — so the console's
Product step no longer asks for one. The logic that uses a domain stays
where it is, waiting for one.
- blueprint.yaml: no productdomain input
- repo-blueprint.yaml: productdomain is optional, default empty
- rebrand.mjs: productdomain no longer required; empty brands the reserved
placeholder <reponame>.example.com (RFC 2606) where the domain goes
(BASE_DOMAIN), so setting it later is replacing one string
- the product README and ai/context/operations.md say how to set it
- testing/fixtures/acme.json carries no domain; rebrand.test.sh pins the
placeholder; baseline.yml's blueprint read sets no domain
- records: CR6 / CR-8, tagged baseline-v3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
---------
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CR4 (task CR-5). This turns the repository into an Orun baseline. It is a card (
blueprint.yaml) plus a build document (repo-blueprint.yaml) that take a new product from nothing to live on stage and prod in one landing, using cirrus-baseline v22's shape. It is ported fromkv-redis-starter(sourceplane/kv-redis-starter#5) and adapted for a Worker with a scheduled handler. The Workers Free plan is enough.What was added
Two phases.
01-productplaces every module, brands it and lands it as one PR. Its post hooks run retouch → git-init → stage → rebrand → orun-workspace → work-tree strip → promotion/dev-lanes defer → restage → rebrand-verify → lockfile →orun.repo/ensure→ link → reconcileCLOUDFLARE_API_TOKEN(workers-deploy) andCLOUDFLARE_ACCOUNT_ID(account-id) →orun.pr/land. Its await watches the merge sha, checksWIRING_CLOUDFLARE_KVexists on stage and prod, and probes both URLs.02-docsis hook-only: it restores the deferrals, renders the deployment record and lands it.KV is applied before the Worker deploys.
apps/webdeclaresdependsOn: cloudflare-kvwithmode: enforced, plusmodeRulesthat make it advisory ongithub-pull-request. In the product's ownorun plan --trigger github-push-main, the KV applies run at lane level 0. Each web deploy runs at level 1 and waits only on its own environment's apply.One Cron Trigger per Worker (second commit). Cloudflare counts triggers per account, and Free allows 5. The Worker now registers only
* * * * *, so a product uses 2 triggers. The scheduled handler checks the seven schedules inlib/crons.tsagainst the trigger'sscheduledTime, in UTC:0 0 * * 0Each due schedule runs
/api/cron/<interval>through the OpenNext fetch handler, as before. A failing route doesn't stop the others, and the invocation then fails, naming each failure. The page and/api/data/<interval>are unchanged.The cron path survives a staged build. The handler is in the committed entry
worker.ts, and the trigger is in the template the build re-renders. Both are asserted on the config the lane's own build writes.The smoke checks that a cron run happened. It reads
/api/data/1mand requires afetchedAtfrom the last ten minutes. Before, it only grepped/for the heading text.Latent bugs fixed, as in KR:
wrangler.jsoncwas git-ignored, butverify-app-structurechecks for it before the build. It is now committed as the fixture render, and Checks diffs it.--fixture … --fixture-envs dev).packages/.gitkeepwas missing, which madeorun planfail.Other changes:
apps/web/lib/site.ts.getServerSideProps), so noSITE_URLis needed.<title>and the description are rendered by_app's own<Head>. The@vercel/examples-uilayout's<Head>never reaches the server render..wrangler/is excluded from lint.checks.ymlruns on PRs only.ci.ymlgate is nowws_CHANGE_ME.Factory pieces copied from KR:
.baseline/,tooling/{rebrand,bootstrap},hooks/render-deployment-docs.sh,ai/context/,docs/phases/,BOOTSTRAP.md,testing/,baseline.ymlandtag.yml.How it was verified (at head
f5cbe21)orun new --statusat v2.58.11, v2.78.4 and 2.79.001-productplaces 72 files;02-docsis hook-onlyorun validate,orun work check* * * * *trigger.--resumeis a no-opwire:fixture(no diff), typecheck, lint (0 warnings), test (34), buildterraform validateoninfra/terraform/cloudflare-kvWhat the e2e does:
verify-app-structure,build-app,verify-build-outputanddeploy-dry-runin the staged job tree, with a stage wiring document.wrangler dev --test-scheduled. Before any trigger fires, the component's own smoke fails./__scheduled?cron=*+*+*+*+*, which runs 1m./cdn-cgi/local/scheduled?cron=…&time=…), because/__scheduledalways uses the current time. At each time, exactly the due schedules run and every other record stays unchanged. This includes 1w on a Sunday but not a Monday, and 1mo on the 1st.Not verified here:
terraform apply, a real deploy that registers the trigger, the trigger firing on Cloudflare's clock, and the probes.🤖 Generated with Claude Code
https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk