Rename tests that break the S2 layout convention #656
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#656
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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>.rblives at<test_path>/<some suffix of dirs>/<base>_test.rb(or<base>_<scenario>_test.rbfor 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 onecarries 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'sOrigin session).
Approach
git mveach violating test to its conformant path with no content changeexcept a
require_relativepath 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:
plugins/os-sdlc/tests/lint_changed_hook_test.rbtoplugins/os-sdlc/tests/hooks/lint_changed_test.rb(proven by AC 1)plugins/os-aidd-lint/tests/hooks/post_tool_use_hook_test.rbtoplugins/os-aidd-lint/tests/hooks/post_tool_use_test.rb(proven by AC 2)plugins/os-aidd-lint/tests/hooks/session_end_hook_test.rbtoplugins/os-aidd-lint/tests/hooks/session_end_test.rb(proven by AC 2)plugins/os-aidd-lint/tests/hooks/session_start_hook_test.rbtoplugins/os-aidd-lint/tests/hooks/session_start_test.rb(proven by AC 2)plugins/os-aidd-lint/tests/aidd_lint_bin_test.rbtoplugins/os-aidd-lint/tests/aidd_lint_test.rb(proven by AC 2)plugins/os-backlog/tests/issue_show_cli_test.rbtoplugins/os-backlog/tests/issue_show_test.rb(proven by AC 2)plugins/os-sdlc/tests/model/model_test.rbtoplugins/os-sdlc/tests/model_test.rb(proven by AC 3)plugins/os-sdlc/tests/model/open_implementation_*_test.rbfiles (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) toplugins/os-sdlc/tests/pipeline/(proven by AC 3)plugins/os-sdlc/tests/model/ticket_shape_parity_test.rbtoplugins/os-sdlc/tests/pipeline/ticket_shape_parity_test.rb(proven by AC 3)plugins/os-sdlc/tests/pipeline/dispatch_record_usage_test.rbanddispatch_step_summaries_test.rbtoplugins/os-sdlc/tests/model/(proven by AC 3)plugins/os-sdlc/tests/pipeline/handoff_latest_test.rbtoplugins/os-sdlc/tests/model/handoff_latest_test.rb(proven by AC 3)plugins/os-sdlc/tests/pipeline/map/map_edge_test.rbandmap_node_test.rbtoplugins/os-sdlc/tests/pipeline/(proven by AC 3)plugins/os-sdlc/tests/pipeline/step_result_lint_failures_for_test.rbtoplugins/os-sdlc/tests/model/step_result_lint_failures_for_test.rb(proven by AC 3)plugins/os-sdlc/tests/pipeline/violations_cli_test.rbandviolations_keys_for_dispatch_test.rbtoplugins/os-sdlc/tests/model/(proven by AC 3)plugins/os-sdlc/tests/lint/checkpoint_label/lint_checkpoint_label_test.rbtoplugins/os-sdlc/tests/lint/checkpoint_label/checkpoint_label_test.rb(proven by AC 3)plugins/os-sdlc/tests/pipeline/subagent_start_hook_test.rbtoplugins/os-sdlc/tests/hooks/subagent_start_test.rb(proven by AC 4)plugins/os-sdlc/tests/pipeline/subagent_stop_hook_test.rbtoplugins/os-sdlc/tests/hooks/subagent_stop_test.rb(proven by AC 4)plugins/os-sdlc/tests/pipeline/post_tool_use_hook_test.rbtoplugins/os-sdlc/tests/hooks/post_tool_use_test.rb(proven by AC 4)plugins/os-sdlc/tests/pipeline/post_tool_use_async_dispatch_test.rbandpost_tool_use_non_pipeline_async_dispatch_test.rbtoplugins/os-sdlc/tests/hooks/(proven by AC 4)require_relativetargets 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.rbAcceptance criteria
plugins/os-sdlc/hooks/lint_changed.rb, when the test suite runs, then its test is atplugins/os-sdlc/tests/hooks/lint_changed_test.rband no file remains at the oldtests/lint_changed_hook_test.rbpath.git statusis checked, then each old path is gone and each new path exists with unchanged test bodies apart from require-path fixes.git statusis checked, then each test file sits at the path S2 selects for its matching production file.git statusis checked, then each test that shells out to aplugins/os-sdlc/hooks/*.rbscript lives underplugins/os-sdlc/tests/hooks/, distinct from the pre-existingplugins/os-sdlc/tests/hook/directory that covers thelib/os_sdlc/hook/*.rbclasses.Owner sketch
Non-goals
Origin
plugins/os-sdlc/tests/,plugins/os-aidd-lint/tests/,plugins/os-backlog/tests/Work started on branch ticket-656 (session 557d47dd) via /os-sdlc:implement --target os-sdlc, after #655 merged (main
157da599).Deviation: hand-finished outside the pipeline (#665)
Problem. Every change in this ticket is a
git mvof a test file plus arequire_relativedepth fix, across three targets (os-sdlc, os-aidd-lint, os-backlog). The mappoodr-ticket-implementation.yamlruns 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. Commita978c698; merge commit on main3c48366dafter merging #671 from main (fork guard now scans git-tracked files, no conflict).No test loader needed edits: all three
tests/all.rbfiles glob. Four pre-existing rubocop offenses in moved files (AbcSize, MultipleAssertions) are content-based and untouched.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
a978c698on branch ticket-656, merge commit on main3c48366d. 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.