Repository navigation
test(cli): pin flag propagation, stdin trimming and shutdown exit code - #429
Merged
Merged
Conversation
Nightly Stryker (run 41171362594) left 121 survivors in src/cli.ts. Most are log-string or equivalent mutants; a dozen are behaviour the suite never asserted. Pin each: - check: whitespace-only piped stdin is "No input" (exit 1), not Clean - check: the red tier renders at 75% and 100% with the real percentage - prompt/add: the "write --flag=<value>" hint appears only for a bare flag - attach: --cli, --no-raw and --verbose reach pluk and the watcher argv; the dangerous flag is absent without --dangerous; whitespace-only --rationguard-bin= counts as unset like the empty form - watch: default log mode prints no delivery footer and no trace lines; a bare --diagnostics, --log-format=json and --verbose are accepted and --verbose traces watcher startup - watch: a signal after a watcher error exits 1, not 0 Each target mutant was hand-applied to dist/cli.js and fails under the new tests; the suite is green unmutated (453 pass, 99.76/97.57/100). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
2 tasks
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.
Why
The nightly Stryker run (41171362594,
clishard) left 121 survivors insrc/cli.ts(84.78%). Most are log-string or equivalent mutants (e.g. thepromptproject-excuse filter is already enforced insidegeneratePromptBlock, so dropping it incli.tsis unobservable). A dozen are real assertion gaps — flags that reach pluk or the watcher, a stdin edge, an exit-code path — that the suite exercised but never checked. This pins them, following the same approach as #411/#412/#420/#424/#428.What the tests pin
check: whitespace-only piped stdin is "No input" (exit 1), not "Clean"check: the red tier renders at 75% (three keywords) and 100% with the real percentageprompt/add: thewrite --flag=<value>hint appears only for a bare flag, not for an unknown valueattach:--cli=codex,--no-rawand--verbosereach pluk's pipe-pane and the watcher argv; the CLI's dangerous flag is absent without--dangerous; a whitespace-only--rationguard-bin=counts as unset like the empty formwatch: the default log mode prints no→delivery footer and no[rationguard]trace lines; a bare--diagnostics,--log-format=jsonand--verboseare accepted together and--verbosetraces watcher startup; the bare flag still arms the final diagnostics summarywatch: a signal arriving after a watchererrorexits 1 — the shutdown handler must not resetprocess.exitCodeValidation
Each target mutant was hand-applied to
dist/cli.jsand fails under the new tests (confidence >= …→false,* 100→/ 100,.trim()removed at both sites,?? 'claude'→&& 'claude', each attach boolean forcedtrue/false,['text','json']→[],=== 'send'→true,?? 0→&& 0, both bare-flag hints forced). Unmutated: 453 pass, 99.76 / 97.57 / 100 vs floors 99 / 95 / 100;npm run lintclean.One finding while writing the signal test: a stubbed
start()that resolves lets the event loop drain beforeprocess.killdispatches SIGINT, so the process exits through the natural path. The test keeps the loop alive with a watchdog timer so it genuinely exercises the shutdown handler.Tests only, no shipped-code change, so no CHANGELOG line.
Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88