GENERATED VIEW · PRIVATE ARCHIVE · DO NOT SERVE
RobCo Industries · Archive Museum

AUDIT_U8_readability.md



RELEASE

planning/2.8.5/audits/AUDIT_U8_readability.md

sha256 c244c30a60f32989 · 8235 bytes · original held in the private archive

# AUDIT — 2.8.5 U-A6 Readability Pass (`97188ee` vs `f37c44e`) **Independent auditor, Protocol 8 stage 3. Read-only. Formed from the diff, not the implementer's narration.** ## VERDICT: ACCEPT The comments-only claim is **TRUE**, verified with my own parse-based tooling (not the implementer's). The one code change (`owner:` strings) is genuinely inert. The gate was **not** weakened. **No factually-wrong comments found** across a broad sample; the new headers are accurate and document WHY. Both reported bugs are real. Zero executable code removed. --- ## 1. Central claim — "38 of 39 files: every changed line a pure comment/blank" — VERIFIED TRUE **My own tool (did NOT reuse theirs):** `acorn.tokenizer` for JS (comments are never emitted as tokens; regex literals and template literals are whole tokens, so a comment injected *inside* one would change the stream) + `postcss` parse→`walkComments().remove()`→normalized-stringify for CSS. Both are real parsers — structurally immune to the regex-literal / template-string / `//`-in-string bug class the implementer hit with their first regex tool. **Soundness proof of my own tool:** it flagged *exactly* the two real non-comment changes — the single `owner:` string token in `state.js` (buried among 31 changed lines) and the `CACHE_NAME` string in `sw.js` — while classifying all 40 other JS/CSS files as byte-identical. A tool that skipped content could not pinpoint a lone string-value token. Result across all 41 touched JS/CSS files: - **12/12 CSS files:** non-comment content byte-identical. ✓ - **28/29 JS files:** acorn token stream byte-identical. ✓ - **`js/core/state.js`:** the ONLY JS file with a non-comment change — exactly **3** `owner:` string values (`robco_cargo_drawer`, `robco_faction_channel`, `robco_databank_qdrawer`) repointed from `'ui-render.js'` to their post-split sibling filenames. Matches the claim exactly; nothing else. - **`sw.js`:** `-r9`→`-r10` cache bump only — required by Protocol 1 for a served-file commit. Expected. - **`CHANGELOG.md`:** cache-rev header sync + one honest `[Unreleased]` entry. Docs. The "38 of 39" denominator is loose (git shows 43 files; 41 are source), but the **substance is fully validated**: every non-comment byte in the entire commit is one of {3 inert owner strings, 1 required cache bump, 1 doc entry}. **Severity: n/a — claim holds.** ## 2. Is `owner:` genuinely never read? — YES, CONFIRMED (not a behavior change) - `grep '\.owner'` across `js/ index.html tests/ scripts/` → **zero** property reads. Every textual "owner" hit is the English word inside comments. - `MetaStore` (the sole `META_MANIFEST` consumer, `state.js:129`) reads only `META_MANIFEST[k].family` and `Object.keys(META_MANIFEST)`. The `type`/`default`/`owner` fields are pure documentation. - Some tests *do* assert `owner:` values — but only for *other* keys (`robco_input_mode`→`state.js`, `robco_bay_opened`→`ui-core.js`, etc.). `grep 'owner.*ui-render' tests/` → **empty**. No test observes any of the three changed values. **This is a documentation-field correction with provably zero runtime effect. Not a smuggled behavior change. NOT a blocker.** ## 3. Was the gate weakened for the 95.1/95.9 fix? — NO **Neither test runner is in the diff.** `git diff --name-only` contains no `tests/` file (the two name-matches are `test-console.js` and `diagnostic-shell.css` — both product source). Suite 95.1's `{0,400}` window and 95.9's `bi + 800` window are **unchanged**. The gate could only have been satisfied by moving the comment in source — which is what happened: in `ui-core.js:1040-1055` the explanatory block sits *above* the `addEventListener('beforeunload'…)` registration (outside the scanned window), and the guard `if (window._contextSwitching || window._loadingSave) return;` (line 1049) still precedes the `robco_v8` write (line 1054). Guard intact, test un-loosened. **Severity: n/a — the most dangerous possible shape for this commit did NOT occur.** ## 4. Comment quality & factual accuracy — HIGH; no wrong comments found Sampled headers checked line-by-line against code: - **`cloud.js`:** "the ONE ES module" → exactly **1** `type="module"` in index.html, and it's cloud.js. ✓ All **22** EXPOSES entries verified as real `window.*` attachments. ✓ **Proactively documents the `pushToCloud`/`pullFromCloud` incident** (Protocol 45) — actively corrects the exact drift class the guard exists for. Exemplary. - **`api.js`:** all 6 named exports exist (`transmitMessage`, `fetchAuthorizedModels`, `saveApiKeySilent`, `_resetTransmitUI`, `_commGet`, `window._invalidateCommCache`). ✓ Load-order GOTCHA (api* siblings load after this file, before cloud.js) matches index.html slots 4328–4336. ✓ - **`runtime.js`:** new LOAD-ORDER note "after ocr.js, before ui-core.js" → confirmed (slots 4315/4316/4317). ✓ All 8 `AmbientRuntime` methods + `initAmbientRuntime` in EXPOSES exist verbatim (`runtime.js:288-321`). ✓ - **`ui-render-databank.js` / `ui-core.js`:** function inventories and the TTK math banner match the code. ✓ - **CSS banners:** "05-base first … 99-mobile last", "12 files", cascade-order-is-semantics rationale → all correct against index.html slots 33–44. The WHY (flat numeric naming keeps cascade order visible) is real signal, not filler. Every header documents WHY / scoping / load-order dependencies rather than narrating WHAT. GOTCHAs are real traps (forward-reference safety, ES-module scoping, boot-order load-bearing pairs). **I found no factually-wrong comment.** **Severity: n/a — this is the unit delivering its intended value.** ## 5. Dead code — zero executable removals — CONFIRMED My acorn token-stream comparison proves no JS token was removed from any file (all 28 non-state files identical; state.js differs only by the owner tokens). Any deletions in the commit were comment-only. Matches the "deleted ZERO code" claim. **Severity: n/a.** ## 6. The two reported bugs — BOTH REAL ### 6a. `state.equipped` dangling reference on inventory removal — REAL, LOW severity (NOTE) `delItem()` (`ui-render-inventory.js:60`) and `adjItemQty()`'s zero-quantity branch (line 76) `splice()` the item out but never clear `state.equipped[slot]` when the removed item was the equipped one. Because `equipped` stores a **name string** (not an index or object), this is a **stale-display** bug — the EQUIPPED readout keeps showing an item you no longer carry — **not a crash and not data loss**. Live, user-reachable, but cosmetic. Correctly reported, correctly not fixed here (a fix needs a Protocol 13 regression test — out of scope for a comments pass). ### 6b. Hardcoded FO3 companion names in the Karma Center — REAL, LATENT (NOTE) `renderKarmaCenter()` (`ui-render-factions.js:247-252`) hardcodes `Dogmeat, Fawkes, Star Paladin Cross` / `Clover, Jericho` / `Charon, Sergeant RL-3`, plus the `ENCLAVE HIT SQUAD` label and karma thresholds. The panel's *visibility* is gated on `_activeDef().usesKarmaCenter` (a game-def flag — Protocol 38-clean), and FO3 is the only karma game today, so **the displayed content is currently correct**. It is a **latent** Protocol 38 violation: adding a second karma-using game would surface FO3's companions for it. Real, but not a live bug. Accurately characterized. ## 7. Trivial note (no action needed) `api.js` header says the family "loads … right before cloud.js"; strictly, `api-router.js` is immediately before cloud.js and `api.js` has three siblings between it and cloud.js. The same sentence clarifies the siblings load after api.js, so read in full it is not wrong — just slightly loose. Not worth a change. --- ## Bottom line A disciplined, honest comments-only commit. The one code touch is a provably-inert documentation field; the gate-break was fixed by relocating a comment, not by weakening a test; the new documentation is accurate where it is checkable and adds real WHY signal. Two pre-existing bugs were surfaced and reported truthfully with correct severity. **ACCEPT** — the two NOTE-level bugs are pre-existing and out of scope; queue them as their own future units (each needs a fix + regression test).
STAMP · generated for RELEASE v2.8.5 commit 06e5180 (06e51801b38a) · archive input-tree hash c07fbfbdd2e1ddeb · 754 files · no wall-clock timestamp (regenerates identically when nothing changed).