Give the code/test path convention one owner: Project::Layout [capture] #574
Labels
No labels
P0
P1
P2
P3
bug
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
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#574
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?
Context
Responsibility audit run 13 on plugins/os-sdlc/lib/os_sdlc/project.rb (analysis: .sdlc/tmp/responsibility-audit/13-project-rb-reaudit/analysis.yaml, uncommitted). Capability: code/test path convention.
Project#tests_forknows the mirrored and unnamespaced test naming and the scenario glob. Four other objects decide "is this a test path" with their own string form.Callers that would delegate:
Project#tests_for;Project::Changes#code_paths/#test_paths;ScopePolicy#test_path?;GreenAssertFailureSidecar#under_test_path?;LintWorklistTarget#code_dir.Observed
delete_prefixat project.rb:93 does not anchor: a path outsidecode_pathpasses through and yields candidates liketest/bin/foo_test.rb.Reproduce
Expected
Illustration
Origin
tests_forplaced onProject(DESIGN, ADR-0174)Tasks
Project::Layoutat lib/os_sdlc/project/layout.rb withcode?,test?,tests_for.tests_forraisesArgumentErrorfor a path outsidecode_path.test?andcode?honor a non-defaulttest_pathandcode_path.Project#tests_fordelegates toProject::Layout.Acceptance criteria
Project::Layout.new(project).tests_for("bin/foo.rb")raisesArgumentError.Project::Layout.new(project).tests_for("lib/os_sdlc/foo.rb")returns the same listProject#tests_forreturned before this change.Project::Layout.new(project).test?("spec/x_spec.rb")is true whentest_pathisspec.Structural follow-through
Applied by hand or
/os-sdlc:code-writeafterimplementation_complete, before commit:Project::Changes#code_paths/#test_pathscalllayout.code?/layout.test?.ScopePolicy#test_path?,GreenAssertFailureSidecar#under_test_path?,LintWorklistTarget#code_dirdelegate toProject::Layout.rg -n 'test_path}/|code_path}/' plugins/os-sdlc/libreturns only project/layout.rb.ADR case
Amends ADR-0174 (
Project#tests_formoves toProject::Layout;Projectkeeps the attributes per ADR-0074). Create the amending ADR with /os-adr:create when this ticket lands. ADR-0156 (ScopePolicy owns role and scope rules) is unchanged: ScopePolicy keeps the policy and asks Layout the path question.Batch
Map: #570. Position 3 of 4. Follows #573. Followed by #572. Map: maps/poodr-ticket-implementation.yaml.
Work started via /os-sdlc:responsibility-refactor batch 2 (map #570). Branch: ticket-574, worktree .claude/worktrees/ticket-574, map poodr-ticket-implementation.yaml.
Resolution
Done: Project::Layout (project/layout.rb) owns code?, test?, code_prefix, test_prefix, tests_for; tests_for raises ArgumentError for a path outside code_path; Layout::TestCandidates resolves existing → scenario-split → HarnessError. Project#tests_for and Project::Changes delegate. ADR-0180 amends ADR-0174.
Evidence: Merged to main
a26ebb3(code4ca0e83). Suite 1228 runs, 0 failures; rubocop clean on 5 touched files; pre-tool-use hook smoke test still denies; rg for inline test_path}/ and code_path}/ under lib returns only project/layout.rb. Pipeline: 7 dispatches, 594 s, ended implementation_failed verdict:error. Cause: the gate could not map tests/project_layout_test.rb to project/layout.rb (harness test-mapping gap, same family as #535), and the accepted tests plus one existing test (project_tests_for_test.rb) encoded the old unanchored behavior. Hand-finished: moved the test to tests/project/layout_test.rb, rewrote inputs to anchored paths, extracted TestCandidates to satisfy the ParameterThreaded cop. No contract-auditor/refactorer rounds ran. Position 3 of 4 on map #570.Follow-ups: Structural follow-through partially applied by decision recorded in ADR-0180: ScopePolicy#test_path? and GreenAssertFailureSidecar#under_test_path? keep segment-match regexes (absolute and subtree-relative inputs); LintWorklistTarget#code_dir is a join, not a classification. No ticket: the re-audit after #572 decides whether these still read as duplicate classification. Harness gap (gate cannot map an unnamespaced test file for a nested class) is covered by #535's family; not re-filed.