Skip to content

fix(classifier): report the tool name for Claude Tool(word) lines - #368

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

extractTool's TOOL_PAREN_RE (/\(([a-z]+)\)$/) had no boundary before the paren, so Claude's ● Bash(ls) matched the Copilot-style (kind) suffix and reported tool: "ls". Require whitespace before the suffix so Claude lines fall through to the bullet extractor (Bash); Copilot's (shell) suffix is unaffected. Adds a regression test and changelog fragment.

Closes #367

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

Closes #367

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 24, 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 24, 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 24, 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.

Looks correct to me.

Verified against the tree at 920cd5c:

  • src/classifier.ts:28 trims the line before classification, so the $ anchor in the new /\s\(([a-z]+)\)$/ still matches Copilot's trailing kind suffix; test/patterns-semantics.test.js:85-95 (● npm test (shell) → tool: "shell") still passes.
  • src/classifier.ts:56-61: with the leading \s, ● Bash(ls) no longer matches the paren regex and falls through to TOOL_BULLET_RE, yielding Bash — exactly the fix #367 asks for. The existing ● Bash command ls -la (bash) precedence test (test/classifier-events.test.js:67-72) is unaffected.
  • Ran npm test locally on the PR head: 608 passed, 0 failed.

Changelog fragment name fixed-367.md follows the existing changelog.d/ convention. Nothing else to flag.

— hive: agent=reviewer 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.

Looks correct to me.

Read extractTool and the recognisers at the PR head (920cd5c):

  • The only producers of a (kind) suffix are the Copilot TOOL_START_PATTERN/TOOL_END_PATTERN at src/patterns.ts:127-128, which already require .+ \(shell\) etc. with a space before the paren — so adding \s to TOOL_PAREN_RE (src/classifier.ts:52) cannot drop a suffix those patterns accept.
  • Lines are .trim()ed before classify() (src/classifier.ts:28), so the $ anchor is unaffected by trailing whitespace.
  • Claude ● Bash(ls) now falls through to TOOL_BULLET_RE and reports Bash, as the new test asserts; ● Read(…) and ● Bash command ls -la (bash) fixtures still behave as before.

npm test at the head: all green, 99.7% lines.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 1fa0bc9 into main Oct 24, 2026
12 of 13 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-367 branch October 24, 2026 23:55
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#368920cd5c` sha256:c6a96c9470f5be4cdbf13f6d04dec48c3b8cf98f9dde6ba4bca2c626605b341f — download from the dashboard or `hivectl review evidence #368`.

@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 24, 2026
hanthor pushed a commit that referenced this pull request Oct 24, 2026
The TOOL_PAREN_RE whitespace fix this branch carried landed first on
main as #368, so after the rebase only the test delta is left: the
regression case now also covers "● Bash(pwd)", "● Bash(make)" and
"● Agent(explore)" (not just Bash(ls)/Skill(commit)), asserts with the
offending line as the message, and records why the "(kind)" suffix
matcher needs the leading \s.

Refs #367

Hive-Run: #367
Hive-Plan: fix TOOL_PAREN_RE word boundary per issue #367 proposed fix
Hive-Spec: issue-367#proposed-fix
Signed-off-by: unknown <unknown@users.noreply.github.com>
hivecommons-hive Bot pushed a commit that referenced this pull request Oct 25, 2026
The TOOL_PAREN_RE whitespace fix this branch carried landed first on
main as #368, so after the rebase only the test delta is left: the
regression case now also covers "● Bash(pwd)", "● Bash(make)" and
"● Agent(explore)" (not just Bash(ls)/Skill(commit)), asserts with the
offending line as the message, and records why the "(kind)" suffix
matcher needs the leading \s.

Refs #367

Hive-Run: #367
Hive-Plan: fix TOOL_PAREN_RE word boundary per issue #367 proposed fix
Hive-Spec: issue-367#proposed-fix

Signed-off-by: unknown <unknown@users.noreply.github.com>
Co-authored-by: unknown <unknown@users.noreply.github.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 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] classifier: Claude tool line like "● Bash(ls)" reports the argument ("ls") as the tool name

0 participants