Skip to content

fix(ai-slop): close leftover directory-expansion defects (0.3.9) - #3331

Merged
kyle-sexton merged 3 commits into
mainfrom
cursor/aislop-quotepath-cfcf
Aug 24, 2026
Merged

fix(ai-slop): close leftover directory-expansion defects (0.3.9)#3331
kyle-sexton merged 3 commits into
mainfrom
cursor/aislop-quotepath-cfcf

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Closes #3332

Summary

Three defects in detect.sh directory expansion survived the 0.3.8 path-anchor fix: a tracked non-ASCII filename was dropped, a filesystem walk still ran silently when git could not answer, and the new tests asserted only a scan count so the original spelling-rebuild defect could return unnoticed.

Fix

  • git -c core.quotePath=false ls-files so a filename holding an em dash is actually opened.
  • Report on stderr when git is missing or rev-parse --is-inside-work-tree fails; a silent walk remains only when git reports the directory is genuinely outside a checkout.
  • Dir-target tests now assert the emitted file= path, subtree restriction, a non-ASCII filename, and the git-absent report.
  • normalize_dir_target still keeps a Windows drive-root slash (C:/).

ai-slop 0.3.9. Duplicate stale PR #3330 is still DIRTY and would regress drive-root slash preservation; ignore it.

Verification

  • bash plugins/ai-slop/skills/audit/scripts/detect.test.sh: 149 cases passed
  • scripts/check-changed-skills.sh origin/main: 0 failed
  • scripts/check-changelog-parity.sh --check-bump origin/main: pass
  • python3 scripts/sync-plugin-options-docs.py --check: up to date

Related

Follow-up to the merged directory-anchor work. Do not merge #3330.

Open in Web Open in Cursor 

@kyle-sexton
kyle-sexton marked this pull request as ready for review August 24, 2026 03:24
@kyle-sexton
kyle-sexton enabled auto-merge (squash) August 24, 2026 03:25
@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 8s —— View job


Security Review

  • Gather context (PR diff, changed files)
  • Run /review:security-review per custom instructions
  • Post findings

No security issues found.

This PR is a narrow, local-tooling bug fix in plugins/ai-slop/skills/audit/scripts/detect.sh. It adds -c core.quotePath=false to an existing git ls-files '*.md' invocation inside expand_dir_target so tracked filenames containing non-ASCII bytes (e.g. an em dash) are emitted raw instead of C-quoted, fixing a case where such files were silently dropped from the audit's markdown scan.

Reviewed for the categories in scope for this lane:

  • Command/path injection: dir and the *.md glob are passed as quoted arguments to git -C/ls-files, same as the pre-existing code; -c core.quotePath=false is a formatting-only git config value, not a code-execution or trust-boundary setting, and is not influenced by untrusted input beyond what the function already accepted.
  • Trust boundary / data flow: no new external input source is introduced; the only behavioral change is how already-tracked repo filenames are decoded from git's own output.
  • GitHub Actions surface: no workflow files, permissions, or triggers are touched.
  • Test file (detect.test.sh): only adds a local fixture (a tracked file with an em-dash filename) and assertions; no injection or credential handling involved.

Nothing here meets the skip-gate bar for further work — no security-relevant surface in this diff.

Branch: cursor/aislop-quotepath-cfcf

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown

Last security-reviewed head: 0e6b30c97d2101b221f89cd36cfd5d810141332f. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

@kyle-sexton
kyle-sexton force-pushed the cursor/aislop-quotepath-cfcf branch from 85b1f3c to 4c4dfe4 Compare August 24, 2026 03:39
@cursor cursor Bot changed the title fix(ai-slop): list non-ASCII directory targets unquoted (0.3.9) fix(ai-slop): close leftover directory-expansion defects (0.3.9) Aug 24, 2026
@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 54s —— View job


Security Review

  • Gather context (PR diff, changed files)
  • Run /review:security-review per custom instructions
  • Post findings

No security issues found.

This PR is a local-tooling bug fix in plugins/ai-slop/skills/audit/scripts/detect.sh's expand_dir_target (this PR's diff builds on the merged directory-anchor fix, closing three leftover directory-expansion defects). Reviewed the full PR diff against the categories in scope for this lane:

  • Non-ASCII path handling (detect.sh#L323): adds -c core.quotePath=false to git ls-files so tracked filenames with non-ASCII bytes (e.g. an em dash) are emitted raw instead of C-quoted, fixing files that were silently dropped from the scan. core.quotePath only affects quoting of bytes ≥ 0x80; git always escapes control characters (including embedded newlines) and backslash/double-quote regardless of this setting, so the newline-delimited while IFS= read -r rel; do ... done <<<"$listing" loop at detect.sh#L330 is not newly exposed to line-splitting/injection via crafted filenames — that guarantee predates and is unaffected by this change.
  • New git-absent / no-worktree fallback paths (detect.sh#L305-L317): both branches only change when the pre-existing find "$dir" -name '*.md' -type f fallback runs and add an stderr note; no new command construction or input source.
  • Command/path injection: dir and the *.md glob remain quoted arguments to git -C/ls-files/find, unchanged from the prior version; -c core.quotePath=false is a formatting-only git config value, not code-execution or trust-boundary relevant.
  • Test file (detect.test.sh): adds fixtures (an em-dash-named tracked file, a PATH stub without git built from ln -s to existing local binaries) and assertions only — no untrusted input or credential handling.
  • No GitHub Actions, permissions, or workflow files touched.

No security-relevant surface introduced by this diff.

Branch: cursor/aislop-quotepath-cfcf

kyle-sexton and others added 3 commits August 24, 2026 03:47
git ls-files C-quotes paths that hold non-ASCII bytes, so a tracked
filename containing an em dash failed the scan loop's existence test
and vanished from the report. Directory expansion now sets
core.quotePath=false. Drive-root slash preservation is unchanged.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Drop the C-quoted octal example that typos reads as "caf", and collapse
the extra blank line markdownlint flags between 0.3.9 and 0.3.8.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Report when git is missing or cannot confirm a work tree, instead of
walking silently. Pin dir-target tests on the emitted file= path,
subtree restriction, and a non-ASCII filename. quotePath=false and
drive-root slash preservation stay.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
@kyle-sexton
kyle-sexton force-pushed the cursor/aislop-quotepath-cfcf branch from 4c4dfe4 to 0e6b30c Compare August 24, 2026 03:48
@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 12s —— View job


Security Review

  • Gather context (PR diff, changed files)
  • Run /review:security-review per custom instructions
  • Post findings

Skip gate: no new security-relevant surface since the last successful review.

Diffing the previously-reviewed head (4c4dfe4) against the current head (0e6b30c) shows zero changes to plugins/ai-slop/** — the only delta is unrelated plugins/computer-use/** content that entered via a rebase onto main, not new commits on this PR. The ai-slop changeset (plugin.json, CHANGELOG.md, detect.sh, detect.test.sh) is byte-identical to what was already reviewed and cleared in the prior two passes on this PR.

No new review performed; the prior finding stands: no security issues found.

Branch: cursor/aislop-quotepath-cfcf

@kyle-sexton
kyle-sexton merged commit 26cf21f into main Aug 24, 2026
54 checks passed
@kyle-sexton
kyle-sexton deleted the cursor/aislop-quotepath-cfcf branch August 24, 2026 03:57
@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 19s —— View job


Code Review

  • Gather context (PR diff, changed files)
  • Check /review:code-review skip gate
  • Post findings

Skipped: PR is merged (not open).

Per /review:code-review's skip gate, review stops early when "PR is closed or not open," and no further findings are posted in that case. This PR (#3331) is already MERGED, so there's no open PR to review or anchor inline comments to — the code-review lane doesn't apply retroactively to merged history.

If you'd like a review of this code as it stands on main now, or of a new/reopened PR, just ask and I'll run the review lane against that target.

@github-actions

Copy link
Copy Markdown

Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count.

kyle-sexton added a commit that referenced this pull request Sep 2, 2026
…(0.5.6) (#3628)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Closes #3407

## Summary

The no-paths target list in `detect.sh` still ran `git ls-files '*.md'`
without `core.quotePath=false`. Non-ASCII filenames were C-quoted,
failed `[[ -f ]]`, and were silently dropped from a whole-repo scan.

## Fix

The bare listing now uses `-c core.quotePath=false` and reports listing
failures instead of swallowing them with `2>/dev/null`. Work-tree
detection matches the already-fixed directory-expansion path. Plugin
bumped to 0.5.6.

## Verification

`scripts/affected-tests.sh --run`: 17 suites passed. `detect.test.sh` is
at 202 cases, including nine new bare-invocation cases for non-ASCII
names and listing failures.

## Related

Refs #3331 (0.3.9 directory-expansion path)
<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-7ffb619a-6ebb-4d47-9c45-d68e846edf93?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-7ffb619a-6ebb-4d47-9c45-d68e846edf93&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ksextonmelodic <ksextonmelodic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ai-slop detect.sh: three defects survive the directory-expansion fix, including tests that do not pin the invariant they name

1 participant