emrg: GUI packaged fix — whitelist conn-manager.js + gui-state.js + require-coverage guard - #651
Merged
Merged
Conversation
…equire-coverage guard (rant 2026-08-10T20:37:08)
argszero
commented
Aug 10, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ 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
commented
Aug 10, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ 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
commented
Aug 10, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ 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
added a commit
that referenced
this pull request
Aug 10, 2026
…whitelist guard) (#652) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes v0.2.21 packaged GUI startup crash (rant 2026-08-10T20:37:08, host-tested on Windows):
Root cause: the GUI multi-session work (P2/P4) added
emrg/gui/conn-manager.jsandemrg/gui/gui-state.js, but electron-builder'sfileswhitelist inpackage.jsonwas 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:
emrg/gui/package.json— addconn-manager.js+gui-state.jstobuild.fileswhitelist.emrg/gui/test/build-config.test.js— new guard: everyrequire("./x")in main.js/preload.js must be covered by thefileswhitelist. 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: removingconn-manager.jsfrom the whitelist → the new test fails with a clear message.Verification
cd emrg/gui && npm test: 179/179 pass (was 178; +1 new guard test)uv run pytest tests/ -v: 681 pass (incl. test_doc_counts.py 3/3)emrg --help: OKAcceptance mapping
Cannot find module './conn-manager'(files now packed)