Skip to content

cli: Remove duplicated messages - #157

Open
BenWestgate wants to merge 1 commit into
claude/project-thread-jhiarhfrom
claude/project-thread-jhiarh-dup-messages
Open

BenWestgate wants to merge 1 commit into
claude/project-thread-jhiarhfrom
claude/project-thread-jhiarh-dup-messages

Conversation

@BenWestgate

Copy link
Copy Markdown
Owner

Before: some CLI messages repeated another message or sat behind a check that an earlier check already makes unreachable:

  • create said "Only Bitcoin master-seed backups can be created." after the header parser had already required ms1.
  • create checked "Use --existing when supplying a seed or secret." after it had already required an interactive terminal.
  • Wallet commands said "Wallet commands accept only Bitcoin master-seed secrets." after input had already been limited to ms.
  • A header collision appended "; choose another set header" to the library's "new share set must use a different set header".
  • The "Use blank wallet …? [y/N]" prompt was written out three times.

After: each message lives in one place. What users see is unchanged, except that a header collision now prints only the library sentence.

How: one commit removes the four checks and adds a small use() helper inside _select. Library: 4,859 to 4,844 logical lines. It's stacked on #155; retarget to reviewability-v1 after #155 merges. #156 lists the remaining duplicates, which need a decision or a security review.

Checks: 909 tests pass, plus python -O -m pytest, mypy, ruff, verify_correction_constants and differential_correction. It touches no recovery, checksum or generation code.

Refs #156


Generated by Claude Code

@BenWestgate BenWestgate self-assigned this Oct 22, 2026
Drop checks whose messages an earlier check already gives or makes
unreachable: create's ms-only and --existing checks, the wallet
commands' MasterSeed check, and create's HeaderCollision suffix, which
repeated the library message. Ask the blank-wallet question in one
place instead of three.

Refs #156

Claude-Session: https://claude.ai/code/session_01Q1TNm1YeYW8K9W2eBvxmCD

@BenWestgate BenWestgate left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted review at maintainer request.

Code ACK 50cbc19 (draft). The removed CLI checks are already enforced at input/header boundaries; factoring the wallet confirmation preserves the prompt. Tests not rerun here. Keep stacked on #155 until it merges.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T21:31:50.172724Z 50cbc19 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@BenWestgate
BenWestgate added this pull request to stack #162 October 22, 2026 11:18

@BenWestgate BenWestgate left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crACK

@BenWestgate
BenWestgate marked this pull request as draft October 22, 2026 18:49

@BenWestgate BenWestgate left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Focused security review — commit 50cbc19a500e2b324cc144f85b4c8bbdfc03a567 (PR #157, relative to #155 at 377f2bc).

Security ACK: no reportable findings in the two-file diff.

  • _master_seed: the removed runtime isinstance(MasterSeed) check was redundant at the current trusted-artifact boundary. _artifacts(profiles=(Profile.MS,)) validates and filters the HRP, parse_codex32 constructs MasterSeed for ms secrets, and recover_secret reparses the recovered secret. BitcoinCore.initialize also retains an independent MasterSeed type check.
  • _create: _creation_header returns only Profile.MS or raises for other application prefixes; the remaining terminal guard rejects redirected input before Core connection or generation. The deleted not existing and not sys.stdin.isatty() branch was unreachable after that guard. Existing-source type, confirmation, identifier, and ceremony checks remain.
  • HeaderCollision: its CodexError still reaches the general except CodexError handler and stops creation. Only the duplicated suggestion suffix is removed.
  • BitcoinCore._select: the factored use(name) helper preserves all three explicit [y/N] prompts, exact affirmative choices (y/yes, case-insensitive), and rejection behavior. Eligibility is checked when listing candidates and rechecked after selection and before sensitive import; fingerprint/identity verification and relocking paths remain intact. No new bypass or sensitive-data output was found.

Read all changed source hunks and the relevant parsing, recovery, creation, Core eligibility/identity, and CLI call paths. Existing tests cover non-ms and redirected creation rejection, wallet-selection confirmations, unsafe-wallet filters, and identity gating. Exact-head GitHub CI passed: Python package run 39726929553 and Bitcoin Core wallet fixtures run 39726929557. The PR commit is absent from the local checkout, so tests were not rerun locally; this is a focused static security review supported by exact-head CI.

This sign-off applies to the current head 50cbc19, not future changes or the eventual fully integrated release candidate. Keep the #155 → #157 → #161 stack order and retest on the final integrated head.

@BenWestgate
BenWestgate marked this pull request as ready for review October 22, 2026 18:55
@BenWestgate

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 50cbc19a50

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BenWestgate BenWestgate left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch has not been deployed

No deployments
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