Skip to content

[1/5] feat(neuroflow): session contract and Rust commands - #11

Closed
cdrake wants to merge 1 commit into
mainfrom
neuroflow/1-session-contract
Closed

cdrake wants to merge 1 commit into
mainfrom
neuroflow/1-session-contract

Conversation

@cdrake

@cdrake cdrake commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Part 1 of 5 of making BIDSvue a NeuroFlow ingest tool. A NeuroFlow runtime launches a tool with NEUROFLOW_SESSION set and a context.json there; when the step finishes the tool writes neuroflow.handoff.json in its output directory and appends a line to the session's provenance.jsonl.

This PR adds the plumbing only. Nothing calls it yet, so every launch behaves as before.

  • Rust commands (src-tauri/src/lib.rs): neuroflow_context, neuroflow_session_path, neuroflow_mint_path_token, neuroflow_write_handoff, neuroflow_append_provenance. Outside NeuroFlow the reads return null and the writes refuse.
  • $lib/neuroflow/contract: context parsing and the handoff and provenance record bodies, with no host dependency, plus unit tests.
  • $lib/neuroflow/session: typed wrappers over the commands.

Stack (merge in order; each PR is based on the one before):

  1. [1/5] feat(neuroflow): session contract and Rust commands #11 Session contract and Rust commands ← this PR
  2. [2/5] feat(neuroflow): place an import's BIDS root at a chosen path #12 Place an import's BIDS root at a chosen path
  3. [3/5] feat(neuroflow): run the ingest step when launched by NeuroFlow #13 Run the ingest step when launched by NeuroFlow
  4. [4/5] refactor(test): promote the node:fs adapters out of test-only files #14 Promote the node:fs adapters out of test-only files
  5. [5/5] feat(neuroflow): headless DICOM ingest CLI #15 Headless DICOM ingest CLI

Checks

  • bun test
  • bun run typecheck
  • bun run lint
  • cargo check (src-tauri)

🤖 Generated with Claude Code

BIDSvue can be launched by a NeuroFlow runtime as a workflow step. The
runtime sets NEUROFLOW_SESSION and writes context.json there; when the step
finishes the tool writes neuroflow.handoff.json in its output directory and
appends a line to the session's provenance.jsonl.

This adds the plumbing only; nothing calls it yet, so every normal launch is
unchanged.

- Rust commands: neuroflow_context, neuroflow_session_path,
  neuroflow_mint_path_token, neuroflow_write_handoff,
  neuroflow_append_provenance. Outside NeuroFlow (NEUROFLOW_SESSION
  unset) the reads return null and the writes refuse.
- $lib/neuroflow/contract: host-independent context parsing and the handoff
  and provenance record bodies, with unit tests.
- $lib/neuroflow/session: typed wrappers over the commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cdrake

cdrake commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #18, which collapses this stack into one PR: the headless ingest CLI plus only the pieces it needs. The window ingest mode (#13 and the Rust commands from #11) is kept on the neuroflow/window-ingest branch for later.

@cdrake cdrake closed this Oct 13, 2026
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