Skip to content

[quality] #351 --status regression test cannot fail: TTY branch unreachable with piped stdin #353

Closed

Description

@hivecommons-hive

Finding

PR #351 fixed --status so it never prompts for an unfilled blank (src/cli.ts:118, the !statusOnly term in the interactive condition). The regression test it added (src/cli.test.ts, "--status alone never prompts or errors on an unfilled blank") cannot observe that fix: runCli spawns the CLI with piped stdin, so process.stdin.isTTY is never true and interactive is already false with or without !statusOnly. The test's own comment acknowledges this.

Verified at 8d26afe (Node v26.12.0) by reverting the one-line fix in dist/cli.js:

run --status on Review {{ file }}, stdin </dev/null exit
HEAD, plain spawn (what the test does) 📋 inline: file=___ 0
fix reverted, plain spawn 📋 inline: file=___ 0 — test still passes
HEAD, --import shim setting process.stdin.isTTY = true 📋 inline: file=___ 0
fix reverted, same shim file: Variable "file" has no value and stdin is closed; … 1 — regression caught

Coverage does not flag this: the line is 100% covered either way (99.60% lines / 97.69% branches at HEAD), which is exactly why a test that cannot fail slips through a line-coverage gate.

Recommendation

Make the test reach the TTY branch portably (no pty, works on the ubuntu and macOS matrix legs) by spawning the CLI with
node --import 'data:text/javascript,Object.defineProperty(process.stdin,"isTTY",{value:true})' dist/cli.js 'Review {{ file }}' --status
and keep a positive control in the same test: the identical shim without --status must take the ask path and fail with the "stdin is closed" diagnostic, proving the shim actually flips interactive so the --status assertion is meaningful.

  • src/cli.test.ts: --status test spawns with the isTTY shim and includes the positive control
  • compiled dist/cli.test.{js,js.map,d.ts} regenerated (dist-sync gate)
  • changelog.d/added-status-tty-regression-test.md

Priority


Filed by quality agent (ACMM L4/L6 — full mode)


🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 8d26afe

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    testingCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    on Oct 26, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 26, 2026
  3. added a commit that references this issue on Oct 26, 2026
    5d54d0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/claimed-by-qualitytestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions