feat(mcp): validate .loopover.yml offline by extracting buildFocusManifestValidation into @loopover/engine - #6425
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…ifestValidation into @loopover/engine
loopover_validate_config's result builder, buildFocusManifestValidation, lived app-only in
src/services/focus-manifest-validation.ts, so the local stdio server had to POST to
/v1/validate/focus-manifest to validate a manifest -- unusable offline. Its parsing core
(parseFocusManifestContent) was already engine-side, but the result builder and its
unknownTopLevelWarnings dependency (src/selfhost/config-lint.ts) were not.
Extract both into @loopover/engine (packages/loopover-engine/src/{focus-manifest-validation,config-lint}.ts),
leaving re-export shims at the original src/ locations so the remote server (src/mcp/server.ts) and
API (src/api/routes.ts) keep working unchanged. Add the two exports-map entries and barrel re-exports.
Rewire the local loopover_validate_config handler to call buildFocusManifestValidation in-process
instead of apiPost, so a user validates a .loopover.yml fully offline.
All existing focus-manifest-validation and config-lint tests pass against the new location; adds a
stdio test that drives loopover_validate_config with an unreachable API URL to prove offline behavior.
Closes JSONbored#6269
0ffb9f1 to
787d1cd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6425 +/- ##
=======================================
Coverage 95.61% 95.61%
=======================================
Files 600 600
Lines 47346 47354 +8
Branches 15067 15068 +1
=======================================
+ Hits 45268 45276 +8
Misses 1291 1291
Partials 787 787
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-16 07:39:40 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
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.
|
What & why
loopover_validate_config's result builder,buildFocusManifestValidation, lived app-only insrc/services/focus-manifest-validation.ts, so the local stdio server had toapiPostto/v1/validate/focus-manifestto validate a manifest — unusable offline. Its parsing core (parseFocusManifestContent) was already engine-side, but the result builder and itsunknownTopLevelWarningsdependency (src/selfhost/config-lint.ts) were not.This extracts both into
@loopover/engine, following the established extraction pattern (a re-export shim left at each originalsrc/location), and rewires the local handler to compute in-process.Changes
packages/loopover-engine/src/focus-manifest-validation.tsandpackages/loopover-engine/src/config-lint.ts— the extracted builders, importing the manifest core engine-relative.src/services/focus-manifest-validation.tsandsrc/selfhost/config-lint.tsre-export the engine surface, so the remote server (src/mcp/server.ts) and API (src/api/routes.ts) — and every existing config-lint caller — keep working unchanged (no behavior change).packages/loopover-engine/package.json(./config-lint,./focus-manifest-validation) and the barrel.loopover_validate_confignow callsbuildFocusManifestValidation(input)directly instead ofapiPost— fully offline.Tests
focus-manifest-validation(13),selfhost-config-lint(22),loopover-config-lint-script(12), andconfig-templatestests pass against the new location.test/unit/mcp-cli-validate-config-offline.test.ts— drives the real stdioloopover_validate_configwith a black-holed API URL (http://127.0.0.1:1) to prove it validates in-process (well-formed →ok, unknown field →warn, unparseable →error); a residual round-trip would fail these.Closes #6269