Repository navigation
Conversation
`_HOME` wanted a `/` after the `~`, so it expanded `find ~/ -name SKILL.md` and left `find ~ -name SKILL.md` alone. Home is itself a directory the skill sits under and one `_ancestors` keeps, so the second spelling swept the skill up and was reported as a clean room -- on the baseline, the side whose emptiness the whole verdict rests on. `grep -r pattern ~`, `find $HOME -name SKILL.md`, `cd ~; ls` and `Grep(path="~")` were the same miss. What follows the `~` may now be a separator, a shell one included, or the end of the word. What precedes it has to be whitespace, a quote or the start of the string, which is what keeps the wider lookahead safe: anything-but-a-word-character sufficed while a `/` had to follow, and would now expand the `~` in `[[ $x =~ ^run ]]`, `awk '$1 !~ /p/'` and `find . -name '*~'`, voiding cases that never went near home. A word character after the `~` still rules out `~5` and `~user`. A bare `~` between spaces in text that was never a path is still read as home. That voids a case rather than inverting a verdict, and it is the string matcher's standing limit rather than this rule's. Signed-off-by: John Lybeck <john.lybeck@amd.com>
`_swept` lost its caller when the logic moved inline into `_read_the_skill`, so that the sweep word and the directory could be matched across separate arguments rather than within one string. The two have drifted since: the inline version also treats a call to a search tool as a sweep whatever its arguments say, and this one does not. Signed-off-by: John Lybeck <john.lybeck@amd.com>
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.
Why
_HOMEexpanded a~only where a/followed it. Home is itself a directory the skill sits under, and one_ancestorskeeps, so every spelling that names home with nothing after it swept the skill up and came back a clean room:find ~/ -name SKILL.mdfind ~ -name SKILL.mdgrep -r pattern ~find $HOME -name SKILL.mdGrep(pattern=…, path="~")That lands on the baseline, the side whose emptiness the whole verdict rests on, so a baseline that found the skill this way was graded
no_signalorharmfulinstead of being voided.grep -r <topic> ~is a natural first move for an agent that has been told nothing.Raised as a follow-up on #35.
What changes
Both anchors, not only the one the review named.
~: a separator, a shell one included, or the end of the word. That reaches the four spellings above, and alsocd ~; lsand(cd ~) && ....~: whitespace, a quote, or the start of the string. This half is what makes the first one safe.(?<![\w/~$])was enough while a/had to follow and stops being enough the moment the end of a word will do, because[[ $x =~ ^run ]],awk '$1 !~ /p/'andfind . -name '*~'each put a~after punctuation, and each would expand to home and void a case that never went near it.~still rules out~5and~user, and the lookbehind still keepss/~/-/a sed script.The second commit deletes
_swept. It lost its caller when the logic moved inline into_read_the_skill, so that a sweep word and a directory could be matched across separate arguments rather than within one string, and the two have drifted since: the inline version also treats a call to a search tool as a sweep whatever its arguments say, and_sweptdoes not.Verification
ruff --select F401,F841is clean.(?=/)fails the new tests in 8 places. Loosening the lookbehind back to(?<![\w/~$])while keeping the new lookahead fails the punctuation test. Neither mutation is caught by the other's test.~is the only thing keeping them clean and the assertion cannot pass vacuously.Not verified: no live agent run. The behaviour is exercised through
_inspect_roomwith recorded tool calls, as the surrounding tests are.Scope
A bare
~between spaces in text that was never a path,grep -r 'a ~ b' notes.txt, is still read as home. No anchoring catches that one: it is indistinguishable from a real sweep without knowing what the string meant. It voids a case rather than inverting a verdict, and it belongs to the standing question about the string matcher raised on #35 rather than to this change.