Skip to content

Define correction exit statuses - #45

Merged
BenWestgate merged 2 commits into
codex/37-mixed-case-correctionfrom
codex/39-correct-exit-status
Sep 30, 2026
Merged

BenWestgate merged 2 commits into
codex/37-mixed-case-correctionfrom
codex/39-correct-exit-status

Conversation

@BenWestgate

@BenWestgate BenWestgate commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes #39.

correct now has a stable, documented status contract:

  • 0: input is already valid
  • 1: a correction suggestion was emitted
  • 2: command or input syntax is invalid
  • 3: no usable suggestion was emitted

Status 3 covers no result, incomplete searches with no usable suggestion, ambiguous searches, refused disclosure, and a missing dependency needed to present a suggestion. Worksheet-residue repairs return 1 when they emit repair instructions. Other commands retain their existing status behavior.

This PR is stacked on #42 because its tests include the mixed-case correction path. It is one human-authored focused commit on #42 head 7c7ba26; current #45 head is 794f898. All inline review threads are resolved, including the immutable-HRP syntax check, the generalized BIP93 1–83 HRP contract, and the incomplete-search documentation qualification.

Validation:

  • correction/status/disclosure subset: 104 passed normally and 104 under python -O;
  • frozen differential correction verifier: all 57 cases passed;
  • Ruff check: clean for the touched Python files;
  • git diff --check: clean;
  • exact-head GitHub Python-package run 433: success.

Human review order is #42 first, then #45.

The HRP check follows the generalized BIP93 draft (BenWestgate/bips PR #2 @ 01374bf): BIP93 uses the BIP173 HRP grammar, including the 1–83 character bound; the larger limit is for the expanded checksum codeword, not the HRP.

Disclosure: AI tools were used while implementing and checking review follow-ups, per docs/developer/AI_POLICY.md.

@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: 9178bf4cde

ℹ️ 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.py
BenWestgate added a commit that referenced this pull request Sep 24, 2026
Keep the security model aligned with the standalone correct command while documenting that embedded correction workflows retain status 1.\n\nSecurity: the disclosure gate remains fail-closed; this change records its command-specific observable status.\n\nValidated by diff inspection. Addresses the review of #45.
@BenWestgate

Copy link
Copy Markdown
Owner Author

Thanks for suggesting this one @FractalEncrypt.

@BenWestgate BenWestgate self-assigned this Sep 24, 2026
@BenWestgate BenWestgate added the enhancement New feature or request label Sep 24, 2026
@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 added area: cli Command-line interface behavior. area: correction Correction engine and correction UX. gate: adversarial review Resolve, merge, or explicitly defer before the next full adversarial review. labels Sep 24, 2026

@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-generated review (Claude), posted at the maintainer's request.

Concept ACK. Code looks right; not ACKing 5a826bd until the merge commits are gone.

  • I checked correct on the head: already valid → 0, garbage prefix/empty → 2, uncorrectable/non-ASCII → 3, EOF at the YES gate → CorrectionDeclined → 3. That matches the docs.
  • The branch has two merges of #42 (60cb96e, 5a826bd). Rebase to 9178bf4 + 06e4a05 per CONTRIBUTING.

Copy link
Copy Markdown
Owner Author

Release-gate recheck: the prior Concept ACK still has one mechanical blocker. Current head remains 5a826bd with the two #42 refresh merges (60cb96e, 5a826bd) in a 4-commit stack. Rebase to a linear #42 head + the substantive status commits (9178bf4 and its follow-up) before human review/merge, per CONTRIBUTING. The exit-status behavior itself remains accepted.

@BenWestgate
BenWestgate force-pushed the codex/39-correct-exit-status branch from 5a826bd to eb7cfdd Compare September 27, 2026 03:20
@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.

Copy link
Copy Markdown
Owner Author

Release-gate follow-up: the earlier branch-history blocker is resolved. Current head eb7cfdd is a single linear commit directly on #42 head 2d925d6; the refresh merge commits are gone, the only review thread is resolved, and fresh Python package run 36291117100 completed successfully. The exit-status behavior remains the previously Concept-ACKed design, so #45 is ready for human review after #42.

@BenWestgate
BenWestgate force-pushed the codex/37-mixed-case-correction branch from 2d925d6 to 8619aeb Compare September 28, 2026 00:16
@BenWestgate
BenWestgate force-pushed the codex/39-correct-exit-status branch 2 times, most recently from 300cc7f to 87f0ff8 Compare September 28, 2026 00:25

@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: 87f0ff8190

ℹ️ 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.py Outdated
@BenWestgate
BenWestgate force-pushed the codex/39-correct-exit-status branch 2 times, most recently from b2aafe3 to f8de15a Compare September 28, 2026 00:56

@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: f8de15a739

ℹ️ 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.py Outdated
@BenWestgate
BenWestgate force-pushed the codex/39-correct-exit-status branch from f8de15a to 135c466 Compare September 28, 2026 03:11
@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 codex/39-correct-exit-status branch from 135c466 to 61fe0df Compare September 28, 2026 03:23
@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 codex/39-correct-exit-status branch from 61fe0df to d1ecc82 Compare September 28, 2026 03:38
@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 codex/39-correct-exit-status branch from d1ecc82 to c943e9a Compare September 28, 2026 03:48
@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 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-generated review, posted at the maintainer's request.

ACK 3d5e60d code. Before merge, squash/rewrite the Codex-authored follow-up under the responsible human author per the AI policy.

@BenWestgate
BenWestgate force-pushed the codex/39-correct-exit-status branch from 3d5e60d to ee752ab Compare September 29, 2026 07:10

@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: ee752abfde

ℹ️ 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 docs/user/guide.md Outdated
@BenWestgate
BenWestgate force-pushed the codex/37-mixed-case-correction branch from 70cfae4 to 7edb926 Compare September 29, 2026 14:36
@BenWestgate
BenWestgate force-pushed the codex/39-correct-exit-status branch from ee752ab to bfd8b1b Compare September 29, 2026 14:43
@BenWestgate
BenWestgate force-pushed the codex/37-mixed-case-correction branch from 7edb926 to 7c7ba26 Compare September 29, 2026 23:41
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.

@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.

Release-gate ACK 794f898.

Current head is the one human-authored focused commit on #42. The resolved review findings are present in the final tree: standalone correct uses distinct 0/1/2/3 statuses, malformed immutable HRPs are usage errors under the 1–83 BIP93/BIP173 contract, disclosure refusal/no-result paths use status 3, and emitted incomplete best-effort suggestions remain status 1. All inline threads are resolved and exact-head Python-package run 433 is green.

No remaining code blocker from this review. Review #42 first, then #45.

Copy link
Copy Markdown
Owner Author

Agent release-gate review at current head 794f898: reviewed the single current commit. The status contract is internally consistent (0 valid, 1 suggestion emitted, 2 usage/input syntax, 3 no usable suggestion), residue repair correctly returns 1 when it emits instructions, malformed immutable HRPs remain usage errors, and non-correct commands retain status 1 for command/Core failures. Exact-head Python-package run 36646776371 succeeded. No remaining code-review blocker found; review #42 first, then this PR.

Comment thread docs/user/guide.md Outdated
The status-3 wording called Bitcoin Core an unavailable dependency, which reads like a Python package dependency. Name the actual optional runtime service and the ms32 path that uses it. The generic codex32 correct command remains Core-independent. Refs #39.

@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 merged commit 8283e78 into codex/37-mixed-case-correction Sep 30, 2026
12 checks passed
@BenWestgate
BenWestgate deleted the codex/39-correct-exit-status branch September 30, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command-line interface behavior. area: correction Correction engine and correction UX. enhancement New feature or request gate: adversarial review Resolve, merge, or explicitly defer before the next full adversarial review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant