Narrow run_fixture_ac_lint skip guard: 0e34b5f over-broadened it, breaking 3 fail-closed/grammar tests #209

Closed
opened 2026-08-01 15:40:44 +00:00 by jared · 3 comments
Owner

Problem

3 failures in plugins/os-sdlc/tests/cli_test.rb, pre-existing on main:

CliAcLintScopeAndGrammarTest#test_ac_lint_with_tests_discloses_when_no_ac_grammar_is_recognized [cli_test.rb:335]
Expected output to include "no recognized AC grammar"; got the generic "fixture-AC-grammar lint skipped -- no --tests given" line

CliAcLintSkipTest#test_ac_lint_without_tests_derives_glob_from_project_test_path_and_fails_closed_on_empty_match [cli_test.rb:426]
Expected exit 1, actual 0

CliAcLintCoverageTest#test_ac_lint_exits_1_when_tests_glob_matches_no_files_and_grammar_is_declared [cli_test.rb:259]
Expected exit 1, actual 0

Root cause

Commit 0e34b5f ("Fix CliAcLintSkipTest with matched files gate") changed the guard in run_fixture_ac_lint (bin/os-sdlc ~line 259-264):

# before
return skip_fixture_ac_lint(artifact) if tests.empty?
# after
return skip_fixture_ac_lint(artifact) if fixture_files_for(tests).empty?

The new guard treats "glob given/derived but matched zero files" the same as "no --tests given at all": generic skip message, exit 0. That contradicts the documented round-3 policy (bin/os-sdlc:285-290: fixture-grammar findings including the "--tests matched no fixture files" form exit 1 when a grammar is declared; lib/os_sdlc/fixture_ac_coverage_lint.rb:35-46 for the no-grammar disclosure behavior). The three tests exercise exactly those paths: empty match with declared grammar (fail closed, exit 1), derived-empty-glob (fail closed), and matched-glob-but-no-recognized-grammar (disclosure line). 0e34b5f fixed its one target test without re-running these.

Proposed fix

Restore the narrow guard — skip only when the tests glob is absent/underivable (tests.empty?) — and let an empty fixture_files_for(tests) result flow into fixture_ac_lint/FixtureAcCoverageLint.check, whose existing no_fixtures_tail / grammar-detection logic already produces the correct exit-1 finding or the "no recognized AC grammar" disclosure. Then re-diagnose whatever CliAcLintSkipTest regression 0e34b5f was originally chasing and confirm it still passes under the narrower condition.

Verify

cd plugins/os-sdlc && ruby -Itests -Ilib tests/cli_test.rb — all 3 above go green AND the CliAcLintSkipTest case 0e34b5f fixed stays green. (2 CliProjectConfigTest failures are ticket #208.)

## Problem 3 failures in plugins/os-sdlc/tests/cli_test.rb, pre-existing on main: ``` CliAcLintScopeAndGrammarTest#test_ac_lint_with_tests_discloses_when_no_ac_grammar_is_recognized [cli_test.rb:335] Expected output to include "no recognized AC grammar"; got the generic "fixture-AC-grammar lint skipped -- no --tests given" line CliAcLintSkipTest#test_ac_lint_without_tests_derives_glob_from_project_test_path_and_fails_closed_on_empty_match [cli_test.rb:426] Expected exit 1, actual 0 CliAcLintCoverageTest#test_ac_lint_exits_1_when_tests_glob_matches_no_files_and_grammar_is_declared [cli_test.rb:259] Expected exit 1, actual 0 ``` ## Root cause Commit 0e34b5f ("Fix CliAcLintSkipTest with matched files gate") changed the guard in `run_fixture_ac_lint` (bin/os-sdlc ~line 259-264): ```ruby # before return skip_fixture_ac_lint(artifact) if tests.empty? # after return skip_fixture_ac_lint(artifact) if fixture_files_for(tests).empty? ``` The new guard treats "glob given/derived but matched zero files" the same as "no --tests given at all": generic skip message, exit 0. That contradicts the documented round-3 policy (bin/os-sdlc:285-290: fixture-grammar findings including the "--tests matched no fixture files" form exit 1 when a grammar is declared; lib/os_sdlc/fixture_ac_coverage_lint.rb:35-46 for the no-grammar disclosure behavior). The three tests exercise exactly those paths: empty match with declared grammar (fail closed, exit 1), derived-empty-glob (fail closed), and matched-glob-but-no-recognized-grammar (disclosure line). 0e34b5f fixed its one target test without re-running these. ## Proposed fix Restore the narrow guard — skip only when the tests glob is absent/underivable (`tests.empty?`) — and let an empty `fixture_files_for(tests)` result flow into `fixture_ac_lint`/`FixtureAcCoverageLint.check`, whose existing `no_fixtures_tail` / grammar-detection logic already produces the correct exit-1 finding or the "no recognized AC grammar" disclosure. Then re-diagnose whatever CliAcLintSkipTest regression 0e34b5f was originally chasing and confirm it still passes under the narrower condition. ## Verify `cd plugins/os-sdlc && ruby -Itests -Ilib tests/cli_test.rb` — all 3 above go green AND the CliAcLintSkipTest case 0e34b5f fixed stays green. (2 CliProjectConfigTest failures are ticket #208.)
Author
Owner

Ran through /os-sdlc:implement: one-line guard revert in bin/os-sdlc run_fixture_ac_lint (tests.empty?). red/green/ac-lint gates passed (245 runs green incl. enlivened cli_test.rb); reviewer APPROVE, no findings. Lint gate red on 530 pre-existing offenses only — gate bug filed as #215. Awaiting merge from sdlc-209 worktree.

Ran through /os-sdlc:implement: one-line guard revert in bin/os-sdlc run_fixture_ac_lint (tests.empty?). red/green/ac-lint gates passed (245 runs green incl. enlivened cli_test.rb); reviewer APPROVE, no findings. Lint gate red on 530 pre-existing offenses only — gate bug filed as #215. Awaiting merge from sdlc-209 worktree.
Author
Owner

Merged to main (merge c15cca4, commit 6b29c4c). Also removed the stale all.rb LIVE_TEST_FILES whitelist (701056e) that let these regressions merge unseen. Suite green: 432 runs, 0 failures. Ready for sign-off.

Merged to main (merge c15cca4, commit 6b29c4c). Also removed the stale all.rb LIVE_TEST_FILES whitelist (701056e) that let these regressions merge unseen. Suite green: 432 runs, 0 failures. Ready for sign-off.
Author
Owner

Confirmed fixed on main: bin/os-sdlc:302 has the narrow tests.empty? guard restored. plugins/os-sdlc/tests/cli_test.rb full run: 49 runs, 0 failures. Closing.

Confirmed fixed on main: bin/os-sdlc:302 has the narrow tests.empty? guard restored. plugins/os-sdlc/tests/cli_test.rb full run: 49 runs, 0 failures. Closing.
jared closed this issue 2026-08-13 18:15:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#209
No description provided.