You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make history script workspace synchronization atomic #180
🤖 GUI Run script passes only a partial workspace into pop_runscript and copies fields back manually. ALLCOM, LASTCOM, and CURRENTSTUDY are outside the transaction, so scripts can leave GUI and console state inconsistent.
_run_script builds a partial namespace (EEG, ALLEEG, CURRENTSET, STUDY) — missing ALLCOM, LASTCOM, CURRENTSTUDY — and then writes results back with direct attribute assignment rather than through session helpers, so a script that sets CURRENTSET = 2 does not refresh EEG from ALLEEG and a script that sets STUDY = ... does not update CURRENTSTUDY. The console workspace (EEGPrepConsoleWorkspace.after_execute) already routes the same fields through session.retrieve / store_current / set_study / add_history for the matching WORKSPACE_NAMES tuple.
Expand the script namespace to all seven WORKSPACE_NAMES and replace the direct-assign copy-back with a small helper that mirrors the console sync rules: session.ALLEEG accepts the list, a changed CURRENTSET goes through session.retrieve (so EEG follows), a rebound EEG goes through session.store_current, STUDY goes through session.set_study (so CURRENTSTUDY follows), and any new ALLCOM / LASTCOM entries go through session.add_history before the final pop_runscript LASTCOM is appended. Add tests/test_gui_main_window.py coverage that exercises each of EEG, ALLEEG, CURRENTSET, STUDY, CURRENTSTUDY, LASTCOM, ALLCOM in one script call.
Status
PR #188 opened. All target tests pass locally; monitoring CI.
Activity
claude commentedon Jun 10, 2026
🤖 Plan:
Research
_run_scriptbuilds a partial namespace (EEG,ALLEEG,CURRENTSET,STUDY) — missingALLCOM,LASTCOM,CURRENTSTUDY— and then writes results back with direct attribute assignment rather than through session helpers, so a script that setsCURRENTSET = 2does not refreshEEGfromALLEEGand a script that setsSTUDY = ...does not updateCURRENTSTUDY. The console workspace (EEGPrepConsoleWorkspace.after_execute) already routes the same fields throughsession.retrieve/store_current/set_study/add_historyfor the matchingWORKSPACE_NAMEStuple.Relevant code
src/eegprep/functions/guifunc/menu_actions.py#L889-L914— partial namespace + manual copy-backsrc/eegprep/functions/popfunc/pop_runscript.py#L11-L25—execagainst the namespace dictsrc/eegprep/functions/adminfunc/console.py#L26—WORKSPACE_NAMEScanonical listsrc/eegprep/functions/adminfunc/console.py#L335-L397— session-owned sync path used by the consolesrc/eegprep/functions/guifunc/session.py#L174-L287—store_current/retrieve/set_study/add_historyProposed Fix
Expand the script namespace to all seven
WORKSPACE_NAMESand replace the direct-assign copy-back with a small helper that mirrors the console sync rules:session.ALLEEGaccepts the list, a changedCURRENTSETgoes throughsession.retrieve(soEEGfollows), a reboundEEGgoes throughsession.store_current,STUDYgoes throughsession.set_study(soCURRENTSTUDYfollows), and any newALLCOM/LASTCOMentries go throughsession.add_historybefore the finalpop_runscriptLASTCOM is appended. Addtests/test_gui_main_window.pycoverage that exercises each of EEG, ALLEEG, CURRENTSET, STUDY, CURRENTSTUDY, LASTCOM, ALLCOM in one script call.Status
PR #188 opened. All target tests pass locally; monitoring CI.