Skip to content
This repository was archived by the owner on Oct 5, 2026. It is now read-only.

feat(auth-fz): venture fz CLI + collected migrations; fix magic-link template id (#41) - #47

Merged
ParallelEntrepreneur merged 1 commit into
mainfrom
feat/auth-fz-and-migrations
Sep 8, 2026
Merged

ParallelEntrepreneur merged 1 commit into
mainfrom
feat/auth-fz-and-migrations

Conversation

@ParallelEntrepreneur

Copy link
Copy Markdown
Contributor

Completes the tooling side of #41: makes fz available for this venture, collects the migrations, and fixes a bug that fz surfaced which would have crashed the deployed Worker.

What

  • crates/auth-fz (factory0-auth-fz) — a native fz that composes the same modules as the Worker over a trivial AllPorts runtime (fz reads module metadata, not live bindings) and calls cratefield_cli::main_for. The standalone cratefield-cli binary can't do this — it "runs inside a venture repo where it links against the venture's harness." Kept out of the workspace (exclude) so the CLI's native-only deps (clap, rusqlite) never reach the wasm build (workspace) job.
  • migrations/ — the fz migrations collect output: 6 auth-core migrations (the login-method modules declare no tables) + .harness-lock.json. wrangler d1 migrations apply uses these.
  • Fix (auth-magic-link): TEMPLATE_MAGIC_LINK was auth-magic-link.sign-in (a dot). The harness keys template ids <module>/<template> and validates the module part, so composing magic-link into a venture failed Harness::build — "template names module auth-magic-link.sign-in which is not registered" — which would have panicked the deployed auth Worker (feat(auth-worker): the deployable auth Worker (#41) #46) on its first request. Now auth-magic-link/sign-in. Nothing caught it before because no venture had composed magic-link with its templates.

Verification

fz migrations collect succeeds and writes the lock; the Worker still builds to wasm32; auth-magic-link's 28 tests pass; clippy (-D warnings) / fmt clean.

This removes the "run fz migrations collect" item from #41's needs-human list — migrations are now committed. The remaining owner-only steps stay: wrangler d1 create + ids, secrets, the DNS custom domain, and the first v* tag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QScfNS82MGFi3Yn63Vj2rR

…template id

`fz migrations collect`/`doctor` must link the venture's own harness to see
its modules — the standalone cratefield-cli binary cannot. This adds that
`fz`, uses it to collect the migrations, and fixes a template-id bug it
surfaced that would have crashed the deployed Worker.

- `crates/auth-fz` (`factory0-auth-fz`): a native `fz` bin that composes
  the same modules as the Worker over an `AllPorts` runtime (fz reads
  module metadata, not live bindings) and calls `cratefield_cli::main_for`.
  Kept OUT of the workspace (`exclude`) so the CLI's native-only deps
  (clap, rusqlite) never reach the `wasm build (workspace)` job.
- `migrations/`: `fz migrations collect` output — 6 auth-core migrations
  (the login methods declare no tables) + `.harness-lock.json`. wrangler
  applies these to D1.
- **Fix (auth-magic-link):** `TEMPLATE_MAGIC_LINK` was
  `auth-magic-link.sign-in` (a dot); the harness keys template ids as
  `<module>/<template>` and checks the module part, so composing magic-link
  into a venture failed `Harness::build` with "template names module
  `auth-magic-link.sign-in` which is not registered" — which would have
  panicked the deployed auth Worker (#46) on its first request. Now
  `auth-magic-link/sign-in`. No module before this composed magic-link with
  its templates, so nothing caught it.

Verified: `fz migrations collect` succeeds and writes the lock; the Worker
still builds to wasm32; magic-link's 28 tests pass; clippy/fmt clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QScfNS82MGFi3Yn63Vj2rR
@ParallelEntrepreneur
ParallelEntrepreneur merged commit d572e8e into main Sep 8, 2026
7 checks passed
@ParallelEntrepreneur
ParallelEntrepreneur deleted the feat/auth-fz-and-migrations branch September 8, 2026 00:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant