Repository navigation
Closed
Labels
phaseEpic implementation phase
Description
🤖 Phase issue for the EEGLAB completion epic.
Goal
Stabilize the shared foundations that other phases need before broad EEGLAB feature work proceeds in parallel: EEG dict contracts, session/workspace synchronization, history command conventions, menu/action inventory rules, placeholder exclusion policy, multi-dataset selection state contracts, and reusable parity/test scaffolding.
Target branch and PR flow
- Create the phase branch from
feature/eeglab-completion. - Open the phase PR back into
feature/eeglab-completion. - The phase PR should close this issue.
Parallelization
This phase should land before Phases 1b, 2, 3, and 4 start heavy implementation. Once merged, Phases 1b, 2, 3, and 4 can proceed in parallel against stable shared contracts. Phase 5 should also use these contracts before expanding STUDY workflows, including reading multi-dataset selection state.
In scope
- Define and document EEG dict field invariants needed across phases, including
event,urevent,epoch,history, ICA fields, channel locations, and 1-based user-facing indices versus Python internals. - Stabilize
EEGPrepSessionusage rules for GUI/menu actions andeegprep-consoleshared workspace behavior. - Define the multi-dataset selection state contract: shape, 1-based user-facing numbering, empty/single/multiple semantics, session propagation, console visibility, and how STUDY code should read it. Do not implement the user-facing selection mutator here.
- Define history command requirements:
return_com=True, valid Python console echoes, EEGLAB-style history where relevant, and no duplicate history entries. - Audit menu inventory and placeholder policy so later phases can distinguish implementable items from explicit EEGBrowser/external exclusions.
- Add or improve reusable test/parity scaffolding for sample_data workflows, MATLAB parity checks, visual parity inventory, multi-dataset selection contract checks, and console/GUI synchronization.
- Update docs or development notes that future phase agents must follow.
Out of scope
- Porting the actual File/Edit metadata features; that is Phase 1b.
- Implementing the GUI/menu mutator for multi-dataset selection; Phase 1a only defines and tests the shape/propagation contract so Phase 5 can design against it.
- Implementing filtering, ICA/rejection, plotting, or STUDY workflows; those are later phases.
- EEGBrowser/eegplot scrolling-browser workflows.
- Runtime dependence on
src/eegprep/eeglab.
Acceptance criteria
- Shared EEG/session/history/menu contracts are documented in code, tests, docs, issue notes, or AGENTS/skill guidance where appropriate.
- The multi-dataset selection contract is explicit and testable, including 1-based visible indices, internal representation, propagation through
EEGPrepSession, and read access for future STUDY workflows. - Existing implemented GUI/menu/console workflows still pass and conform to the shared contracts.
- Placeholder and exclusion policy is explicit enough that phase agents do not implement browser-only workflows accidentally.
- Reusable tests or helpers exist for sample_data loading, session/history synchronization, action inventory, multi-dataset selection contract behavior, and MATLAB parity scaffolding where appropriate.
- Required checks pass: focused tests for session/menu/history scaffolding,
uv run --no-sync ruff check .,uv run --no-sync ruff format --check .,uv run --no-sync ty check, and the non-slow pytest suite unless a documented external blocker exists.
/goal prompt
/goal Stabilize EEGPrep's shared EEGLAB-parity foundations so Phases 1b, 2, 3, 4, and Phase 5 design work can proceed in parallel: document and test EEG dict invariants, EEGPrepSession and eegprep-console synchronization, multi-dataset selection state shape and propagation rules, history command conventions, menu/action inventory rules, placeholder/exclusion policy, sample_data/MATLAB parity scaffolding, and GUI/console test helpers. Verify by running focused session/menu/history/selection-contract tests, ruff/format/ty, and the non-slow pytest suite, and do not port the actual File/Edit metadata features or the user-facing multi-dataset selection mutator in this phase.
Metadata
Metadata
Assignees
Labels
phaseEpic implementation phase
Activity
claude commentedon May 27, 2026
🤖 Analysis (not opening a PR — phase epic spans ~9 placeholder actions across
popfunc/,guifunc/,resources/help/, and tests; far above the 100-line single-PR threshold and should be split into per-function PRs targetingfeature/eeglab-completion).Scope inventory
Phase 1 Edit-menu actions currently routed to
show_coming_soonviamenu_actions.py#L144-L252and registered inmenu_placeholders.py#L9-L72:pop_editsetpop_editset.mpop_commentspop_comments.mpop_editeventfieldpop_editeventfield.mpop_editeventvalspop_editeventvals.mpop_selecteventpop_selectevent.mpop_chaneditpop_chanedit.mpop_copysetpop_copyset.mpop_mergesetpop_mergeset.mselect_multiple_datasetseeglab.mcb_selectstudy regionWiring already present in
eeglab_menu.py#L125-L142and#L336.pop_delset/pop_adjusteventsalready shipped;pop_select/pop_rmdatpartially implemented. EEGLAB sources are not vendored undersrc/eegprep/eeglab/in this checkout — implementers must pull from https://github.com/sccn/eeglab during the port.Infrastructure already in place
EEGPrepSession.store_current,add_history,notify_changed,delete_currentinadminfunc/console.py— new pop functions plug in via_run_pop_function(menu_actions.py#L226-L251) once added to the dispatch chain.<function_name>.mdundersrc/eegprep/resources/help/(currently haspop_reref.md,pop_select.md, etc.).PLACEHOLDER_ACTIONSinmenu_placeholders.pyand add a new branch indispatch()per action.feature/eeglab-completion(currently equal todevelop) — phase PRs target it per issue instructions.Proposed split (9 sub-PRs against
feature/eeglab-completion)Sequencing is chosen so dataset/channel metadata land before multi-dataset operations that read them, and event field shape stabilizes before event-based selection:
pop_comments— simplest, pure metadata string, good template PR.pop_editset— dataset-level metadata (setname,subject,condition,chanlocsref, etc.); careful witheeg_checksetinteractions.pop_editeventfield— add/rename/delete event struct fields; updatesureventcorrespondence.pop_editeventvals— per-row editor; useseeg_checkset('eventconsistency')already ineeg_checkset.py.pop_selectevent— event-based epoch/data selection; reusespop_select/pop_epochplumbing.pop_chanedit— largest single dialog; channel struct editor with import/export and centering; gates Phase 4 plotting.pop_copyset—EEGPrepSession.store_current(copy=True, ...); mostly session-layer.pop_mergeset— multi-dataset concatenation; needs boundary-event insertion andureventrecompute (see existingeeg_findboundaries.py).select_multiple_datasets+ Datasets menu multi-select state — surfaces session selection vector for downstream STUDY work.Each sub-PR must include: pop function in
functions/popfunc/pop_<name>.py, GUI dialog spec viainputgui,return_com=Truehistory string, Help Markdown, dispatch wiring + placeholder removal, console-flow test intests/test_console_workspace.py, sample_data unit test, MATLAB parity test where deterministic, and visual parity capture undertools/visual_parity/with side-by-side PR attachment.Open questions for a human before implementation
pop_mergesetaccept the multi-dataset selection state from item 9 as input, requiring item 9 to land first?pop_chaneditcoordinate transforms (cart/sph/topo round-trip) andpop_mergesetboundary-event semantics?feature/eeglab-completion, or land each sub-PR with its own non-slow + parity subset?No duplicate work detected —
gh pr list --search "phase 1"returns no open PRs.[-]Phase 1: File, dataset, event, and channel metadata parity[/-][+]Phase 1a: EEG/session/data contract foundation[/+]suraj-ranganath commentedon May 27, 2026
@claude I have split phase 1 into 2 phases now 1a and 1b so 1b can now happen in parallel with 2,3,4. Any comments on that? Dont start any implementation yet.
claude commentedon May 27, 2026
Claude finished @suraj-ranganath's task in 1m 57s —— View job
Comments on the 1a/1b split
The split is the right shape — 1a is now pure contract/scaffolding (docs, helpers, invariants, inventory), 1b is the actual File/Edit feature port. That cleanly separates "things every phase reads" from "things only one phase writes", which is what enables safe parallelism with 2/3/4. A few specific observations and asks before any implementation starts:
1. The split is sound, but parallelism with 2/3/4 only works if 1a freezes these seams
These are the shared surfaces where 1b directly touches data Phases 2/3/4 also write. If 1a leaves any of them ambiguous, the parallel phases will fight in the same dict fields:
event/ureventfield schemapop_editeventfield,pop_editeventvals,pop_selecteventeeg_eegrej, merge), Phase 3 rejection-mark conversionureventlinkage rule, boundary-event identitychanlocs/chaninfoschemapop_chaneditpop_copyset,pop_mergeset,select_multiple_datasetsALLEEG/CURRENTSTUDYpropagation)CURRENTSTUDY, boundary-event semantics on mergepop_chanedit(channel removal/reorder),pop_mergeset, event/selection editsicaact/icaweights/icasphere/icawinvget cleared (mirroreeg_checkset)If 1a ships these as a
tests/test_eeg_invariants.pythat runs againstsample_data, every later phase canpytest -k invariantsto prove it didn't break the contract.2. Two contract risks that look small but multiply across 4 parallel phases
return_com=True" is not enough — 1a should lock the string format (single line, valid Python expression, noEEG =prefix, exact argument-quoting rules,[]vsNonefor empty). Otherwise 1b ships 9 functions with slight variations and 2/3/4 mirror them, multiplying the cleanup. Recommend aassert_history_replayable(EEG, com)helper that the dispatcher tests pin to.menu_placeholders.pycurrently flags actions as placeholder vs not. For parallel work, the inventory needs why: phase target (1b/2/3/4), explicit EEGBrowser exclusion, or external-plugin exclusion. Without that, a 1b agent may legitimately delete a placeholder that Phase 2 still needs to dispatch through (e.g., event-related but called from filtering paths).3. Concrete deliverables I'd expect 1a to ship (so 1b/2/3/4 can actually parallelize)
AGENTS.md(ordocs/source/dev/contracts.md) and enforced bytests/test_eeg_invariants.pyagainstsample_data.tests/fixtures.pyor newtests/helpers/session_assertions.py:assert_history_replayable,assert_session_synced,assert_no_duplicate_history,fresh_session_with_sample().menu_placeholders.pyentries to carryphaseandexcluded_reasonfields; add atests/test_menu_inventory.pythat fails if an action is both implemented and still placeholder, or if an EEGBrowser-flagged action gets dispatched.eeglabcompat.py— takes(pop_func_name, eeglab_call, python_call, fields_to_compare, tolerances)and yields a parity test, instead of every phase hand-rolling the boilerplate.EEGPrepSessionper test (currently each test reloads ad-hoc, which makes session-sync tests flaky once multi-dataset state is in play).4. Cleanup items the rename surfaces
feature/eeglab-completion(my earlier recommendation, given >100-line threshold per action) or a single phase PR with all 9 actions? That sequencing matters because some actions (e.g.,pop_chaneditschema) feed Phase 4 — if 1b is one PR, Phase 4 has to wait for the whole thing; if it's 9 PRs, Phase 4 can branch off the momentpop_chaneditlands.5. One open question for the human
Should 1a's
EEGPrepSessionrules treat multi-dataset selection state (the vector Phase 1b'sselect_multiple_datasetsexposes) as part of the 1a contract, or defer it to 1b? Phase 5 (STUDY) reads it, so leaving it undefined until 1b means Phase 5 can't start its design work in parallel even after 1a merges. My recommendation: pull just the shape and propagation rule into 1a (no behavior), so Phase 5 can write tests against the contract while 1b implements the mutator.No implementation started, as requested.
EEGPrepSession,menu_placeholders.py, existing tests· branch
claude/issue-61-20260527-0114suraj-ranganath commentedon May 27, 2026
Accepted the above stated recommendation and included it in the scope for 1a.
suraj-ranganath commentedon May 27, 2026
Merged to the epic branch.