Skip to content

OpenNeuro/BIDS dataset client + agent tools (discovery, metadata, files)#3

Merged
juniperbevensee merged 2 commits into
mainfrom
dev/juniperbevensee/matilde-openneuro
Jun 16, 2026
Merged

OpenNeuro/BIDS dataset client + agent tools (discovery, metadata, files)#3
juniperbevensee merged 2 commits into
mainfrom
dev/juniperbevensee/matilde-openneuro

Conversation

@juniperbevensee

Copy link
Copy Markdown
Collaborator

Matilde's first scientific-data capability — built from the adversarially-verified OpenNeuro research thread.

Scope: the realistic first capability

Read-only discovery → metadata → file listing/download, not heavy compute. Per the research, DataLad full-clones, fMRIPrep, and NiMARE meta-analysis are deferred to the Docker layer / aspirational.

What's here

  • engine/openneuro.py — stdlib-only client over the OpenNeuro GraphQL API + the public no-auth S3 mirror (no datalad/git-annex/openneuro-py/AWS SDK). get_dataset, list_datasets, list_files, download_file; injected I/O for offline tests. Schema validated live against ds000246.
  • Tools: matilde_openneuro_dataset_info, matilde_openneuro_search, matilde_openneuro_list_files.

Proven (live)

ds000246: 'MEG-BIDS Brainstorm data sample' — modalities ['meg','mri'], 1 subject(s), 2457671893 bytes (snapshot 1.0.1).

Tests

11 new offline + 3 live (MATILDE_LIVE=1). 74 offline total green. Sanitization gate clean. Also fixes a _tool_result envelope bug (dropped message on positional dict) caught by a live smoke.

🤖 Generated with Claude Code

juniperbevensee and others added 2 commits June 16, 2026 19:09
Matilde's first scientific-data capability — the realistic-first-capability the
research identified (discovery + metadata + files), not heavy compute.

- engine/openneuro.py: stdlib-only client over the OpenNeuro GraphQL API + public
  no-auth S3 mirror (no datalad/git-annex/openneuro-py/AWS SDK). get_dataset,
  list_datasets, list_files, download_file; injected I/O for offline tests.
  Schema validated live against ds000246.
- Tools: matilde_openneuro_dataset_info / _search / _list_files.
- Fix: _tool_result dropped the message kwarg when passed a positional dict
  (caught by a live smoke); dataset_info now merges message into the payload.
- 11 new offline tests + 3 live; 74 offline total green; gate clean.
- Heavy paths (DataLad clone, fMRIPrep, NiMARE) explicitly scoped to the Docker
  layer / aspirational, per the research.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The deterministic gate flags real-looking emails as PII; the placeholder
contact-email example in engine/cli.py now uses an allowlisted example domain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@juniperbevensee
juniperbevensee merged commit 83aa976 into main Jun 16, 2026
1 check failed
@juniperbevensee
juniperbevensee deleted the dev/juniperbevensee/matilde-openneuro branch June 16, 2026 07:11
juniperbevensee added a commit that referenced this pull request Jun 22, 2026
…phy study) (#11)

* feat(pipeline): stateful, resumable study store + runner (+ bibliography study)

Long analyses currently run inline in one agent turn — they die on OOM and lose
all state on container rebuild. This adds durable, checkpointed analysis state so
a study resumes from the last completed step instead of vanishing.

- engine/store.py: StudyStore (stdlib sqlite3, WAL, atomic). studies/steps/
  artifacts/findings tables; create/get/list studies, add_steps, step status +
  result, artifacts, findings, study_summary. Injected db path (MATILDE_STUDY_DB /
  HERMES_HOME / repo engagements dir). State survives a fresh StudyStore instance
  on the same file (the container-rebuild guarantee, under test).
- engine/pipeline.py: resumable runner. Step/StepContext/StepResult; run()/resume()
  skip done steps, persist result+artifacts+findings per step, stop on failure
  leaving the study blocked + resumable. Pure/injected.
- engine/bibliography_study.py: first concrete study (parse_refs -> verify_each ->
  summarize) reusing the citations/parsing engine, verifier injected. verify_each
  is mid-step resumable (skips refs that already have findings).
- tools.py / __init__.py: matilde_study_create/run/status/list, matching the
  existing tool-dict + thin-handler conventions.

Tests (TDD): store CRUD + status transitions + persistence across a new instance;
runner skip-done / stop-on-failure / resume-without-rerun; bibliography happy path
and fail-on-ref-#3-then-resume (refs 1-2 NOT re-verified); tool arg coercion +
output shape. Full suite: 123 passed, 6 skipped. Engine stays stdlib-only (no
mne/numpy) — the heavy MEG data-analysis study is a documented follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(pipeline): generalize motivation for public repo (drop dated incident specifics); note plan-evolution semantics

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Juniper Bevensee <juniperbevensee@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant