fix(ai-slop): expand directory targets from one path anchor (0.3.8) - #3270
Conversation
|
Claude finished @kyle-sexton's task in 1m 7s —— View job Security review
No security issues found. This PR is a bug fix to Notes from a security lens:
Per the skip gate in |
|
Last security-reviewed head: |
8e3a3bc to
26b07b4
Compare
|
Claude finished @kyle-sexton's task in 1m 7s —— View job Security review
No security issues found. Reviewed the full diff at HEAD The change replaces a
Security-relevant observations:
No CRITICAL / IMPORTANT / SUGGESTION findings to report. |
|
Claude finished @kyle-sexton's task in 1m 25s —— View job Security review
No security issues found. Skip-gate condition 3 applies: this PR already has a successful security review (prior review) at commit The prior review's conclusion holds: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26b07b4336
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude finished @kyle-sexton's task in 3m 2s —— View job Code review —
|
|
Claude finished @kyle-sexton's task in 1m 18s —— View job Security review
No security issues found. The previously-recorded reviewed head ( Changes in scope (detect.sh#L283-L318):
Security-relevant observations:
No CRITICAL / IMPORTANT / SUGGESTION findings to report. |
|
Claude has reviewed this PR 3 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
|
Claude finished @kyle-sexton's task in 3m 43s —— View job Code Review
No new findings. What changed
Codex P2 finding — verified resolvedThe earlier automated review flagged that stripping a trailing slash from a Windows drive root (
The concatenation logic in Test coverage for this is direct: Other changes
Note on verificationThis review's sandbox blocked running |
detect.sh built its directory-expansion prefix from `git rev-parse --show-toplevel` and its filter from `pwd`. A directory has several spellings on Git Bash, where git answers `C:/Users/...` for the checkout a shell reaches as `/tmp/...`, so no prefixed candidate survived the filter, `grep` exited non-zero, and the `|| find` fallback ran in place of the tracked-files listing it was meant to back up. The walk returns untracked and ignored markdown, so a directory target audited files the checkout does not track and said nothing about it. Expansion now runs `git ls-files` with `-C <dir>`, which is already restricted to that directory's subtree and answers in paths relative to it. The caller's own spelling of the directory is the only anchor, so there is no second source to disagree with. The branch is chosen up front from `--is-inside-work-tree` rather than from an empty pipeline, so a filesystem walk is only ever the answer for a directory genuinely outside a checkout; inside one, a listing that fails reports on stderr instead of degrading into a different set of files. Measured on Git Bash against `plugins/ai-slop`: 0 of 13 tracked files survived the old filter, and the walk scanned 14 files including an untracked one. The expansion now scans exactly the 13 tracked files. Adds coverage pinning the invariant that the spelling of the target cannot change the answer, plus a trailing-slash target and a directory inside a checkout holding only untracked markdown. Closes #3266 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtbWChCVfUWAv1Pi5Qk2hA
The expansion fix is already on this branch. Changelog-parity requires a new manifest version and a new ## [0.3.8] heading whenever plugins/ai-slop/ changes; 0.3.7 is published on main and must not be reused or absorbed. Closes #3266 Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
…ents comment-hygiene flags the bare "issue 3266" parentheticals in detect.sh and detect.test.sh as tracker-ref:issue-reference. The comments already state the path-spelling failure; the ticket number is not needed. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Stripping a trailing slash from C:/ produced C:, which Windows treats as drive-relative (cwd on that drive). git -C and the find fallback can then scan the wrong tree or nothing. Ordinary directory targets still lose one trailing slash; Unix root / is already preserved by the empty-result path. Adds a host-independent helper test that sources the production normalize_dir_target function. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
machine-specific-paths flags C:/Users/ as a Windows user path. The case only needs a nested directory on a drive root, so C:/tmp/ is enough. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
8fedb24 to
3a77842
Compare
|
Claude finished @kyle-sexton's task in 1m 19s —— View job Security review
No security issues found. Skip-gate condition 2/3 applies. The previously-recorded reviewed head ( -assert_eq "nested trailing slash is stripped" "$(normalize_dir_target "C:/Users/")" "C:/Users"
+assert_eq "nested trailing slash is stripped" "$(normalize_dir_target "C:/tmp/")" "C:/tmp"This swaps a hardcoded test literal (
The prior reviews' conclusions on this PR stand: |
|
Claude finished @kyle-sexton's task in 2m 46s —— View job Code Review
No high-signal correctness or maintainability findings. What changed since the last full passThe prior five review rounds on this PR (three security, two code-review) already covered The only new commit is Full-diff re-trace (not just the delta)Walked
Not independently verifiedThis lane's |
Closes #3266
Summary
detect.shexpands a directory target to the markdown files beneath it. The prefix came fromgit rev-parse --show-topleveland the filter frompwd. On hosts where those spellings differ (Git Bash:D:/repovs/d/repo), no prefixed candidate survived the filter, so|| findsilently replaced the tracked-files listing. The walk includes untracked and ignored markdown.Fix
Directory expansion now runs
git ls-fileswith-C <dir>, which is already restricted to that directory's subtree and answers in paths relative to it. The caller's own spelling of the directory is the only anchor. The branch is chosen up front from--is-inside-work-tree, so a filesystem walk is only ever the answer for a directory genuinely outside a checkout. Inside one, a listing that fails reports on stderr instead of degrading into a different set of files.ai-slop 0.3.8.
Verification
plugins/ai-slop/skills/audit/scripts/detect.test.sh— 132/132dir target in git repo: only the tracked file counts— PASSscripts/check-changelog-parity.sh --check-bump origin/main— pass--check-preserved origin/main— 0.3.7 heading kept--check-order— passRelated
Refs #3242