lint: split space-separated bare names, drop the dead fixedNames - #130
Merged
Conversation
Two defects the review of #128 turned up in that PR, after it had merged. Space-separated bare names regressed. The pre-#128 code split on /[,\s]+/; readAllowedTools split on commas only, so `allowed-tools: nmap curl` produced the single bogus `Bash(nmap curl:*)` instead of two entries. splitToolNames restores the old behaviour but leaves a part containing `(` whole, so `Bash(git diff:*)` stays one tool rather than being torn in half -- something the original only avoided by early-returning on any wrapped value, which also meant it fixed nothing in a mixed list. fixedNames was computed and never read: the fix closure recomputes the same map from a fresh parse. `bun run lint` flags it, and #128 passed CI only because unused variables are a warning. Removed, and the wrap predicate that had been written out three times is now isWellFormedTool + wrapTool. 4 more regression tests: space-separated names, a wrapper containing a space, and flow-sequence brackets. Neither defect reached opencue/skills#21: no skill carries a bare multi-word allowed-tools value, and on its own base the repaired fixer reproduces that PR byte-for-byte. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 7, 2026
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.
Follow-up to #128. Reviewing that PR turned up two defects in its own change; it merged before the fixes landed, so both are live on
main.HIGH — space-separated bare names regressed
The pre-#128 code split on
/[,\s]+/.readAllowedToolssplit on commas only:maintodayallowed-tools: nmap, curlBash(nmap:*), Bash(curl:*)allowed-tools: nmap curlBash(nmap curl:*)Bash(nmap:*), Bash(curl:*)Confirmed by executing
applyFixeson both shapes, not by reading.splitToolNamesrestores the old behaviour but keeps a part containing(whole, soBash(git diff:*)is not torn in half — a case the original only survived by early-returning on any wrapped value, which also meant it fixed nothing in a mixed list. So this is strictly better than either version.MEDIUM —
fixedNamesis dead codeThe
fixclosure recomputes the same map from a fresh parse, so the outer binding is never read.bun run lintflags it:#128 passed CI only because unused variables are a warning, not an error. Removed. The wrap predicate had been written out three times, which is how the dead copy went unnoticed; it is now
isWellFormedTool+wrapTool.Blast radius on the corpus: none
allowed-toolsvalue, so the HIGH never fired in practice.Verification
bun testbun run typecheckbun run lintskill-linter.test.ts🤖 Generated with Claude Code