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.
Read
packages/pipeio/src/pipeio/registry.py— understandFlowEntryandPipelineRegistry.scan().Read
mcp_registry_scaninpackages/pipeio/src/pipeio/mcp.py— understand how flows are discovered.Read
mcp_flow_status— understand what it returns.Add an optional
app_type: str = ""field toFlowEntryin registry.py. Values:""(unknown/legacy),"snakebids"(has run.py),"snakemake"(has Snakefile but no run.py).In
PipelineRegistry.scan()(ormcp_registry_scan), after discovering a flow directory:- Check if
run.pyexists in the flow dir → setapp_type = "snakebids"- Otherwise if
Snakefileexists → setapp_type = "snakemake"Check if
config/snakebids.ymlexists → prefer it as config_path overconfig.ymlIn
mcp_flow_status, includeapp_typein the returned dict.Add tests:
test_registry_scan_detects_snakebids_app— scaffold a flow dir with run.py, verify app_type="snakebids"test_registry_scan_detects_plain_snakemake— scaffold without run.py, verify app_type="snakemake"
test_flow_status_includes_app_type— verify the field appears in outputRun full test suite:
PYTHONPATH=src python -m pytest tests/ -qSave with datalad_save:
- message: "Add snakebids app detection to registry_scan, app_type field on FlowEntry"
- 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)