Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: import the jev route schema from the module that declares it

[._.]/ Adam Eivy34d417041216
diff --git a/server/lib/jev.js b/server/lib/jev.js
index 5bfe778064..bff15a8567 100644
--- a/server/lib/jev.js
+++ b/server/lib/jev.js
@@ -187,8 +187,12 @@ export const JEV_FAILURE_CODES = Object.freeze([
// ── Wire contract ─────────────────────────────────────────────────────────
/**
- * What a caller may ask the sidecar to score. Also the route-input schema,
- * re-exported as `localLlmJevScoreSchema` from `mediaValidation.js`.
+ * What a caller may ask the sidecar to score. Also the route-input schema:
+ * `routes/localLlm.js` validates against it from HERE rather than through
+ * `validation.js`. Re-exporting it there put this module into the static import
+ * closure of all ~227 suites that reach `mediaValidation.js`, for one schema one
+ * route uses — the "constant re-exported through a heavy barrel" shape the
+ * import budget in `lib/importScoping.test.js` exists to catch.
*
* `.strict()`: the sidecar is a fixed-shape endpoint, so an unexpected key is
* a caller bug (or an attempt to reach a parameter that does not exist), not
diff --git a/server/lib/mediaValidation.js b/server/lib/mediaValidation.js
index 01581780ed..224df5bdc0 100644
--- a/server/lib/mediaValidation.js
+++ b/server/lib/mediaValidation.js
@@ -250,10 +250,6 @@ export const localLlmMigrateSchema = z.object({
mode: z.enum(['link', 'copy']).optional().default('link'),
});
export const localLlmInstallBackendSchema = z.object({ backend: localLlmBackendSchema });
-// The jev scorer route input IS the service contract — declared once beside the
-// pinned model descriptor (lib/jev.js) and re-exported here so routes keep
-// importing every schema from validation.js.
-export { jevScoreRequestSchema as localLlmJevScoreSchema } from './jev.js';
export const localPersistentMindSetupApplySchema = z.object({
setMindProfile: z.boolean().optional(),
modelId: z.string().trim().max(200).optional(),
diff --git a/server/routes/localLlm.js b/server/routes/localLlm.js
index 49138a0d67..e7a13d1413 100644
--- a/server/routes/localLlm.js
+++ b/server/routes/localLlm.js
@@ -19,7 +19,6 @@ import {
localLlmUnloadSchema,
localLlmMigrateSchema,
localLlmInstallBackendSchema,
- localLlmJevScoreSchema,
localLlmOllamaServiceSchema,
localLlmHuggingFaceSearchSchema,
localLlmTestSchema,
@@ -61,7 +60,7 @@ import { getSpecDecodePresetStatus, downloadSpecDecodeModel, previewSpecDecodeDo
import { SPEC_TYPE_SUGGESTIONS } from '../lib/specDecodePresets.js'
import { resetProviderReadinessCache } from '../services/providerReadiness.js'
import { MODEL_ABUSE_GUARD } from '../lib/modelAbuseGuard.js'
-import { JEV_MODEL } from '../lib/jev.js'
+import { JEV_MODEL, jevScoreRequestSchema } from '../lib/jev.js'
import { getCatalog, searchCatalog, isBackend } from '../lib/localLlmCatalog.js'
import { isAppleSilicon } from '../lib/platform.js'
import {
@@ -298,7 +297,7 @@ router.post('/jev/install/cancel', asyncHandler(async (_req, res) => {
// Policy: this is the only path that starts the sidecar, and it starts it
// because someone asked for a score.
router.post('/jev/score', asyncHandler(async (req, res) => {
- const { premise, hypotheses, minMargin } = validateRequest(localLlmJevScoreSchema, req.body)
+ const { premise, hypotheses, minMargin } = validateRequest(jevScoreRequestSchema, req.body)
res.json(await decide({ premise, options: hypotheses, minMargin }))
}))