From 70b9a2f8cc2b249362ca4893fdbb6703c0ea7b8a Mon Sep 17 00:00:00 2001 From: Agando Date: Thu, 22 Oct 2026 00:46:05 +0200 Subject: feat(newos4): world-model-ask answers with the LLM, grounded in the model (v4.6.50) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `world-model-ask` was a 10-keyword lookup: any real question returned "Unknown query. Try: modules, skills, ...". The documented example ("what changed since yesterday") compared nothing — it restated the current snapshot. - _modelDigest(): whitelisted snapshot (measured 942-965 chars on fixtures, ~3.3 KB live) + recent error sample + changesSinceLastSnapshot - _buildAskPrompt(): "answer only from this JSON, never invent numbers, name the command that would produce missing data" - ask(): connects Ollama on demand, answers via chat(), falls back to the facts path with a visible warning; --facts keeps the instant lookup - _diffSincePrev(): keeps one previous snapshot in /system/world-model.prev.json so "what changed" is a real diff (files 136 -> 140) - world_model_query tool returns the snapshot (digest or detail:full) instead of ten canned strings; no nested LLM call inside a tool call - help text now says what it does; node test modules/test/test-world-model-ask.js (11 assertions, runs the real class) Verified live v4.6.50: facts "Loaded 46 modules" | LLM "The snapshot does not contain information regarding the cause of memory growth ... use world-model-refresh" | diff "files 136 -> 140" | tool snapshot 3,334 bytes. --- main.html | 6 +- modules/core/core-bundle.js | 131 +++++++++++++++++++++++++++++++---- modules/core/module-aiassist.js | 17 +++-- modules/core/module-loader.js | 2 +- modules/core/module-world-model.js | 114 +++++++++++++++++++++++++++--- modules/test/test-world-model-ask.js | 47 +++++++++++++ 6 files changed, 287 insertions(+), 30 deletions(-) create mode 100644 modules/test/test-world-model-ask.js diff --git a/main.html b/main.html index 636a0a1..c89d183 100644 --- a/main.html +++ b/main.html @@ -1349,13 +1349,13 @@ - + - + - +