IW-613: Make non-final negated BATS assertions fail the test #647

Merged
claude merged 13 commits from IW-613 into main 2026-09-26 11:16:16 +00:00
Member

Summary

Five BATS assertions used a negated command (! <cmd>) in a non-final position. Bash does not apply errexit to a pipeline that starts with !, so bats could not fail the test at that line. The assertions were vacuous.

Defects fixed

  • Phase 1 (#646): appended || false to each non-final negated assertion:
    • test/help-intercept.bats:114 and :189
    • test/rm.bats:61
    • test/open.bats:53
    • test/contract/mill_contract.bats:62

Testing

  • Reproduction (negation-repro.bats) confirmed the root cause before the fix.
  • Mutation proof: each of the five assertions goes red when its guarded condition is injected; before the fix, the same mutation on help-intercept.bats:114 stayed green.
  • Unmutated runs green: help-intercept.bats 16/16, rm.bats 2/2, open.bats 1/1, contract/mill_contract.bats 6/6.
  • No hidden defects surfaced when the assertions became effective.

Release notes

See project-management/issues/IW-613/release-notes.md (Czech). Test-only change; no user-visible behavior changes.

🤖 Generated with Claude Code

Closes #613

## Summary Five BATS assertions used a negated command (`! <cmd>`) in a non-final position. Bash does not apply `errexit` to a pipeline that starts with `!`, so bats could not fail the test at that line. The assertions were vacuous. ## Defects fixed - **Phase 1 (#646):** appended ` || false` to each non-final negated assertion: - `test/help-intercept.bats:114` and `:189` - `test/rm.bats:61` - `test/open.bats:53` - `test/contract/mill_contract.bats:62` ## Testing - Reproduction (`negation-repro.bats`) confirmed the root cause before the fix. - Mutation proof: each of the five assertions goes red when its guarded condition is injected; before the fix, the same mutation on `help-intercept.bats:114` stayed green. - Unmutated runs green: `help-intercept.bats` 16/16, `rm.bats` 2/2, `open.bats` 1/1, `contract/mill_contract.bats` 6/6. - No hidden defects surfaced when the assertions became effective. ## Release notes See `project-management/issues/IW-613/release-notes.md` (Czech). Test-only change; no user-visible behavior changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Closes #613
test/help-intercept.bats uses a non-final '! grep -q', which bats does not check

Artifacts:
- analysis.md
- issue.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test/help-intercept.bats uses a non-final '! grep -q', which bats does not check

Artifacts:
- tasks.md
- review-state.json (tasks_ready)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: IW-613
Phase: 1 - Negated commands in a non-final position do not fail the test

This commit marks the checkpoint for phase 1 context generation.
Use dx-fix IW-613 to return to this point.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Negated commands in a non-final position do not fail the test

Artifacts:
- phase-01-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(IW-613): add release notes
Some checks failed
CI / changes (pull_request) Successful in 4s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 9s
CI / lint (pull_request) Successful in 12s
CI / test (pull_request) Has been cancelled
CI / dashboard-build (pull_request) Has been cancelled
CI / compile (pull_request) Has been cancelled
d9a0ff3929
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore(IW-613): update review-state to all_complete
All checks were successful
CI / changes (pull_request) Successful in 4s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 12s
CI / compile (pull_request) Successful in 1m34s
CI / dashboard-build (pull_request) Successful in 1m14s
CI / test (pull_request) Successful in 15m33s
2d1addbc66
claude merged commit 94689b3124 into main 2026-09-26 11:16:16 +00:00
Sign in to join this conversation.
No description provided.