fix: declare mcp dep, add createRequire banner, fix atlas-data resolution for bundled runners#134
Conversation
…solution for bundled runners
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughAdds ChangesMCP SDK dependency and ESM/CJS shim
Atlas YAML path resolution
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/src/standards/atlas.ts`:
- Around line 38-43: The fallback in atlasFilePath currently returns the
monorepo third_party candidate even when no ATLAS.yaml exists, which makes
downstream errors point packaged users at the wrong fix. Update atlasFilePath to
return only an existing path (or null/undefined) after checking the candidates
array, and adjust the caller/error handling that uses atlasFilePath so it
reports an actionable message for the selected layout instead of forcing the
monorepo submodule path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cdd05332-d4b0-405c-b008-6b34ad58e95f
📒 Files selected for processing (3)
core/src/standards/atlas.tsrunners/sdk/package.jsonrunners/sdk/tsup.config.ts
…d layout-aware error
Problem
@keyvaluesystems/agent-opfor-sdkwas unpublishable in its current state for three reasons:@modelcontextprotocol/sdkwas used at runtime but not declared as a dependency — consumers would get "Cannot find module" on install.yaml) that callrequire()at runtime. Without acreateRequireshim in the banner, esbuild's stub throws "Dynamic require of … is not supported".core/atlas.tsis bundled into a runner, tsup flattens the file to<pkg>/dist/*.js, movingatlas-data/one level closer. The resolver only checked 2 levels up (correct for the standalone core package) and 3 levels up (monorepo dev), missing the bundled-runner layout — causing ATLAS.yaml to not be found at runtime.Solution
runners/sdk/package.json— added@modelcontextprotocol/sdk: ^1.29.0todependencies. tsup leaves these as bare imports in the output; the SDK must be present in the consumer'snode_modules.runners/sdk/tsup.config.ts— added abanner.jsinjectingcreateRequire(import.meta.url)into the ESM output. Mirrors the identical fix already in the cli and mcp esbuild bundles.core/src/standards/atlas.ts— extendedatlasYamlPath()to try three candidates in order:here/../atlas-data/(bundled runner, new),here/../../atlas-data/(published core package),here/../../../third_party/atlas-data/dist/(monorepo dev). Falls back to the last candidate if none exist.Verified with
npm run build(clean),npm pack --dry-run(atlas-data ships at package root), and a runtimeimport()smoke test (all six public exports resolve without errors).Checklist
npm run buildpassesnpm run typecheckpassesnpm run build:catalog:checkpasses (if evaluators or suites changed).env, or.opfor/artifacts committed<type>: <what changed>— e.g.feat: add SSRF evaluatorEvaluator checklist (skip if no evaluator added)
idis unique across all evaluatorspass_criteriaandfail_criteriaare specific, not vagueseveritymatches actual risk (critical= RCE / data breach)standardsmapping is correct.test.yamlfixture includedSummary by CodeRabbit