os-sdlc: extract_target! only strips first --target occurrence #231

Closed
opened 2026-08-02 12:12:47 +00:00 by jared · 4 comments
Owner

extract_target! in plugins/os-sdlc/bin/os-sdlc only strips the first --target occurrence from ARGV; a duplicated flag leaks the second copy into subcommand parsing. Minor quirk found during the #229 --target plumbing review, confirmed by Codex second-opinion review. Low priority.

extract_target! in plugins/os-sdlc/bin/os-sdlc only strips the first --target occurrence from ARGV; a duplicated flag leaks the second copy into subcommand parsing. Minor quirk found during the #229 --target plumbing review, confirmed by Codex second-opinion review. Low priority.
Author
Owner

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: extract_target! should strip every --target occurrence from ARGV, not just the first

Current behavior:
The os-sdlc CLI's extract_target! removes only the first --target <value> (or --target=<value>) pair from the argument list. If the flag is passed twice, the second copy leaks through into subcommand argument parsing, where it is unrecognized.

Desired behavior:
All --target occurrences are stripped before dispatch. Which value wins (first or last) should match whatever the current single-occurrence semantics imply — pick one, assert it in a test, and keep it consistent with how the resolved target is threaded to subcommands (per the --target plumbing shipped for #229's pipeline blocker).

Key interfaces:

  • extract_target! in the os-sdlc CLI entrypoint — its contract becomes "ARGV contains no --target tokens after this call"

Acceptance criteria:

  • A CLI regression test passing --target X --target Y shows no --target leaking into subcommand args
  • The test asserts which value wins, and both --target v and --target=v spellings are covered
  • Existing --target threading regression tests stay green

Out of scope:

  • Rejecting duplicate flags with an error (silently resolving is fine at P3)
  • Any other flag's parsing
> *This was generated by AI during triage.* ## Agent Brief **Category:** bug **Summary:** `extract_target!` should strip every `--target` occurrence from ARGV, not just the first **Current behavior:** The `os-sdlc` CLI's `extract_target!` removes only the first `--target <value>` (or `--target=<value>`) pair from the argument list. If the flag is passed twice, the second copy leaks through into subcommand argument parsing, where it is unrecognized. **Desired behavior:** All `--target` occurrences are stripped before dispatch. Which value wins (first or last) should match whatever the current single-occurrence semantics imply — pick one, assert it in a test, and keep it consistent with how the resolved target is threaded to subcommands (per the `--target` plumbing shipped for #229's pipeline blocker). **Key interfaces:** - `extract_target!` in the `os-sdlc` CLI entrypoint — its contract becomes "ARGV contains no `--target` tokens after this call" **Acceptance criteria:** - [ ] A CLI regression test passing `--target X --target Y` shows no `--target` leaking into subcommand args - [ ] The test asserts which value wins, and both `--target v` and `--target=v` spellings are covered - [ ] Existing `--target` threading regression tests stay green **Out of scope:** - Rejecting duplicate flags with an error (silently resolving is fine at P3) - Any other flag's parsing
Author
Owner

Starting work in worktree fix-231-extract-target.

Starting work in worktree fix-231-extract-target.
Author
Owner

Fix implemented in worktree fix-231-extract-target, commit 920487a: extract_target! now strips every --target occurrence (first value wins), 4 CLI regression tests cover both spellings + mixed + first-wins; existing threading tests green. A full /os-sdlc:fix-lints run followed (worklist + residual clear, suite 577 runs green). Awaiting merge sign-off.

Fix implemented in worktree fix-231-extract-target, commit 920487a: extract_target! now strips every --target occurrence (first value wins), 4 CLI regression tests cover both spellings + mixed + first-wins; existing threading tests green. A full /os-sdlc:fix-lints run followed (worklist + residual clear, suite 577 runs green). Awaiting merge sign-off.
Author
Owner

Merged to main in 762591f..dac4e13 (merge commit dac4e13). Verified: full suite green in worktree before merge (577 runs, 1527 assertions, 0 failures), main..branch empty after merge, plugin cache refreshed. Closing.

Merged to main in 762591f..dac4e13 (merge commit dac4e13). Verified: full suite green in worktree before merge (577 runs, 1527 assertions, 0 failures), main..branch empty after merge, plugin cache refreshed. Closing.
jared closed this issue 2026-08-02 19:54:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#231
No description provided.