feat(miner): add cross-repo --full-execution dry-run mode#7639
Closed
kai392 wants to merge 3 commits into
Closed
Conversation
| export function defaultRunShellCommand(input: { command: string; cwd: string }): CrossRepoShellCommandResult { | ||
| const result = spawnSync(input.command, { | ||
| cwd: input.cwd, | ||
| shell: true, |
Contributor
There was a problem hiding this comment.
P2: spawnSync with shell: true executes benchmark repo commands without validation or timeout
spawnSync runs external benchmark repo build/test commands with shell: true, inheriting the full parent environment and without a timeout.
Add a timeout to spawnSync, validate or sanitize commands before execution, and pass a minimal environment to child processes.
AI prompt
Check if this security scanner issue is valid. If so, understand the root cause and fix it. If appropriate, update or add tests. Keep the change focused and preserve intended behavior.
<file name="packages/loopover-miner/lib/cross-repo-evaluation.ts">
<violation number="1" location="packages/loopover-miner/lib/cross-repo-evaluation.ts:460">
<priority>P2</priority>
<title>`spawnSync` with `shell: true` executes benchmark repo commands without validation or timeout</title>
<evidence>`defaultRunShellCommand` uses `spawnSync(input.command, { cwd: input.cwd, shell: true, encoding: "utf8", env: process.env })` where `input.command` comes from `stack.buildCommand` or `stack.testCommand` detected from cloned benchmark repositories. This passes the full parent environment to child processes and lacks a timeout, allowing a compromised benchmark repo to execute arbitrary shell commands or hang the evaluation process indefinitely.</evidence>
<recommendation>Add a `timeout` to `spawnSync` (e.g., `timeout: 300000` for 5 minutes), validate or sanitize `command` before execution, and consider using `shell: false` with pre-parsed arguments when possible. Pass a sanitized or minimal environment instead of `process.env` to reduce secret exposure from CI environments.</recommendation>
</violation>
</file>
Extend the existing harness so benchmark repos can run local code/build/test without forge PR writes (Closes JSONbored#7634). Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7639 +/- ##
==========================================
- Coverage 88.51% 88.48% -0.03%
==========================================
Files 724 724
Lines 75992 76045 +53
Branches 22618 22643 +25
==========================================
+ Hits 67263 67290 +27
- Misses 7681 7697 +16
- Partials 1048 1058 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
|
Superagent findings, fix + resubmit. |
…T.md Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
--full-executionto the existing cross-repo evaluation CLI/lib so at least two tagged benchmark repos can run local discover→plan→code→build→test without opening forge PRs (Closes #7634).plan_formed_compile_failed,compiled_tests_failed,tests_passed_noop_diff, andexecution_abandon, keeping the same report format.test/unit/miner-cross-repo-evaluation.test.ts.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlint— no workflow changesnpm run typecheck— miner package rebuilt viatsc -p packages/loopover-miner/tsconfig.jsonvitest runagainsttest/unit/miner-cross-repo-evaluation.test.ts(49 passed). Package path is outside Codecovsrc/**patch gate for apps; miner lib coverage still exercised by the new tests.npm run test:workers— unrelatednpm run build:mcp— unrelatednpm run test:mcp-pack— unrelatednpm run ui:openapi:check— unrelatednpm run ui:lint— unrelatednpm run ui:typecheck— unrelatednpm run ui:build— unrelatednpm audit --audit-level=moderate— skipped (no dependency changes)If any required check was skipped, explain why:
tscemit for the dual-published lib.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
N/A — miner CLI/lib/docs only; no visible UI changes.
Notes
runCodingAttemptis injected orLOOPOVER_MINER_FULL_EXECUTION_STUB=1is set. Never opens PRs against benchmark repos.expressjs/expressandlodash/lodashwithfullExecution: true(≥2 of 6).Closes #7634