fix(hook): the singleton scan reads mise's subcommand, not its first argument - #973
Merged
Merged
Conversation
|
Warning Review limit reachedNext included review available in 50 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…argument
`singleton_task_started` recognised a guarded start with
`arguments.first() != Some("run")`, so it saw `mise run land` and nothing else.
`mise` takes its own options BEFORE the subcommand, and every one of them moves
`run` off index 0: `mise -C /repo run land` and `mise -E dev run land` both start
`land`, both were skipped, and a second `land` ran with no singleton — an
under-deny on exactly the collision CLOUD-438 exists to stop.
The third measurement of one class. CLOUD-857 found it as `split(command, " ")[0]`,
CLOUD-1382 as `segment.words[0]`, and this is the same anchor one layer in, over a
program's own argv. `destructive_reset_target` two functions down had already been
fixed for it and reached its verb through a scan that skips options and what they
consume; the two sat side by side answering one question two ways.
So the resolver is SHARED rather than copied. `git_subcommand` becomes
`subcommand_index(arguments, value_options)` — the same scan, parameterised by the
option set — and both call sites use it, git with `GIT_VALUE_OPTIONS` and mise with
`MISE_VALUE_OPTIONS`. Writing a second scan beside the first is the second-authority
defect `destructive_reset_target`'s own comment refuses to grow, and it is what let
these two drift. The task scan past `run` is the same question one position along,
so it is the same call rather than a third loop.
A widening of the anchor and never a replacement: `mise run land` is still
recognised, a `mise` call that is not `run` is still not, and `run` naming no task
still resolves nothing to look up.
`MISE_VALUE_OPTIONS` now documents both positions, because `mise` accepts these
globals before `run` as well as after and a set covering only the second left the
first unseen.
The cases go in `crates/batten/tests/it/singleton_gate.rs` rather than the
`singleton_guard.rs` the Ready block names: the fixture, the lock states and the
sibling case for options AFTER `run` all live there, and a second file would fork
them. Shown able to fail by restoring the first-token anchor, which reddens the new
case and leaves the other eight green.
Refs: CLOUD-1555
wenzowski
force-pushed
the
claude/eloquent-babbage-mbto6k
branch
from
September 17, 2026 16:36
c14adf0 to
247c886
Compare
wenzowski
marked this pull request as ready for review
September 17, 2026 16:36
wenzowski
marked this pull request as draft
September 17, 2026 20:49
wenzowski
marked this pull request as ready for review
September 17, 2026 20:49
Contributor
Author
|
/fast-forward |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
singleton_task_started(crates/batten/src/hook.rs) recognised a guarded startwith
arguments.first() != Some("run"), so it sawmise run landand nothingelse.
misetakes its own options before the subcommand, and every one ofthem moves
runoff index 0:mise -C /repo run landmise -E dev run landBoth start
land. Neither was seen, so the segment was skipped, no lock waslooked up, and a second
landran with no singleton — an under-deny on exactlythe collision CLOUD-438 exists to stop.
The third measurement of one class
CLOUD-857 found this anchor as
split(command, " ")[0], CLOUD-1382 assegment.words[0], and this is the same mistake one layer in, over a program'sown argv.
destructive_reset_targettwo functions down had already been fixedfor it and reached its verb through a scan that skips options and the values they
consume. The two sat side by side answering one question two different ways.
How
The resolver is shared rather than copied.
git_subcommandbecomessubcommand_index(arguments, value_options)— the same scan, parameterised bythe option set — and both call sites use it: git with
GIT_VALUE_OPTIONS, misewith
MISE_VALUE_OPTIONS. A second scan beside the first is the second-authoritydefect
destructive_reset_target's own comment refuses to grow, and it is whatlet these two drift. The task scan past
runis the same question one positionalong, so it is the same call rather than a third loop.
A widening of the anchor, never a replacement:
mise run landis stillrecognised, a
misecall that is notrunstill is not, andrunnaming notask still resolves nothing to look up.
MISE_VALUE_OPTIONSnow documents both positions, becausemiseaccepts theseglobals before
runas well as after, and a set covering only the second leftthe first unseen.
Tests
crates/batten/tests/it/singleton_gate.rs, over the compiled binary:an_option_before_the_subcommand_does_not_hide_the_task— seven denied spellingsincluding a valueless global and both positions at once, plus the anti-vacuity
half: a global before another subcommand, before another task,
mise --version,and
runwith no task at all must all still allow.Shown able to fail by restoring the first-token anchor: the new case reddens on
mise -C /repo run landand the other eight stay green, so it discriminates thedefect rather than the gate.
The cases go here rather than in the
singleton_guard.rsthe Ready block names —the fixture, the four lock states and the sibling case for options after
runall live in this file, and a second one would fork them.
Closes CLOUD-1555
🤖 Generated with Claude Code
https://claude.ai/code/session_01Qbw3zwPXfwifgfg4ckf9Bm