Skip to content

Add the command people type first, and stop crashing on the fallback path - #20

Merged
n1ckyb merged 1 commit into
release/v0.0.2-rcfrom
fix/cli-usability-and-fallback-crash
Aug 9, 2026
Merged

Add the command people type first, and stop crashing on the fallback path#20
n1ckyb merged 1 commit into
release/v0.0.2-rcfrom
fix/cli-usability-and-fallback-crash

Conversation

@n1ckyb

@n1ckyb n1ckyb commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Four defects found by using the CLI the way a new user would.

intentumdiff diff did not exist

The first thing anyone types, and it failed:

Error: No such command 'diff'. Did you mean 'gist-diff'?

A suggestion pointing away from the two commands that actually diff things. Now aliased to file.

This needed registering in both layers. The entry point is a Click group in _parser.py that registers commands by name and delegates to argparse — and the Click group rejects unknown commands before argparse is ever consulted, so aliases=["diff"] on the argparse subparser alone changed nothing. (Tell them apart by the error: Click says "Try 'intentumdiff --help'", argparse prints usage:.)

--json was rejected, though JSON output already existed

intentumdiff: error: unrecognized arguments: --json

It has always been available as --format json. An error that denies a feature we actually ship is worse than a missing feature, because it teaches the user the tool cannot do it. Added as a store_const alias.

The fallback path crashed while rendering its own output

The token-level fallback description contained U+2192. A Windows console is cp1252, so Rich raised UnicodeEncodeError and printed

Error: 'charmap' codec can't encode character '\u2192'

inside the results table — on exactly the files that had already failed to parse. Same for an em dash in the accompanying log line. Both ASCII now.

A retired distribution failed silently and totally

Both intentdiff (pre-rebrand) and intentumdiff-python install the same intentumdiff import package. With both present, the resolved distribution name can be the retired one — which is not in the first-party trust allowlist. Every bundled parser is then rejected as untrusted, and the user sees a stream of

IntentumDiff error: native_fallback: parse errors require Python token fallback

and no diff at all. Nothing in that chain names the cause, and the failure is total rather than partial, so it reads as "the tool is broken". This is the same defect class that made 0.0.1 unusable, so it now warns at startup naming the fix.

Verification

In the source repo: diff returns a change · --json emits JSON · the fallback table renders without the crash · stderr is 0 bytes on a clean run.

pyproject.toml is deliberately not synced — the version already matches (0.0.2b1) and this branch's comment wording differs from the monorepo's.

🤖 Generated with Claude Code

…lback

Four defects found by using the CLI the way a new user would.

**`intentumdiff diff` did not exist.** It is the first thing anyone types, and it
failed with "No such command 'diff'. Did you mean 'gist-diff'?" - a suggestion
pointing away from the two commands that actually diff things. Now aliased to
`file`.

This needed registering in BOTH layers. The entry point is a Click group in
_parser.py that registers commands by name and delegates to argparse; the Click
group rejects unknown commands before argparse is ever consulted, so
aliases=["diff"] on the argparse subparser alone changed nothing.

**`--json` was not accepted**, failing with "unrecognized arguments: --json" even
though JSON output existed the whole time behind `--format json`. An error that
denies a feature we actually ship is worse than a missing feature, because it
teaches the user the tool cannot do it. Added as a store_const alias.

**The fallback path crashed while rendering its own output.** The token-level
fallback description contained U+2192; a Windows console is cp1252, so Rich
raised UnicodeEncodeError and printed "Error: 'charmap' codec can't encode
character" INSIDE the results table - on exactly the files that had already
failed to parse. Same for an em dash in the accompanying log line. Both ASCII now.

**A retired distribution now warns instead of failing silently.** Both
`intentdiff` (pre-rebrand) and `intentumdiff-python` install the same
`intentumdiff` import package, so with both present the resolved distribution
name can be the retired one - which is not in the first-party trust allowlist.
Every bundled parser is then rejected as untrusted and the user sees a stream of
`native_fallback: parse errors require Python token fallback` and no diff at all.
Nothing in that chain names the cause, and the failure is total rather than
partial, so it reads as "the tool is broken". Same defect class as 0.0.1.

Verified in the source repo: `diff` returns a change, `--json` emits JSON, the
fallback table renders without the crash, and stderr is 0 bytes on a clean run.

pyproject.toml is deliberately NOT synced - the version already matches (0.0.2b1)
and this branch's comment wording differs from the monorepo's.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@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: 4950f07d81

ℹ️ 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 on lines +194 to +196
#: The pre-rebrand distribution. Installing IntentumDiff does not remove it, because pip
#: treats a renamed project as an unrelated package.
_RETIRED_DISTRIBUTION = "intentdiff"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check the actual legacy distribution before warning

When the unrelated bare intentdiff project is installed, this lookup emits a false collision warning and directs the user to uninstall that package. The repository’s released pre-rebrand package was named intentdiff-python and installed the intentdiff import package, whereas the current distribution installs intentumdiff; therefore the checked distribution neither represents the retired release nor shares this import package. Remove this warning or base collision detection on distributions that actually own intentumdiff.

Useful? React with 👍 / 👎.

@n1ckyb
n1ckyb merged commit 6b375fe into release/v0.0.2-rc Aug 9, 2026
1 check passed
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