fix(cli): print new-vault banner before first passphrase prompt#529
Merged
ALRubinger merged 1 commit intomainfrom May 7, 2026
Merged
fix(cli): print new-vault banner before first passphrase prompt#529ALRubinger merged 1 commit intomainfrom
ALRubinger merged 1 commit intomainfrom
Conversation
The first-run banner ("Creating a new Aileron vault. The passphrase
you choose protects all secrets...") was firing AFTER the user had
already typed a passphrase, defeating the warning's purpose. Move
it ahead of the first prompt in both promptCreateAndUnlock (the
auto-spawn first-run path) and runVaultInit (`aileron vault init`).
Add willPromptInteractively helper so callers can decide whether to
print user-facing context BEFORE the prompt fires, instead of inferring
interactivity from readVaultPassphrase's post-hoc source return value.
Also drop the stale audit-log reference in sessionLogPath's comment;
the audit log moved to user-scope (~/.aileron/audit/) but the session
log stayed per-project, so they're no longer "alongside" each other.
Regression tests pin the banner-before-prompt ordering for both code
paths.
Refs #528 (findings 1 and 2).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🚅 Deployed to the aileron-pr-529 environment in aileron 1 service not affected by this PR
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #529 +/- ##
==========================================
- Coverage 82.34% 81.41% -0.94%
==========================================
Files 221 221
Lines 21908 21912 +4
==========================================
- Hits 18041 17840 -201
- Misses 2758 2981 +223
+ Partials 1109 1091 -18
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This was referenced May 7, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Resolves findings 1 and 2 from #528 (manual acceptance testing of #454).
promptCreateAndUnlock(auto-spawn first-run) andrunVaultInit(aileron vault init).sessionLogPath's comment claimed the session log lives "alongside the audit log in.aileron/", but the audit log moved to~/.aileron/audit/per Umbrella: Local Daemon Architecture (ADR-0012) #454 step 5. Updated to describe what the function actually does.Approach
Added
willPromptInteractively(passphraseFile string) boolnext toreadVaultPassphraseincmd/aileron/vault.go. It mirrors the dispatch order (file > env > interactive) so callers can decide whether to print user-facing context before the prompt fires, instead of inferring interactivity from the post-hocpassphraseSourcereturn value.Both
promptCreateAndUnlockandrunVaultInitnow print the banner conditionally onwillPromptInteractively, then read the passphrase, then (if interactive) read the confirmation. File/env-sourced passphrases continue to skip the banner — non-interactive callers (CI, scripts) don't need the warning.Test plan
TestEnsureVaultUnlocked_StoppedMissing_BannerPrintsBeforeFirstPromptasserts banner index < first-prompt index in stderr (mirrors the user-observed output from Umbrella: Local Daemon Architecture (ADR-0012) #454 Test 1).TestRunVaultInit_BannerPrintsBeforeFirstPromptcovers thevault initpath with the same ordering check.go test ./cmd/aileron/... ./internal/...— all green.🤖 Generated with Claude Code