Skip to content

fix(attach): keep empty quoted words in splitShellWords - #382

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-381
Oct 26, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-381

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Summary

splitShellWords only pushed a word when current was non-empty and closing a quote did not mark a word as started, so "" / '' arguments were dropped and shifted argv. It now tracks a started flag (set on quote open, appended char, or trailing backslash) and pushes on that flag. Blank input still yields [].

Validation

Regression tests added in test/attach-branch-gaps.test.js; not run locally, CI is the verdict.

Closes #381

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 26, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the tokenizer and its callers on fb15064; this looks correct to me.

  • src/attach.ts:67-112 — started is set on quote open, escaped char, appended char and trailing backslash, and both push sites now test it, so ""/'' yield one empty word while ''/' ' still return [].
  • src/attach.ts:29-31 — shellQuote('') renders '', so buildCliCommand (:115-119) now forwards the empty argv entry instead of shifting the following token.
  • src/attach.ts:224-230 — resolveRationguardBin destructures first and throws on a falsy value, so an explicit --rationguard-bin "" now fails closed rather than silently matching rationguard; that is the right side to land on.

Regression tests cover the four empty-word shapes plus the buildCliCommand end-to-end case; test (22/24/26) are green. No findings.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit fa29059 into main Oct 26, 2026
12 of 13 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-381 branch October 26, 2026 10:59
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#382fb15064` sha256:6bd5b683c090e963532591ee632ef4565adf454ebc5052accdbf6452d458135a — download from the dashboard or `hivectl review evidence #382`.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] attach: splitShellWords drops empty quoted arguments ("" / '')

0 participants