system-model resolves its root through the os-sdlc project target #1516
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#1516
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
system-modeldoes not find its root through the Project target logic that the other os-sdlc commands use.It needs an explicit path argument, so it ignores
.sdlc/project.yaml.In cc-os,
.sdlc/project.yamllists many codebases undertargets:; Jared ruled thatsystem-modelmust resolve its root through that same logic, with shared code and no new resolver.Related: #1515 (fail loudly on an empty root) is open with no "work started" comment. It guards the explicit-path root in
SystemModel::Run; this ticket adds a second way to reach that root. See Non-goals.Reproduce
n/a: design change. Today
system-model generatewith no argument prints the usage text and exits 2 (plugins/os-sdlc/lib/os_sdlc/boot/inputs.rb:68).Approach
How the other commands choose a target today: only by an explicit
--target NAMEflag.ArgvOption.take!(argv, "--target NAME")(boot/inputs.rb:51,:207;CrcArgv.target!for the crc commands;bin/lint-worklist:9) fillsInput#target.Boot#third_argument(boot.rb:71-74) then callsProjectBind#project(dir, target:)(boot/project_bind.rb:17-20), which callsProject::Config.load.Project#target(project.rb:46-52) raisesTargetSelectionErrorwith "no target selected ... Available: " when the project defines named targets and none is given. No existing command infers the target from the cwd.Design:
Inputs.system_model_roottakes--target NAMEwithArgvOption.take!and setsInput#target. With a target, no path argument is allowed.--target,Input#targetstays nil.Project#targetthen resolves a single-target project to the project root, and refuses a multi-target root and lists the targets (project.rb:80-84). No cwd inference.boot/commands.rb:132-139receives aProjectwhen a target is set. It computes the scan root asFile.join(project.root, project.target.path)and passes that String toSystemModel::Runas today.root:set, soBoot#third_argumentreturns it unchanged.Reused:
ArgvOption.take!,Input#target,Boot#third_argument,ProjectBind#project,Project::Config.load,Project#target,TargetSelectionError. New code: the root computation in step 3 (about 2 lines); the flag and wiring are about 4 lines. No new resolver class.Fit with #1515: the empty-
lib/refusal inRun#callapplies to the root from every source, so a target path with no Ruby files also fails loudly. The two tickets touch different files exceptcommands.rb/inputs.rbversusrun.rb; either can land first.Required work:
--target NAMEinsystem_model_root— check: present--target NAMEinplugins/os-sdlc/lib/os_sdlc/boot/inputs.rbproject.target.pathinplugins/os-sdlc/lib/os_sdlc/boot/commands.rb--targetinplugins/os-sdlc/tests/system_model_cli_test.rbOrchestrator work: run
bin/refresh-plugins; add one History row todocs/implementation-status/os-sdlc-system-model.md; update the usage text. A project with no.sdlc/project.yamlgets one through/os:fix, as for every other project.Acceptance criteria
system-model generate --target os-meruns, then it scansplugins/os-me.system-model generateruns, then it exits nonzero and the error lists the available targets, as other commands do.system-model generate <path>runs, then it scans that path as before.targets:key, whensystem-model generateruns from its root with no argument, then it scans the project root.Owner sketch
Non-goals
Removing the nested
plugins/os-backlog/.sdlc/project.yamlandplugins/os-sdlc/.sdlc/project.yaml.system-model shapes. Adding cwd inference to other commands. cwd inference is out of scope; if wanted, it becomes a shared feature for all commands in its own ticket. The empty-root refusal (#1515).Origin
system-modelmust use the os-sdlc Project target logic.system-modelneeds an explicit path ←Inputs.system_model_rootraises usage unless one argument is given ← DESIGN (plugins/os-sdlc/lib/os_sdlc/boot/inputs.rb:66-71)VERDICT: CREATE
Work started on branch
ticket-1516through /os-sdlc:implement.Resolution
Done: system-model resolves its root through the os-sdlc project target: with no root argument it takes --target NAME, binds the project, and scans File.join(project root, target path). A root argument works as before; a root plus --target, or extra arguments, refuses with the usage text. Bind/target errors on this path append the usage text.
Evidence: Commit
1b5f152don ticket-1516 (implementation 225). New tests in plugins/os-sdlc/tests/system_model_cli_test.rb. Suite gate green on dispatch 2066 after two programmer-repair rounds (required-work check, then a suite failure). Contract audit pass (2067).Follow-ups: none