feat(miner): add dry-run full-execution mode to the cross-repo evaluation harness#7642
Closed
luciferlive112116 wants to merge 3 commits into
Closed
Conversation
…tion harness Extends the cross-repo evaluation harness (JSONbored#4788) from readiness-only to a full-execution dry-run mode (JSONbored#7634): a new --full-execution CLI flag runs the discover -> plan -> code -> test loop against the benchmark repos, driving the configured coding agent to generate a real diff in the local clone, building it, running the target repo's own test suite locally, and flagging a no-op diff. Dry-run only -- it edits the clone and hard-resets it; it never opens a PR, pushes, or writes to any third-party repo. Adds the CROSS_REPO_EXECUTION_CATEGORY taxonomy (plan_not_formed, code_build_failed, tests_failed, no_op_diff, plus shared clone_setup/other), evaluateRepoFullExecution / runFullCrossRepoExecution (readiness reused for the plan stage; code/build/test delegated to injectable seams so the orchestration is unit-testable without a live agent), and summarize/format helpers in the same shape the readiness report produces. The CLI wires real dry-run seams (child_process build/test in the clone; the driver via runCodingAgentAttempt + git diff capture + reset). Docs updated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7642 +/- ##
=======================================
Coverage 88.51% 88.51%
=======================================
Files 724 724
Lines 75992 76066 +74
Branches 22618 22644 +26
=======================================
+ Hits 67263 67330 +67
- Misses 7681 7688 +7
Partials 1048 1048
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…ensive arms Covers the non-Error agent throw, the build/test no-detail reason fallbacks, and the null-manifest guard directly, and narrows the post-readiness stack to its detected shape so the (unreachable-after-readiness) optional-chain arms are gone -- bringing the new code to full patch coverage.
|
|
||
| /** Run one of the target repo's own commands (build or test) in its clone. `ok` is a clean exit 0. */ | ||
| function spawnRepoCommand({ repoPath, command }) { | ||
| const child = spawnSync("sh", ["-c", command], { cwd: repoPath, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }); |
Contributor
There was a problem hiding this comment.
P2: Full-execution harness runs arbitrary shell commands from third-party repos without validation
Default build/test seam passes inferred repo commands through sh -c without validation.
Run commands through the package manager directly, or sandbox the harness in a container.
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/scripts/cross-repo-evaluation.mjs">
<violation number="1" location="packages/loopover-miner/scripts/cross-repo-evaluation.mjs:86">
<priority>P2</priority>
<title>Full-execution harness runs arbitrary shell commands from third-party repos without validation</title>
<evidence>The spawnRepoCommand default seam uses spawnSync('sh', ['-c', command], ...) where command is inferred from a benchmark repo's own configuration (e.g., package.json scripts). A compromised or malicious benchmark repo can inject arbitrary shell commands that execute on the evaluation runner without sandboxing or allowlisting.</evidence>
<recommendation>Replace sh -c with a safer execution strategy: invoke the repository's package manager directly (e.g., npm test) rather than extracting and shelling raw commands, or document the RCE risk and run the harness inside an isolated container/VM with no access to sensitive data.</recommendation>
</violation>
</file>
Owner
|
Superagent findings, closing. |
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.
Closes #7634
Summary
Extends the cross-repo evaluation harness (#4788) from readiness-only to a full-execution dry-run mode, so it answers not just "can the miner form a plan for this repo?" but "does the miner actually produce working, correct code?" — the real signal behind the #4810 launch-readiness bar.
A new
--full-executionflag on the existingpackages/loopover-miner/scripts/cross-repo-evaluation.mjsruns the discover → plan → code → test loop against the benchmark repos: it drives the configured coding-agent driver to generate a real diff in the local clone, builds the result, runs the target repo's own test suite locally, and checks the diff isn't a no-op. Dry-run only — it edits the clone and hard-resets it afterward; it never opens a PR, never pushes, and needs nothing beyond a local clone + a configured driver (the same safety posture the readiness harness already has).What's added
CROSS_REPO_EXECUTION_CATEGORY), extending the readiness taxonomy per the issue:plan_not_formed,code_build_failed,tests_failed,no_op_diff(tests passed but the diff was empty), plus the sharedclone_setup/other.evaluateRepoFullExecution/runFullCrossRepoExecution— reuseevaluateRepoReadinessfor the plan stage, then delegate the code/build/test steps to injectable seams (runAgentAttempt,buildRepo,runRepoTests) so the orchestration + taxonomy are unit-testable without a live agent.summarizeCrossRepoExecution/formatCrossRepoExecutionReport— an execution report in the same shape the readiness report already produces.--full-executionmode wiring real dry-run seams: build/test spawn the repo's own commands in the clone; the agent seam runs the configured driver viarunCodingAgentAttemptand capturesgit diff, then resets.docs/cross-repo-evaluation.mddocuments the new mode, taxonomy, and operator prerequisites.Scope
--full-executionmode on the existing CLI + lib module (no new script; no live PR submission against benchmark repos)packages/loopover-miner/**,test/**), noblockedPaths; no secretssite//CNAME/lovableeditsTest Coverage
packages/loopover-miner/**is outside Codecov'scoverage.include(src/**only), so no patch-coverage gate applies — but the new logic has real unit tests (test/unit/miner-cross-repo-full-execution.test.ts) following this package's conventions: every execution category and the pass path are exercised with injected fake seams, plusrunFullCrossRepoExecution, the summary, the report, and the CLI arg/dispatch wiring.Validation
tsc -p packages/loopover-miner/tsconfig.json— new module compiles clean; emitted.js/.d.tscommittednode --checkon the emitted.jsand the CLI script--full-executionis additive); CLI--helpdocuments the new flagvitest runon the new test suite — greenmainSafety