From e452ce7785e5e47ec01a409d6da1f59564f8f365 Mon Sep 17 00:00:00 2001 From: Hermes SysOp Date: Thu, 12 Nov 2026 17:02:47 +0100 Subject: fix(newos4): stop reporting network and VFS size as facts we do not have (v4.6.161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. The last two `navigator.onLine`-as-fact payloads - module-aiassist.js: the debug/health payload carried `online: navigator.onLine`, consumed by downloads/dashboard.html, which rendered "๐Ÿ”ด Offline" โ€” on an Android WebView (reports false while fully connected) that told working users they were offline. The key is gone; the payload carries `network:'unknown'`, `networkKnown:false` and `networkHint`. - module-world-model.js: the snapshot had the same field, and it is also handed to the LLM through `_modelDigest()`/`ask()`, so the model was told the user was offline. Now `network:'unknown'` + `networkKnown:false`. - `_loadFromVFS()` scrubs `system.online` from a model persisted by an older build โ€” otherwise the stale boolean would survive inside the digest for the life of the VFS. - downloads/dashboard.html: `networkText()` renders reachable/unreachable/http-* only when doctor produced them ("(doctor)"), `unprobed` as "โ€” not probed", and everything else as "โ€” unknown (run doctor for a live probe)". A legacy payload's `online:false` lands in "unknown", never "Offline". The row label is "Network", not "Online". - Neither payload invents a probe: SystemModule stores no last-doctor verdict, so 'unknown' is the honest value until one exists. 2. `vfsSize` in both payloads was a different unit again - aiassist: `JSON.stringify(fs.root).length / 1024`; world-model: `JSON.stringify(fs.root).length`. Same lie v4.6.160 fixed in `vfs-size` โ€” UTF-16 code units plus serialisation structure. Both now sum UTF-8 bytes of file content (`_utf8Len`/`_measureVfs`, Blob โ†’ TextEncoder โ†’ code-point fallback, depth/node capped) and carry `sizeBytes` beside the human string so the rows reconcile. - world-model's `_gatherFileInfo().size` used a THIRD unit on an adjacent line (`JSON.stringify(fs.root).length/1024`); now the same measurement, plus `sizeBytes`. - `showModel()` renders exact bytes and tolerates a pre-fix persisted string. 3. Predictor made a guaranteed-401 request on every boot (UI-plan finding F6) - `_wdConfig()` returns `user:''`/`pass:''` when the saved WebDAV config has a URL but no credentials, and `_pullFromServer`/`_pushToServer` fetched the auth-gated `/spaces//_data/predictor.json` anyway โ€” 107 ร— 401 in one day, logged by the browser as console errors. Both now refuse without credentials (`cache-only (no credentials)`). Verified: 42/42 node tests, 2 new files (38 payload/honesty assertions, 8 predictor-store assertions); the predictor suite is 4/8 against the pre-fix source, and the payload suite fails 14 assertions against HEAD (`online:false` present, vfsSize === JSON.stringify length). Live Chromium on v4.6.161, on the served dashboard: a legacy payload with `online:false` renders "Network โ€” unknown (run doctor for a live probe)", the current payload renders "85.8 KB (87880 B)" and the same unknown, and a doctor-produced `unreachable` renders "โš ๏ธ unreachable (doctor)". Served bytes identical for core-bundle.js, main.html and downloads/dashboard.html. `maintain.py --fix` all PASS. --- downloads/dashboard.html | 17 +- main.html | 6 +- modules/core/core-bundle.js | 152 +++++++++++++- modules/core/module-aiassist.js | 50 ++++- modules/core/module-loader.js | 2 +- modules/core/module-predictor.js | 7 + modules/core/module-world-model.js | 95 ++++++++- modules/test/test-network-payload-honesty.js | 298 +++++++++++++++++++++++++++ modules/test/test-predictor-store-auth.js | 80 +++++++ 9 files changed, 685 insertions(+), 22 deletions(-) create mode 100644 modules/test/test-network-payload-honesty.js create mode 100644 modules/test/test-predictor-store-auth.js diff --git a/downloads/dashboard.html b/downloads/dashboard.html index 799bdbb..c217e1b 100644 --- a/downloads/dashboard.html +++ b/downloads/dashboard.html @@ -399,6 +399,19 @@ } } + // Network is NEVER rendered as "Offline" from an unknown. The terminal payload stopped + // carrying an `online` boolean because navigator.onLine reports false on a fully connected + // Android WebView; `doctor` is the only thing that probes, and it is the only source that may + // produce a reachable/unreachable verdict. No verdict => 'unknown', never a red dot. + function networkText(health) { + const n = health && health.network; + if (n === 'reachable') return 'โœ… reachable (doctor)'; + if (n === 'unreachable') return 'โš ๏ธ unreachable (doctor)'; + if (typeof n === 'string' && n.indexOf('http-') === 0) return 'โš ๏ธ ' + n.replace('http-', 'HTTP ') + ' (doctor)'; + if (n === 'unprobed') return 'โ€” not probed'; + return 'โ€” unknown (run doctor for a live probe)'; + } + // 2026-10-22: a 10 s cutoff threw away perfectly good data and the page's own auto-refresh // then showed "Cannot connect". Keep whatever exists and let the UI label its age. function fetchDashboardData() { @@ -578,8 +591,8 @@ const health = data.health || {}; let healthHtml = ''; healthHtml += '
Modules loaded' + (health.modules || '?') + '
'; - healthHtml += '
VFS size' + (health.vfsSize || '?') + '
'; - healthHtml += '
Online' + (health.online ? 'โœ… Online' : '๐Ÿ”ด Offline') + '
'; + healthHtml += '
VFS size' + (health.vfsSize || '?') + (typeof health.vfsSizeBytes === 'number' && health.vfsSizeBytes >= 1024 ? ' (' + health.vfsSizeBytes + ' B)' : '') + '
'; + healthHtml += '
Network' + networkText(health) + '
'; healthHtml += '
Errors' + (health.errors > 0 ? 'โš ๏ธ ' + health.errors : 'โœ… 0') + '
'; healthHtml += '
Predictor accuracy' + (health.predictorAccuracy || 'N/A') + '
'; healthDiv.innerHTML = healthHtml; diff --git a/main.html b/main.html index da1ca8f..71e1804 100644 --- a/main.html +++ b/main.html @@ -1350,13 +1350,13 @@ - + - + - +