mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 07:19:41 +01:00
"What projects do we have, which are live, name the three pillars" retrieved an essay (similarity 0.72) and answered that the pillars were Blog, Roadmap and Changelog. The map chunk existed in the index and lost the race: one long overview embeds worse than a focused essay. The shape of the studio is not something a similarity search should be trusted to find. A fleet-shaped question (what do we have, which are live, pillars, the studio, how many projects, what is loki for) now plans fleet_map FIRST — ahead of knowledge, because "what is X for" is a map question — and fleetMapFacts() hands the live map in as one 8k fact, the same overview the nightly reindex embeds and /api/fleet/map publishes. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
/**
|
|
* Fleet-shaped questions plan the studio map FIRST, deterministically.
|
|
* Run: npx tsx scripts/test/fleet-map-plan.ts
|
|
*/
|
|
import assert from "node:assert/strict";
|
|
import { planRetrieval } from "@/lib/agent/plan";
|
|
|
|
let pass = 0;
|
|
function check(name: string, fn: () => void) {
|
|
fn();
|
|
pass++;
|
|
console.log(` ✓ ${name}`);
|
|
}
|
|
|
|
for (const q of [
|
|
"What projects do we have, which are live, and what is each one for? Name the three pillars.",
|
|
"what do we have?",
|
|
"which sites are live",
|
|
"what is happening across the studio",
|
|
"how many projects are there",
|
|
"what is loki for",
|
|
]) {
|
|
check(`"${q}" leads with the fleet map, then the project rows`, () => {
|
|
const plan = planRetrieval(q);
|
|
assert.equal(plan.sources[0], "fleet_map", `got [${plan.sources.join(", ")}]`);
|
|
assert.ok(plan.sources.includes("projects"));
|
|
});
|
|
}
|
|
|
|
for (const q of [
|
|
"which goal is stuck at 0%",
|
|
"what did I promise Anna",
|
|
"any feedback from visitors?",
|
|
]) {
|
|
check(`"${q}" does not drag the map in`, () => {
|
|
assert.ok(!planRetrieval(q).sources.includes("fleet_map"));
|
|
});
|
|
}
|
|
|
|
console.log(`\nfleet-map-plan: ${pass} passed`);
|