Skip to content

BA4: better-auth-starter becomes an Orun baseline - #5

Merged
ruehowl merged 1 commit into
mainfrom
ba/4-a-baseline
Oct 29, 2026
Merged

ruehowl merged 1 commit into
mainfrom
ba/4-a-baseline

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

BA4 (task BA-5): the baseline layer over the auth app.

What lands

  • blueprint.yaml — the console card: inputs, the four brokered Cloudflare secrets (workers-deploy, d1-edit, r2-data, account-id), expectedMinutes: 8 (the phases' 7 + 1), the example product "Acme Accounts".
  • repo-blueprint.yaml — the build document: 01-product lands the whole product in one landing (D1, KV and R2 → db-migrate → web per environment), then 02-docs records it.
  • .baseline/ — this tree's identity, the task contracts, the product's README.
  • Tooling — the rename engine (tooling/rebrand), the bootstrap helpers (tooling/bootstrap), the deployment-record renderer (hooks/), and the component docs generator (tooling/catalog). The docs are generated for all 8 components.
  • The context pack (ai/context/), BOOTSTRAP.md, docs/phases/, and the README's baseline sections.
  • The test tiers (testing/) and .github/workflows/baseline.yml, plus tag.yml.

The e2e (testing/e2e.test.sh + testing/lib/auth-flows.py)

  1. The bootstrapped product's landing installs, renders the fixture, and passes typecheck, lint, test and build.
  2. Its stage web lane builds with the stage documents' database, namespace and bucket ids. OAuth keys and an auth secret are planted in the build's environment, and none of them reach the bundle. The dry run comes in at 1,912 KiB gzipped, under the 3 MiB limit.
  3. Its db-migrate lane plans, then applies against a stand-in D1 API. It creates better-auth's tables and a generated auth secret. A second apply applies nothing.
  4. The site is served with wrangler dev:
    • With no schema, /api/health answers 503 and the component's own smoke check fails. After db:migrate:local, the smoke check passes.
    • With no provider connected, every visitor flow works:
      • sign-up, with a foreign Origin refused (403)
      • the redirects between / and /dashboard, and the dashboard
      • a file's R2 round trip: upload, list, a byte-identical download, refused to another user (404), delete
      • sign-out, a wrong password (401), signing in again
      • anonymous sign-in, the OpenAPI reference, the sign-in rate limit (429)
    • The users are in D1 and the sessions in KV.
    • With GitHub's keys handed over the way the deploy hands them, the page offers GitHub alone. Sign-in returns github.com's authorize URL with the handed-over client id and this deployment's callback.

Also

tests/web's site test no longer pins the name Auth Starter. The rename rewrites that seam, so the test failed in every product; the e2e caught it.

Local results

  • Contract tests (manifest, phases, coverage, rebrand, retouch, bootstrap-defer, wire): ok
  • Component docs --check: ok
  • leak.test.sh: ok
  • placement.test.sh: ok
  • e2e.test.sh: ok
  • orun new --status: ok

Generated by Claude Code

The console card (blueprint.yaml: inputs, the four brokered Cloudflare
secrets, 8 minutes summed from the phases, 7 + 1), the build document
(repo-blueprint.yaml: 01-product lands the whole product in one landing,
02-docs records it), this tree's identity and task contracts (.baseline/),
the rename engine, the bootstrap helpers, the deployment-record renderer,
the product's README and context pack, generated component docs, and the
baseline's tiers in Baseline CI: contract tests, the leak gate, the offline
bootstrap with the product's own plan, and the end-to-end run.

The e2e builds the bootstrapped product at its landing, runs its stage web
lane (the stage documents' ids rendered, OAuth keys and an auth secret
planted in the build's environment and kept out of the bundle, the dry run
within 3 MiB) and its db-migrate lane against a stand-in D1 API, then
serves it with wrangler dev: no schema and the smoke refuses it; migrated
and the smoke passes; then every sign-in flow, an R2 round trip and the
rate limit with no provider connected (testing/lib/auth-flows.py), and a
GitHub sign-in started with keys handed over as the deploy hands them.

tests/web's site test no longer pins the baseline's own name: the rename
rewrites that seam, so the literal failed in every product.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
@ruehowl
ruehowl merged commit 3065701 into main Oct 29, 2026
5 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