aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-fs.js
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-10-23 17:46:41 +0200
committerAgando <roduccomm@gmail.com>2026-10-23 17:46:41 +0200
commit83e64b88910c952c7469cee57cc5c5a8a07ad902 (patch)
treeddcbc0253fe26b5cc016da2a2acc58f2e5359dfa /modules/core/module-fs.js
parent895d8f5ed57c76f25770f88f290e6ab93949b6f8 (diff)
fix(newos4): predictor arithmetic, deployed-source viewer, ls text output (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).
Diffstat (limited to 'modules/core/module-fs.js')
-rw-r--r--modules/core/module-fs.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js
index 686a1a6..03c3733 100644
--- a/modules/core/module-fs.js
+++ b/modules/core/module-fs.js
@@ -63,7 +63,13 @@ class FileSystemModule {
const total = filtered.reduce((s, f) => s + (f.size || 0), 0);
this.terminal.print('total ' + filtered.length + ' (' + total + ' bytes)', 'text-muted');
} else {
- this.terminal.printClickable(filtered);
+ // v4.6.57: printClickable() writes straight to the DOM, so anything that
+ // captures output (the AI run_command tool, the diagnostics sweep) saw nothing
+ // and reported "directory empty" (packet ยง1b). Always emit a text line.
+ const names = filtered.map(f => f.name + (f.type === 'dir' ? '/' : '')).join(' ');
+ this.terminal.print(names);
+ const capturing = !!(this.terminal._printCaptureStack && this.terminal._printCaptureStack.length);
+ if (!capturing && typeof this.terminal.printClickable === 'function') this.terminal.printClickable(filtered);
}
};
this.commands['cat'] = (args) => {