Add the command people type first, and stop crashing on the fallback path - #20
Conversation
…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>
There was a problem hiding this comment.
💡 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".
| #: The pre-rebrand distribution. Installing IntentumDiff does not remove it, because pip | ||
| #: treats a renamed project as an unrelated package. | ||
| _RETIRED_DISTRIBUTION = "intentdiff" |
There was a problem hiding this comment.
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 👍 / 👎.
Four defects found by using the CLI the way a new user would.
intentumdiff diffdid not existThe first thing anyone types, and it failed:
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.pythat registers commands by name and delegates to argparse — and the Click group rejects unknown commands before argparse is ever consulted, soaliases=["diff"]on the argparse subparser alone changed nothing. (Tell them apart by the error: Click says "Try 'intentumdiff --help'", argparse printsusage:.)--jsonwas rejected, though JSON output already existedIt 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 astore_constalias.The fallback path crashed while rendering its own output
The token-level fallback description contained
U+2192. A Windows console is cp1252, so Rich raisedUnicodeEncodeErrorand printedinside 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) andintentumdiff-pythoninstall the sameintentumdiffimport 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 ofand 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:
diffreturns a change ·--jsonemits JSON · the fallback table renders without the crash · stderr is 0 bytes on a clean run.pyproject.tomlis 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