Skip to content

feat(b-0852): zeta-creds-picker --verify — catch bad blob at install time, not at first reboot (opt-in)#5655

Merged
AceHack merged 1 commit into
mainfrom
feat/b-0852-picker-verify-post-persist-2026-05-27
May 27, 2026
Merged

feat(b-0852): zeta-creds-picker --verify — catch bad blob at install time, not at first reboot (opt-in)#5655
AceHack merged 1 commit into
mainfrom
feat/b-0852-picker-verify-post-persist-2026-05-27

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 27, 2026

Summary

Adds opt-in `--verify` flag to `zeta-creds-picker.ts`. After persist succeeds, re-decrypts the just-written blob via `zeta-creds-restore.ts --dry-run` to confirm it's cryptographically valid + manifest-parseable BEFORE the operator reboots.

Why

Without `--verify`, a corrupt blob (wrong passphrase captured, disk write error, persist bug) only surfaces at first reboot — operator then reboots into live USB + re-runs install. With `--verify`, same failure surfaces seconds after persist, inside the running install flow.

Scope

  • Opt-in only (default false; `zeta-install.sh` Step 6.95-picker doesn't pass `--verify` yet — that flip is a follow-up after operator testing)
  • New exit code 5 for verify-failed (distinct from persist-failed=4)
  • New export `buildVerifyArgs` for testable composition of restore-CLI args

Test plan

  • 21 pass / 0 fail (was 16; +5 new tests: parseArgs --verify default/opt-in, buildVerifyArgs composition + passphrase-file/persona propagation)
  • Tree-count canary 61 (clean)
  • Operator empirical: run `bun zeta-creds-picker.ts --verify ...` against a real install + confirm verify-pass output appears

🤖 Generated with Claude Code

…re the just-written blob at install time (operator catches bad blob BEFORE reboot, not at first boot)

Adds opt-in --verify flag to zeta-creds-picker.ts. When set, after
zeta-creds-persist succeeds, the picker spawns zeta-creds-restore.ts
with --dry-run + the same passphrase source + a tmpdir as
--target-root. If restore-dry-run exits 0, the blob is confirmed
cryptographically valid + manifest-parseable. If non-zero, the
operator sees an actionable error at install time + can re-run the
picker to retry.

Operator-experience improvement: without --verify, a corrupt blob
(wrong passphrase captured, disk write error, persist bug) only
surfaces at first reboot when zeta-creds-restore.service fails its
ConditionPathExists or scrypt-decrypt step. At that point the
operator must reboot back into the live USB + re-run the install.
With --verify, the same failure surfaces SECONDS after persist,
inside the running install flow, with the live USB still mounted.

New exit code 5 for verify-failed (distinct from persist-failed=4).

API addition:
- PickerArgs gains `verify: boolean` (default false; opt-in)
- New export buildVerifyArgs(parsed, tmpTargetRoot) — pure
  composer of the restore-CLI argv list; testable in isolation

Tests added (3 new + 2 parseArgs-extension):
- --verify flag default false
- --verify flag parsed when passed
- buildVerifyArgs composes restore-CLI args with --dry-run + tmpdir
- buildVerifyArgs propagates --passphrase-file when picker used file
- buildVerifyArgs propagates --persona when set

21 pass / 0 fail (was 16; +5).

Substrate-honest scope: opt-in only. Future PR can flip default-on
after operator empirical testing confirms verify doesn't introduce
new failure modes (e.g., tmpdir permission, restore-CLI changes).
zeta-install.sh Step 6.95-picker currently does NOT pass --verify;
that flip can land in a follow-up after operator tests.

Composes with:
- B-0852 cred-persistence cascade (#5635 + #5637 + #5639 + #5640 +
  #5642 + #5644 + #5645 + #5646 + #5648 + #5649 + #5650)
- tools/installer/zeta-creds-restore.ts (existing --dry-run mode)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 27, 2026 22:49
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AceHack AceHack enabled auto-merge (squash) May 27, 2026 22:49
@AceHack AceHack merged commit 80430d7 into main May 27, 2026
32 of 33 checks passed
@AceHack AceHack deleted the feat/b-0852-picker-verify-post-persist-2026-05-27 branch May 27, 2026 22:52
@AceHack AceHack review requested due to automatic review settings May 27, 2026 23:11
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.

1 participant