test(cli): cover pure helpers — mapErr, mapClientErr, worseStatus, GPU helpers#251
Merged
Conversation
…U helpers The no-infrastructure "free batch" from the coverage audit (pure logic, no production changes): - mapErr (was 0%): Ctrl-C (terminal.InterruptErr) -> errInteractiveCancelled (the clean-exit-0 seam contract); other errors pass through. - mapClientErr (was 0%): cancel -> nil; else exit-1 *exitError. - worseStatus (was 40%): the Fail>Warn>OK verdict truth-table, both orders. - machineGPUShort / currentGPUCount / defaultGPUChoice (all 0%): the GPU wizard's pure helpers. make ci green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a3cf549. Configure here.
saadqbal
approved these changes
Jul 14, 2026
saadqbal
left a comment
Collaborator
There was a problem hiding this comment.
LGTM 👍 Checked each helper against the impl — the worseStatus truth table and the defaultGPUChoice out-of-range→1 edges all line up. Good pure-function coverage.
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.
The no-infrastructure "free batch" from the coverage audit — pure logic, no production changes.
mapErr(0% → covered): Ctrl-C (terminal.InterruptErr) →errInteractiveCancelled(the clean-exit-0 seam contract); other errors pass through.mapClientErr(0%): cancel → nil; else exit-1*exitError.worseStatus(40%): the Fail>Warn>OK verdict truth-table, both orders.machineGPUShort/currentGPUCount/defaultGPUChoice(all 0%): the GPU wizard's pure helpers.make cigreen. Part of the coverage-audit backlog.🤖 Generated with Claude Code
Note
Low Risk
Test-only addition with no runtime or behavioral changes to the CLI.
Overview
Adds
internal/cli/pure_helpers_coverage_test.goto lock in behavior of previously under-covered CLI helpers—no production code changes.Tests document the interactive cancel seam:
mapErrmaps survey Ctrl-C toerrInteractiveCancelled(other errors unchanged);mapClientErrturns cancel into a cleanniland other errors into exit-1*exitError.worseStatusis exercised across the full Fail > Warn > OK truth table (both argument orders). GPU wizard helpersmachineGPUShort,currentGPUCount, anddefaultGPUChoiceget table-driven cases for capacity checks and default prompt values.Reviewed by Cursor Bugbot for commit a3cf549. Bugbot is set up for automated code reviews on this repo. Configure here.