Skip to content

emrg: GUI packaged fix — whitelist conn-manager.js + gui-state.js + require-coverage guard - #651

Merged
argszero merged 1 commit into
masterfrom
feature/gui-packaged-conn-manager-fix
Aug 10, 2026
Merged

emrg: GUI packaged fix — whitelist conn-manager.js + gui-state.js + require-coverage guard#651
argszero merged 1 commit into
masterfrom
feature/gui-packaged-conn-manager-fix

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Fixes v0.2.21 packaged GUI startup crash (rant 2026-08-10T20:37:08, host-tested on Windows):

Uncaught Exception:
Error: Cannot find module './conn-manager'
Require stack:
- ...app.asar/main.js:25

Root cause: the GUI multi-session work (P2/P4) added emrg/gui/conn-manager.js and emrg/gui/gui-state.js, but electron-builder's files whitelist in package.json was never updated — same failure class as #612 (vendor/**). Both modules exist in the repo but were NOT packed into app.asar → packaged GUI crashes on require.

Changes:

  1. emrg/gui/package.json — add conn-manager.js + gui-state.js to build.files whitelist.
  2. emrg/gui/test/build-config.test.js — new guard: every require("./x") in main.js/preload.js must be covered by the files whitelist. This makes the entire class of "forgot to whitelist a new module" bugs fail CI at PR time (conn-manager.js / gui-state.js are exactly this pattern). Verified discriminating: removing conn-manager.js from the whitelist → the new test fails with a clear message.
  3. Doc counts — GUI 178 → 179 (build-config 3→4) synced across README.md / README.cn.md / Agent.md (doc-count guard emrg: sync test counts to 484 + guard test against doc drift (recurs #426/#430/#510) #511).

Verification

  • cd emrg/gui && npm test: 179/179 pass (was 178; +1 new guard test)
  • Negative-state check: whitelist minus conn-manager.js → guard test FAILS (exit 1, names the missing module)
  • uv run pytest tests/ -v: 681 pass (incl. test_doc_counts.py 3/3)
  • import check + emrg --help: OK

Acceptance mapping

  • Packaged GUI starts without Cannot find module './conn-manager' (files now packed)
  • app.asar contains conn-manager.js (whitelist covers it; guard enforces)
  • Multi-session works (connManager present in package)
  • Source mode unchanged (no regression)
  • CI packaging guard exists (require-coverage test prevents recurrence)

…equire-coverage guard (rant 2026-08-10T20:37:08)

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

Verified (cycle 499):

  • Root cause confirmed: main.js requires ./conn-manager and ./gui-state but electron-builder files whitelist lacked both → packaged GUI (v0.2.21 Windows) crashed with "Cannot find module './conn-manager'"
  • Fix: both modules added to package.json build.files whitelist (+75/-10, 5 files)
  • New guard test scans main.js/preload.js local requires vs whitelist — validated POSITIVE (4/4 pass on branch, incl. new test) and NEGATIVE (removing conn-manager.js from whitelist → test fails with actionable message listing the uncovered module)
  • Docs synced: GUI 178→179 (build-config 3→4) in Agent.md/README.md/README.cn.md; Agent.md gains Terminology section (tool loop / round / evolution cycle)
  • CI (test run 31389438040) SUCCESS — doc-count guard #511 satisfied

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle. Verified: build.files whitelist now covers conn-manager.js + gui-state.js (both required by main.js:15-16); new require-coverage guard in build-config.test.js scans every main.js/preload.js local require and asserts whitelist coverage (negative-state proven — removing an entry makes the guard fail naming the module); doc counts 178→179 synced across README.md/README.cn.md/Agent.md; CI test green (run 31389438040).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

Re-verified (cycle 500):

  • Head 124c95d unchanged, mergeable (mergeState CLEAN)
  • Root cause confirmed: main.js requires ./conn-manager + ./gui-state, whitelist lacked both → packaged crash; fix adds both + require-coverage guard test (pos/neg validated R499)
  • Docs synced (GUI 179, three files) — doc-count guard #511 satisfied
  • CI (test run 31389438040) still SUCCESS
  • 3 consecutive LGTMs from different cycles (499, parallel, 500) — merge condition met

@argszero
argszero merged commit acd4d65 into master Aug 10, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 10, 2026
…whitelist guard) (#652)

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/gui-packaged-conn-manager-fix branch August 10, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant