Repository navigation
park and resume refuse a flag given an empty value in the same words as one given none, so --lane "" no longer parks with the lane dropped and --repo "" no longer falls back to the walk-up - #17
Conversation
…rds as one given none, so `--lane ""` no longer parks with the lane dropped and `--repo ""` no longer falls back to the walk-up
${2:?…} rejected an unset OR EMPTY value; the [ $# -ge 2 ] that replaced it in #14 only checks that an argument slot exists, so an empty one was let through and then read further down as "was this given at all?" — park --lane "" exited 0 having run make park with ARGS=[], the lane silently gone from the WIP commit subject, and --repo "" fell past the --repo branch of the resolver into the walk-up, which is the one thing naming a clone's origin was there to prevent; resume --workspace "" read as a machine nobody had named a workspace to. All seven value-taking arms now ask [ $# -ge 2 ] && [ -n "$2" ] and refuse in the same words, which already read right for both halves; the comment block in each file says why an empty value is the same refusal. Nine more parametrized tests beside #14's own, run from INSIDE an estate so the walk-up is there to be fallen back to: exit 2, the command's own message, and an empty stdout as the proof that nothing was resolved, said or run. Copilot's review of #14, which posted a minute after it merged.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 3 days and 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideThe PR makes empty arguments equivalent to missing values for value-taking options, preventing silent flag loss and unintended estate/workspace fallback across File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 Changes recommended
status still accepts empty values without the promised validation or tests.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR rejects empty option values for park and resume, with regression coverage. The described status parity change remains unimplemented.
Changes:
- Validate non-empty values for
parkandresume. - Add parameterized empty-value tests.
statusstill needs equivalent validation and coverage.
File summaries
| File | Reviewed changes |
|---|---|
tests/test_park_resume_commands.py |
Adds empty-value regression coverage for park and resume. |
resume |
Rejects empty option values. |
park |
Rejects empty option values. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… two arms Copilot's review of #14 never had in front of it — so `status --repo ""` no longer reports the estate around the cwd These two were never ${2:?…}: they have been [ $# -ge 2 ] since status's first commit (fbf6f11), so the review that caught the arity-only check in park and resume — where it had just replaced ${2:?…} — never saw this file, and it kept the hole the other two closed in 8320472. It is the same hole: an empty value is read further down as "was this given at all?", so status --repo "" exited 0 having fallen past the --repo branch of the resolver into the walk-up and reported the estate around the cwd as though the flag had never been typed. A read-only report of the wrong estate is worse than a refusal, not better — nothing was changed, so nobody looks twice. Both arms now ask [ $# -ge 2 ] && [ -n "$2" ] and refuse in the words they already used; the shared resolver and expand_home are untouched, byte for byte. Three more cases in test_refusals_read_nothing, one per flag spelling, run from INSIDE the estate so the walk-up is there to be fallen back to: exit 2, the command's own message, an empty stdout, and that test's own "a refusal read nothing" over all six results. PR #17. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…value-taking arms of `park`, `resume` and `status`, so the arity-only arm cannot ship a third time The independent review of #17 asked for it, and the history is the argument: the arity-only arm reached main twice — park and resume at 83a1601, status at fbf6f11, its first commit — and an outside reviewer caught it both times, because each command's own tests ask what a refusal SAYS and an arm that does not refuse says nothing for them to read. This one reads the three files as text, beside that file's other command-text tests: every line taking $2 into a variable must carry [ $# -ge 2 ] && [ -n "$2" ] within the three lines above it, with whole-line comments dropped by code_lines first so the three that QUOTE the idiom in order to explain it cannot stand in for the guard they describe; and the count of nine is asserted by hand, so a tenth arm arrives as a failure somebody reads rather than as a silent pass. It needs neither the submodule nor a shell, so it runs in a clone made without --recurse-submodules and on Windows. Two nits from the same review: resume's --workspace comment no longer joins two different branches with "so" — with a config already here the empty slug slips past the refusal that never silently replaces one, with none it reaches the refusal that says none is configured, which is the branch the tests exercise; and the status empty-value loop gains the "bash's own message leaked" assertion its park/resume twin already had. PR #17. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
… Atlas --lane --dry-run` no longer parks with the lane set to `--dry-run` — and `--flag=value` is the spelling that gives a `-`-led value back, read through one `flag_value` held byte-identical in `park`, `resume` and `status` Two commits, the second the fix round of this branch's independent review. The two halves of the first are ONE commit because neither is safe alone. THE HOLE, and what it cost. Every value-taking arm tested `[ $# -ge 2 ] && [ -n "$2" ]`, which asks whether a second argument EXISTS and whether it is non-empty and never what it HOLDS — so `park Atlas --lane --dry-run` ran a REAL park with the lane set to `--dry-run`: the flag a person typed was swallowed as a value, `--dry-run` itself never took effect, and the only sign was a WIP commit subject labelled with it. PR #17 named the hole and left it open; this is the ruling made against something concrete, and if it goes the other way the whole of it is one revert. Proved again on this base, in a temp estate with a probe Makefile, against origin/main's OWN three commands: `park Atlas --lane --dry-run` printed `make park ARGS='--lane --dry-run'` and RAN it, exit 0; `resume Atlas --org --dry-run` went past the rehearsal it was asked for and on to the workspace record, which on a machine that has one is a clone; `status --name --fetch` fetched nothing and refused about an estate named `--fetch`. After: each is `REFUSED: <flag> needs a value: …`, exit 2, from the argument loop with an EMPTY stdout, and the refusal's own sentence names the spelling that does take such a value. THE TWO HALVES ARE ONE COMMIT because refusing `-*` alone takes a value away with nowhere to put it, and the refusal's words name the `=` spelling as the exit, so the exit has to exist the moment the refusal does. All nine value-taking arms — `park`'s `--lane`, `--repo`, `--name | --project`; `resume`'s `--repo`, `--workspace`, `--org`, `--name | --project`; `status`'s `--repo`, `--name | --project`, none of them in the shared estate resolver — read their value through `flag_value`, a new function held BYTE-IDENTICAL in the three files the way `expand_home` already is, and OUTSIDE that block for the reason its own header gives: the resolver answers "which estate is this", and this answers "did this flag get a value". It asks the arity question #14 asked, the emptiness question #17 added, and one more: a next argument beginning with `-` is a flag, and nothing here swallows the next word whatever it is. Each arm keeps its own words and its own `die` at exit 2; the `-`-led refusal adds one sentence naming the spelling that does take such a value, asserted per flag so a hint cannot name the wrong one. `--flag=value` takes whatever follows the FIRST `=` and asks nothing about it, so `--lane=--weird` and `--repo=https://…` both arrive whole; `--flag=` is an empty value and is refused as #17 refuses `""`. `park Atlas --lane=--dry-run --dry-run` gives `ARGS='--dry-run --lane --dry-run'` — the rehearsal flag and the `-`-led lane both through — and `status --name=--fetch` is read as a NAME, refused as "no estate named '--fetch'" and not as a flag. THE STANDARD'S OWN PYTHON HAS ALWAYS DONE THIS: openRepoShape's `scripts/repo_shape.py` (`checked_value`, "ARGUMENT INJECTION IS THE THREAT … A value that begins with `-` is therefore refused outright") and `setup-project.py` refuse a `-`-led value, and their argparse entry points take `--flag=value` for free; the standard's bash front door, `openRepoShape --org`, does not yet — `ORG="${2:?--org needs a value}"`, no `=` arm, still so at the pinned `ba14e1d` — and that is a pull request THERE, then a pin bump here. Each `--help` gains one line for the `=` spelling and nothing else. Tests: eighteen parametrized command cases across `park` and `resume` (nine flags, a `-`-led value refused with nothing run, the `=` form byte-for-byte the same run as the spaced one, `--flag=` refused), plus `status`'s own three flags in both shapes, `park`'s lane case end to end, `resume --workspace=` / `--org=` doing the work those flags name rather than being echoed, and two hygiene tests. Suite at the branch tip, which adds no test after this commit: 571 passed, 0 skipped. The fix round of the independent REPORT-ONLY review of this branch (2026-09-11; 168 runs across the twelve flag spellings and fourteen forms, main against the branch: every accepted form byte-identical to the spaced one, every `-`-led value refused with an empty stdout, the `--` passthrough and the no-value flags unchanged; verdict MERGE AFTER FIXES), every finding taken. THE ONE THAT MATTERED: `test_every_value_taking_arm_reads_its_value_through_flag_value` counted only arms that read `$FLAG_VALUE`, so a TENTH arm written the old way — `X="$2"`, no emptiness test, no `-` test, no `=` spelling — would have left the count at nine and PASSED the suite, where the test it replaced had caught exactly that. It now names any `="$2"` outside `flag_value` itself, and the count is still nine and still hand-kept, so a tenth arm is read rather than silently passed; re-proved on THIS base by injecting such an arm into a scratch copy of `park` — `AssertionError: park: TENTH="$2"; shift 2 ;; takes $2 straight from the command line`. THE SECOND: for `--lane` the `=` spelling buys `park`'s own parsing and NOT the extension's — the recipe word-splits `$(ARGS)`, so `--lane=--dry-run` hands the extension the same two words the accident did — which the lane test's docstring now says instead of claiming the value "survived"; `park --help`'s example moves to `--repo=<owner/name>`, a value that never leaves the command, and `status --help`'s to `--project=<Name>`, the one value-taking flag its OPTIONS block lists. THE THIRD: `FLAG_VALUE`, `FLAG_SHIFT` and `FLAG_HINT` are declared beside the other globals in all three files, so a `die` that reached `$FLAG_HINT` before any arm had asked prints an empty hint under `set -u` rather than "unbound variable" at exit 1 — the one exit these arms must not produce; unreachable today, since every arm asks first, and cheap to keep that way. Suite: 571 passed, 0 skipped. BASED ON THE MAIN OF THE MOMENT. The branch was built on `a40cbb7` and rebased onto `8a36eb3` for this first push — 35 commits, in four steps as `main` moved under it, and NOT ONE CONFLICT at any of them: `park` and `resume` had not moved on `main` at all (both byte-identical to `a40cbb7`'s), and `status`'s growth from 2,619 lines to 5,767 lands BETWEEN the regions these commits edit — the globals at line 102 and the OPTIONS block at 222 above it, `flag_value` and the argument loop at 5,631 and 5,704 below it. Every number here is the re-measurement on that base, not one carried over. THE BITE: all 24 of these tests FAIL against origin/main's own `park`, `resume` and `status` — the 23 the first commit adds and `status`'s own `test_refusals_read_nothing`, which took the flag-shaped readings — measured in a scratch tree with main's three commands dropped in beside this branch's tests: `24 failed, 436 passed`. Suite on the branch: 571 passed, 0 skipped, against main's 549 collected; 23 test ids added, one renamed away (`test_every_value_taking_arm_refuses_an_empty_value`, which this replaces). INVARIANTS, each asserted by the suite and checked again by hand: the shared estate resolver byte-identical across the three AND byte-identical to main's, because this branch does not touch it; `expand_home` byte-identical in `status` and `resume`; `flag_value` byte-identical in all three, which is the new test; `bash -n` clean on all three; no `${x,,}`, `mapfile`, `declare -A` or `local -n`, so it parses under macOS bash 3.2; every `"${arr[@]}"` guard is main's own, since this branch adds no array. NO CAP MOVES: README.md and AGENTS.md are untouched and still sit exactly at their caps, 409 and 224. Ruling: "ruling (c): take dash-values as built, push and PR" — Brett Heap, 2026-09-14. Lane: openrepotools-3 (openRepoTools-3) PR #37 Co-Authored-By: Claude Fable 5.1 <[email protected]>



The follow-up #14 owed to Copilot, whose review posted one minute after that PR merged.
${2:?…}rejected an unset OR empty value; the[ $# -ge 2 ]that replaced it only checks that an argument slot exists, so an empty one was let through and read further down as "was this given at all?":park --lane ""exited 0 having runmake parkwith the lane silently gone from the WIP commit subject,--repo ""fell past the--repobranch of the resolver into the walk-up, andresume --workspace ""on a machine with a config skipped the never-silently-replaces-an-existing-config check. All seven value-taking arms inparkandresumenow ask[ $# -ge 2 ] && [ -n "$2" ]and refuse in the same words as before (which already read right for both halves), exit 2; the comment block in each file says why an empty value is the same refusal. Nine parametrized tests beside #14's own, run from INSIDE an estate so the walk-up is there to be fallen back to. Withpark/resumefrom main all nine fail, in two ways: park's four at exit 0 withARGS=[](the lane gone,make parkrun), resume's five at exit 2 withno workspace record is configuredinstead of the flag's own refusal (the estate had been resolved from the cwd; they died at the workspace record). With this change: exit 2, the command's own message, empty stdout.The second commit brings
status's two value-taking arms (--repo,--name | --project) to the same guard: they were arity-only fromstatus's first commit rather than${2:?}, so Copilot never saw them, butstatus --repo ""reported the estate around the cwd as though--repohad not been given, andstatusis the one command where a wrong answer changes nothing and so is never looked at twice. After this PR the three commands agree about what an empty value means. The third commit, from the independent review, adds a hygiene test that reads the three files as text and asserts every line taking$2into a variable carries the whole guard within the three lines above it, and that there are exactly nine such lines: this bug shipped twice by two routes (83a1601 intopark/resume, fbf6f11 intostatusfrom its first commit) and was caught both times only by an outside reviewer, because each command's own tests ask what a refusal says and an arm that does not refuse says nothing. Withstatusfrom main that test fails naming the line. Suite: 261 passed, 0 skipped.Caller-facing: a wrapper doing
park --lane "$LANE"with an empty$LANEparked before and is refused now, exit 2; likewise--repo "$SLUG",--org "$ORG",status --name "$N". The spelling that passes the flag only when there is a value is${LANE:+--lane "$LANE"}.Out of scope and reported for a ruling: a value beginning with
-is still accepted by every arm, as it was under${2:?}, sopark Atlas --lane --dry-runhands the extension a lane literally named--dry-runand runs a real park. Refusing-*values would foreclose a legitimate dash-led value, and these arms have no=form to escape through, so that is a decision, not a fix.🤖 Generated with Claude Code
Summary by Sourcery
Refuse empty values consistently across
park,resume, andstatusso they cannot be mistaken for omitted flags or trigger unintended estate resolution.Bug Fixes:
park,resume, andstatusinstead of silently treating them as omitted and continuing with fallback behavior.Enhancements:
Tests:
parkandresumevalue-taking flag refuses an empty value.status's repository, name, and project flags.