Repository navigation
test(biofeedback): golden egress replay fixture and alpha physiology check (ADR-011 PR 5) - #79
Merged
Merged
Conversation
aurascoper
force-pushed
the
feat/biofeedback-replay
branch
from
November 8, 2026 03:23
1d7e778 to
d5821b4
Compare
aurascoper
force-pushed
the
feat/biofeedback-wiring
branch
from
November 8, 2026 03:23
4726783 to
1431c45
Compare
…check (ADR-011 PR 5) GoldenEgressReplayTests replays Recordings/golden through PlaybackEEGStream (.normalized 256 Hz, instant), 2 s / 1 s windowing and BiofeedbackCoordinator with the per-channel Mind Monitor mirror and a fixed four-mapping set, then pins what came out: 303 windows, 77,966 samples, per-channel health tallies (TP9 263/40, AF7 283/20, AF8 276/27, TP10 280/23 healthy/saturated), three spot windows (RMS and alpha Bels), and every window's Bels, horseshoe, OSC and MIDI in Fixtures/golden_egress_v1.json compared with tolerances. The fixture holds derived values only; no raw EEG is written. MuseValidationAlphaTests reads each muse_validation_converted session's eeg.csv and segments.csv row for row (using whereSeparator: \.isNewline for CRLF compatibility) and windows each segment on its own, because the protocol's inter-segment pause would otherwise be interpolated by PlaybackEEGStream and misalign the labels. Statistic is the median window alpha Bels per segment. Asserts a doubling (log10 2) on TP9 and TP10 and less on AF7 and AF8 for alpha_pass: true sessions (014223, 015723), and that 013820 (alpha_pass: false) does not double on both posterior channels. Pins the measured median rises for the three sessions with sidecars and records all sessions in Fixtures/muse_validation_alpha_v1.json. Updates ADR-011 "Related implementation" and decision_registry.md entry 10 with the Principle 3 replay evidence. Refs: ADR-011, ADR-002, PRINCIPLES.md 3 and 7, decision_registry.md entry 10. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QapsKF5C619kjbak7vTmRK
aurascoper
force-pushed
the
feat/biofeedback-replay
branch
from
November 8, 2026 03:23
d5821b4 to
898cd74
Compare
Open
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacks on #78 (
feat/biofeedback-wiring,4726783) and closes Issue 6 (PR 5) from #76: deterministic golden-recording egress replay and eyes-closed vs eyes-open alpha physiology validation, including the committed JSON fixtures (golden_egress_v1.jsonandmuse_validation_alpha_v1.json).GoldenEgressReplayTests+Fixtures/golden_egress_v1.jsonRecordings/golden/golden_20260710-141352.eeg.csvthroughPlaybackEEGStream(.normalized(sampleRate: 256.0), pacing: .instant),EEGWindowing(windowSeconds: 2.0, strideSeconds: 1.0), andBiofeedbackCoordinatorwith the per-channelMindMonitorMirrorand a fixed 4-mapping set covering all fourHealthPolicycases (holdLast,decayToRest,mute,passthrough).303windows,77,966resampled samples (durationSeconds = 304.55078125), the four per-channel health tallies (TP9: 263/40,AF7: 283/20,AF8: 276/27,TP10: 280/23healthy/saturated), and three spot windows (0,151,302, where window302has horseshoe[1, 4, 1, 1]).bels,horseshoe,osc,midi) againstTests/BCIBiofeedbackTests/Fixtures/golden_egress_v1.json(198 KB, derived values only; zero raw EEG).MuseValidationAlphaTests+Fixtures/muse_validation_alpha_v1.jsonRecordings/muse_validation_converted/<name>/sessions (<name>.eeg.csvand<name>.segments.csvrow-for-row usingwhereSeparator: \.isNewlineso CRLF files fromcsv.writerparse cleanly) and windows each segment independently (512samples at256stride ->29windows per30 ssegment), avoiding interpolation across the inter-segment prompt discontinuity (abs(openClosedBoundaryGap) > 1.0 s).Tests/BCIBiofeedbackTests/Fixtures/muse_validation_alpha_v1.json):alpha_pass: truesessions double (>= log10(2) = 0.3010 Bels) on both posterior channels (TP9,TP10) and stay below< 0.3010 Belson both frontal channels (AF7,AF8):014223:TP9 +0.4615,TP10 +0.5651,AF7 -0.1228,AF8 +0.2033Bels015723:TP9 +0.4277,TP10 +0.3716,AF7 -0.1500,AF8 -0.1019Belsalpha_pass: falsesession (013820) fails as the expected negative (TP9 +0.0616,TP10 +0.2422,AF7 -0.1217,AF8 -0.0906Bels).Two Build/Runtime Nits Fixed on First Run
MuseValidationAlphaTests.readEEG/readSegments: changedtext.split(separator: "\n")totext.split(whereSeparator: \.isNewline)becauseconvert_muse_validation_recordings.pyuses Python'scsv.writer(\r\n), and Swift treats"\r\n"as a single extended grapheme cluster distinct from"\n".GoldenEgressReplayTests.spotPinsandMuseValidationAlphaTests.medianRisePins(plusabs(session.openClosedBoundaryGap) > 1.0for004345's-12.19 sring-buffer overlap) to matchBandPowerEstimator.swift's exact symmetric Hann (n - 1) and half-open[lowBin, highBin)bin summation.Verification
GoldenEgressReplayTests: PASS (2.193 s)MuseValidationAlphaTests: PASS (2.741 s)BCIBiofeedbackTeststotal: 71/71 passedScripts/check_adr_references.py: PASS (0 warnings)