Skip to content

test(cli): pin flag propagation, stdin trimming and shutdown exit code - #429

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-cli-mutation-survivors
Nov 1, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-cli-mutation-survivors

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

The nightly Stryker run (41171362594, cli shard) left 121 survivors in src/cli.ts (84.78%). Most are log-string or equivalent mutants (e.g. the prompt project-excuse filter is already enforced inside generatePromptBlock, so dropping it in cli.ts is 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 percentage
  • prompt / add: the write --flag=<value> hint appears only for a bare flag, not for an unknown value
  • attach: --cli=codex, --no-raw and --verbose reach 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 form
  • watch: the default log mode prints no → delivery footer and no [rationguard] trace lines; a bare --diagnostics, --log-format=json and --verbose are accepted together and --verbose traces watcher startup; the bare flag still arms the final diagnostics summary
  • watch: a signal arriving after a watcher error exits 1 — the shutdown handler must not reset process.exitCode

Validation

Each target mutant was hand-applied to dist/cli.js and fails under the new tests (confidence >= …→false, * 100→/ 100, .trim() removed at both sites, ?? 'claude'→&& 'claude', each attach boolean forced true/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 lint clean.

One finding while writing the signal test: a stubbed start() that resolves lets the event loop drain before process.kill dispatches 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

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit de2f950 into main Nov 1, 2026
16 of 17 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-cli-mutation-survivors branch November 1, 2026 00:14
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#429e0eccd2` sha256:4fb895fbf425193a22dc33f21e83086fe8b7fcef5eccbdc33b9e88624e684802 — download from the dashboard or `hivectl review evidence #429`.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants