You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_detect_features_fast feeds a newline-separated file list into xargs grep without -d '\n' or -0. If any file in the target repository has an apostrophe or single quote in its path (e.g. src/don't_crash.js), xargs fails with unmatched single quote and outputs nothing. The recon step silently detects 0 features.
_detect_features_fast passes newline-separated paths to xargs grep without -0 or -d '\n', so an apostrophe can be treated as shell quoting and leave feature detection empty.
Every Python invocation that feeds a file list to xargs can be checked for a delimiter.
a check that keeps it fixed:
version: 1id: xargs-file-list-delimitertitle: Python code that runs xargs on a file list passes -0 or -d '\n'description: Python code that runs xargs on a file list passes -0 or -d '\n', sopaths with quotes are not parsed as shell quotingselect:
glob: openhack/**/*.pygrep: xargsassert:
- id: delimit-file-pathsdescription: Every xargs invocation that consumes a file list uses -0 or -d '\n'.error: Pass -0 or -d '\n' to xargs when it consumes a file list.decide: Pass if every xargs invocation that consumes a file list passes -0 or -d'\n'; fail if any such invocation omits both.
On main (6a0675e) it flags openhack/deterministic_recon.py. Note the same pattern is also at line 213 (cmd_parts = ["xargs", "grep", "-El", ...]): with only line 182 fixed the check still fails; with both, it passes.
Run npx agentests run in CI, or --staged as a pre-commit hook. It flags the pattern in new changes; the existing files still need the fix.
Activity
mlgxiii commentedon Nov 20, 2026
_detect_features_fast passes newline-separated paths to xargs grep without -0 or -d '\n', so an apostrophe can be treated as shell quoting and leave feature detection empty.
Every Python invocation that feeds a file list to xargs can be checked for a delimiter.
a check that keeps it fixed:
On main (6a0675e) it flags openhack/deterministic_recon.py. Note the same pattern is also at line 213 (cmd_parts = ["xargs", "grep", "-El", ...]): with only line 182 fixed the check still fails; with both, it passes.
Run npx agentests run in CI, or --staged as a pre-commit hook. It flags the pattern in new changes; the existing files still need the fix.