aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-aiassist.js
Commit message (Collapse)AuthorAgeFilesLines
* fix(newos4): tokenised body-aware skill search for load_skills (v4.6.62)Agando2026-10-231-7/+76
| | | | | | | | | | | | | | | | | | | | | | Packet 4. The matcher tested the whole query as one substring against name+description+tags: word order decided the outcome ("telemetry dashboard" = 0 while "telemetry" = 1), a sentence could never match, and skill bodies were never searched at all. - _skillTokens(): lowercase, split on non-word chars, drop <3-char words and a stopword list; a query made only of stopwords keeps its literal form - scoring: name 3, description 2, tags 2, body 1 + up to 1.0 for repeated hits, multiplied by token coverage (0.5 + 0.5 * matched/total), +3 phrase bonus so word order can never zero a real hit - results carry score and matchedTokens ("2/3"); top 3 by score, name as tiebreak - zero results now name the tokens searched and the closest skill names instead of "No matching skills found" Verified live on v4.6.62 via the real runTool entry point: "telemetry dashboard" and "dashboard telemetry" both return the same 2 skills (was 0 and 0); "how do I regenerate the skill index" returns skills-system-guide first (8.96, 2/3) where a sentence previously matched nothing; "info" returns 3 body matches; a nonsense query returns 0 with the tokens and closest names.
* fix(newos4): one error counter for errors/dashboard/world-model (v4.6.61)Agando2026-10-231-4/+6
| | | | | | | | | | | | | | | | | | | | | Packet 2 (three surfaces, three answers). Measured first: `errors` scanned /logs/current.log for [ERROR] lines, but that file only ever receives explicit terminal.log('ERROR', ...) calls -- exactly one call site in the whole app -- so it read 0. The dashboard added DebugSupervisor._errorDB plus failed tool calls (18), and the world model read the debug DB alone (11). - terminal.countErrors() / countLogErrors(): the single counter, exposed on the one object all three surfaces already hold - `errors` prints the canonical total with its breakdown, the entry list (hash, count, severity, message), and reports the log scan separately as a mirror - dashboard health.errors and health.errorBreakdown derive from it - world model telemetry.recentErrors derives from it, plus errorsBySource - terminal.log('ERROR', ...) now also records into DebugSupervisor, so the log is a human-readable mirror of one store instead of a second store almost nobody wrote Verified live on v4.6.61: with a seeded debug entry + failed tool call, all three report 2; a single log('ERROR') call moves debug 1->2 and the total by exactly 1 (the mirror line is counted once, in the log, and reported separately).
* fix(newos4): predictor arithmetic, deployed-source viewer, ls text output ↵Agando2026-10-231-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (v4.6.57) Acting on the "Request to the newOS4 team" packet (spaces/agando/guides/, re-verified by its author on 4.6.56). Three verified defects fixed: Packet 5 (predictor arithmetic) - module-predictor.js - the persisted field named mape held a SUM while predictor-status divided by the paired count: renamed to errorSum, older payloads read through - errorPct is stored raw; the 500% clamp is now render-only, so a 475x miss stays visible instead of being flattened to the ceiling - predictions are floored at 1 s and marked floored; a floored prediction is consumed but never scored as 100% error (a 0 s prediction is not a prediction) - observations shorter than 1.5 s (aborted/instant runs) are marked unusable and no longer train _findSimilar - one 0.079 s run was rounding the next prediction to 0 s - status prints an unpaired and an unscored count alongside the mean Packet 10 (verification cannot see its own fixes) - module-aiassist.js - view_module now returns the DEPLOYED source, prefixed with file and version, and only falls back to the _mods copy with a "may be stale" banner. The unversioned _mods/<Class>.js edit cache used to shadow the deployed file forever, so the viewer showed pre-fix code while the bundle was new. Proven by seeding a stale _mods/PredictorModule.js and calling the tool. Packet 1b (ls exits clean with no output) - module-fs.js - ls rendered only via printClickable(), which writes straight to the DOM, so any capture (AI run_command, diagnostics) saw an empty result and reported "empty directory". It now always prints a text line and keeps the clickable chips when nothing is capturing. Test: modules/test/test-predictor-accuracy.js 34/34 (new cases Q, R, S).
* fix(newos4): measure predictor accuracy over paired predictions (v4.6.56)Agando2026-10-231-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | The accuracy readout was structurally 0%: module-predictor.js:187 incremented the denominator on every observed run while the numerator only moved when a stored prediction existed, and predictions were stored only by the manual `predict` command (the AI tool predict_task computed one and discarded it). Replaying the AI loop's own call path with 6 tasks printed "Predictions made: 0, Accuracy: 0/6". - pending predictions with a 15m TTL, consumed by threaded id -> task hash -> cli-only similarity >= 0.5; unpaired runs never enter the denominator - duration scored within 30% or 3s (integer predictions vs fractional observations) - errorPct capped at 500% so one miss cannot poison the mean error - schema v2: v1 correct/total counters dropped on load, observed runs and the prediction counter kept; task text stored as an FNV-1a hash only - tuning (confidence-threshold, min-data-points, pair-ttl) persists - min-data-points now scales confidence (was declared, printed, settable, unread) - AI loop registers a prediction per turn and threads its id; predict_task returns predictionId; durations exclude chat-lock queue wait - status/dashboard say "n/a" instead of "N/A%", and carry paired count, mean error, turns error, pending and unpaired counts - test: modules/test/test-predictor-accuracy.js (26 assertions) Live on main.html v4.6.56: fresh session -> "Accuracy: n/a (0/0 paired)"; one paired run -> "100% (1/1 paired) - mean error 5% - turns +-0.0".
* fix(newos4): dashboard shows the real world model and stops dying after 10 s ↵Agando2026-10-221-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (v4.6.51) Two defects, both verified live before/after: 1. The World Model panel always said "Not synthesized yet". The page had a renderer for data.worldModel and _collectDashboardData() never set it -- the model was right there in WorldModelModule._model. Now collected and mapped to the renderer's exact keys (model has modules.loaded/skills.count/memory.nodes, the page reads modules/skills/memoryNodes), plus changesSinceLastSnapshot and the recent-error sample, with an honest "not synthesized" fallback. 2. The page discarded any payload older than 10 s and its own 5 s auto-refresh then showed "Cannot connect to newOS4". Stale payloads are now rendered with their age ("Data as of 1:20:14 AM - 3m ago"), labelled amber past 5 min. Also: the Refresh button wrote a localStorage key nobody read -> the terminal now listens for it and re-collects (page says "No terminal tab answered" when no terminal tab is open); storage events repaint instantly; the dead /api/dashboard fetch (404 on all three paths, 5 s stall) is gone; `dashboard --watch` / `--stop` re-collects every 5 s; header says the data is this browser's instance. Verified v4.6.51: panel rows "Synthesized 34s ago / v4.6.51 / 46-22 / 136-3 / 1 nodes 0 edges / OK / none recorded"; 130 s-old payload still renders with "- 3m ago" and no banner (previously "Cannot connect"); storage event moves the footer 13s -> 0s; watch timer advances the payload, --stop clears it; mobile 360/390 px all OK; 0 console errors.
* feat(newos4): world-model-ask answers with the LLM, grounded in the model ↵Agando2026-10-221-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | (v4.6.50) `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.
* fix(newos4): coreutils flags + loop-guard arg key, both found by the agent's ↵Agando2026-10-221-5/+12
| | | | | | | | | | | | | | | | | | | | live run (v4.6.49) Agent session surfaced two real defects: 1. The A4 prompt told it to use grep -n / sed -n 'N,Mp' / wc -l / head -N — none of those flags parsed: grep treated '-n' as the pattern (6/6 variants failed), wc read '-l' as a filename, head looked for a file named '-2', sed had no range parser. Fixed the tools, not just the text: grep now accepts -n/-i/-c/-v/-l (line numbers were already printed), wc accepts -l/-w/-c, head accepts -N and -n N, sed accepts Np and N,Mp, tail no longer prints a blank line for a trailing newline. Prompt re-ranked to the working forms. 2. Loop guard keyed calls by tool name plus the raw arguments field. When arguments was already an object (parsed upstream), the key became 'run_command:[object Object]', collapsing distinct batched commands into one signature and producing false "called 3x" warnings. Now the key is JSON.stringify(arguments) whenever it is not a string (3 sites: sig, _sigR, _sigD). Verified live v4.6.49: grep -n/-c, wc -l, head -2, sed -n '2,3p', tail -n 1 all correct.
* fix(newos4): GLM review follow-ups for AI read/context (v4.6.47)Agando2026-10-211-23/+70
| | | | | | | | | | | | | - loop guard: a mutation unblocks the replay but no longer erases the repeat counter (identical mutating calls could loop forever) - tool traces are per agent tag, flushed in a catch as well as on success, ring-buffered (first 2 + last 10) so verification reads survive - read_file notes are metadata only (path/range/next_offset); no file bodies, no secrets, and web_search/web_fetch output is excluded from durable context (injection surface) - trace is role:'system' (was 'assistant' — the model re-read it as its own answer) - surrogate-safe pagination, 500 floor / 16000 cap, prompt limits aligned - prompt now names checks that exist in the in-page terminal (test, grep -n, wc -l) - compressed summary capped at 4000 chars; denied-destructive tool result carries tool_call_id
* feat(newos4): AI paged file reads, durable tool traces, 12k context budget, ↵Agando2026-10-211-24/+82
| | | | | | | | | | read/tool/verify prompt rules (v4.6.46) - read_file: offset/limit + JSON {total_chars,truncated,next_offset} (was a hard 8000-char cut with no resume) - tool results now leave a per-turn trace that is persisted into session context and survives compression - maxContextTokens 2000 -> 12000; compression keeps 8 exchanges and 400 chars/msg - system prompt: page big files, prefer grep -n / sed -n / head, re-read + verify after every edit - verified in the live browser: 30k file pages 0->8000->16000, prompt section present, v4.6.46 served
* newOS4 v4.6.34: running tool ledger in the prompt (D4)Agando2026-10-181-0/+16
|
* newOS4 v4.6.33: progress-based turn budget (D3)Agando2026-10-181-0/+22
|
* newOS4 v4.6.31: tool-result memo cache with epoch invalidation (D2)Agando2026-10-181-1/+35
|
* newOS4 v4.6.30: per-agent session isolation (D1)Agando2026-10-181-5/+15
|
* newOS4 v4.6.29: progress-aware loop guard + agent attributionAgando2026-10-181-21/+91
|
* fix: sequential safe-tool execution — parallel fan-out corrupted ↵Agando2026-09-291-4/+7
| | | | print-capture attribution + shadow diff pairing
* newOS4 v4.6.15: reentrant print-capture stack, AI tail -f block, read-only ↵Agando2026-09-291-17/+16
| | | | sed in safeRead, security test harness (21 checks)
* fix: regex captures full command name + suggestion in unknown-cmd tool errorAgando2026-09-291-1/+1
|
* fix: parse per-call captured output for unknown-cmd error (race-free under ↵Agando2026-09-291-4/+4
| | | | Promise.all)
* newOS4 v4.6.14: race-safe AI loop guard (depth counter), cover _capture* ↵Agando2026-09-291-6/+15
| | | | entry points, structured JSON tool error
* newOS4 v4.6.13: typo suggestion bar (one-tap fix), consistent unknown-cmd ↵Agando2026-09-291-1/+4
| | | | messages, AI loop guard
* auto: 2026-07-09_06:00 changesAgando2026-07-091-26/+908
|
* auto: 2026-07-02_06:00 changesAgando2026-07-021-15/+318
|
* auto: 2026-06-25_06:00 changesAgando2026-06-251-22/+502
|
* auto: 2026-06-24_06:01 changesAgando2026-06-241-1/+26
|
* auto: 2026-06-23_18:00 changesAgando2026-06-231-7/+14
|
* auto: 2026-06-23_06:00 changesAgando2026-06-231-0/+2
|
* auto: 2026-06-22_18:00 changesAgando2026-06-221-2/+7
|
* auto: 2026-06-18_18:00 changesAgando2026-06-181-13/+33
|
* auto: 2026-06-18_06:00 changesAgando2026-06-181-5/+26
|
* auto: 2026-06-17_06:01 changesAgando2026-06-171-7/+189
|
* auto: 2026-06-16_06:00 changesAgando2026-06-161-1/+6
|
* auto: 2026-06-13_18:00 changesAgando2026-06-131-9/+115
|
* auto: 2026-06-13_06:00 changesAgando2026-06-131-4/+4
|
* auto: 2026-06-10_18:00 changesAgando2026-06-101-9/+37
|
* auto: 2026-06-10_06:00 changesAgando2026-06-101-44/+75
|
* auto: 2026-06-09_06:00 changesAgando2026-06-091-105/+28
|
* auto: 2026-06-08_18:00 changesAgando2026-06-081-0/+10
|
* auto: 2026-06-07_18:00 changesAgando2026-06-071-13/+59
|
* auto: 2026-06-06_06:00 changesAgando2026-06-061-64/+439
|
* auto: 2026-06-05_18:01 changesAgando2026-06-051-2/+46
|
* auto: 2026-06-04_06:00 changesAgando2026-06-041-13/+195
|
* auto: 2026-06-02_18:00 changesAgando2026-06-021-1/+73
|
* auto: 2026-06-02_06:00 changesAgando2026-06-021-2/+2
|
* auto: 2026-06-01_18:00 changesAgando2026-06-011-1/+77
|
* auto: 2026-06-01_06:00 changesAgando2026-06-011-4/+6
|
* auto: 2026-05-31_06:00 changesAgando2026-05-311-10/+37
|
* auto: 2026-05-30_06:00 changesAgando2026-05-301-97/+16
|
* auto: 2026-05-29_18:01 changesAgando2026-05-291-3/+103
|
* auto: 2026-05-29_06:01 changesAgando2026-05-291-60/+61
|
* auto: 2026-05-27_06:00 changesAgando2026-05-271-10/+39
|