<feed xmlns='http://www.w3.org/2005/Atom'>
<title>newos4/modules/test/test-world-model-ask.js, branch main</title>
<subtitle>newOS4 - the browser terminal that runs WebX11 user spaces</subtitle>
<id>https://newos.webx11.duckdns.org/newos4/atom?h=main</id>
<link rel='self' href='https://newos.webx11.duckdns.org/newos4/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/'/>
<updated>2026-10-21T22:46:05+00:00</updated>
<entry>
<title>feat(newos4): world-model-ask answers with the LLM, grounded in the model (v4.6.50)</title>
<updated>2026-10-21T22:46:05+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-21T22:46:05+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=61571cae4c642918b9e49dd81b51a3a9b2e46793'/>
<id>urn:sha1:61571cae4c642918b9e49dd81b51a3a9b2e46793</id>
<content type='text'>
`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 -&gt; 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 -&gt; 140" | tool snapshot 3,334 bytes.
</content>
</entry>
</feed>
