Skip to content

Add snakebids app detection to registry_scan (non-breaking)

Goal

Extend registry_scan and FlowEntry to detect and record whether a flow is a snakebids app. This is additive — existing flat-layout flows continue to work. It's Phase 1 of the v2 roadmap.

Context

v2 roadmap: docs/log/idea/idea-arash-20260330-174518-164647.md

A snakebids app is identified by the presence of run.py in the flow directory. The app may also have config/snakebids.yml (cookiecutter layout) or just config.yml (simpler layout). The derivative directory may have a .snakebids marker file.

Current registry_scan in packages/pipeio/src/pipeio/mcp.py detects flows by looking for Snakefile or config.yml in code/pipelines/ subdirectories. It doesn't check for snakebids markers.

Current FlowEntry in packages/pipeio/src/pipeio/registry.py has: name, pipe, code_path, config_path, doc_path, mods.

Prompt

Add snakebids app detection to pipeio's registry_scan. This is a code change task.

  1. Read packages/pipeio/src/pipeio/registry.py — understand FlowEntry and PipelineRegistry.scan().

  2. Read mcp_registry_scan in packages/pipeio/src/pipeio/mcp.py — understand how flows are discovered.

  3. Read mcp_flow_status — understand what it returns.

  4. Add an optional app_type: str = "" field to FlowEntry in registry.py. Values: "" (unknown/legacy), "snakebids" (has run.py), "snakemake" (has Snakefile but no run.py).

  5. In PipelineRegistry.scan() (or mcp_registry_scan), after discovering a flow directory:

  6. Check if run.py exists in the flow dir → set app_type = "snakebids"
  7. Otherwise if Snakefile exists → set app_type = "snakemake"
  8. Check if config/snakebids.yml exists → prefer it as config_path over config.yml

  9. In mcp_flow_status, include app_type in the returned dict.

  10. Add tests:

  11. test_registry_scan_detects_snakebids_app — scaffold a flow dir with run.py, verify app_type="snakebids"
  12. test_registry_scan_detects_plain_snakemake — scaffold without run.py, verify app_type="snakemake"
  13. test_flow_status_includes_app_type — verify the field appears in output

  14. Run full test suite: PYTHONPATH=src python -m pytest tests/ -q

  15. Save with datalad_save:

  16. message: "Add snakebids app detection to registry_scan, app_type field on FlowEntry"
  17. dataset: "packages/pipeio"

Acceptance Criteria

  • [ ] FlowEntry has app_type field
  • [ ] registry_scan detects run.py → snakebids
  • [ ] flow_status includes app_type
  • [ ] Tests pass
  • [ ] Saved to pipeio submodule

Result

(Filled in after execution)