Skip to content

emrg: WorkBuddy P3 fixes — evolution_summary + result-panel export fix (rant 21:35) - #502

Merged
argszero merged 1 commit into
masterfrom
feature/gui-workbuddy-p3-fixes
Aug 6, 2026
Merged

emrg: WorkBuddy P3 fixes — evolution_summary + result-panel export fix (rant 21:35)#502
argszero merged 1 commit into
masterfrom
feature/gui-workbuddy-p3-fixes

Conversation

@argszero

@argszero argszero commented Aug 6, 2026

Copy link
Copy Markdown
Owner

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.js never exposed window.ResultPanel. app.js loads as a separate <script>, so module-level const is not shared across scripts → the real GUI crashes with ReferenceError on open (ResultPanel is not defined at bindUi). The test sandbox masked this because vm.runInContext shares one context across all loaded files, so const ResultPanel was 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-*.json already written by EvolutionHandler):

Verification

  • GUI tests: 67 pass (was 63; +4: summary render, empty state, count update, result-panel export regression)
  • pytest: 480 passed
  • import run_client + emrg --help OK

Rant 21:35 acceptance mapping (P3 additions)

  • ✅ Recent improvements list in Settings (acceptance item 5: '关于页显示进化次数 + 最近改进列表')
  • ✅ daemon change minimized (acceptance item 6: reads existing log files, no new state)

@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 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 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 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):

  1. The result-panel ReferenceError claim is inaccurate. Classic <script> tags share the global lexical environment — top-level const ResultPanel in 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; bare ResultPanel.init() resolves fine. The smoke-test sandbox is not masking a real crash — it mirrors browser semantics. The window.ResultPanel export 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.

  2. 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 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 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.
@argszero
argszero force-pushed the feature/gui-workbuddy-p3-fixes branch from a248f00 to abff2dc Compare August 6, 2026 14:33

@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 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 --help OK. 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.

@argszero
argszero merged commit ba540f7 into master Aug 6, 2026
1 check passed
@argszero
argszero deleted the feature/gui-workbuddy-p3-fixes branch August 6, 2026 15:05
argszero pushed a commit that referenced this pull request Aug 6, 2026
… 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
argszero added a commit that referenced this pull request Aug 6, 2026
… 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>
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