This repository was archived by the owner on May 13, 2026. It is now read-only.
refactor(setup): CLI wizard becomes a thin /api/setup/bootstrap client - #909
Merged
Conversation
… POST The legacy `run_setup_wizard` minted identity, wrote Sled trees, registered with Exemem, and dropped the `.onboarding_complete` marker entirely in-process — duplicating logic the canonical bootstrap endpoint already owns and harboring the master-key-never-minted bug from before #903. The CLI wizard is now a thin REST client around `POST /api/setup/bootstrap`: ensure the daemon is running, collect prompts (interactive or via `--non-interactive` flags), POST once, surface the recovery phrase, and reload `node_config.json` from disk. Brew users and Tauri users now share the same bootstrap path. `folddb setup --non-interactive --name X [--email Y --invite-code Z --no-cloud ...]` is the new headless mode for CI / scripting. Verified end-to-end on macOS with `os-keychain`: identity stored in Sled is ENC:-prefixed, marker present, no plaintext keys leak into `node_config.json`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
shiba4life
enabled auto-merge
May 6, 2026 04:36
The egress classifier lint requires a `// trace-egress: <kind>` comment within 3 lines preceding each reqwest::Client construction. The post_bootstrap site had a free-form `// loopback:` comment that the lint didn't recognize. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pure rustfmt — no behavior changes. (My local fmt run was missed; CI caught the diffs.) Co-Authored-By: Claude Opus 4.7 (1M context) <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 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.
Summary
run_setup_wizardas a thin REST client: ensure daemon, collect prompts, POST/api/setup/bootstrap, display recovery phrase, reload config. The server owns identity minting, Sled writes, Exemem registration, and the.onboarding_completemarker — closing out the master-key-never-minted bug from before feat(setup): canonical bootstrap endpoint + legacy migration #903 and unifying the brew-CLI and Tauri paths.folddb setup --non-interactive --name X [--email Y --birthday MM-DD --invite-code Z --no-cloud --ai-provider {anthropic|ollama|skip} ...]for CI / scripting.save_identity_card_via_local_node, the local Sled /node_config.json/ marker writes, and thepersist_ai_confighelper they used.Re-exports
register_with_exemem,register_with_exemem_and_invite, andderive_recovery_phraseasCliError-friendly wrappers aroundfold_db_node::handlers::setup::*socloud enableandrestorekeep their import paths.Test plan
cargo test --bin folddb(clap + non-interactive arg builders, 5 new unit tests)cargo test --test cli_integration_test setup_non_interactive— fresh daemon, non-interactive REST bootstrap, second invocation hits the 410 self-disableFOLDDB_HOME=/tmp/test FOLDDB_PORT=19101 ./target/debug/folddb setup --non-interactive --name "Smoke" --no-cloud→ daemon starts, recovery phrase prints, marker +node_config.jsonwritten, no plaintext keys in config--features os-keychain+FOLDDB_MASTER_KEY=<64-hex>) → identity in Sled isENC:-prefixedcargo clippy --bin folddb --bin folddb_server --tests -- -D warnings -A dead-codeclean (the-A dead-codesuppresses the pre-existing macOS-onlybuild_attendee_ingestion_recordswarning that doesn't fire in Linux CI)🤖 Generated with Claude Code