Collapse os-sdlc slice directories into role autoload roots and drop slice prefixes from constants #737
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#737
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
ADR-0196 maps
lib/os_sdlc/<slice>/<name>.rbtoOsSdlc::<Slice>::<Name>. The layout ADR that follows ADR-0221 (number to be filled in by the implementer from docs/adr/README.md, title starts "os-sdlc organizes constants by concept and files by role") replaces that rule. Role directories (model/,query/,presenter/,parser/,command/,adapter/, and the existinglint/,cli/,evidence/,hook/,pipeline/as decided in the ADR) become Zeitwerk collapsed directories. A file atmodel/gate.rbdefinesOsSdlc::Gate;presenter/gate/reply.rbdefinesOsSdlc::Gate::Reply. Every existing constant loses its slice prefix.Model.for(db)is a registry that needs a new name, sinceModelstops being a namespace.Reproduce
n/a: layout change, not a defect.
Approach
One move-map script, the same shape ADR-0196 used, that moves every file and rewrites every constant reference in lib/, tests/, bin/, and .rubocop.yml in one pass. Suite green before merge. Run
os-sdlc:blast-radiusfirst; theosplugin and any other repo that names os-sdlc constants are the unknowns. Rewrite the inward-dependency check from constant names to file paths. This ticket lands before any Gate consolidation, so Gate moves once.Required work:
os-sdlc:blast-radiusto identify external consumers — check:os-sdlc:blast-radiusreturns no breaking changes outside this repo or a clear list of repos to updateModel.for(db)registry to new name and update all callers — check: grep finds no references toModel.forbin/inward-dependency-checkpassesbin/testpasses with zero failuresbin/zeitwerk:checkor project equivalent passesbin/refresh-pluginscompletes successfullyos-sdlc-runnercommand succeeds with updatedospluginAcceptance criteria
zeitwerk:check(or the project's equivalent eager-load test) passes with the collapsed directories.Model::,Pipeline::,Lint::,Adapter::,Evidence::,Hook::,Cli::) except where the ADR keeps one by explicit nesting.Model.for(db)has a new name and every caller uses it.bin/refresh-pluginsrun; a liveos-sdlc-runnercommand succeeds from another repo.Owner sketch
Origin
Work started on branch crc-pass-os-sdlc (hand-run, not the pipeline: rename with no red test). Blast radius: one sibling gem test (procman procman_kind_contract_test.rb references OsSdlc::LspProbe::ProcmanKind -> OsSdlc::ProcmanKind), .claude/rules/os-sdlc-architecture.md, two SKILL.md path references, two string-pinned constant names in tests. Move map (321 rows, verb-rule roles, four CLI collisions renamed RunnerCLI/EvidenceCLI/LspProbeCLI, Git:: nesting kept) at docs/crc/os-sdlc/move-map-0222.tsv. Registry Model.for(db) becomes Records.for(db).
Resolution
Done: Slice directories collapsed into 11 Zeitwerk role autoload roots (model query presenter parser command adapter lint cli evidence hook pipeline); every constant lost its slice prefix per docs/crc/os-sdlc/move-map-0222.tsv (321 rows); Model.for(db) registry renamed Records; CLI collisions resolved as RunnerCLI, EvidenceCLI, LspProbeCLI; Git:: nesting kept; 148 tests moved to mirror role dirs; inward-dependency rule enforced by file path in tests/inward_dependency_test.rb with a 72-entry recorded baseline; .claude/rules/os-sdlc-architecture.md rewritten to ADR-0222; docs and skills updated.
Evidence: main
27b7b9bb(commits4d462e1b0d91cb2b9bca106838cbe22baebc1ebc81b16e3727b7b9bb). Suite: 1428 runs, 3245 assertions, 1 failure (pre-existing fork-guard, #740), 0 errors. zeitwerk_eager_load_test green. bin/refresh-plugins run; from ~/dev/ruby-gems/procman the cached os-sdlc-runner, lsp-probe, and evidence binaries start and eager load resolves OsSdlc::RunnerCLI and OsSdlc::Records. Blast radius run first; hand-run rather than pipeline because a rename has no red test.Follow-ups: #740 fork-guard allowlist defect (pre-existing from #713); #741 shrink the 72-entry inward-dependency baseline and re-layer IssueSource, Map, Records; jared/procman#5 rename OsSdlc::LspProbe::ProcmanKind in the procman gem test; Gate/Brief consolidation and card rewrites tracked in docs/crc/os-sdlc/HANDOFF.md, not tickets yet.