Skip to content

Reuse pre-scan plan for interfile scans#4

Draft
mfow-nullify wants to merge 1 commit into
mainfrom
michael-codex/scan-auto-bundle-cache
Draft

Reuse pre-scan plan for interfile scans#4
mfow-nullify wants to merge 1 commit into
mainfrom
michael-codex/scan-auto-bundle-cache

Conversation

@mfow-nullify
Copy link
Copy Markdown

Summary

  • reuse the pre-scan SAST plan for interfile scans when the core rule set exactly matches
  • thread an optional precomputed plan through CoreRunner so interfile scans can skip rebuilding the bundle/plan in memory
  • add unit coverage for safe reuse, mismatch fallback, wiring from run_rules, and the no-replan CoreRunner path

Testing

  • python3 -m py_compile cli/src/semgrep/core_runner.py cli/src/semgrep/run_scan.py cli/tests/default/unit/test_interfile_scan_plan.py
  • PATH="/Users/mfow/.codex/worktrees/6889/opengrep/.venv311/bin:$PATH" .venv311/bin/python -m pytest cli/tests/default/unit/test_interfile_scan_plan.py -q
  • PATH="/Users/mfow/.codex/worktrees/6889/opengrep/.venv311/bin:$PATH" .venv311/bin/python -m pytest cli/tests/default/unit -q

Notes

  • I also ran PATH="/Users/mfow/.codex/worktrees/6889/opengrep/.venv311/bin:$PATH" .venv311/bin/python -m pytest cli/tests/default -m 'not pysemfail' -x -vv --tb=short.
  • That broader default suite stops on an unrelated existing snapshot mismatch in cli/tests/default/e2e/test_autofix.py::test_autofix_json_output[imported-entity.yaml-imported-entity.py-json-dryrun].
  • The diff there is an autofix snapshot expectation for $X.abstract_content and does not touch the scan/interfile code changed in this PR.

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.

1 participant