Skip to content

feat(meg): skeptical validation diagnostics + offline golden recipe (#14)#15

Merged
juniperbevensee merged 2 commits into
mainfrom
dev/juniperbevensee/smarter-validations-golden-recipe
Jun 22, 2026
Merged

feat(meg): skeptical validation diagnostics + offline golden recipe (#14)#15
juniperbevensee merged 2 commits into
mainfrom
dev/juniperbevensee/smarter-validations-golden-recipe

Conversation

@juniperbevensee

Copy link
Copy Markdown
Collaborator

Closes #14.

Two asks from the live M100 test, where a wrong measurement (15 ms artifact) was nearly accepted because the pipeline ran without error.

1. Make the study skeptical of its own measurements

validate_finding no longer reports a confident refuted drawn from a noise-dominated average. Below MIN_RELIABLE_EPOCHS (or with no measurable amplitude), an out-of-window peak is downgraded to inconclusive with a stated next_step — increase the sample / inspect the evoked — instead of being accepted. Findings now carry the material to sanity-check them: search_window_ms, channel, n_epochs, and a caveats list. (A strong out-of-window peak with enough epochs is still refuted — regression-tested.)

2. Ship an offline, self-demonstrating golden recipe

SyntheticMegIO + build_golden_steps() run the same five-step pipeline and verdict logic against a planted in-window M100 — no mne / numpy / network / download. Exposed as study kind golden_meg_validation (matilde_study_create kind="golden_meg_validation"matilde_study_run) so the agent can run it live as the reference for "what a correct validation looks like," and as an offline CI smoke/regression test. The same builder also demonstrates the skeptical-inconclusive path (peak_latency_ms=300, n_epochs<threshold). See docs/golden-validation-recipe.md.

3. Methodology, not just tooling

SOUL: a "be skeptical of your own measurements" principle. SKILL: a "Reasoning Over Datasets" section — a result contradicting a well-established finding (missing M100, implausible latency, near-noise amplitude, few epochs) is a red flag to inspect; prefer inconclusive + next step over a confident refuted; imitate the golden recipe.

Tests

Skepticism boundaries, diagnostics presence, golden recipe (supported / skeptical-inconclusive / no-heavy-deps), and the wired tool kind end-to-end. 143 passed, 7 skipped; changed code pyflakes-clean (one pre-existing unrelated warning at tools.py:86).

Deploy note

Plugin code + SOUL/SKILL. No image rebuild strictly required for the engine/tools (plugins are hot-mounted), but SOUL/SKILL changes reach a running agent only on its next reload/redeploy. Coordinate as usual — don't wipe in-progress work.

🤖 Generated with Claude Code

juniperbevensee and others added 2 commits June 23, 2026 11:18
)

Two layers on top of the M100 measurement fix (#13), prompted by the live
test where a wrong measurement was nearly accepted because the pipeline ran
without error.

1. Skepticism in the study itself. `validate_finding` now withholds a
   *confident* `refuted` drawn from a noise-dominated average: below
   MIN_RELIABLE_EPOCHS (or with no measurable amplitude) an out-of-window peak
   is downgraded to `inconclusive` with a stated `next_step`, never silently
   accepted. Findings carry the material to sanity-check them — search_window_ms,
   channel, n_epochs, and a caveats list — so the agent reasons over evidence,
   not a single number.

2. A shipped, offline golden recipe. SyntheticMegIO + build_golden_steps run
   the SAME five-step pipeline and verdict logic against a planted in-window
   M100 — no mne / numpy / network / download. Exposed as study kind
   'golden_meg_validation' so the agent can run it live as the self-
   demonstrating reference for "what correct looks like," and as an offline CI
   smoke/regression test. docs/golden-validation-recipe.md documents both the
   supported path and the skeptical-inconclusive path.

3. Methodology, not just tooling. SOUL gains a "be skeptical of your own
   measurements" principle; SKILL gains a "Reasoning Over Datasets" section:
   a result contradicting a well-established finding is a red flag to inspect,
   prefer inconclusive+next-step over a confident refuted on thin evidence,
   and imitate the golden recipe.

Tests: skepticism boundaries (few-epochs out-of-window -> inconclusive;
enough-epochs -> still refuted), diagnostics presence, golden recipe
supported/inconclusive/no-heavy-deps, and the wired tool kind end-to-end.
143 passed, 7 skipped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@juniperbevensee
juniperbevensee merged commit d3500df into main Jun 22, 2026
1 check passed
@juniperbevensee
juniperbevensee deleted the dev/juniperbevensee/smarter-validations-golden-recipe branch June 22, 2026 23:21
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.

Make study validations smarter + ship a small golden sample-dataset validation recipe

1 participant