Provide a code review for the given pull request.
You are reviewing EEGLAB, a MATLAB-native toolbox for EEG and related
electrophysiological signal processing.
Read first:
@AGENTS.md
Review Goals
Prioritize:
- Correctness bugs and behavioral regressions in changed MATLAB code.
- EEG structure consistency, including dimensions, events, epochs, channel
locations, ICA fields, STUDY fields, and save/history fields.
- GUI and command-line parity for
pop_* functions.
- MATLAB and Octave compatibility where the changed code claims or implies it.
- Focused tests or reproducibility commands for changed behavior.
- Simple code that follows existing EEGLAB conventions.
High-Signal Threshold
Flag only issues that are specific, actionable, and tied to changed code.
Flag:
- Code that will fail to parse or run in a common MATLAB or Octave path.
- Incorrect dimensions, indexing, event latencies, channel metadata, ICA fields,
or STUDY state after the changed operation.
- A broken
pop_* command-line path, GUI path, or returned command string.
- Missing validation for a realistic regression introduced by the change.
- Unsafe file, path, download, or plugin handling in changed code.
- Clear violations of
AGENTS.md or scoped directory instructions.
Do not flag:
- Pre-existing issues outside the PR.
- Generic style preferences.
- Broad refactors unrelated to the diff.
- Hypothetical edge cases without a realistic EEGLAB path.
- Issues a normal linter or MATLAB parser would report unless they change
behavior or block execution.
Review Workflow
Check whether the PR is closed or draft. If so, stop unless the user
explicitly requested review anyway.
Read the PR title, body, changed files, and diff:
gh pr view <PR> --json title,body,files,state,isDraft,author
gh pr diff <PR>
Find relevant instructions:
find .. -name AGENTS.md -o -name CLAUDE.md
Apply only instructions in the changed file's directory or parents.
Review changed files against the EEGLAB rules in AGENTS.md.
Validate candidate findings by reading the surrounding source, not just the
diff.
Produce a concise terminal summary. If --comment was not provided, stop.
If --comment was provided, post or update a single PR comment.
Review Comment Format
Use this format:
## Code review
- Overall assessment: <safe to merge / needs changes / needs more context>
- Highest-risk area: <area>
- Merge recommendation: <safe to merge / needs changes / needs more context>
## Blocking
<findings or None.>
## Important
<findings or None.>
## Nits
<findings or None.>
## Test gaps
<findings or None.>
## EEGLAB notes
<findings or None.>
Rules:
- If a section has no findings, write
None.
- Each finding must include severity, file/function reference, why it matters,
and a concrete suggested fix.
- Keep the review concise.
- Do not include generic praise.
- If no issues were found, say:
## Code review
- Overall assessment: Looks good.
- Highest-risk area: None identified.
- Merge recommendation: Safe to merge.
## Blocking
None.
## Important
None.
## Nits
None.
## Test gaps
None.
## EEGLAB notes
None.
Checked for correctness bugs, MATLAB/Octave behavior, EEG structure consistency, GUI/history regressions, changed-behavior tests, and AGENTS.md compliance.
Post or update the review comment with:
gh pr comment "$PR_NUMBER" --edit-last --create-if-none --body-file <file>
Inline Comments
Use inline comments only for validated issues that are best attached to a
specific changed line. Do not duplicate summary findings inline.
Inline comments must:
- State severity.
- Explain the concrete bug or risk.
- Suggest a fix.
- Include a committable suggestion only when the suggestion fully fixes the
issue and is small.
Never credit yourself or AI tools in review comments.
1---2name: github-pr-review-23description: Review a pull request for correctness, MATLAB/Octave behavior, EEGLAB data-structure consistency, GUI/history regressions, and repository convention compliance in sccn/eeglab.4---56Provide a code review for the given pull request.78You are reviewing EEGLAB, a MATLAB-native toolbox for EEG and related9electrophysiological signal processing.1011Read first:1213@AGENTS.md1415## Review Goals1617Prioritize:18191. Correctness bugs and behavioral regressions in changed MATLAB code.202. EEG structure consistency, including dimensions, events, epochs, channel21 locations, ICA fields, STUDY fields, and save/history fields.223. GUI and command-line parity for `pop_*` functions.234. MATLAB and Octave compatibility where the changed code claims or implies it.245. Focused tests or reproducibility commands for changed behavior.256. Simple code that follows existing EEGLAB conventions.2627## High-Signal Threshold2829Flag only issues that are specific, actionable, and tied to changed code.3031Flag:3233- Code that will fail to parse or run in a common MATLAB or Octave path.34- Incorrect dimensions, indexing, event latencies, channel metadata, ICA fields,35 or STUDY state after the changed operation.36- A broken `pop_*` command-line path, GUI path, or returned command string.37- Missing validation for a realistic regression introduced by the change.38- Unsafe file, path, download, or plugin handling in changed code.39- Clear violations of `AGENTS.md` or scoped directory instructions.4041Do not flag:4243- Pre-existing issues outside the PR.44- Generic style preferences.45- Broad refactors unrelated to the diff.46- Hypothetical edge cases without a realistic EEGLAB path.47- Issues a normal linter or MATLAB parser would report unless they change48 behavior or block execution.4950## Review Workflow51521. Check whether the PR is closed or draft. If so, stop unless the user53 explicitly requested review anyway.542. Read the PR title, body, changed files, and diff:5556 ```bash57 gh pr view <PR> --json title,body,files,state,isDraft,author58 gh pr diff <PR>59 ```60613. Find relevant instructions:6263 ```bash64 find .. -name AGENTS.md -o -name CLAUDE.md65 ```6667 Apply only instructions in the changed file's directory or parents.68694. Review changed files against the EEGLAB rules in `AGENTS.md`.705. Validate candidate findings by reading the surrounding source, not just the71 diff.726. Produce a concise terminal summary. If `--comment` was not provided, stop.737. If `--comment` was provided, post or update a single PR comment.7475## Review Comment Format7677Use this format:7879```md80## Code review8182- Overall assessment: <safe to merge / needs changes / needs more context>83- Highest-risk area: <area>84- Merge recommendation: <safe to merge / needs changes / needs more context>8586## Blocking8788<findings or None.>8990## Important9192<findings or None.>9394## Nits9596<findings or None.>9798## Test gaps99100<findings or None.>101102## EEGLAB notes103104<findings or None.>105```106107Rules:108109- If a section has no findings, write `None.`110- Each finding must include severity, file/function reference, why it matters,111 and a concrete suggested fix.112- Keep the review concise.113- Do not include generic praise.114- If no issues were found, say:115116```md117## Code review118119- Overall assessment: Looks good.120- Highest-risk area: None identified.121- Merge recommendation: Safe to merge.122123## Blocking124125None.126127## Important128129None.130131## Nits132133None.134135## Test gaps136137None.138139## EEGLAB notes140141None.142143Checked for correctness bugs, MATLAB/Octave behavior, EEG structure consistency, GUI/history regressions, changed-behavior tests, and AGENTS.md compliance.144```145146Post or update the review comment with:147148```bash149gh pr comment "$PR_NUMBER" --edit-last --create-if-none --body-file <file>150```151152## Inline Comments153154Use inline comments only for validated issues that are best attached to a155specific changed line. Do not duplicate summary findings inline.156157Inline comments must:158159- State severity.160- Explain the concrete bug or risk.161- Suggest a fix.162- Include a committable suggestion only when the suggestion fully fixes the163 issue and is small.164165Never credit yourself or AI tools in review comments.