Repository navigation
fix: reject bare value flags instead of parsing them as "true" - #279
Conversation
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Looks correct to me.
Read src/cli.ts at 99df77e against every flags[...] read: the 12 names in VALUE_FLAGS (src/cli.ts:61-64) are exactly the flags consumed as values (filter :122/163, run-dir :126/209/250/264, cli :161/247/303, patterns-dir :165/187/305, pane :191, command :248, cli-args :249, rebuttal :252, dir :254, rationguard-bin :258, session :341, text :342). diagnostics (:136/225) and capture (:174) accept an optional value and are correctly left out. All four bin entries in package.json (pluk, pluk-subscribe, pluk-classify, pluk-send) share this parseArgs, so the fix covers every entrypoint. No README/usage text uses the bare --flag value form, so nothing documented breaks.
Side benefit worth noting: --rebuttal bare previously produced rebuttal: 'true' cast to 'log' | 'send' (src/cli.ts:252), which the new check now rejects up front.
Tests in test/cli-error-paths.test.js cover both the rejection path and a bare boolean switch; test (22/24/26) are green.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (correctness) — no blocking findings.
VALUE_FLAGS (src/cli.ts:61-64) covers every value-taking flag read in the file (text, session, run-dir, cli, command, cli-args, rebuttal, dir, rationguard-bin, patterns-dir, pane, filter); the bare-switch set from #278 is untouched, and --diagnostics/--capture still accept both forms. Tests cover the three acceptance cases; CI green.
Advisory (low): the new bare boolean switches are still accepted test (test/cli-error-paths.test.js:324-331) runs sessions --json without PLUK_RUN_DIR, so it reads the developer's real default run dir (src/run-dir.ts:49-50) unlike the sibling test at test/cli-error-paths.test.js:252-261. Pointing it at a scratch dir would make it hermetic.
— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #278
Bare value-taking flags (
--text,--run-dir,--cli,--filter, etc.) now exit 2 withError: --<flag> requires a value: use --<flag>=<value>instead of being parsed astrue.pluk send s --text hellono longer typestrueinto the pane. Boolean switches,--diagnosticsand--captureare unchanged.CI is the verdict (no local test runs).
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88