aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-fs.js
Commit message (Collapse)AuthorAgeFilesLines
* fix(newos4): grep, head and tail take every path argument (v4.6.67)Agando2026-10-231-32/+71
| | | | | | | | | | | | | | | | | | | | | | | Packet 1's multi-path ask was only honoured by wc in v4.6.58 — grep read only args[ai+1] and head/tail only positional[0], so `grep x a b` searched `a`, printed one file's hits, and exited 0. Same silent drop, three more commands. - grep: loops every path; multiple files print `file:line: text`, `-c` prints one count per file, missing files are reported per file and excluded from the summary count; single-file output unchanged - head: every path, `==> file <==` header when more than one; `head f 40` still works - tail: every path with headers; a numeric second positional is still the legacy `tail <file> <count>`; `-f` warns and follows only the first file instead of printing all of them and claiming otherwise Verified live on v4.6.67: grep "bug_id" a b -> a:2 + b:3 + "2 match(es) in 2 file(s)" grep -c "alpha" a b -> one count per file grep "alpha" a missing -> hits from a, per-file error, "in 1 file(s)" head -n 1 a b -> header + first line for each tail -n 1 a b -> header + last line for each tail a 2 -> legacy count still honoured tail -f a b -> warns, follows a only
* fix(newos4): an invalid grep pattern returns a message, not an exception ↵Agando2026-10-231-1/+10
| | | | | | | | | | | | | | | | | (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: <pattern> (<engine message>)" 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.
* feat(newos4): agent status says never-scheduled vs waiting; `guides` command ↵Agando2026-10-231-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | (v4.6.63) Packet 6 and 7. 6 — four agents showed `sleeping` and nothing distinguished "waiting for work" from "never handed a task". Added tasksAssigned/lastTaskAt to the agent record (counted where a task is actually assigned), and the status line now reads idle — NEVER SCHEDULED (0 tasks since 2026-10-23 16:22) idle — waiting for work (3 task(s), last 2026-10-23 16:22) parked — NEVER SCHEDULED ... plus "Dispatch: 0/3 agent(s) have ever been given a task" and a warning that spawning is not dispatching. 7 — /guides/ was reachable by nobody. New `guides` command lists it newest-first with sizes and the preview/cat hints; help.html gained a Guides nav entry and section with links to the published guides. Verified live on v4.6.63: `guides` → 2 entries after seeding two files; orchestrator-status shows 3x NEVER SCHEDULED on a fresh session (the packet's own observation), and "waiting for work (3 task(s) ...)" once a counter is set, with "Dispatch: 1/3".
* fix(newos4): refuse shell composition, wc takes multiple paths (v4.6.58)Agando2026-10-231-14/+34
| | | | | | | | | | | | | | | | | | | Packet 1 and 3 (silent wrong answers from a shell-less terminal). - detectComposition() in the security gate refuses ; && || | before dispatch. `;` used to fail loudly, but `&&`/`||` folded the right-hand side into the left command's argv (wc -l f && 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` -> "14 a / 10 b / 24 total"; `&&` and `;` refused; `echo "a && b"` still echoes; AI run_command semantics with `|` and `&&` refused; single command and multi-file wc still return real output.
* fix(newos4): predictor arithmetic, deployed-source viewer, ls text output ↵Agando2026-10-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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): coreutils flags + loop-guard arg key, both found by the agent's ↵Agando2026-10-221-19/+84
| | | | | | | | | | | | | | | | | | | | 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): download link uses the user's space; WebDAV share copies ↵Agando2026-10-211-1/+9
| | | | | | | | | | | | verified file links; preview fullscreen+share; files->WebDAV upload button (v4.6.45) - download: URL built from _resolveSpaceName() (config url = logged-in user), not the page space - WebDAV browser 🔗: shares selected FILES only, URL-encoded, HEAD-verified (200) before claiming success; folders offer a tar fallback instead of a guaranteed-403 link - file manager preview: ⛶ fullscreen + 🔗 copy-link toolbar (was none) - file manager toolbar: ☁ WebDAV publishes selected/current file via webdav-push - modules/test/test-download-url.js: 4 PASS - rebuild bundles, bump v4.6.44 -> v4.6.45 (loader + 3 script tags)
* newOS4 v4.6.15: reentrant print-capture stack, AI tail -f block, read-only ↵Agando2026-09-291-0/+4
| | | | sed in safeRead, security test harness (21 checks)
* newOS4: sed command (s///, /pat/d, Nd, -i, -n, pipe input) + help entriesAgando2026-09-291-1/+92
|
* newOS4: tail -n/-N flags + live follow mode (-f) with test harnessAgando2026-09-291-4/+45
|
* auto: 2026-06-18_18:00 changesAgando2026-06-181-0/+17
|
* auto: 2026-06-17_06:01 changesAgando2026-06-171-20/+54
|
* auto: 2026-06-09_06:00 changesAgando2026-06-091-1/+5
|
* auto: 2026-06-06_06:00 changesAgando2026-06-061-1/+51
|
* auto: 2026-06-03_06:00 changesAgando2026-06-031-37/+51
|
* auto: 2026-06-02_18:00 changesAgando2026-06-021-4/+30
|
* auto: 2026-06-02_06:00 changesAgando2026-06-021-24/+4
|
* auto: 2026-06-01_18:00 changesAgando2026-06-011-1/+1
|
* auto: 2026-05-27_06:00 changesAgando2026-05-271-3/+46
|
* auto: 2026-05-25_18:02 changesAgando2026-05-251-0/+445