Skip to content

fix(resolver): treat \, as a literal comma so values are not fanned out - #356

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Adds a \, escape: values are split only on unescaped commas, then \, is unescaped to ,. Applied to --flag values, interactive answers (shared expandArrayValue), and @file lines (unescape only; file lines were never comma-split, so that behaviour is unchanged). Values without \, behave as before. The builder UI preview (ui.html) accepts the same escape; its generated command already passes the raw value through. Docs updated in README and SKILL.md; tests, changelog fragment and rebuilt dist/ included.

Closes #355

— 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 27, 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 27, 2026
@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 27, 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 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.

Reviewed — no findings from this perspective.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

@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 src/resolver.ts at the PR head and the base, plus the ui.html command generator. Looks correct to me.

  • splitUnescaped (src/resolver.ts:33-39): the (?<!\\), lookbehind split then \,→, replace is applied before expandPiece, so a value with an escaped comma stays one iteration and a mixed a\,b,c yields ['a,b','c'] — both covered by the new tests.
  • @file path (src/resolver.ts:45-51): base code only ever split on \n, never on commas, so the issue's claim that file lines were comma-split (#355 "resolver.ts:40-44") was inaccurate; the PR's unescape-only treatment there is the right call and keeps existing files unchanged.
  • Builder round-trip (src/ui.html:898-911): a value containing \, fails bareWord and is single-quoted, where the backslash is literal, so the generated command reaches the resolver with \, intact; glob-source values go through dquote, which doubles the backslash and also survives the shell.

One known limitation, not a defect: there is no \\ escape, so a value whose intended separator comma is immediately preceded by a literal backslash cannot be expressed. Fine for the prose-blank use case in #355; worth a line in the README table only if it ever comes up.

CI green on all six build-and-test matrices (dist/ in sync).

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

@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 src/resolver.ts at 988512b and the callers; this looks correct to me.

  • Both expandArrayValue call sites (src/resolver.ts:174 flag path, :204 interactive answer) go through the new splitUnescaped, so the escape covers exactly the two paths #355 names.
  • @file lines were only ever split on \n (src/resolver.ts:46-51), so adding the \, → , unescape there without a comma split is the right call — issue #355's "@file lines are split too" was not accurate against the tree, and the PR body says so.
  • src/ui.html:910 emits row.values raw into the generated command, so \, survives to the CLI and is unescaped exactly once; splitValues (:818) is preview-only. No double-unescape.
  • a\,b,c → ['a,b','c'] and returns 200\, not 500 → single value, both asserted in src/resolver.test.ts; dist/ is regenerated and the dist-sync CI gate is green on Node 22/24/26.

One note, not a defect: template {{var=default}} defaults (src/resolver.ts:195-198) never pass through expandArrayValue, so a \, in a default stays literal \,. Defaults were never comma-split, so nothing regresses; just mentioning it in case anyone expects the escape to be universal.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 6eb6830 into main Oct 27, 2026
14 of 15 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-355 branch October 27, 2026 09:46
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#356988512b` sha256:d16ea12ce25afb5d23f041b04bd13562a82c41ddf35ff041bfa54725c2258f1c — download from the dashboard or `hivectl review evidence #356`.

@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 27, 2026
Karibhou added a commit to Karibhou/promptargs that referenced this pull request Oct 27, 2026
splitUnescaped only looked one character back, so a value ending in a
backslash (C:\out\,D:\out) could no longer be split after hivecommons#356, and there
was no escape to recover it. A run of backslashes right before a comma is
now read in pairs: each \\ is a literal backslash and an odd leftover
makes the comma literal. Backslashes elsewhere are untouched, so plain
Windows paths and existing \, values behave as before. The builder
preview (ui.html) and @file lines follow the same rule.

Closes hivecommons#357

Hive-Run: hivecommons#357
Hive-Plan: review-backlog/correctness
Hive-Spec: promptargs-comma-escape#357
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HRH6kne36mF3hG2NYw72Ef
Signed-off-by: Karibhou <Karibhou@users.noreply.github.com>
hivecommons-hive Bot pushed a commit that referenced this pull request Oct 27, 2026
…ma (#358)

splitUnescaped only looked one character back, so a value ending in a
backslash (C:\out\,D:\out) could no longer be split after #356, and there
was no escape to recover it. A run of backslashes right before a comma is
now read in pairs: each \\ is a literal backslash and an odd leftover
makes the comma literal. Backslashes elsewhere are untouched, so plain
Windows paths and existing \, values behave as before. The builder
preview (ui.html) and @file lines follow the same rule.

Closes #357

Hive-Run: #357
Hive-Plan: review-backlog/correctness
Hive-Spec: promptargs-comma-escape#357

Claude-Session: https://claude.ai/code/session_01HRH6kne36mF3hG2NYw72Ef

Signed-off-by: Karibhou <Karibhou@users.noreply.github.com>
Co-authored-by: Karibhou <Karibhou@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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 copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] resolver: a value containing a comma always fans out into iterations; no way to pass a literal comma

0 participants