Skip to content

fix(init): guard no longer matches delegated names inside quoted args - #43

Merged
tomfordweb merged 1 commit into
mainfrom
fix/guard-quoted-args
Jul 30, 2026
Merged

fix(init): guard no longer matches delegated names inside quoted args#43
tomfordweb merged 1 commit into
mainfrom
fix/guard-quoted-args

Conversation

@tomfordweb

Copy link
Copy Markdown
Owner

Closes #32.

The generated delegate-guard.mjs split the entire command line on &&/||/;/| and matched segment prefixes, so a delegated command name appearing as data inside a quoted argument — the repro was bd 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).

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
@tomfordweb
tomfordweb merged commit 28b53e2 into main Jul 30, 2026
1 check passed
@tomfordweb
tomfordweb deleted the fix/guard-quoted-args branch July 30, 2026 17:43
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.

delegate-guard matches command strings inside quoted arguments

1 participant