os-sdlc shard-plan: code_files heuristic resolves to tests/test_helper.rb instead of production files #300
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#300
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?
In #297 shard-plan assigned code_files=[tests/test_helper.rb] though the fix belonged in lib/aidd_lint/fence_mask.rb. The programmer prompt's ownership rules then technically forbade the real fix; dispatcher had to annotate around it.
Spec: shard-plan code_files must resolve to production files, not test-support files
Problem Statement
When the os-sdlc implement pipeline shards a ticket, shard-plan derives each shard's
code_filesfrom the literalrequire/require_relativelines in the shard's test file. When a test reaches production code only transitively (e.g. throughtests/test_helper.rb), the heuristic assigns the test-support file as the owned code file and never discovers the real production file. The programmer brief then forbids editing the file the fix actually belongs in ("never edit any file outside your owned set"), forcing the dispatcher to annotate around the ownership rules by hand (as happened in #297, where the fix belonged in the fence-mask production file but the shard owned only test_helper).Solution
Make shard-plan's collaborator discovery follow require chains transitively: when a required file is itself a test-support file (lives under the tests directory), recurse into its requires instead of claiming it, so the closure lands on the production files the test actually exercises. Test-support files are excluded from
code_filesoutright. Reservation of shared collaborators and the single-programmer fallback behave exactly as today, operating on the improved sets.User Stories
Implementation Decisions
require/require_relativeparsing: resolve each target relative to the requiring file (existing resolution rules); if the resolved file is a test-support file, recurse into it rather than including it; otherwise include it as a collaborator.test_helper— location, not naming, decides.reserved_pathsmerge, trim, single-programmer fallback) is untouched and operates on the closed sets.Testing Decisions
Out of Scope
.sdlc/project.yamlschema.Further Notes
Spec: shard-plan code_files must resolve to production files, not test-support files
Problem Statement
When the os-sdlc implement pipeline shards a ticket, shard-plan derives each shard's
code_filesfrom the literalrequire/require_relativelines in the shard's test file. When a test reaches production code only transitively (e.g. throughtests/test_helper.rb), the heuristic assigns the test-support file as the owned code file and never discovers the real production file. The programmer brief then forbids editing the file the fix actually belongs in ("never edit any file outside your owned set"), forcing the dispatcher to annotate around the ownership rules by hand (as happened in #297, where the fix belonged in the fence-mask production file but the shard owned only test_helper).Solution
Make shard-plan's collaborator discovery follow require chains transitively: when a required file is itself a test-support file (lives under the tests directory), recurse into its requires instead of claiming it, so the closure lands on the production files the test actually exercises. Test-support files are excluded from
code_filesoutright. Reservation of shared collaborators and the single-programmer fallback behave exactly as today, operating on the improved sets.User Stories
Implementation Decisions
require/require_relativeparsing: resolve each target relative to the requiring file (existing resolution rules); if the resolved file is a test-support file, recurse into it rather than including it; otherwise include it as a collaborator.test_helper— location, not naming, decides.reserved_pathsmerge, trim, single-programmer fallback) is untouched and operates on the closed sets.Testing Decisions
Out of Scope
.sdlc/project.yamlschema.Further Notes
Spec: shard-plan code_files must resolve to production files, not test-support files
Problem Statement
When the os-sdlc implement pipeline shards a ticket, shard-plan derives each shard's
code_filesfrom the literalrequire/require_relativelines in the shard's test file. When a test reaches production code only transitively (e.g. throughtests/test_helper.rb), the heuristic assigns the test-support file as the owned code file and never discovers the real production file. The programmer brief then forbids editing the file the fix actually belongs in ("never edit any file outside your owned set"), forcing the dispatcher to annotate around the ownership rules by hand (as happened in #297, where the fix belonged in the fence-mask production file but the shard owned only test_helper).Solution
Make shard-plan's collaborator discovery follow require chains transitively: when a required file is itself a test-support file (lives under the tests directory), recurse into its requires instead of claiming it, so the closure lands on the production files the test actually exercises. Test-support files are excluded from
code_filesoutright. Reservation of shared collaborators and the single-programmer fallback behave exactly as today, operating on the improved sets.User Stories
Implementation Decisions
require/require_relativeparsing: resolve each target relative to the requiring file (existing resolution rules); if the resolved file is a test-support file, recurse into it rather than including it; otherwise include it as a collaborator.test_helper— location, not naming, decides.reserved_pathsmerge, trim, single-programmer fallback) is untouched and operates on the closed sets.Testing Decisions
Out of Scope
.sdlc/project.yamlschema.Further Notes
Resolution
Done: shard-plan collaborator discovery is now a transitive closure over static require parsing: recurses through test-support files (location-based under the test file's dir), lands on the production files a test actually exercises, cycle-safe via visited set; test-support files excluded from code_files; reservation/fallback untouched.
Evidence: Merged to main via sdlc/300 (worktree commit
4e5b91b, merge32b7e3f); suite on main after merge: 759 runs / 0 failures; reviewer verdict APPROVE (spec fidelity, test relevance, design). Run also flushed out and fixed pipeline bugs #305 and #306 on main (a639666,5d858fc,9446f79).Follow-ups: Captured: duplicate transitive test coverage consolidation (new issue above). Dropped: tests_dir uses File.dirname(test_file) not test_path — spec-sanctioned; only matters if nested test subdirectories ever appear.