fix: port search and dimension safety guardrails

- enforce canonical dimensions across app and MCP surfaces
- prioritize title-first node search in UI and query tools
- add regression tests for ranking and dimension validation
This commit is contained in:
“BeeRad”
2026-03-23 10:47:18 +11:00
parent c1eda905d3
commit 545dc6e2e8
18 changed files with 250 additions and 78 deletions
+5 -12
View File
@@ -26,20 +26,13 @@ async function getPopularDimensionsSQLite() {
SELECT nd.dimension, COUNT(*) AS count
FROM node_dimensions nd
GROUP BY nd.dimension
),
all_dimensions AS (
SELECT DISTINCT dimension AS name FROM node_dimensions
UNION
SELECT name FROM dimensions
)
SELECT ad.name AS dimension,
SELECT d.name AS dimension,
COALESCE(dc.count, 0) AS count,
dim.description
FROM all_dimensions ad
LEFT JOIN dimension_counts dc ON dc.dimension = ad.name
LEFT JOIN dimensions dim ON dim.name = ad.name
WHERE ad.name IS NOT NULL
ORDER BY LOWER(ad.name) ASC
d.description
FROM dimensions d
LEFT JOIN dimension_counts dc ON dc.dimension = d.name
ORDER BY LOWER(d.name) ASC
`);
return NextResponse.json({