Rename tests that break the S2 layout convention #656

Closed
opened 2026-09-23 21:37:05 +00:00 by jared · 3 comments
Owner

Problem

Blocked by #655.

Ticket "code.path is the target path; no lib/ default" (#655) implements S2:
a test for production file <target>/<dirs>/<base>.rb lives at
<test_path>/<some suffix of dirs>/<base>_test.rb (or <base>_<scenario>_test.rb
for a scenario test). Scanning every test file under the six cc-os targets found
26 tests that violate this convention: some sit in the wrong directory, some use
a file-kind word (_hook, _bin, _cli) as if it were a scenario, and one
carries a redundant lint_ prefix the directory already supplies. User decision
(this session): these tests are renamed to conform; S2 does not grow a
carve-out for them. Full scan: scratchpad/mapping/orphans.md (this ticket's
Origin session).

Approach

git mv each violating test to its conformant path with no content change
except a require_relative path fix where the file's depth changes. Run after
#655 lands (S2 must exist first, so a re-run of the mapper confirms each
destination is reachable).

Required work:

  1. Rename plugins/os-sdlc/tests/lint_changed_hook_test.rb to plugins/os-sdlc/tests/hooks/lint_changed_test.rb (proven by AC 1)
  2. Rename plugins/os-aidd-lint/tests/hooks/post_tool_use_hook_test.rb to plugins/os-aidd-lint/tests/hooks/post_tool_use_test.rb (proven by AC 2)
  3. Rename plugins/os-aidd-lint/tests/hooks/session_end_hook_test.rb to plugins/os-aidd-lint/tests/hooks/session_end_test.rb (proven by AC 2)
  4. Rename plugins/os-aidd-lint/tests/hooks/session_start_hook_test.rb to plugins/os-aidd-lint/tests/hooks/session_start_test.rb (proven by AC 2)
  5. Rename plugins/os-aidd-lint/tests/aidd_lint_bin_test.rb to plugins/os-aidd-lint/tests/aidd_lint_test.rb (proven by AC 2)
  6. Rename plugins/os-backlog/tests/issue_show_cli_test.rb to plugins/os-backlog/tests/issue_show_test.rb (proven by AC 2)
  7. Rename plugins/os-sdlc/tests/model/model_test.rb to plugins/os-sdlc/tests/model_test.rb (proven by AC 3)
  8. Rename the four plugins/os-sdlc/tests/model/open_implementation_*_test.rb files (open_implementation_retired_tests_test.rb, open_implementation_retires_file_entries_test.rb, open_implementation_ticket_body_test.rb, open_implementation_ticket_shape_test.rb) to plugins/os-sdlc/tests/pipeline/ (proven by AC 3)
  9. Rename plugins/os-sdlc/tests/model/ticket_shape_parity_test.rb to plugins/os-sdlc/tests/pipeline/ticket_shape_parity_test.rb (proven by AC 3)
  10. Rename plugins/os-sdlc/tests/pipeline/dispatch_record_usage_test.rb and dispatch_step_summaries_test.rb to plugins/os-sdlc/tests/model/ (proven by AC 3)
  11. Rename plugins/os-sdlc/tests/pipeline/handoff_latest_test.rb to plugins/os-sdlc/tests/model/handoff_latest_test.rb (proven by AC 3)
  12. Rename plugins/os-sdlc/tests/pipeline/map/map_edge_test.rb and map_node_test.rb to plugins/os-sdlc/tests/pipeline/ (proven by AC 3)
  13. Rename plugins/os-sdlc/tests/pipeline/step_result_lint_failures_for_test.rb to plugins/os-sdlc/tests/model/step_result_lint_failures_for_test.rb (proven by AC 3)
  14. Rename plugins/os-sdlc/tests/pipeline/violations_cli_test.rb and violations_keys_for_dispatch_test.rb to plugins/os-sdlc/tests/model/ (proven by AC 3)
  15. Rename plugins/os-sdlc/tests/lint/checkpoint_label/lint_checkpoint_label_test.rb to plugins/os-sdlc/tests/lint/checkpoint_label/checkpoint_label_test.rb (proven by AC 3)
  16. Rename plugins/os-sdlc/tests/pipeline/subagent_start_hook_test.rb to plugins/os-sdlc/tests/hooks/subagent_start_test.rb (proven by AC 4)
  17. Rename plugins/os-sdlc/tests/pipeline/subagent_stop_hook_test.rb to plugins/os-sdlc/tests/hooks/subagent_stop_test.rb (proven by AC 4)
  18. Rename plugins/os-sdlc/tests/pipeline/post_tool_use_hook_test.rb to plugins/os-sdlc/tests/hooks/post_tool_use_test.rb (proven by AC 4)
  19. Rename plugins/os-sdlc/tests/pipeline/post_tool_use_async_dispatch_test.rb and post_tool_use_non_pipeline_async_dispatch_test.rb to plugins/os-sdlc/tests/hooks/ (proven by AC 4)
  20. Fix require_relative targets in every renamed file so they resolve from the new location, and run each target's full test command green (proven by AC 5) — check: cd /home/jared/dev/cc-os && ruby plugins/os-sdlc/tests/all.rb && ruby plugins/os-aidd-lint/tests/all.rb && ruby plugins/os-backlog/tests/all.rb

Acceptance criteria

  1. Given plugins/os-sdlc/hooks/lint_changed.rb, when the test suite runs, then its test is at plugins/os-sdlc/tests/hooks/lint_changed_test.rb and no file remains at the old tests/lint_changed_hook_test.rb path.
  2. Given the five other Category-A fake-scenario renames (items 2-6), when git status is checked, then each old path is gone and each new path exists with unchanged test bodies apart from require-path fixes.
  3. Given the fifteen Category-B renames (items 7-15), when git status is checked, then each test file sits at the path S2 selects for its matching production file.
  4. Given the five Category-C renames (items 16-19), when git status is checked, then each test that shells out to a plugins/os-sdlc/hooks/*.rb script lives under plugins/os-sdlc/tests/hooks/, distinct from the pre-existing plugins/os-sdlc/tests/hook/ directory that covers the lib/os_sdlc/hook/*.rb classes.
  5. Given all 26 renames, when each affected target's test command runs, then it is green with the same test count as before the renames (no test silently dropped by a require failure).

Owner sketch

git mv plugins/os-sdlc/tests/lint_changed_hook_test.rb plugins/os-sdlc/tests/hooks/lint_changed_test.rb
git mv plugins/os-aidd-lint/tests/hooks/post_tool_use_hook_test.rb plugins/os-aidd-lint/tests/hooks/post_tool_use_test.rb
# ...remaining 24 git mv calls per Required work above

Non-goals

  • Any test in orphans.md Category D (integration/cross-cutting, no single production file). Those are allowed under S2 and stay where they are.
  • Implementing S2 itself (#655).

Origin

  • Trigger: #655's S2 orphan scan (this session, 2026-09-23)
  • Improvised this session: none
  • Chain: S2 orphan scan ← #655 defines S2 ← user decision: violating tests are renamed, the rule does not adapt
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/tests/, plugins/os-aidd-lint/tests/, plugins/os-backlog/tests/
  • Session: a5f43be9-5476-418e-99f0-2c4d0e5fa57d
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/a5f43be9-5476-418e-99f0-2c4d0e5fa57d.jsonl
## Problem Blocked by #655. Ticket "code.path is the target path; no lib/ default" (#655) implements S2: a test for production file `<target>/<dirs>/<base>.rb` lives at `<test_path>/<some suffix of dirs>/<base>_test.rb` (or `<base>_<scenario>_test.rb` for a scenario test). Scanning every test file under the six cc-os targets found 26 tests that violate this convention: some sit in the wrong directory, some use a file-kind word (`_hook`, `_bin`, `_cli`) as if it were a scenario, and one carries a redundant `lint_` prefix the directory already supplies. User decision (this session): these tests are renamed to conform; S2 does not grow a carve-out for them. Full scan: `scratchpad/mapping/orphans.md` (this ticket's Origin session). ## Approach `git mv` each violating test to its conformant path with no content change except a `require_relative` path fix where the file's depth changes. Run after #655 lands (S2 must exist first, so a re-run of the mapper confirms each destination is reachable). Required work: 1. Rename `plugins/os-sdlc/tests/lint_changed_hook_test.rb` to `plugins/os-sdlc/tests/hooks/lint_changed_test.rb` (proven by AC 1) 2. Rename `plugins/os-aidd-lint/tests/hooks/post_tool_use_hook_test.rb` to `plugins/os-aidd-lint/tests/hooks/post_tool_use_test.rb` (proven by AC 2) 3. Rename `plugins/os-aidd-lint/tests/hooks/session_end_hook_test.rb` to `plugins/os-aidd-lint/tests/hooks/session_end_test.rb` (proven by AC 2) 4. Rename `plugins/os-aidd-lint/tests/hooks/session_start_hook_test.rb` to `plugins/os-aidd-lint/tests/hooks/session_start_test.rb` (proven by AC 2) 5. Rename `plugins/os-aidd-lint/tests/aidd_lint_bin_test.rb` to `plugins/os-aidd-lint/tests/aidd_lint_test.rb` (proven by AC 2) 6. Rename `plugins/os-backlog/tests/issue_show_cli_test.rb` to `plugins/os-backlog/tests/issue_show_test.rb` (proven by AC 2) 7. Rename `plugins/os-sdlc/tests/model/model_test.rb` to `plugins/os-sdlc/tests/model_test.rb` (proven by AC 3) 8. Rename the four `plugins/os-sdlc/tests/model/open_implementation_*_test.rb` files (`open_implementation_retired_tests_test.rb`, `open_implementation_retires_file_entries_test.rb`, `open_implementation_ticket_body_test.rb`, `open_implementation_ticket_shape_test.rb`) to `plugins/os-sdlc/tests/pipeline/` (proven by AC 3) 9. Rename `plugins/os-sdlc/tests/model/ticket_shape_parity_test.rb` to `plugins/os-sdlc/tests/pipeline/ticket_shape_parity_test.rb` (proven by AC 3) 10. Rename `plugins/os-sdlc/tests/pipeline/dispatch_record_usage_test.rb` and `dispatch_step_summaries_test.rb` to `plugins/os-sdlc/tests/model/` (proven by AC 3) 11. Rename `plugins/os-sdlc/tests/pipeline/handoff_latest_test.rb` to `plugins/os-sdlc/tests/model/handoff_latest_test.rb` (proven by AC 3) 12. Rename `plugins/os-sdlc/tests/pipeline/map/map_edge_test.rb` and `map_node_test.rb` to `plugins/os-sdlc/tests/pipeline/` (proven by AC 3) 13. Rename `plugins/os-sdlc/tests/pipeline/step_result_lint_failures_for_test.rb` to `plugins/os-sdlc/tests/model/step_result_lint_failures_for_test.rb` (proven by AC 3) 14. Rename `plugins/os-sdlc/tests/pipeline/violations_cli_test.rb` and `violations_keys_for_dispatch_test.rb` to `plugins/os-sdlc/tests/model/` (proven by AC 3) 15. Rename `plugins/os-sdlc/tests/lint/checkpoint_label/lint_checkpoint_label_test.rb` to `plugins/os-sdlc/tests/lint/checkpoint_label/checkpoint_label_test.rb` (proven by AC 3) 16. Rename `plugins/os-sdlc/tests/pipeline/subagent_start_hook_test.rb` to `plugins/os-sdlc/tests/hooks/subagent_start_test.rb` (proven by AC 4) 17. Rename `plugins/os-sdlc/tests/pipeline/subagent_stop_hook_test.rb` to `plugins/os-sdlc/tests/hooks/subagent_stop_test.rb` (proven by AC 4) 18. Rename `plugins/os-sdlc/tests/pipeline/post_tool_use_hook_test.rb` to `plugins/os-sdlc/tests/hooks/post_tool_use_test.rb` (proven by AC 4) 19. Rename `plugins/os-sdlc/tests/pipeline/post_tool_use_async_dispatch_test.rb` and `post_tool_use_non_pipeline_async_dispatch_test.rb` to `plugins/os-sdlc/tests/hooks/` (proven by AC 4) 20. Fix `require_relative` targets in every renamed file so they resolve from the new location, and run each target's full test command green (proven by AC 5) — check: `cd /home/jared/dev/cc-os && ruby plugins/os-sdlc/tests/all.rb && ruby plugins/os-aidd-lint/tests/all.rb && ruby plugins/os-backlog/tests/all.rb` ## Acceptance criteria 1. Given `plugins/os-sdlc/hooks/lint_changed.rb`, when the test suite runs, then its test is at `plugins/os-sdlc/tests/hooks/lint_changed_test.rb` and no file remains at the old `tests/lint_changed_hook_test.rb` path. 2. Given the five other Category-A fake-scenario renames (items 2-6), when `git status` is checked, then each old path is gone and each new path exists with unchanged test bodies apart from require-path fixes. 3. Given the fifteen Category-B renames (items 7-15), when `git status` is checked, then each test file sits at the path S2 selects for its matching production file. 4. Given the five Category-C renames (items 16-19), when `git status` is checked, then each test that shells out to a `plugins/os-sdlc/hooks/*.rb` script lives under `plugins/os-sdlc/tests/hooks/`, distinct from the pre-existing `plugins/os-sdlc/tests/hook/` directory that covers the `lib/os_sdlc/hook/*.rb` classes. 5. Given all 26 renames, when each affected target's test command runs, then it is green with the same test count as before the renames (no test silently dropped by a require failure). ## Owner sketch ``` git mv plugins/os-sdlc/tests/lint_changed_hook_test.rb plugins/os-sdlc/tests/hooks/lint_changed_test.rb git mv plugins/os-aidd-lint/tests/hooks/post_tool_use_hook_test.rb plugins/os-aidd-lint/tests/hooks/post_tool_use_test.rb # ...remaining 24 git mv calls per Required work above ``` ## Non-goals - Any test in orphans.md Category D (integration/cross-cutting, no single production file). Those are allowed under S2 and stay where they are. - Implementing S2 itself (#655). ## Origin - Trigger: #655's S2 orphan scan (this session, 2026-09-23) - Improvised this session: none - Chain: S2 orphan scan ← #655 defines S2 ← user decision: violating tests are renamed, the rule does not adapt - Root candidate: this ticket - Where: `plugins/os-sdlc/tests/`, `plugins/os-aidd-lint/tests/`, `plugins/os-backlog/tests/` - Session: a5f43be9-5476-418e-99f0-2c4d0e5fa57d - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/a5f43be9-5476-418e-99f0-2c4d0e5fa57d.jsonl
Author
Owner

Work started on branch ticket-656 (session 557d47dd) via /os-sdlc:implement --target os-sdlc, after #655 merged (main 157da599).

Work started on branch ticket-656 (session 557d47dd) via /os-sdlc:implement --target os-sdlc, after #655 merged (main 157da599).
Author
Owner

Deviation: hand-finished outside the pipeline (#665)

Problem. Every change in this ticket is a git mv of a test file plus a require_relative depth fix, across three targets (os-sdlc, os-aidd-lint, os-backlog). The map poodr-ticket-implementation.yaml runs one target and routes edits only to programmer, who may not edit tests. There is no route for a test-only ticket (#665).

Solution. A Sonnet agent performed the 26 renames in worktree ticket-656, verified each source still existed after #642 and #666-#669, fixed require paths, and updated the two fork-guard allowlist entries the renames invalidated. Commit a978c698; merge commit on main 3c48366d after merging #671 from main (fork guard now scans git-tracked files, no conflict).

Suite Before After
os-sdlc 1419 runs, 0 failures 1419 runs, 0 failures
os-aidd-lint 502 runs, 0 failures 502 runs, 0 failures
os-backlog 244 runs, 0 failures 244 runs, 0 failures

No test loader needed edits: all three tests/all.rb files glob. Four pre-existing rubocop offenses in moved files (AbcSize, MultipleAssertions) are content-based and untouched.

## Deviation: hand-finished outside the pipeline (#665) **Problem.** Every change in this ticket is a `git mv` of a test file plus a `require_relative` depth fix, across three targets (os-sdlc, os-aidd-lint, os-backlog). The map `poodr-ticket-implementation.yaml` runs one target and routes edits only to programmer, who may not edit tests. There is no route for a test-only ticket (#665). **Solution.** A Sonnet agent performed the 26 renames in worktree `ticket-656`, verified each source still existed after #642 and #666-#669, fixed require paths, and updated the two fork-guard allowlist entries the renames invalidated. Commit a978c698; merge commit on main 3c48366d after merging #671 from main (fork guard now scans git-tracked files, no conflict). | Suite | Before | After | |---|---|---| | os-sdlc | 1419 runs, 0 failures | 1419 runs, 0 failures | | os-aidd-lint | 502 runs, 0 failures | 502 runs, 0 failures | | os-backlog | 244 runs, 0 failures | 244 runs, 0 failures | No test loader needed edits: all three `tests/all.rb` files glob. Four pre-existing rubocop offenses in moved files (AbcSize, MultipleAssertions) are content-based and untouched.
Author
Owner

Resolution

Done: All 26 test files renamed to the S2 layout: hook-script tests under tests/hooks/, model and pipeline tests moved beside their production file's directory, fake-scenario suffixes (_hook, _bin, cli) and the redundant lint prefix dropped; require_relative paths fixed; fork-guard allowlist updated for the two renamed entries; no test body changed.

Evidence: Commit a978c698 on branch ticket-656, merge commit on main 3c48366d. Suites before and after identical: os-sdlc 1419 runs, os-aidd-lint 502 runs, os-backlog 244 runs, all 0 failures 0 errors. git status showed exactly 26 R/RM entries and no stale old paths. Hand-finished because the ticket is test-only (#665); write-up in the comment above.

Follow-ups: Pipeline defect cited: #665 (no route for test-only tickets), already filed. Four pre-existing rubocop offenses in moved files: dropped, content-based and unrelated to this rename; no ticket-skeptic verdict sought.

## Resolution **Done:** All 26 test files renamed to the S2 layout: hook-script tests under tests/hooks/, model and pipeline tests moved beside their production file's directory, fake-scenario suffixes (_hook, _bin, _cli) and the redundant lint_ prefix dropped; require_relative paths fixed; fork-guard allowlist updated for the two renamed entries; no test body changed. **Evidence:** Commit a978c698 on branch ticket-656, merge commit on main 3c48366d. Suites before and after identical: os-sdlc 1419 runs, os-aidd-lint 502 runs, os-backlog 244 runs, all 0 failures 0 errors. git status showed exactly 26 R/RM entries and no stale old paths. Hand-finished because the ticket is test-only (#665); write-up in the comment above. **Follow-ups:** Pipeline defect cited: #665 (no route for test-only tickets), already filed. Four pre-existing rubocop offenses in moved files: dropped, content-based and unrelated to this rename; no ticket-skeptic verdict sought.
jared closed this issue 2026-09-24 14:38:35 +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#656
No description provided.