feat: sync runtime search and schema quality updates from app repo

- port retrieval, validation, and eval improvements relevant to os
- align prompts and dimensions with the flat single-agent model
- replace the old eval suite with the focused core scenarios

Generated with Codex
This commit is contained in:
“BeeRad”
2026-03-15 14:55:45 +11:00
parent 053c163e31
commit 4c75df101f
57 changed files with 1809 additions and 534 deletions
+15
View File
@@ -2,6 +2,7 @@ import { NextRequest, NextResponse } from 'next/server';
import { nodeService } from '@/services/database';
import { autoEmbedQueue } from '@/services/embedding/autoEmbedQueue';
import { hasSufficientContent } from '@/services/embedding/constants';
import { normalizeDimensions, validateExplicitDescription } from '@/services/database/quality';
export const runtime = 'nodejs';
@@ -71,6 +72,20 @@ export async function PUT(
const updates: Record<string, unknown> = { ...body };
let shouldQueueEmbed = false;
if (typeof body.description === 'string') {
const descriptionError = validateExplicitDescription(body.description);
if (descriptionError) {
return NextResponse.json({
success: false,
error: descriptionError
}, { status: 400 });
}
}
if (Array.isArray(body.dimensions)) {
updates.dimensions = normalizeDimensions(body.dimensions, 5);
}
const incomingChunk = typeof body.chunk === 'string' ? body.chunk : undefined;
const incomingNotes = typeof body.notes === 'string' ? body.notes : undefined;
const existingChunk = existingNode.chunk ?? '';