Skip to content

correct: Say why the entry was invalid when suggesting a repair - #101

Open
BenWestgate wants to merge 6 commits into
30-recorded-fingerprint-gatefrom
claude/new-issue-fixes-fvhbl3-85
Open

BenWestgate wants to merge 6 commits into
30-recorded-fingerprint-gatefrom
claude/new-issue-fixes-fvhbl3-85

Conversation

@BenWestgate

Copy link
Copy Markdown
Owner

Requested by Ben · project thread

Before: correct, and the "Possible correction" prompt in secret, share, wallet and create --existing, showed only the repaired string.

After: one stderr line comes first with the reason check gives. On BIP-93 vector 1 in uppercase with a lowercase last letter:

Invalid: A codex32 string is all uppercase or all lowercase; either case recovers the same wallet.
Warning: This is only a correction suggestion. Compare it with the original backup before using it.
MS10TESTSXXXXXXXXXXXXXXXXXXXXXXXXXX4NZVCA9CMCZLW

The other four cases from the issue (threshold A, index A with threshold 0, B in the data, one extra character) are tested and give the header, character set and length reasons.

How: _confirm_correction takes the reason as an argument, and each caller passes the parse error it already caught, so nothing is parsed twice. _correct uses _parse in place of parse_codex32 to get the same friendly text. InvalidCase gets a friendly message. The line prints after the YES gate, so a non-interactive gate failure still emits only its error. create --existing passes the library's own message, as its "Rejected:" line already does.

Budget: 5195 of < 5200. 927 tests pass; ruff, mypy and the touched files under -O are clean.

Based on #57; the mixed-case repair it describes comes from #42. Closes #85

🤖 Generated with Claude Code

https://claude.ai/code/session_015CuLXqAvAovfoVcUmmogwa


Generated by Claude Code

BenWestgate and others added 5 commits September 30, 2026 21:35
Apply the established majority-case interpretation to standalone correction while preserving immutable context, entered edit semantics, and disclosure accounting. Account the normalized retry frontier even when the first optional search reaches its deadline after finding a candidate, so cumulative capture mass remains fail-closed.

Fixes #37.
Give standalone correction a stable status contract: 0 for already-valid input, 1 when a suggestion is emitted, 2 for command or input syntax errors, and 3 when no usable suggestion is emitted. Keep incomplete best-effort suggestions at status 1 and document status 3 only for incomplete searches without a usable suggestion.

Fixes #39.
Remove unreachable creation guards and the permanently false correction ambiguity field, align the CLI test Core stub with production, and move reference-only correction helpers out of the installed package.\n\nSecurity: fail-closed correction and wallet behavior are unchanged.\n\nRefs #38.
Gate restore and existing-seed wallet initialization on the independently recorded BIP32 master fingerprint before any Bitcoin Core wallet mutation. Keep the correction path from disclosing or reusing a fingerprint derived from the candidate being authenticated.

Fixes #30.
`correct` and the "Possible correction" prompt in secret, share, wallet
and create --existing showed only the repair. Print one line to stderr
first, "Invalid: <reason>", using the reason `check` already gives.

Callers pass the parse error they already caught, so nothing is parsed
twice. A mixed-case string now says codex32 strings are all uppercase
or all lowercase and that either case recovers the same wallet.

Closes #85

Claude-Session: https://claude.ai/code/session_015CuLXqAvAovfoVcUmmogwa
@BenWestgate BenWestgate self-assigned this Oct 1, 2026
@BenWestgate
BenWestgate marked this pull request as ready for review October 1, 2026 13:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4d15aeeb6

ℹ️ 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".

Comment thread src/codex32/_cli_input.py Outdated
The mixed-case message said either case "recovers the same wallet", but
`_parse` shows it for every profile, including shares and application
prefixes with no wallet. Say that both cases decode to the same data.

Claude-Session: https://claude.ai/code/session_015CuLXqAvAovfoVcUmmogwa
@BenWestgate
BenWestgate force-pushed the 30-recorded-fingerprint-gate branch 2 times, most recently from a7efaae to 054e8d9 Compare October 1, 2026 22:02
@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.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@BenWestgate
BenWestgate force-pushed the 30-recorded-fingerprint-gate branch from 054e8d9 to 115f2c2 Compare October 2, 2026 08:57

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.

2 participants