test(scenarios): grade the #8884 guard via its engine-src path - #9104
Conversation
…l-branch collector collectLocalBranchMetadata only called the local assertSourceUploadDisabled helper, which checks the LOOPOVER_UPLOAD_SOURCE env flag and nothing else. The real forbidden-source-upload-key / oversized-content scan lived in assertScenarioLocalBranchInputSafe (src/scenarios/input-model.ts) but had no production importer, so source-content fields smuggled into the metadata-only scenario input were never refused on the actual entry point. Move that guard into @loopover/engine so both the backend scenario-input model (re-exported, public surface unchanged) and the loopover-mcp collector share one scan, wire it into collectLocalBranchMetadata in place of the weaker env check, and drop the now-dead assertSourceUploadDisabled. Add a regression test asserting the mcp collector itself rejects forbidden-key, oversized, and non-array changedFiles payloads. Closes JSONbored#8884
The scenario source-upload guard now lives in packages/loopover-engine/src/ scenario-input-safety.ts, but the suite reached it through the @loopover/engine barrel, which resolves to the built dist/*.js copy. v8 then attributed the executed statements to dist while reporting the src file (in coverage.include) at 0%, so codecov/patch graded the moved lines as uncovered. Import the guard directly from its engine-src module (the same relative-path pattern other engine-src suites use) so coverage lands on the real file: 19/19 statements, patch 100%.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9104 +/- ##
==========================================
- Coverage 93.88% 93.88% -0.01%
==========================================
Files 810 811 +1
Lines 80600 80598 -2
Branches 24454 24453 -1
==========================================
- Hits 75675 75669 -6
Misses 3560 3560
- Partials 1365 1369 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 18:02:59 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
test(scenarios): grade the #8884 guard via its engine-src path
The scenario source-upload guard now lives in packages/loopover-engine/src/
scenario-input-safety.ts, but the suite reached it through the @loopover/engine
barrel, which resolves to the built dist/*.js copy. v8 then attributed the
executed statements to dist while reporting the src file (in coverage.include)
at 0%, so codecov/patch graded the moved lines as uncovered. Import the guard
directly from its engine-src module (the same relative-path pattern other
engine-src suites use) so coverage lands on the real file: 19/19 statements,
patch 100%.
Closes #8884
Validation
Verified locally on this branch before opening:
npm run typechecknpx turbo run build:tsc build:verifynpm run test:coverage— patch coverage 100.0% of changed lines