<feed xmlns='http://www.w3.org/2005/Atom'>
<title>newos4/modules/test/test-shell-test-cmd.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>
</feed>
