From c2f2ea62503f81c07f4d36d7c3a798b91146153e Mon Sep 17 00:00:00 2001 From: Agando Date: Mon, 2 Nov 2026 21:05:58 +0100 Subject: fix(newos4): WebDAV listing sizes + pull, and five MemoryGraph defects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes STEER-20261102-205416-facd and STEER-20261102-204031-f82a. WebDAV (modules/ext/webdav.js): - listings showed "21 B" for a 21 KB file: nginx emits humanised sizes (autoindex_exact_size off, vhost :412) and _parseAutoindex did parseInt("21K"). _parseAutoindexSize() handles K/M/G, decimals, lowercase and "-"; PROPFIND's exact getcontentlength path is untouched. - webdav-pull into a missing local directory printed "Pulled: ... (N bytes)" and wrote nothing: it ignored fs.writeFile's false return (virtual-fs.js:561). It now creates the parent chain, checks the write, and only reports success after a confirmed write. The byte count uses TextEncoder, not .length (a Cyrillic file under-reported ~2x). - _formatSize gained the GB branch the parser already accepted (3 GB printed "3072.0 MB") and no longer prints "NaN MB" for a missing size. MemoryGraph (modules/core/module-memory-graph.js): - addEdge averages weights, so every repeat pulled a strong edge toward the call site's constant (0.9 -> 0.7 -> 0.6). Now Math.max, with decay left to applyDecay(); prune() untouched. - task ids were `task-${Date.now()}`, so re-submitting a task never deduped: now a hash of agent + normalised text. - recordFileAccess no longer records the graph's own /.memory_graph/ store. - failed tool calls were weighted 0.8 vs success 0.5, so showStats ranked failures as strongest: now 0.2. Legacy 0.8 failures are capped on load. - concept ids keep punctuation ("concept:(v2!),"): slugged, and the slug uses \p{L}\p{N} so Cyrillic/CJK/accented text still yields nodes -- an a-z0-9 slug silently produced none. Review findings folded in from the regression pass: the non-Latin regression (a-z0-9 slug), the GB formatter asymmetry, and the pull byte count were all found by review, not by the patch authors, and each now has a test. Tests: test-webdav-sizes.js 27 (was RED 15/24 before the fix), test-memory-graph.js 37 (RED 17/32), both auto-discovered by newos4-maintain -- 26/26 node tests. Live on v4.6.140: _parseAutoindexSize('21K') 21504, _formatSize -> "21.0 KB", _formatSize(2GiB) "2.0 GB", slug Cyrillic "исправить-парсер-ошибок", 0 console errors. --- main.html | 6 +- modules/core/core-bundle.js | 106 ++++++++++++--- modules/core/module-loader.js | 2 +- modules/core/module-memory-graph.js | 106 ++++++++++++--- modules/ext/webdav.js | 52 +++++++- modules/test/test-memory-graph.js | 253 ++++++++++++++++++++++++++++++++++++ modules/test/test-webdav-sizes.js | 239 ++++++++++++++++++++++++++++++++++ 7 files changed, 720 insertions(+), 44 deletions(-) create mode 100644 modules/test/test-memory-graph.js create mode 100644 modules/test/test-webdav-sizes.js diff --git a/main.html b/main.html index 743d261..e67a7fb 100644 --- a/main.html +++ b/main.html @@ -1349,13 +1349,13 @@ - + - + - +