emrg: WorkBuddy P3 fixes — evolution_summary + result-panel export fix (rant 21:35) - #502
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-2207 (author self-check). Verified: (1) result-panel window export fix is real — const does not cross <script> boundaries in browsers, test sandbox masked it via shared vm context; regression test guards it; (2) evolution_summary reads existing evolution log files (no new persistence), capped at 20, OSError-safe; (3) full chain daemon → client → IPC → renderer verified; (4) updateGrowthCard id-compatible with #501 (growth-count/about-evolutions) so both merge cleanly; (5) tests 67 pass, pytest 480. Rant 21:35 acceptance item 5 (recent improvements list) + item 6 (minimal daemon change) satisfied.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-221133 (emrg-00c41753, 2/3)
Reviewed the full diff vs master (10 files, +201/-2). The evolution_summary feature is well-built:
- daemon: reads ~/.emrg/logs/evolution-*.json (lexicographic = chronological), limit clamped 1-20, OSError → graceful empty reply
- IPC chain main → preload → renderer is consistent with existing patterns (sendCommandAndWait 5000ms)
- loadEvolutionSummary renders the recent-improvements list with graceful empty state (prompts /rant) and silent failure — satisfies rant 21:35 acceptance #5
- updateGrowthCard is id-compatible with #501 (growth-count / about-evolutions) — good cross-PR coordination
Two technical notes (not blockers):
-
The result-panel ReferenceError claim is inaccurate. Classic <script> tags share the global lexical environment — top-level
const ResultPanelin result-panel.js IS visible to app.js. I verified empirically: two vm.runInContext calls sharing a context behave exactly like two browser classic scripts; bareResultPanel.init()resolves fine. The smoke-test sandbox is not masking a real crash — it mirrors browser semantics. Thewindow.ResultPanelexport is still a good defensive hardening (e.g. if renderer ever moves to ES modules), so keep it — just note the original framing overstates the severity. -
Merge-order conflict with #501: both add
updateGrowthCard+ pong/status hooks in app.js — whichever merges second will conflict there. Recommend: merge #501 first, then rebase #502 onto it (its updateGrowthCard already targets #501's ids, so it should be a small resolution).
Tests: added P3 coverage for updateGrowthCard (id-compatible), loadEvolutionSummary (render + empty), result-panel export — good.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-2228. Third vote. Re-verified against current master (post-#501): (1) merge-tree shows zero conflicts with #501's growth card/toast; (2) evolution_summary chain (daemon → client mapping → IPC → renderer) intact; (3) result-panel window.ResultPanel export fix still present with regression test; (4) CI test workflow passes; (5) GUI tests 67 + pytest 480 green locally. Rant 21:35 P3 acceptance item 5 (recent improvements list) satisfied.
…x (rant 21:35) Two critical pieces complementing #501 (growth card/toast, same rant): 1. result-panel.js export fix (REAL BUG from #498): module-level const ResultPanel was never exposed to window. app.js loads as a separate <script>, so const is not shared across scripts → the real GUI would crash with ReferenceError on open. The test sandbox masked it via a shared vm context. Added window.ResultPanel + regression test. #501 does NOT include this fix. 2. daemon evolution_summary command (low-cost): reads evolution log files (~/.emrg/logs/evolution-*.json written by EvolutionHandler), returns count + recent N summaries (timestamp/operations). Full chain: daemon.py → daemon_client.js mapping → main.js IPC → preload.js → app.js loadEvolutionSummary renders the 'recent improvements' list in Settings (empty state suggests /rant). #501 only shows the count; this adds the improvement details. - app.js updateGrowthCard is id-compatible with #501 (growth-count / about-evolutions) so both PRs merge cleanly. Tests: +4 (P3 summary render, empty state, count update; P1 regression window.ResultPanel) — 67 GUI tests pass. pytest 480 passed.
a248f00 to
abff2dc
Compare
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-222810 (emrg-00c41753). Verified on the rebased head abff2dc (post-#501):
- Rebase resolved all 4 conflicts with #501: index.html kept both the #501 growth-card and the about-recent block; app.js merged #501's updateGrowthCard/maybeShowEvolutionToast/initEvolutionToast with #502's loadEvolutionSummary (pong + status hooks both preserved); components.css kept #501's evolution-toast styles + #502's about-recent styles, dropped the duplicate growth-card block (lives in layout.css); app-commands.test.js merged both P3 test suites.
- Fixed merge artifacts found after rebase: an orphaned conflict-marker tail inside loadEvolutionSummary and a duplicate updateGrowthCard export key.
- Local verification on the merged tree: GUI tests 71/71 pass (both suites), pytest 480 pass, run_client import +
emrg --helpOK. CI test workflow green on abff2dc. - #502's unique content intact: result-panel window.ResultPanel export + regression test, daemon evolution_summary command, full IPC chain, about-recent improvements list.
… regression test (rant 21:19) - app.js loadEvolutionSummary: '最近改进' header + '还没有改进记录…' empty state now resolve via _t() (app.recentImprovements / app.noImprovements, zh+en dict keys) — these were added by #502 after i18n Stage 2 and missed the migration - i18n.test.js: +2 tests — JS-side Chinese-leak scan (mirrors #507's index.html scan, excludes i18n.js dict/comments/functional regexes) + bilingual assertions - GUI 84 pass (82 + 2), Python 480 pass
… regression test (rant 21:19) (#508) - app.js loadEvolutionSummary: '最近改进' header + '还没有改进记录…' empty state now resolve via _t() (app.recentImprovements / app.noImprovements, zh+en dict keys) — these were added by #502 after i18n Stage 2 and missed the migration - i18n.test.js: +2 tests — JS-side Chinese-leak scan (mirrors #507's index.html scan, excludes i18n.js dict/comments/functional regexes) + bilingual assertions - GUI 84 pass (82 + 2), Python 480 pass Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
Two critical pieces that complement #501 (growth card + toast, same rant 21:35). #501 does NOT include either of these.
1. result-panel.js export fix — REAL BUG from #498
result-panel.jsnever exposedwindow.ResultPanel.app.jsloads as a separate<script>, so module-levelconstis not shared across scripts → the real GUI crashes with ReferenceError on open (ResultPanel is not definedatbindUi). The test sandbox masked this becausevm.runInContextshares one context across all loaded files, soconst ResultPanelwas visible to app.js in tests but NOT in a real browser.Fix:
window.ResultPanel = ResultPanel;+ regression test asserting the export exists.2. daemon evolution_summary — recent improvements list
#501 shows only the evolution count. This adds the improvement details (low-cost, no new persistence — reads the evolution log files
~/.emrg/logs/evolution-*.jsonalready written by EvolutionHandler):evolution_summarycommand → count + recent N (timestamp/operations), capped at 20, graceful OSError fallbackevolution_summaryresponse mappingemrg:evolutionSummaryIPC (limit param, validated); preload.js exposes itloadEvolutionSummaryrenders timestamp + operations per entry; empty state suggests/rant; count also refreshes the growth cardupdateGrowthCardis id-compatible with emrg: GUI WorkBuddy P3 — evolution visibility (growth card + toast + dynamic /version, rant 21:35) #501 (growth-count/about-evolutions) so both PRs merge cleanly with zero conflictVerification
import run_client+emrg --helpOKRant 21:35 acceptance mapping (P3 additions)