From 5a71f376d469f794fba2d4bb120f594eb0b07068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 26 Jul 2026 15:21:12 +0200 Subject: [PATCH] refactor(coach): keep the manifest's out-of-window rows terse The preamble already says once what the two states mean and that neither is absence; repeating it per row would have doubled a manifest that rides every turn. --- src/lib/ai/coach/tools/inventory.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/ai/coach/tools/inventory.ts b/src/lib/ai/coach/tools/inventory.ts index 4b480df1d..8d37e3413 100644 --- a/src/lib/ai/coach/tools/inventory.ts +++ b/src/lib/ai/coach/tools/inventory.ts @@ -376,11 +376,14 @@ function renderState(entry: InventoryEntry): string { if (entry.present) return "present"; const a = entry.availability; if (!a) return "absent"; + // Terse by design: the preamble states once what these two states mean and + // that neither is absence. Repeating that per row would double a manifest + // that rides every single turn. const range = `${a.count} readings, ${a.firstDate} to ${a.lastDate}`; if (a.state === "unavailable_in_scope") { - return `NOT IN SCOPE — the record holds ${range}, inside the current window, but this domain is not available in this conversation (its module may be switched off). Do NOT call it absent`; + return `NOT IN SCOPE [${range}, inside the window — module may be off]`; } return a.reachableWithWindow - ? `OUTSIDE WINDOW — the record holds ${range}; re-call with window:"${a.reachableWithWindow}" to read it` - : `OUTSIDE WINDOW — the record holds ${range}, older than any window reaches. Say so; do NOT call it absent`; + ? `OUTSIDE WINDOW [${range}, re-call with window:"${a.reachableWithWindow}"]` + : `OUTSIDE WINDOW [${range}, older than any window reaches]`; }