Repository navigation
Lint: flag path-dependent negative greps in test scripts - #2327
Closed
remigiusz-antczak wants to merge 2 commits into
Closed
remigiusz-antczak wants to merge 2 commits into
remigiusz-antczak wants to merge 2 commits into
Conversation
Root cause: the "default excludes" assertion in test-review-checks-scan-summary.sh grepped the raw scanner argv for "worktrees", which the absolute --config path contains whenever the checkout is .claude/worktrees/<lane>. Not the host semgrep cache. It failed in review-checks-scan-summary, -hermetic and -registry-env, and passed in CI (plain checkout path). Fix strips the checkout path before the grep, assertion otherwise unchanged. The hermetic suite now also runs the test from a worktrees-style path (fails pre-fix). Tests: 3/3 suites (19 + 19 + 2 checks) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A test that runs `! grep` for a path-segment word (worktrees, home, tmp, ...) over a log holding absolute paths passes in CI but fails in a lane worktree, because the checkout path contains the word. path_hermetic_lint.py flags that in scripts/test-*.sh. Each line is split on ; && || | outside quotes. In every segment starting with `! grep`, any listed word appearing as a whole word in the literal (non-$var) text is a hit, so a second grep on a line, unbalanced quotes, -e/-eX/--regexp=, and -m N/-A N all flag. A hit is exempt only when the grep's input file (its last arg) is written on that line or the previous one by a sed/replace that uses $ROOT/$PWD. The baseline is keyed on `path<TAB>stripped line text` and messages print path:line, so a new offender in a baselined file fails. Two reviewed offenders are baselined. Regression test covers each reviewer case. Tests: 25/25 (6 path-hermetic lint unit tests + 19 scan-summary checks); path_hermetic_lint over repo clean, no stale rows Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
remigiusz-antczak
marked this pull request as ready for review
November 13, 2026 10:57
Collaborator
Author
|
Superseded by a single-commit recut on current main. |
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.
Adds
scripts/path_hermetic_lint.py, wired viascripts/ci-tests.d/path-hermetic-lint.sh. It flags a! grepinscripts/test-*.shfor a path-segment word (worktrees, home, tmp, ...) over a log that holds absolute paths, unless a sed using $ROOT/$PWD writes exactly the grep's input file on that line or the line before. Such a test passes in CI but fails in a lane worktree, because the checkout path contains the word.Stacked on #2326, which fixes the one real offender. Merge #2326 first.
scripts/path-hermetic-baseline.tsv, keyed by path plus line text. A stale row fails the lint, so the baseline can only shrink.Tests: 25/25 (6 lint unit + 19 scan-summary); repo lint rc 0.
🤖 Generated with Claude Code