One test-directory candidate list; a spec-only project defaults test_path to spec #793

Closed
opened 2026-09-28 14:17:09 +00:00 by jared · 2 comments
Owner

Problem

Three lists name candidate test directories: command/cli/project_config_command.rb:45 %w[tests test spec], model/project/flat_attrs.rb:37 %w[tests test], and model/project/validation.rb:6 CANDIDATE_TEST_DIRS = %w[tests test spec]. They disagree. A project with only spec/ and no test_path: loads with test.path == "tests", and then Validation reports that tests does not exist and lists spec/ as a candidate.

Reproduce

Failing test: a tmp project with name: widgets, no test_path:, and only a spec/ directory. Project::Yaml.load(dir, target: nil).test.path returns "tests" today. Expected "spec".

Approach

Files (5): adapter/project/yaml.rb (owns TEST_DIR_CANDIDATES = %w[tests test spec]), model/project/flat_attrs.rb, model/project/validation.rb, command/cli/project_config_command.rb, tests/model/project_test_path_default_test.rb (add a case).
ADRs cited: ADR-0074, ADR-0192 item 2 (Test defaults). None to supersede. The owner of the constant is a heuristic.

Required work:

  1. One constant on Project::Yaml (T5 renames it to Project::Config). The other two sites read it. — check: grep -rn "%w\[tests test" plugins/os-sdlc/lib | wc -l prints 1
  2. The yaml-side default picks the first existing candidate, in list order. — check: ruby plugins/os-sdlc/tests/model/project_test_path_default_test.rb

Rejected: keep FlatAttrs's two-item list. It is the one that disagrees and causes the false Validation report.

Acceptance criteria

  1. Given a project with only spec/ and no test_path:, when it loads, then test.path is spec.
  2. Given a project with tests/ and spec/, when it loads, then test.path is tests.
  3. Given project-config widgets in a directory with only spec/, when it runs, then the yaml it writes has test_path: spec (as today).

Owner sketch

class OsSdlc::Project::Yaml
  TEST_DIR_CANDIDATES = %w[tests test spec].freeze
end

Non-goals

The rename (T5).

Origin

  • Trigger: user ruling R2 (one candidate list owned by the config)
  • Improvised this session: none
  • Chain: false "tests does not exist" on spec projects ← FlatAttrs default list omits spec ← three copies of one rule (DESIGN: flat_attrs.rb:37)
  • Where: plugins/os-sdlc/lib/os_sdlc/model/project/flat_attrs.rb:37
  • Session: bb36e383-017d-486e-809f-7ce25d151e61
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/bb36e383-017d-486e-809f-7ce25d151e61.jsonl
## Problem Three lists name candidate test directories: command/cli/project_config_command.rb:45 `%w[tests test spec]`, model/project/flat_attrs.rb:37 `%w[tests test]`, and model/project/validation.rb:6 `CANDIDATE_TEST_DIRS = %w[tests test spec]`. They disagree. A project with only `spec/` and no `test_path:` loads with `test.path == "tests"`, and then Validation reports that `tests` does not exist and lists `spec/` as a candidate. ## Reproduce Failing test: a tmp project with `name: widgets`, no `test_path:`, and only a `spec/` directory. `Project::Yaml.load(dir, target: nil).test.path` returns `"tests"` today. Expected `"spec"`. ## Approach Files (5): adapter/project/yaml.rb (owns `TEST_DIR_CANDIDATES = %w[tests test spec]`), model/project/flat_attrs.rb, model/project/validation.rb, command/cli/project_config_command.rb, tests/model/project_test_path_default_test.rb (add a case). ADRs cited: ADR-0074, ADR-0192 item 2 (Test defaults). None to supersede. The owner of the constant is a heuristic. Required work: 1. One constant on `Project::Yaml` (T5 renames it to `Project::Config`). The other two sites read it. — check: `grep -rn "%w\[tests test" plugins/os-sdlc/lib | wc -l` prints 1 2. The yaml-side default picks the first existing candidate, in list order. — check: `ruby plugins/os-sdlc/tests/model/project_test_path_default_test.rb` Rejected: keep FlatAttrs's two-item list. It is the one that disagrees and causes the false Validation report. ## Acceptance criteria 1. Given a project with only `spec/` and no `test_path:`, when it loads, then `test.path` is `spec`. 2. Given a project with `tests/` and `spec/`, when it loads, then `test.path` is `tests`. 3. Given `project-config widgets` in a directory with only `spec/`, when it runs, then the yaml it writes has `test_path: spec` (as today). ## Owner sketch ```ruby class OsSdlc::Project::Yaml TEST_DIR_CANDIDATES = %w[tests test spec].freeze end ``` ## Non-goals The rename (T5). ## Origin - Trigger: user ruling R2 (one candidate list owned by the config) - Improvised this session: none - Chain: false "tests does not exist" on spec projects ← FlatAttrs default list omits spec ← three copies of one rule (DESIGN: flat_attrs.rb:37) - Where: plugins/os-sdlc/lib/os_sdlc/model/project/flat_attrs.rb:37 - Session: bb36e383-017d-486e-809f-7ce25d151e61 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/bb36e383-017d-486e-809f-7ce25d151e61.jsonl
Author
Owner

Work started on branch ticket-793 via /os-sdlc:implement (session bb36e383). #792 merged to main.

Work started on branch ticket-793 via /os-sdlc:implement (session bb36e383). #792 merged to main.
Author
Owner

Resolution

Done: One test-directory candidate list, Project::Yaml::TEST_DIR_CANDIDATES (tests, test, spec), read by the project-config command, FlatAttrs, and Validation through its injected yaml collaborator; a spec-only project now defaults test_path to spec.

Evidence: os-sdlc implementation 58 on branch ticket-793: 10 dispatches, 0 retries, suite-check pass, contract-auditor pass; two LENS lines challenged by opus: both were code facts not lens gaps, fixed in 5f987ca1 (Validation uses @yaml.test_dir_candidates, alias constant deleted); suite 1317 runs 0 failures; commits 7ae416cf 5f987ca1

Follow-ups: #798 filed (inward-dependency lint misses qualified constant chains, skeptic CREATE); flat_attrs.rb reference to the adapter constant is retired with FlatAttrs in #795

## Resolution **Done:** One test-directory candidate list, Project::Yaml::TEST_DIR_CANDIDATES (tests, test, spec), read by the project-config command, FlatAttrs, and Validation through its injected yaml collaborator; a spec-only project now defaults test_path to spec. **Evidence:** os-sdlc implementation 58 on branch ticket-793: 10 dispatches, 0 retries, suite-check pass, contract-auditor pass; two LENS lines challenged by opus: both were code facts not lens gaps, fixed in 5f987ca1 (Validation uses @yaml.test_dir_candidates, alias constant deleted); suite 1317 runs 0 failures; commits 7ae416cf 5f987ca1 **Follow-ups:** #798 filed (inward-dependency lint misses qualified constant chains, skeptic CREATE); flat_attrs.rb reference to the adapter constant is retired with FlatAttrs in #795
jared closed this issue 2026-09-28 15:52:50 +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#793
No description provided.