From 07bd77ea9b893bce7f0f0c1be9a1470c71b6ec3a Mon Sep 17 00:00:00 2001 From: Agando Date: Thu, 29 Oct 2026 12:47:46 +0100 Subject: fix(newos4): shell tokenises command lines quote-aware everywhere (v4.6.132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v4.6.131 taught the pipe stages to forward their raw text, but the shell's own wrapper still split each stage with `cmdText.split(/\s+/)` — so `grep "alpha beta" /qt.txt | wc -l` handed grep the two args `"alpha` and `beta"` and matched nothing. Measured live: the wrapper (ShellModule.init() replaces terminal.executePipeChain) is the implementation that runs, so the core fix alone is decorative. All six command-line split sites in modules/ext/shell.js now go through one helper, `_tokenize()`, which delegates to `security._parseArgs` — the parser the bare-command path already uses — so the two cannot drift again: 111 single command in a `&&` / `;` chain -> `grep "a b" f ; echo done` 176 pipe stage (the wrapper that runs) -> `grep "a b" f | wc -l` 358 `<` redirect input -> `cat < /f` 401 pipe chain inside the script runner -> also forwards the stage's raw text now 424 single command in the script runner -> also forwards raw text 778 `[ -f "path" ]` / `test -f "path"` -> quoted paths in test expressions Empty stages are skipped instead of being dispatched as a command named '' (`help | | wc -l`). The guard test grew the assertion that would have caught this: test-pipe-guard.js now checks `shellTokensQuoted` (tokeniser used, no `cmdText.split(`, empty-stage guard present) alongside `shellForwardsRaw`; both are RED against HEAD's shell.js. Verification node modules/test/test-pipe-guard.js -> {"empty":[],"blank":[],"classifyGuarded":true, "pipeGuarded":true,"shellForwardsRaw":true,"shellTokensQuoted":true} node modules/test/test-parse-args.js -> 28/28 · daily job -> node tests 21/21 pass newos4-maintain.py -> maintenance result: OK (index 349, help 363/363, changelog v4.6.132) live v4.6.132, read from the terminal DOM (no print monkey-patch): cat /qt.txt -> alpha beta grep "alpha beta" /qt.txt -> 1 match, 1 file grep "alpha beta" /qt.txt | wc -l -> 2 (match line + summary; 1 when the quotes are lost) grep "alpha beta" /qt.txt ; echo done-> match count + done ShellModule._tokenize(c) === security._parseArgs(c) for 5 sample lines -> true _tokenize('') / _tokenize(' ') -> [] / [] Also closes the last open feedback item: RPT-20261027-160751 ("Connection failed on all providers") -> resolve, recorded in decisions.jsonl with evidence (headless probe URL `?probe=ctx`, v4.6.117, single occurrence, no stack; Ollama answers 200 with 37 models now). Feedback queue: awaiting 0. --- CHANGELOG.md | 53 ++++++++++++++++++++++++++- main.html | 6 ++-- modules/core/module-loader.js | 2 +- modules/ext/critical-ext-bundle.js | 73 ++++++++++++++++++++++++++------------ modules/ext/shell.js | 73 ++++++++++++++++++++++++++------------ modules/test/test-pipe-guard.js | 10 ++++-- 6 files changed, 166 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71d8e3f..c978a56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,16 +74,67 @@ Generated from git history by `scripts/build-changelog.py` — do not edit by ha Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +# newOS4 changelog + +Generated from git history by `scripts/build-changelog.py` — do not edit by hand between the markers. + +## v4.6.131 — 2026-10-29 + +_Touches modules (8), scripts (3), help.html (1), main.html (1) · fix 1_ + +- `Pipe stage quoting, maintain ordering, help cost row, plan status (v4.6.131)` `2c6c218` + +## v4.6.130 — 2026-10-29 + +_Touches modules (5), main.html (1) · fix 1_ + +- `Js keeps its string literals — dispatcher forwards the raw command line (v4.6.130)` `161372f` + +## v4.6.128 — 2026-10-29 + +_Touches modules (2), help.html (1), main.html (1) · fix 1_ + +- `Js console handles promise rejections + Node-builtin hint (v4.6.128)` `75c5113` + ## v4.6.119 — 2026-10-27 -_Touches modules (4), scripts (4), CHANGELOG.md (2), main.html (1) · release 3, fix 1_ +_Touches scripts (6), modules (4), CHANGELOG.md (3), guide.html (2) · release 3, fix 2_ - `if test …` was always false and `for` items never globbed` `e575ee8` - `Generate the changelog from git and keep it current in maintenance` `22bb505` - `Link the changelog in and deep-link each board fix to its build` `b26bfb8` - `Tag builds, feed the changelog to machines, fail maintenance when it ages` `782b3db` +- `Apply the GLM-5.3 review to the changelog pipeline` `f3b2664` ## v4.6.118 — 2026-10-27 diff --git a/main.html b/main.html index b2fedef..66c1d76 100644 --- a/main.html +++ b/main.html @@ -1349,13 +1349,13 @@ - + - + - +