fix(init): guard no longer matches delegated names inside quoted args - #43
Merged
Conversation
The delegate guard split the whole command line on separators and matched segments, so a delegated command mentioned as data inside a quoted argument (issue notes, commit messages, echo strings) blocked an unrelated command like bd or git. Blank out single- and double-quoted spans before splitting; unquoted newlines now also separate segments so multi-line commands still match. Existing repos pick the fix up by re-running sidemux init. Closes #32
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.
Closes #32.
The generated
delegate-guard.mjssplit the entire command line on&&/||/;/|and matched segment prefixes, so a delegated command name appearing as data inside a quoted argument — the repro wasbd update … --notes \"… ./bin/deploy dendrobundle\"— blocked the unrelated command actually being run.Fix in the guard template's
matchesDelegated: single- and double-quoted spans are blanked out before splitting (they're arguments, not commands), and unquoted newlines now count as segment separators so genuine multi-line commands still match.New integration tests run the generated guard binary: quoted mentions (with newlines and separators inside) pass; a real delegated command outside quotes, including on a second line, still blocks.
Existing repos pick up the fix by re-running
sidemux init(the install path already refreshes a stale guard).Full gate green (typecheck, lint, test, build).