D2 [CRIT]: auth status/token exit-code correctness (C2+C3+C4)#4
Merged
Conversation
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
Three CRIT findings from the C-audit's exit-code-correctness cluster — all in the
authcommand surface, all blocking CI scripts that gate onshithub auth status >/dev/null 2>&1.auth statuswith no hosts configured exited 0. Now errorsauth: no hosts configured. Run 'shithub auth login' to add one.auth status --hostname Xfor an unconfiguredXprinted "no hosts configured" (false: there ARE hosts) and exited 0. Now errorsauth: not logged into <X>.auth tokenemitted the bearer with no trailing newline;read TOKEN <<< $(shithub auth token)was visibly broken and the next prompt char butted up against the token bytes. Now ends in\n(gh-compat).Test plan
TestStatusEmptyHostsExitsNonZero— regression: no-hosts errors, names the login command.TestStatusUnknownHostnameExitsNonZero— regression:--hostname Xfor unknown X errors withnot logged into X.TestTokenPrintsStoredValue— flipped assertion: token now ends with\n.make cigreen locally.Notes
This is D2 from the D-audit campaign (
.docs/sprints/D2-cli-auth-exit-codes.md). Two MIN findings from the same exit-code-correctness rule (C22 completion, C27 api -H) are intentionally out of scope here — they live in their own packages and will land separately.