Skip to content

feat(cli)!: value flags take their value only after =, and -d is removed - #742

Merged
aibex-agent[bot] merged 6 commits into
mainfrom
aibex/t_XcbmECzOScSutEMqfU9u79t9-equals-flags
Dec 6, 2026
Merged

aibex-agent[bot] merged 6 commits into
mainfrom
aibex/t_XcbmECzOScSutEMqfU9u79t9-equals-flags

Conversation

@aibex-agent

@aibex-agent aibex-agent Bot commented Dec 6, 2026

Copy link
Copy Markdown

What

Breaking. Every flag that takes a value now takes it only as --flag=value, and the -d short alias for --dir is removed. Boolean flags (--json, --full, --diff with no value, …) are unchanged.

The space spelling (--rule no-eval, --dir /path, -d /path) is refused with INVALID_INPUT before any command runs. The message gives the = form, for example: "--rule takes its value after =, as --rule=<value>. Here, write --rule=no-eval." Nothing changes behavior silently.

Why

With one spelling, no flag ever consumes the token after it. That means splitRawArguments no longer needs a list of which flags take values, and a flag missing from that list can no longer turn its value into a positional path. The old failure looked like this: check --rule no-eval looked for a file named no-eval, found none, and exited 0. It also settles what the token after a bare --diff is (#741): a positional path.

Changes

  • src/util/argv.ts: the scanner has no list of flags that take values. Every -x=v token records its value, and -- still ends options.
  • src/util/value-flags.ts + src/index.ts: the refusal step. It reads the type: "string" args of the resolved command chain, so a parent command's --dir is covered too. It runs after the --help/--version intercept.
  • -d is removed from 12 commands. telemetry-run.ts reads only --dir=. agent.ts now uses the shared scanner instead of its own copy.
  • Messages, recipes (13 topic versions bumped), skills/taskless/SKILL.md, both READMEs and reference-corpus.yml use the = spelling.
  • The changeset from feat(check): scope a check to the files a unified diff changes with --diff[=<file>] #741 grows to minor, with a note telling callers what to update.
  • OpenSpec value-flags-equals-only, archived. Delta specs restate every requirement that names a value flag; cli gains "Value flags take their value only after =" (7 scenarios). Scenario counts per spec were checked before and after archiving: no scenario was dropped.

Upgrade cost

Anything that runs the CLI with the space spelling must switch to --flag=value. This includes the Taskless service and any CI scripts written by hand. The CI and hook files that the ci and hooks recipes generate use positional paths, --json and --diff, so they need no change.

Checks

pnpm typecheck, pnpm lint, and the full suite (3500 passed, 11 skipped).

@aibex-agent

aibex-agent Bot commented Dec 6, 2026

Copy link
Copy Markdown
Author

@claude /review

@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @aibex-agent[bot]'s task in 4m 2s —— View job


Review mode: incremental — read 0 prior review thread(s) before reviewing.

.prior-review.json held no review threads, reviews, or top-level comments (only the @claude /review trigger comment itself). This is the first review of this PR — the whole diff was assessed fresh; no "already addressed" items to list.

  • Read .prior-review.json
  • Fetch PR diff and metadata
  • Review src/util/argv.ts and src/util/value-flags.ts
  • Review src/index.ts integration
  • Review per-command changes (agent.ts, check.ts, rules.ts, telemetry-run.ts, etc.)
  • Review help.ts and test changes
  • Post inline comments for findings
  • Post final summary

Assessment

The core mechanism is sound and well-tested:

  • splitRawArguments (src/util/argv.ts) is now a pure "does this token start with -" scan with no flag-specific value list, exactly matching the stated goal — no flag can silently swallow the next token.
  • spacedValueFlagMessage (src/util/value-flags.ts) builds its refused-flag set from the resolved command chain's own type: "string" args (valueFlagNames in src/util/help.ts), so a parent's --dir is covered and a newly-declared value flag needs no separate registration. I checked every command definition for a short alias on a type: "string" arg (the one gap this design would have) — the only aliases left are -l/preserve-logs and -v/version, both booleans, so there's no flag that can still absorb a following token unnoticed.
  • The -d removal and refusal-by-name is implemented consistently; I grepped the whole src/ and test/ trees for leftover "-d" literals and found only the two expected occurrences (the refusal check itself and the test that exercises it).
  • --help/--version correctly short-circuit before the refusal runs (src/index.ts), matching the documented "help still answers" behavior and its test.
  • check's extractDiffSource/extractRuleFilters simplification reads cleanly off the single shared scan, removing the old "which flag consumes the next token" ambiguity the changeset/comments describe.
  • New test/value-flags.test.ts exercises the refusal path end-to-end (space spelling, bare flag, parent flag, -d, --json envelope, -- escaping, --help bypass) and matches the new openspec/specs/cli/spec.md "Value flags take their value only after =" requirement scenario-for-scenario.
  • Spot-checked call sites across commands/tests/recipes/README/skill for stray space-spelled value flags; found the implementation and docs consistently converted.

One minor, non-functional nit:

  • packages/cli/test/rule-poll-transient.test.ts (around the "refuses --resume with --from" case) still calls resume("create", REQUEST_ID, "--from", "request.json") with the old space spelling. It still passes only because this test drives ruleCommand directly via citty's runCommand, bypassing the src/index.ts refusal step entirely — citty's own parser accepts either spelling. Every other occurrence in this same file (and the rest of the PR) was converted to --from=request.json; this one line was missed. Not a bug, just a leftover inconsistency against the PR's own stated goal of spelling every value flag =-style. (I couldn't post this inline — the line isn't part of a shown diff hunk, so GitHub rejects a review comment there.)

No other correctness, security, or test-coverage issues found in the diff.

Review status: complete

@aibex-agent

aibex-agent Bot commented Dec 6, 2026

Copy link
Copy Markdown
Author

Fixed the --from nit in 7367e17: the refuses --resume with --from case now passes --from=request.json. A grep of test/ finds no other space-spelled value flag outside value-flags.test.ts, which uses the old spelling on purpose.

@aibex-agent
aibex-agent Bot merged commit 9ac86b9 into main Dec 6, 2026
7 checks passed
@aibex-agent
aibex-agent Bot deleted the aibex/t_XcbmECzOScSutEMqfU9u79t9-equals-flags branch December 6, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant