Skip to content

Make production init idempotent and user-controlled#43

Merged
jonathonbyrdziak merged 1 commit intomasterfrom
fix/idempotent-init-flow
Mar 20, 2026
Merged

Make production init idempotent and user-controlled#43
jonathonbyrdziak merged 1 commit intomasterfrom
fix/idempotent-init-flow

Conversation

@jonathonbyrdziak
Copy link
Copy Markdown
Contributor

Summary

  • Idempotent re-entry: running protocol init again skips already-configured steps (environment, repo URL, GitHub App)
  • User controls exit: every failure asks "Try again? [Y/n]" instead of silently exiting
  • PEM input: extracted readPrivateKey() handles pasted (multi-line or flattened) and file path inputs
  • Access always verified: even on re-entry, tests repo access and refreshes GitHub App token if needed

Test plan

  • Run protocol init → production → complete setup → run protocol init again
    • Should skip environment, repo URL, and GitHub App — go straight to next unconfigured step
  • During GitHub App setup, enter bad App ID → verify "Try again?" prompt
  • During GitHub App setup, paste invalid key → verify "Try again?" prompt
  • App not installed → verify retry loop with install URL
  • User says N at any retry → verify clean exit

🤖 Generated with Claude Code

- Skip environment question on re-entry (reads from Config)
- Skip repo URL question if already stored in NodeConfig
- Skip GitHub App setup if credentials already configured
- Always verify access even on re-entry (refresh token if needed)
- Every failure point asks "Try again? [Y/n]" instead of exiting
- Extract readPrivateKey() to handle paste + file path inputs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jonathonbyrdziak jonathonbyrdziak merged commit 1554ca0 into master Mar 20, 2026
6 of 8 checks passed
@jonathonbyrdziak jonathonbyrdziak deleted the fix/idempotent-init-flow branch March 20, 2026 21:51
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