This repository was archived by the owner on Oct 5, 2026. It is now read-only.
Repository navigation
feat(auth-fz): venture fz CLI + collected migrations; fix magic-link template id (#41) - #47
Merged
Merged
Conversation
…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
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Completes the tooling side of #41: makes
fzavailable for this venture, collects the migrations, and fixes a bug thatfzsurfaced which would have crashed the deployed Worker.What
crates/auth-fz(factory0-auth-fz) — a nativefzthat composes the same modules as the Worker over a trivialAllPortsruntime (fzreads module metadata, not live bindings) and callscratefield_cli::main_for. The standalonecratefield-clibinary 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 thewasm build (workspace)job.migrations/— thefz migrations collectoutput: 6auth-coremigrations (the login-method modules declare no tables) +.harness-lock.json.wrangler d1 migrations applyuses these.TEMPLATE_MAGIC_LINKwasauth-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 failedHarness::build— "template names moduleauth-magic-link.sign-inwhich is not registered" — which would have panicked the deployed auth Worker (feat(auth-worker): the deployable auth Worker (#41) #46) on its first request. Nowauth-magic-link/sign-in. Nothing caught it before because no venture had composed magic-link with its templates.Verification
fz migrations collectsucceeds 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 firstv*tag.🤖 Generated with Claude Code
https://claude.ai/code/session_01QScfNS82MGFi3Yn63Vj2rR