Skip to content

HA3: hono-api becomes an Orun baseline - #4

Merged
ruehowl merged 1 commit into
mainfrom
claude/blissful-ptolemy-c5ajf8
Oct 15, 2026
Merged

ruehowl merged 1 commit into
mainfrom
claude/blissful-ptolemy-c5ajf8

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

HA3 (task HA-4). The Hono API on one Cloudflare Worker becomes an Orun baseline. A new API goes from nothing to live on stage and prod in one landing, the way cirrus-baseline builds its product since baseline-v22. What a small baseline contains comes from portfolio-starter-kit's baseline-v2.

What was added

The card and the build

  • blueprint.yaml (the card) and repo-blueprint.yaml (the build document), with two phases:
    • 01-product places every module (root files, workflows, tooling, apps/api, tests/api). Its post hooks run cirrus's 01-product chain in this order: retouch, git init/stage, rebrand, orun-workspace, work-tree --strip, promotion --defer, dev-lanes --defer, restage, rebrand-verify, the pnpm lockfile, orun.repo/ensure, link, one orun.integrations/reconcile per brokered key, orun.pr/land.
      • Brokered keys: CLOUDFLARE_API_TOKEN (workers-deploy) and CLOUDFLARE_ACCOUNT_ID (account-id).
      • It then awaits orun.run/watch on the merge sha and an orun.http/probe of /health on stage and prod.
      • There is no orun.secrets/exists await, because there is no infra.
    • 02-docs is hook-only. It restores both deferrals, renders the deployment record and lands it, then re-probes.
  • Card: requires.integrations: [github, cloudflare], expectedMinutes: 9. The verify URL is https://{reponame}-api-{env}.{subdomain}.workers.dev.

Baseline machinery

  • .baseline/: the tree's identity, the two task contracts and the product README.
  • tooling/rebrand (the rename engine) and tooling/bootstrap (promotion, dev-lanes, retouch, work-tree).
  • hooks/render-deployment-docs.sh, ai/context/, docs/phases/ and BOOTSTRAP.md.
  • .github/workflows/baseline.yml and tag.yml.

The API

  • GET /health answers {"status":"ok","name":API_NAME,"environment":ENVIRONMENT}.
  • API_NAME in apps/api/src/identity.ts is the product-name seam.
  • GET / is unchanged.

The deploy contract

  • The smoke reads /health for this environment on https://<repo>-api-${ORUN_ENVIRONMENT}.<subdomain>.workers.dev. The worker composition exports no deployed URL, so the command builds its own; DEPLOYED_URL overrides it.
  • The unused orgName/owner/repo parameters are dropped.
  • wrangler.jsonc stays committed, so the composition's verify-worker-structure step finds it in a staged tree before any build.

CI and intent

  • ci.yml uses a linked gate: it plans nothing only while intent.yaml says ws_CHANGE_ME. It is pinned to orun v2.78.4.
  • checks.yml runs on pull_request and workflow_dispatch only.
  • stack-tectonic is pinned to 0.19.0, with its comment.
  • Terraform parameterDefaults are gone, and the repo docs point at ai/context.
  • infra/ and packages/ get .gitkeep files. Without them orun plan refused the tree.

Specs

  • The HA3 — a baseline milestone, tasks/HA-4, and metadata on HA-1..3 (orun work check refused them without it).
  • Design §6, the risks (HA-F to HA-K) and the as-built status.

How it was verified

All of this ran locally; Baseline CI on this PR runs the same tiers.

  • Repo checks pass: pnpm install --frozen-lockfile, wire:fixture, typecheck, lint, test (5 tests) and build.
  • orun new --status parses the blueprint at v2.58.11, v2.78.4 and 2.79.0. orun validate and orun work check are clean.
  • These tests pass: testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh. Hand-made mutations of the blueprint fail them as they should (a reconcile moved before link, the deferrals swapped, the watch removed, two keys on one reconcile, api-tests moved into 02-docs).
  • leak.test.sh passes at 2.79.0 and v2.58.11. It reads all 40 derived files: nothing of the factory ships, no shipped file names a factory path, and there is no provenance prose.
  • placement.test.sh passes at 2.79.0, v2.58.11 and v2.78.4.
    • The offline bootstrap uses the fixture "Sam's Tools & Things" / acme-inc/acme-hono-api, whose slug ends in the baseline's own slug. It produces orun's Initial commit plus two landings.
    • The produced API is branded with no residue, re-tenanted, has its work: block stripped, its gates restored and its record rendered.
    • The product's own push-to-main plan, through ci.yml's --from-ci github --event-file path, deploys api to stage and prod side by side. There is no infra to order before it.
    • A --resume over the finished API is a no-op.
  • e2e.test.sh passes at 2.79.0 and v2.78.4.
    • Both landings pass the Checks sequence.
    • Every run step of the stage lane's pull-request plan passes in a job tree staged the way orun stages it, with no build output present: install, verify-worker-structure, wire-fixture, build, typecheck, deploy-dry-run.
    • wrangler dev --env stage serves the Worker on random ports, under setsid with process-group cleanup.
    • The component's own smoke passes, both verbatim and inside the planned smoke step, and it refuses the stage Worker when told it is prod.
    • /, /health and a 404 return what the API promises.

Not verified: a live bootstrap against a workspace (repo creation, brokered token, real deploy, workers.dev probes). See risks HA-F. HA-G records that orun plan --changed plans nothing for a push whose before is all zeros; the landing merges a PR into orun's Initial commit, so it has a before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk


Generated by Claude Code

The Hono API on one Cloudflare Worker becomes a baseline that takes a new
API from nothing to live on stage and prod in ONE landing, built the way
cirrus-baseline builds its product since baseline-v22, with what a small
baseline contains taken from portfolio-starter-kit's baseline-v2.

- blueprint.yaml (the card) and repo-blueprint.yaml (the build): two
  phases. 01-product places every module, brands it, re-tenants it, strips
  the work tree, defers promotion and dev's push lanes, creates and links
  the repository, reconciles CLOUDFLARE_API_TOKEN (workers-deploy) and
  CLOUDFLARE_ACCOUNT_ID (account-id), lands one PR, and awaits the
  convergence and a /health probe on stage and prod. No wiring await: there
  is no infra. 02-docs is hook-only: it restores both deferrals, renders the
  deployment record and lands it.
- .baseline/ (identity, the two task contracts, the API's README), the
  rebrand engine with an API_NAME seam (apps/api/src/identity.ts), the
  bootstrap helpers, the deployment-record hook, ai/context, docs/phases,
  BOOTSTRAP.md, baseline.yml and tag.yml.
- The API gains GET /health ({status, name, environment}); its smoke reads
  it for THIS environment on the Worker's own workers.dev URL (the Worker
  composition exports no deployed URL; DEPLOYED_URL overrides it).
- ci.yml plans nothing only while intent.yaml names ws_CHANGE_ME (no
  ORUN_CI variable) at orun v2.78.4; checks.yml runs on pull requests only;
  stack-tectonic 0.19.0; infra/ and packages/ discovery roots, without
  which orun plan refused the tree.
- testing/: manifest, phases (the two-phase partition and cirrus's
  01-product hook chain), coverage, rebrand, retouch, bootstrap-defer, leak
  (every shipped file read for factory paths), placement (the offline
  bootstrap on orun's Initial commit, and the product's own push-to-main
  plan through ci.yml's --from-ci github --event-file path) and e2e (both
  landings under Checks, every run step of the stage lane's PR plan in a
  staged job tree, wrangler dev --env stage, the component's own smoke).

Orun-Task: HA-4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
@ruehowl
ruehowl marked this pull request as ready for review October 15, 2026 19:17
@ruehowl
ruehowl merged commit 8eabdff into main Oct 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants