<feed xmlns='http://www.w3.org/2005/Atom'>
<title>newos4/modules/core/terminal.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-29T11:53:41+00:00</updated>
<entry>
<title>feat(newos4): register `test` / `[` so chains decide locally instead of asking a model (v4.6.135)</title>
<updated>2026-10-29T11:53:41+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-29T11:53:41+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=d32c25c60daa0376c0d9d7c7b6ccf84628469b06'/>
<id>urn:sha1:d32c25c60daa0376c0d9d7c7b6ccf84628469b06</id>
<content type='text'>
`[ -f "/qt.txt" ] &amp;&amp; echo exists` — the probe that closed the v4.6.132 batch — was not a shell test
at all: both commands were unregistered, so the line fell through to the AI fallback and a model was
asked whether a file exists. `_evalTest()` has implemented `-f -d -e -z -n ! = !=` for the if/while
parser since the script runner was written; only the command was missing.

  * `test` and `[` registered in ShellModule. Success resolves silently; false rejects with a
    `silent` error so `&amp;&amp;`/`||` skip it — POSIX prints nothing on exit 1.
  * `[` requires the closing bracket (`[ : missing ']'`), and that message is NOT silent.
  * `test` already names the on-demand regression-suite runner ("test auto" / "test list" in
    help.html). A argv that does not look like a test expression (`-f`/`-d`/`-e`/`-z`/`-n`/`!`,
    or `a = b` / `a != b`) is delegated to the handler registered before us, so `test auto`
    still runs the suite and the two meanings cannot collide.
  * terminal.dispatchCommand() now honours `err.silent` — without it a top-level `test -f /nope`
    printed `Error in ShellModule.test:` (measured on v4.6.134, fixed in v4.6.135).
  * help.html documents the bracket form next to the existing `test` row.

Three tags were minted minutes apart — v4.6.133 (commands), v4.6.134 (suite delegation),
v4.6.135 (silent top-level) — each a real cache-bust for a fix that superseded the previous build;
the net change is this commit.

Verification
  node modules/test/test-shell-test-cmd.js -&gt; 24/24 pass (RED against HEAD: "test command
      registered" fails, "m.commands.test is not a function")
  node modules/test/test-pipe-guard.js     -&gt; all seven flags true
  node modules/test/test-parse-args.js     -&gt; 28/28 · daily job -&gt; node tests 22/22 pass
  newos4-maintain.py -&gt; atlas 355 commands (was 354), modules-index 349, help 364/364
  live v4.6.135, read from the terminal DOM:
    [ -f /qt.txt ] &amp;&amp; echo F135          -&gt; F135
    test -f /nope || echo M135           -&gt; M135
    [ -d /nope ] &amp;&amp; echo BAD || echo N134-&gt; N134   (false branch skipped, nothing printed)
    test                                 -&gt; no output (suite not loaded; POSIX false)
    test -f /nope                        -&gt; no output
    js "a b".length | wc -c              -&gt; 1       (v4.6.132 pipe fix still intact)
  The AI fallback is no longer reachable for a bracketed file test.
</content>
</entry>
<entry>
<title>fix(newos4): pipe stage quoting, maintain ordering, help cost row, plan status (v4.6.131)</title>
<updated>2026-10-29T11:42:30+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-29T11:42:30+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=320877d2c8a3bb6be3d32780ecfc6e7d14528f66'/>
<id>urn:sha1:320877d2c8a3bb6be3d32780ecfc6e7d14528f66</id>
<content type='text'>
Four items closed in one batch; three ran as parallel subagents on disjoint files, the bundle was
rebuilt once by the parent (rebuild-bundles.py serialises the working tree, which carries other
sessions' work — see 161372f).

1. PIPE STAGES KEEP THEIR QUOTES. `js "a b".length | wc -c` reached eval as `a b.length` and printed
   a ReferenceError. terminal.js executePipeChain() now keeps `stages[i]` aligned 1:1 with
   `pipeParts[i]` (the `.filter(argv =&gt; argv.length &gt; 0)` shifted the index; replaced by a lastStage
   scan + `if (argv.length === 0) continue`) and forwards the stage's own text to the dispatcher.
   The core path alone was dead code: ShellModule.init() replaces terminal.executePipeChain
   (shell.js:144), and that override is what runs in the browser (`executePipeChain.toString()`
   contained `cmdText.split`, not `lastStage`). Both now pass `cmdText`/`pipeParts[i]`.
   test-pipe-guard.js was rewritten for the new shape and now also asserts the shell override
   forwards raw text — the assertion that would have caught the shadowing. RED on HEAD: both flags
   false; GREEN now.

2. MAINTENANCE --fix CAN CLEAR ITS OWN WARN. check_index() ran before check_atlas(), which is what
   regenerates course/atlas.json, so --fix rebuilt modules-index.json from the stale atlas and the
   same WARN reappeared every run. check_atlas() now runs immediately before check_index().
   modules-index.json regenerated: cost/usage present, 349 commands, version 2026-10-29-atlas.

3. `cost` DOCUMENTED. modules/core/module-billing.js registers `cost [on|off]` (an alias of `usage`);
   help.html had no row. Added above the `usage` row. help coverage 362/363 -&gt; 363/363.

4. SHIPPED PLANS STOP ASKING FOR A DECISION. The applier only flips review&lt;-&gt;safe, so every executed
   review-gated plan kept counting as an open decision (5 of 5). newos4-feedback-collect.py now reads
   the body: a `## Status` / `## Implementation` heading followed by shipped|executed plus a version,
   commit or date is `status: done`; those stay in `plans` (visible as shipped) but leave
   plans_review and awaiting_decision. Counts: plans_review 5 -&gt; 0, awaiting_decision 4 -&gt; 1
   (the remaining one is a real open report, RPT-20261027-160751).
   admin/feedback.html read `it.status[0]`, which would render `d` for a string status; it now
   prefers `status_lines[0]`.

Also carried, authored by earlier uncommitted sessions and already live in the bundle (attributed,
not silently absorbed): modules/core/module-billing.js (new, BillingModule: cost/usage),
its CORE_FILES entry in scripts/rebuild-bundles.py, and the BillingModule registry entry in
terminal.js. The bundle was rebuilt from HEAD + this batch with ollama-manager.js taken from HEAD,
so another session's in-flight `_httpError` refactor is deliberately NOT in the shipped bundle
(grep -c _httpError core-bundle.js = 0).

Verification
  node modules/test/test-pipe-guard.js   -&gt; {"empty":[],"blank":[],"classifyGuarded":true,"pipeGuarded":true,"shellForwardsRaw":true}
  node modules/test/test-parse-args.js   -&gt; 28/28 pass
  maintained job                          -&gt; node tests 21/21 pass
  scripts/newos4-maintain.py             -&gt; maintenance result: OK (modules-index 349, help 363/363,
                                            changelog current v4.6.131)
  live v4.6.131 (real DOM, no print monkey-patch):
    js "a b".length | wc -c   -&gt; 1        (js printed 3, one byte)
    js "a b".length           -&gt; 3
    js "abc".toUpperCase()    -&gt; ABC
    echo "two words"          -&gt; two words
    node -e "import('fs')"    -&gt; red error + Node-builtin hint
    js 6*7                    -&gt; 42
    unhandledrejection        -&gt; 0
  livePipeImpl: shell-override, livePipeForwardsRaw: true, costRegistered: true
</content>
</entry>
<entry>
<title>fix(newos4): js keeps its string literals — dispatcher forwards the raw command line (v4.6.130)</title>
<updated>2026-10-29T11:29:14+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-29T11:29:14+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=12968861b81c6aef3ca15488476db0b33fbf8104'/>
<id>urn:sha1:12968861b81c6aef3ca15488476db0b33fbf8104</id>
<content type='text'>
_parseArgs() treats quote characters as delimiters and drops them, so every string literal in a
js expression died before eval: `js "abc".toUpperCase()` reached the module as
`abc.toUpperCase()` → ReferenceError: abc is not defined. Same for `js import('fs')` →
`import(fs)`. Found while verifying the v4.6.128 console fix
(plan 2026-10-29_112000-newos4-parseargs-strips-js-string-literals.md).

- terminal.js: checkAndRun() records the untokenised line (`_currentRaw`), _dispatch() forwards it,
  dispatchCommand(cmd, args, rawText) passes it to the module. Security classification still runs
  on the tokenised form, and pipes/AI/script-runner calls pass nothing, so they behave as before.
- console.js: `js` evaluates _expr(args, rawText) — the raw remainder. `node -e` deliberately does
  NOT: the tokenizer already keeps `'…'` inside `"…"`, and the raw form would hand eval the string
  literal `"import('fs')"` instead of the import (caught by the live probe, not by review).
  js-run keeps tokenised paths.
- modules/test/test-parse-args.js: tokenizer table (records the deletion as the current contract),
  dispatcher plumbing asserts, _expr cases, and the user-visible paths. 27 assertions.
- module-loader.js + main.html + bundle: v4.6.130 (129 was minted, then console.js changed again —
  re-minting so no cached client keeps the intermediate).

Verification
  node modules/test/test-parse-args.js        -&gt; 27/27 pass
  same file against HEAD sources (git show HEAD:...)  -&gt; TypeError: _expr is not a function (RED)
  scripts/lint-no-undef.py terminal.js console.js     -&gt; clean, 122 cross-file globals
  core-bundle.js rebuilt from HEAD sources + this patch in /tmp/iso (the working tree carries
  another session's uncommitted ollama-manager.js `_httpError`); diff vs HEAD bundle = 14 lines,
  all mine. critical-ext-bundle.js byte-identical.
  Live page v4.6.130 (real executeCommand, output captured):
    js "abc".toUpperCase()        -&gt; ABC
    js 'a b'.split(' ').length    -&gt; 2
    js JSON.stringify({a:1})      -&gt; {"a":1}
    js 6*7                        -&gt; 42
    js import('fs')               -&gt; red "Failed to resolve module specifier 'fs'" + Node-builtin hint
    node -e "import('fs')"        -&gt; same error + hint (was printing the expression as a string)
    echo "two words"              -&gt; two words
    js-run /nope.js               -&gt; js-run: /nope.js: No such file
    unhandledrejection count      -&gt; 0

The sibling's parked terminal.js hunk (BillingModule registry entry) was stashed for this commit and
is restored in the working tree afterwards; it is not part of this change.
</content>
</entry>
<entry>
<title>fix(newos4): one error counter for errors/dashboard/world-model (v4.6.61)</title>
<updated>2026-10-23T16:15:05+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-23T16:15:05+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=d100ad3c57f4a18dacb2cbc11cfdc5590f20cf08'/>
<id>urn:sha1:d100ad3c57f4a18dacb2cbc11cfdc5590f20cf08</id>
<content type='text'>
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-&gt;2 and the total by exactly 1
(the mirror line is counted once, in the log, and reported separately).
</content>
</entry>
<entry>
<title>fix(newos4): refuse shell composition, wc takes multiple paths (v4.6.58)</title>
<updated>2026-10-23T15:53:39+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-23T15:53:39+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=9ae724e87a6471ce503783615ef6083d991531ce'/>
<id>urn:sha1:9ae724e87a6471ce503783615ef6083d991531ce</id>
<content type='text'>
Packet 1 and 3 (silent wrong answers from a shell-less terminal).

- detectComposition() in the security gate refuses ; &amp;&amp; || | before dispatch.
  `;` used to fail loudly, but `&amp;&amp;`/`||` folded the right-hand side into the left
  command's argv (wc -l f &amp;&amp; grep -c x f returned "42 42"), and a `|` arriving from
  the AI run_command tool bypassed splitPipe entirely and degraded the pattern to
  empty -- which matches every line. Operators inside quotes are untouched.
- wc accepts multiple paths: one line per file plus a total, per-file errors for
  missing paths. `wc -c a b` used to print only `a` and exit 0.
- help.html: "There is no shell" callout at the top of the command reference,
  plus the v4.6.57/58 changelog entry.

Verified live on v4.6.58 by replaying the exact call sequence used by both paths:
interactive `wc -c a b` -&gt; "14 a / 10 b / 24 total"; `&amp;&amp;` and `;` refused;
`echo "a &amp;&amp; b"` still echoes; AI run_command semantics with `|` and `&amp;&amp;` refused;
single command and multi-file wc still return real output.
</content>
</entry>
<entry>
<title>fix(newos4): empty-pipeline crash, stacks in reports, frame in digest + dashboard (v4.6.55)</title>
<updated>2026-10-23T13:55:51+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-23T13:55:51+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=ef7e4d4d64c294240542c74d8ad2f99b7ef641f2'/>
<id>urn:sha1:ef7e4d4d64c294240542c74d8ad2f99b7ef641f2</id>
<content type='text'>
Root cause: splitPipe() splits on every '|', so `help |`, `| wc -l`, `a || b` produced a stage with
no argv and executePipeChain() called parts[0].toLowerCase() on undefined — 989 occurrences, first
filed 2026-10-20, unfixable from the report because bug reports dropped the stack that named
executePipeChain:3955. Same unguarded read existed in _classify().

- terminal.js: _classify() returns an inert classification for empty argv; executePipeChain()
  parses each stage once, filters stages with no argv (so the last real stage stays final), warns
  only when the whole pipeline is empty. Last-stage test now compares against the filtered length.
- module-system.js: `bug` diagnostics include the stack (10 frames, 1200 chars); auto-filed reports
  carry it too — they are the majority of the inbox and were previously message-only.
- report.php: per-stack 2 KB cap; fingerprint pinned to message/source/count so adding `stack`
  cannot break dedupe against reports filed before today.
- ingest.php: first_frame() parsed once on ingest, stored as `frame` on each signature.
- newos4-triage.py: FRAME| line with the first application frame.
- dashboard.php: frame under each Top Errors row.
- modules/test/test-pipe-guard.js: ordering tripwire (guard must precede the parts[0] read).

Verified: test RED exit=1 -&gt; GREEN exit=0; browser matrix on v4.6.55 (help |, | wc -l,
echo hi || echo bye, ls | | wc -l, |) -&gt; 0 new error signatures, "|" warns;
auto-filed report now carries stack (RPT-...f3e31124, archived after the probe);
frame = modules/core/core-bundle.js:3955:42; maintain OK; skill audit 7/7.
</content>
</entry>
<entry>
<title>fix(newos4): dashboard shows the real world model and stops dying after 10 s (v4.6.51)</title>
<updated>2026-10-21T23:23:47+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-21T23:23:47+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=bc5834d70992224ef6809229d25efeb23470c024'/>
<id>urn:sha1:bc5834d70992224ef6809229d25efeb23470c024</id>
<content type='text'>
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 -&gt; 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 -&gt; 0s; watch timer advances the payload, --stop clears it; mobile
360/390 px all OK; 0 console errors.
</content>
</entry>
<entry>
<title>newOS4: interactive AI course (terminal module, portal, atlas, telemetry, daily maintenance+cron) + free store card</title>
<updated>2026-10-18T12:05:18+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-10-18T12:05:18+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=88ad8ed2fbbda61920b11a79df29acb58928b5af'/>
<id>urn:sha1:88ad8ed2fbbda61920b11a79df29acb58928b5af</id>
<content type='text'>
</content>
</entry>
<entry>
<title>newOS4 v4.6.15: reentrant print-capture stack, AI tail -f block, read-only sed in safeRead, security test harness (21 checks)</title>
<updated>2026-09-29T13:56:27+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-09-29T13:56:27+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=7b9dd97689db400f2408ed50b04857d7d73d83e5'/>
<id>urn:sha1:7b9dd97689db400f2408ed50b04857d7d73d83e5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: parse per-call captured output for unknown-cmd error (race-free under Promise.all)</title>
<updated>2026-09-29T11:49:18+00:00</updated>
<author>
<name>Agando</name>
<email>roduccomm@gmail.com</email>
</author>
<published>2026-09-29T11:49:18+00:00</published>
<link rel='alternate' type='text/html' href='https://newos.webx11.duckdns.org/newos4/commit/?id=ab51ae2bb3a233c5ac77bff2a046ca710201c138'/>
<id>urn:sha1:ab51ae2bb3a233c5ac77bff2a046ca710201c138</id>
<content type='text'>
</content>
</entry>
</feed>
