project-config --show --target NAME ignores --target and prints all targets #861
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#861
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
Evidence: in cc-plugins/api-wrapper,
--target api-wrapperand--target cli-wrapperboth print both targets. Reproduced on mainb80613ecwith a shaped project with targets a and b:--show --target=aand--show --target aboth print the a line and the b line.--targetis validated (adapter/project/config.rb:15-19), but the status line is not filtered.Approach
Every reachable caller of
reportprints exactly one target:Config.loadalready callsproject.target(@options[:target]). A shaped project with no--targetraisesTargetSelectionErrorbeforereport. A flat project with no--targetselects its sole target.Config#writerefuses a shaped file (raise_if_targets_shaped!), so upsert only reports a flat, one-target project.So the "all targets" branch has no production caller. Do not add an optional
target_name = nilbranch that keeps it. Replace it:Project#status_line(target_name)renders the line oftarget(target_name).Project#targetalready owns the nil rule (sole target on a flat project, raise on a shaped one).ConfigCommand#reportpasses@options[:target]. Output for a flat project is unchanged.Required work:
Project#status_linetakes a requiredtarget_nameand renderstarget_status(target(target_name)). Remove the all-targets map. check: absenttargets.map { |bound| target_status(bound) }inplugins/os-sdlc/lib/os_sdlc/model/project.rbConfigCommand#reportpasses@options[:target], on both the show and upsert paths. check: presentstatus_line(@options[:target])inplugins/os-sdlc/lib/os_sdlc/command/project/config_command.rbtest_status_line_on_a_shaped_project_names_every_targetwith a test that the selected target's line is printed and the other target's line is not. check: absentnames_every_targetinplugins/os-sdlc/tests/model/project_shaped_listing_test.rb--show --target NAMECLI tests for acceptance criteria 1 and 2. Existing tests cover--showwithout--targetonly. Criterion 4 already holds on main (print_statusrescuesTargetSelectionError;tests/model/project_multi_target_test.rb:48pins the unknown-name raise), so like criterion 3 it gets no new test.#status_linesignature in the CRC docs. check: presentstatus_line(target_name)indocs/crc/os-sdlc/roles-project.mdOrchestrator work: after merge, add one History row to
docs/implementation-status/os-sdlc.md(ADR-0255 decision 5: tracker and record work is not Required work). ADR-0238 line 47 says--showandstatus_lineprint every target; the History row names that this line no longer holds, and the user rules on whether ADR-0238 gets a note or an amendment.Sketch:
Acceptance criteria
project.yamlwith targets A and B, whenproject-config --show --target Aruns, then the output has A's line and no line for B.project-config --show --target Bruns, then the output has B's line and no line for A.project-config --showruns with no--target, then its one line prints unchanged. Given the shaped project, when it runs with no--target, then it keeps the "no target selected" message (Config.loadraisesTargetSelectionError).project-config --show --target Cruns, then it prints the unknown-target message and exits 0.print_status(config_command.rb:69-73) rescues the error and prints it.Owner sketch
Changes since filing (verified 2026-10-02 on main
b80613ec)The bug reproduces. No commit has touched
config_command.rborproject.rbsince filing (last:01f5edf9,e6961519,858349ec).Criterion 3 was wrong. A shaped project without
--targetdoes not print both lines.Config.loadraisesTargetSelectionError.Criterion 4 was wrong about the exit code. The exit stays 0.
Space form resolved, not a defect. Under bash,
--show --target aselectsa(then prints both lines, the #861 defect). The earlier "no target selected" came from the repro shell: zsh does not word-split an unquoted variable, so argv held one element"--target a".ArgvOption.flag_indexmatches only--targetor--target=..., so it found no flag. Reproduced exactly withos-sdlc project-config --show "--target a". No second ticket.Approach changed: the optional
target_name = nil"all targets" branch was dropped, because no production path reports more than one target.2026-10-02: #860 (
5d0a1cd6) merged.ConfigCommandnow takesname:/options:/invocation:; the target is@options[:target](used atload_project), not@target. The Approach and check use@options[:target].Blast radius
config_command.rb:83, reached from the show and upsert paths. Entry isonboarding.rb:37-39(ArgvOption.take!). If #860 moves--targetto a Thor option,@options[:target]still reachesConfigCommandthe same way; this ticket's shape does not change.tests/model/project_shaped_listing_test.rb:14-21pins the all-targets output and is replaced.tests/controller/project/cli_project_config_test.rb:60-110andcli_project_config_target_path_test.rb:10-41cover--showwithout--targetonly.docs/crc/os-sdlc/inventory-model.md:149,roles-project.md:108and:129; History row indocs/implementation-status/os-sdlc.md(line 255 records #803).--showandstatus_lineprint every target. Not reachable through--showtoday (shaped needs--target). Whether ADR-0238 gets a note is the user's ruling; do not write an ADR in this ticket.Out of scope
upsertwith an unknown--targetshould refuse before it writes the file.--showshould refuse leftover argv such as a single"--target a"element.Blocking edges
config_command.rband add a History row to the same status leaf.Body revised 2026-10-02 after blast-radius re-check on main
b80613ec: criteria 3 and 4 corrected (no-target shaped message, exit 0); space-form --target open item added.PREDICTED RULING: REVISE
a. No.
b. feedback-no-speculative-hardening-in-artifacts and feedback-remove-habits-dont-backfill-heuristics:
status_line(nil)keeps an "all targets" branch with no production caller. Upsert writes only flat files (raise_if_targets_shaped!). A shaped--showneeds--targetbeforereportruns. Lens A12 (the owner decides):Project#targetalready owns the nil rule. feedback-adr-conflict-is-a-symptom: design correctly first, then name ADR-0238 line 47.c. Lazy: an optional nil flag that keeps dead behavior, and a space-form defect left unexplained. Research done: in bash,
--show --target aselectsa. The repro used zsh with an unquoted variable, so argv held one element"--target a".ArgvOption.flag_indexmatches only--targetor--target=.--show "--target a"reproduces the output exactly. This is not a defect.d.
def status_line(target_name) = target_status(target(target_name)), andreportpasses@target. There is one rule owner and no dead branch. Flat output does not change. If #860 moves--targetto Thor,@targetstill arrives the same way.e. Not read: #860's final body, lens-testing/cases, ADR-0088, ADR-0243 full text, and non-CLI callers outside plugins/.
User ruling needed: should ADR-0238 line 47 get a note? No ADR was written.
os-sdlc project-config --helptreats --help as a project name and writes .sdlc/project.yaml #860os-sdlc project-config --helptreats --help as a project name and writes .sdlc/project.yaml #860Work started 2026-10-02 on branch ticket-861 (os-sdlc pipeline, map poodr-ticket-implementation, target os-sdlc). Body updated first: after #860, the target is @options[:target], so the check now reads status_line(@options[:target]).
Escalation 8 (implementation 26, change-auditor verdict:fail). Cause: under-decomposed ticket — Required work item 6 (History row + ADR-0238 note) is orchestrator work with no criterion or check (ADR-0255 decision 5). Fix: moved to an 'Orchestrator work:' line. Recovery: fresh implementation-open, which abandons implementation 26.
Escalation 9 (implementation 27, bound_exhausted:test-reviewer/fail). Cause: contradictory ticket — Required work 4 asked for a new test of criterion 4, which already holds on main, while every new test in the round must be red; writer and reviewer each followed their rules. Fix: R4 now covers criteria 1 and 2 only (criterion 4, like 3, is covered by existing tests); the AC 4 test method was hand-deleted from cli_project_config_show_target_test.rb. Kept: R3 model test and AC 1/2 CLI tests (red for the intended reason per dispatch 241). Recovery: fresh implementation-open.
Resolution
Done: project-config --show --target NAME prints only that target's line. Project#status_line(target_name) renders target_status(target(target_name)); Project#target stays the only owner of the no-target rule (flat: sole target; shaped: TargetSelectionError). ConfigCommand#report passes @options[:target]. CRC roles-project.md updated. The space-form '--target a' failure in the earlier repro was a zsh quoting error, not a code defect.
Evidence: Commits
7169466a(feat, implementation 28: 8 dispatches, 0 retries, suite green, contract-auditor pass) and7bf03880(History row) merged to main. New test cli_project_config_show_target_test.rb (AC 1, AC 2); project_shaped_listing_test.rb now asserts only the selected target. Implementations 26 and 27 escalated on ticket defects, fixed in the body: (1) History row/ADR note listed as Required work -> moved to Orchestrator work; (2) a new test for already-true criterion 4 conflicted with the all-new-tests-red rule -> R4 limited to AC 1-2, AC 4 test deleted by hand.Follow-ups: ADR-0238 line 47 ruling (note vs amendment) raised to the user as a decision in session 074f69a6, not a ticket. Observed, not filed (no reported pain): on a flat project, 'project-config NAME --target X' now writes the file and then fails loudly (exit 3), where before it ignored --target.