From 9c27d3790b594c94430015675c91ce618c61be1d Mon Sep 17 00:00:00 2001 From: Agando Date: Fri, 23 Oct 2026 18:25:52 +0200 Subject: fix(newos4): an invalid grep pattern returns a message, not an exception (v4.6.64) Packet 8. `new RegExp(pattern)` sat unguarded in the terminal grep handler and in VFS find()/grep(), so a bad pattern threw out of the command handler into the error ledger -- the same ledger packet 2 had to stop trusting. - module-fs.js grep: compile in try/catch, print "grep: invalid pattern: ()" as a warning and return - virtual-fs.js find()/grep(): same guard, return [] and stash the message on _lastPatternError instead of throwing into the module error wrapper Verified live on v4.6.64 with the packet's own repro: `grep "/\bug_id\" file` prints the message, the error counter stays 0 (was: one ledger entry per call), a valid pattern still matches, and fs.grep('[') returns [] instead of throwing. --- help.html | 3 ++- main.html | 6 +++--- modules/core/core-bundle.js | 21 ++++++++++++++++++--- modules/core/module-fs.js | 11 ++++++++++- modules/core/module-loader.js | 2 +- modules/core/virtual-fs.js | 10 ++++++++-- 6 files changed, 42 insertions(+), 11 deletions(-) diff --git a/help.html b/help.html index 0937251..00eff18 100644 --- a/help.html +++ b/help.html @@ -1689,13 +1689,14 @@ listmods

๐Ÿ“‹ Changelog

-
v4.6.57โ€“63 โ€” October 20262026-10-23
+
v4.6.57โ€“64 โ€” October 20262026-10-23
  • No shell โ€” and it now says so โ€” ;, && and || are refused with an explicit message instead of being folded into the command's argv (where wc -l f && grep -c x f returned a plausible wrong number). A | arriving from the AI run_command tool is refused too, because that path bypasses the pipe splitter and degraded the pattern to empty. Documented at the top of the command reference.
  • Multiple paths in wc โ€” wc -c a b printed only a and exited clean. It now prints one line per file plus a total, and reports each missing file separately.
  • ls prints text โ€” it rendered only clickable chips (DOM-only), so any capture โ€” the AI run_command tool, the diagnostics sweep โ€” saw an empty result and reported "directory empty".
  • view_module shows what is deployed โ€” it returned the _mods/<Class>.js edit cache first, unversioned, so after a rebuild it showed pre-fix source while the bundle was new. It now fetches the deployed file and prefixes the version; the cache is a labelled fallback.
  • load_skills searches tokens, not one phrase โ€” the query used to be tested whole against name+description+tags, so "telemetry dashboard" returned 0 while "telemetry" returned 1, and a sentence could never match. Skill bodies were never searched. It now tokenises (stopwords dropped), scores name > description/tags > body, weights by how many tokens matched, keeps a phrase bonus so word order cannot zero a real hit, and reports matchedTokens: 2/3 with each result.
  • +
  • An invalid grep pattern is an answer, not a crash โ€” it used to throw out of the command handler into the error ledger, which is the ledger that has to stay trustworthy. It now prints grep: invalid pattern: โ€ฆ and returns.
  • Agent status says what it means โ€” four agents showed sleeping with no way to tell "waiting for work" from "never handed a task". They now read parked โ€” NEVER SCHEDULED (0 tasks since โ€ฆ) or waiting for work (3 tasks, last โ€ฆ), plus a dispatch line and a warning when spawning happened but nothing was ever dispatched.
  • A guide you can actually find โ€” guides lists /guides/ newest-first; the help page has a Guides section with the command, the preview/cat hints and links to published guides.
  • One error counter โ€” errors, get_dashboard_data and the world model tallied three different sinks (0 / 18 / 11 in the same second). All three now read terminal.countErrors() (DebugSupervisor DB + failed tool calls); the VFS log is reported separately as a mirror, and terminal.log('ERROR', โ€ฆ) now records into the same DB instead of a second store nobody read.
  • diff --git a/main.html b/main.html index a76b3d1..79c9b71 100644 --- a/main.html +++ b/main.html @@ -1349,13 +1349,13 @@ - + - + - +