Fix CLI error-handling papercuts and make the gate pass on macOS#163
Merged
Conversation
Manual QA across the command surface surfaced a cluster of user-input errors that were mislabeled as internal "report a bug" failures, plus a few smaller inconsistencies. Fixes: - webhooks listen --port: add min=0/max=65535 so an out-of-range port is a clean exit-2 validation error, not a socket-layer crash. - init <tmpl> file/sub: reject a target that descends through a file up front instead of failing mid-scaffold with a raw NotADirectoryError. - stream --redact-pii-sub: make it a PIISubstitutionPolicy enum (like transcribe) so a bad value is a clean choice error, no pydantic dump. - clip --out-dir: distinguish "is not a directory" from "doesn't exist". - config path: report the file location even when config.toml is corrupt (defer the callback's parse error; real commands still re-raise it; a bad --env still wins). - llm: a bad-key 401 now routes to the same clean exit-4 auth_failure as transcribe; entitlement/proxy 403s keep their exit-1 passthrough. - account commands: reword the no-session message to explain why it differs from API-key commands. - telemetry enable: note when an env kill-switch overrides the persisted choice. Gate (scripts/check.sh) — fix two macOS-only failures: - brew audit: Homebrew 6+ disabled `brew audit [path]`; audit the formula by name via an ephemeral local tap so it works on macOS and Linuxbrew. - "no new escape hatches": baseline used `git grep -E` and the working tree used `rg`, which disagree on `\b` (ERE ignores it on macOS), so a pre-existing time.sleep failed the gate on macOS. Use `git grep -P` for both sides via shared helpers. Also fix test_validate_out_rejects_the_input_via_hard_link to tolerate case-insensitive filesystems (macOS). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Manual QA across the command surface (run via parallel subagents) surfaced a cluster of user-input errors mislabeled as internal "report a bug" failures, plus a few smaller inconsistencies. While verifying the fixes through
scripts/check.sh, two macOS-only gate failures also turned up and are fixed here so the gate is green on both macOS and Linux.CLI fixes
webhooks listen --portUnexpected error … report a bugmin=0/max=65535→ clean exit-2 validation errorinit <tmpl> file/sub[Errno 20] Not a directorymid-scaffoldstream --redact-pii-suberrors.pydantic.devURLPIISubstitutionPolicyenum → clean[hash|entity_name]choice errorclip --out-dir <file>config pathconfig.toml— the one command you'd use to find the broken file--envstill wins)llm(bad key)auth_failureliketranscribe; entitlement/proxy 403s keep their exit-1 passthroughtelemetry enableDO_NOT_TRACK/AAI_TELEMETRY_DISABLEDoverrides itGate fixes (
scripts/check.sh) — macOS paritybrew audit: Homebrew 6+ disabledbrew audit [path …]; a formula must be audited by name. The step now copiesFormula/assembly.rbinto an ephemeral local tap and audits it by name (works on macOS + Linuxbrew, old + new brew), with cleanup that survivesset -e.git grep -Ewhile the working tree usedrg, which disagree on\b— macOS's ERE engine silently ignores it, so a pre-existingtime.sleepmade the working count exceed the baseline and failed the gate on macOS only. Both sides now use one matcher,git grep -P(PCRE), via sharedhatch_base/hatch_workhelpers (--untrackedcounts newly-added files the wayrgdid).test_validate_out_rejects_the_input_via_hard_linkto tolerate case-insensitive filesystems (macOS).Verification
./scripts/check.sh→ All checks passed (exit 0), including:🤖 Generated with Claude Code