Project::Target carries name, test, lint, tracker; Project#targets lists every target from .sdlc/project.yaml #791
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#791
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
A Project describes one target only. The yaml loader merges the shared keys into the selected section and discards all other targets (
ProjectTargets#attrs,Yaml::Document#attrs). No object can answer "which targets does this project have". R5 says a Project has many targets, and each target is a value withname, path, test, lint, tracker.Reproduce
n/a: new behavior. Failing test:
Project::Yaml.load(dir, target: "b").targets.map(&:name)for a yaml with targetsaandbreturns["a", "b"]. Today it raises NoMethodError.Approach
Files (7): model/project/target.rb, model/project.rb, parser/project/yaml/document.rb, model/project_targets.rb, adapter/project/yaml.rb, tests/model/project_targets_test.rb, tests/model/project/targets_test.rb (new).
ADRs cited: ADR-0088 (named targets; the precedence is target key, then shared key, then default;
namestays top-level), ADR-0056 (tracker), ADR-0167 (Data.define for values), ADR-0210 rule 1-2 (targetpath, default "."), ADR-0192 item 2 (Test and Lint value objects). ADR-0238 (Accepted, 2026-09-28) already amends ADR-0088 "the Project Data member list does not change"; no ADR is written in this ticket.Required work:
Project::Target = Data.define(:name, :path, :test, :lint, :tracker). The defaults are path ".",Test.new,Lint.new, and tracker nil.include?andrelativedo not change. — check:ruby plugins/os-sdlc/tests/model/project/targets_test.rbProjectgains atargetsmember (an Array of Target). The yaml side builds it at load: one Target pertargets:section, with the shared top-level keys merged under the section keys. A yaml with notargets:map gives one Target named after the project, with its path from the top-levelpath(default "."). The member is set at construction. Do not memoize it with@targets ||=: Project is a frozen Data, and that raises FrozenError (confirmed 2026-09-28). — check: same testsection["tracker"] || data["tracker"]. — check: same testtarget,test, andlint(the selected target) stay unchanged in this ticket. T7 removes them. — check:ruby plugins/os-sdlc/tests/all.rbRejected:
def targets = @targets ||= gather_targetson Project. Data instances are frozen, so this raises FrozenError.Rejected: make Project a plain class so that it can memoize. It is a value with no identity (ADR-0167 role test 2).
Acceptance criteria
test_framework: minitestand targetsa(pathpa) andb(pathpb,test_command: rake b), when the project loads, thentargetsnamesaandb,bhas test commandrake b, and both have frameworkminitest.name: widgetswith notargets:key, when the project loads, thentargetsis one target namedwidgetswith path..tracker:, when the project loads, then that target's tracker is the section value. Other targets get the top-level tracker.Owner sketch
Non-goals
Persistence of targets (T3). Removal of the selected-target members, FlatAttrs, and ProjectTargets (T7). Target-relative lint paths (T6).
Origin
Work started on branch ticket-791 via /os-sdlc:implement (session bb36e383).
Escalation on implementation 55: change-auditor failed on the 'ADR to write first' precondition. ADR-0238 already exists and amends ADR-0088. Ticket text corrected; re-entering with a fresh implementation-open.
Resolution
Done: Project::Target is Data(name, path, test, lint, tracker); Project has a targets member built at load with one Target per yaml section, shared keys merged under section keys, per-target tracker falling back to the top-level tracker; a flat yaml yields one target named after the project with path '.'. Selected-target members unchanged.
Evidence: os-sdlc implementation 56 on branch ticket-791 (implementation 55 escalated on a stale ADR clause in the ticket, corrected, reopened): 13 dispatches, 1 suite-check retry repaired; final suite-check pass; contract-auditor pass; new tests/model/project/targets_test.rb; commit
eae175b8Follow-ups: to_flat_h now emits target_name into the stored snapshot; T3 (#792) reshapes that blob per ADR-0238