fix(cli): fail loud on bad input in for/check/stats (#53, #38)#56
Merged
Conversation
Three commands silently accepted malformed input and returned a falsely-reassuring success, inverting their own purpose. Continues the fail-loud pattern from #30 (zero-match globs in suggest). - for <PATH> (#53): stat the path first; a nonexistent/mistyped path, a directory, or a trailing slash now errors (exit 1) instead of printing "no hubs anchor" + exit 0 — byte-identical to a real unanchored file, which greenlit editing the wrong file. - check --files (#38): invalid glob *syntax* in --files patterns now errors instead of being dropped via filter_map(.ok()), which silently widened/narrowed the gate's scope. - stats (#38): invalid hub glob in surf.toml now errors instead of silently excluding hubs from the metrics. Re-sealed the three anchored claims whose spans/contracts changed and updated the for/stats claim prose + for_path module doc to match. Co-Authored-By: Claude Opus 4.8 <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.
Closes #53, closes #38.
Three commands silently accepted malformed input and returned a falsely-reassuring success; this makes them fail loudly (continuing the #30 pattern).
surf for <PATH>(for: nonexistent / mistyped PATH reports "no hubs anchor" (looks like success) #53): stat the path first — a nonexistent/mistyped path, a directory, or a trailing slash now errors (exit 1) instead of printingno hubs anchor+ exit 0.check --files(check --files / stats: invalid glob syntax is silently dropped #38): invalid glob syntax errors instead of being dropped viafilter_map(.ok()).stats(check --files / stats: invalid glob syntax is silently dropped #38): invalid hub glob in surf.toml errors instead of silently excluding hubs.5 new tests; re-sealed the for/stats/check claims (updated for/stats prose where the contract changed).