APPLY6 · Stages in 0.0.1, declared or detected¶
Done 2026-10-28 · branch autopilot/apply-stages · Thomas: 0.0.1 shows both the stages and the processes or rules list · stages detected from nf-core subworkflows and Snakemake rule files · shown on four example pipelines · naming assumed (inbox #68) · a bridge-loading problem raised, not changed (inbox #69) · doc review approve 11/14, changes applied · fact-check: 3 findings, applied

Stage sizes are those of tests/pipelines/real/stages/expected/. Before: autopilot/integration at 1abd5dd, where 0.0.1 showed the processes or rules only and stage detection came later (P1 Assumption 6).
This step is outside pipeline.yaml. Thomas, 2026-10-28: "les 2 dans 0.0.1 ; certains pipelines exemples pour montrer comment ça fonctionne pour 2/3 nf core et https://github.com/friendsofstrandseq/mosaicatcher-pipeline ; travaille pour nf core sur un systeme automatisée qui détecte les différents grand stages ; il doit y avoir un moyen via subworkflows etc" (decision log). A spike came first; this step applies it.
What changed¶
Part 1, the spike (branch spike/stage-detection, files under spikes/stage-detection/). It ran nf-core/rnaseq, sarek and methylseq with -preview and the T2 bridge, and mosaicatcher-pipeline as a Snakemake dry run. It wrote two throwaway detectors and four example lab overlays. Note: Spike: stage detection.
Part 2, the specs (this branch).
- ui-spec §5.1. Source (2), detected, now names the real rules: Nextflow subworkflows below the wrapper scopes, and Snakemake rule files, in place of "top-level subworkflows" and "module prefixes and checkpoints". A dated note says that the run detail shows both the stages and the processes or rules; names in no stage have
tasks.stage_idnull, and the presentation is owned by ui-spec §4.4. -
ui-spec §5.1.1, new. It covers:
- where detection runs: on the server, from what the bridges send, for launched and terminal runs alike;
- the seven Nextflow rules and the four Snakemake rules;
- order and state;
- the four examples, with their fixtures.
§3.2 says the gauge has one sector per declared or detected stage. - checking-scenarios §12.1. A
matchglob sees the fully qualified Nextflow name, and*crosses:. - api §7run_stages. Detected stages freeze at the run's firstonFlowBeginorworkflow_started, before any task. - dev-env §15.1. A new Stages row: yes in 0.0.1, both, display only; the overlay editor, rerun from a stage and gates stay later. -mvp-0.0.1.md§2. A feature row. - P1. - Assumption 6 is reversed: stages and the list, both. - The Goal, Milestones (a new M7) and Done when are updated. - A new Task 27 covers the detectors as pure functions, the overlay assignment,run_stages, filling Task 18's/stagessubset andsummary.stage_mode, and the stages in the run detail per ui-spec §4.4, with golden tests on the fixtures. Snakemake's--list-rulesruns in the head script, so the server never runssnakemakeitself. - Task 18–20 lines are not edited. - Fixtures,tests/pipelines/real/stages/. They hold: - five process lists, the rnaseq events, and the mosaicatcher rule lists; - the four overlays; - the expected detector output; - a README with the pins. - Inbox. #68 and #69. - Decision log. A new entry.
Part 3, the reviews of 2a245bf.
- Doc review, approve 11/14. Required changes, all applied:
- The gauge is ui-spec §3.2, not §2: fixed in §5.1.1 rule 5, the log, this page and the note.
- The head script and its
-pluginstest are P1 Task 9, not Task 10: fixed in inbox #69, this page and the note. - Inbox #69 is linked, with a dated "open; mechanism unchanged" line, wherever loading
nf-spectiois described: architecture §13 and §13.8, dev-env §15.1 and §15.3,mvp-0.0.1.md§2, P1 Task 9 and the Task 25 guide, and ui-spec §6. - Presentation belongs to ui-spec §4.4 (branch
autopilot/ui-lite-review): the ui-spec §5.1 note states the mechanism only (tasks.stage_idnull for names in no stage); P1 Assumption 6 and Task 27 point to §4.4. - Task 27 adds no route: it fills Task 18's
/stagessubset fromrun_stages, andtest_stages_routeasserts that shape. - Where overlay files live and how one matches a run now have an owner: a dated 0.0.1 note in checking-scenarios §12.7 (
~/.spectio/overlays/, matched on engine,workflow.nameand the version range), assumed, inbox #68; Task 27 links it and tests it.
- Optional changes, all applied: §5.1.1 rule 6 names groups of direct calls (joined with ", "); the rnaseq events capture is in
tests/pipelines/real/stages/events/;assignreturns the one matching stage, since §12.3 refuses overlaps. - Fact-check of the spike: the core claims hold, and
onProcessCreatecomes beforeonFlowBeginon 25.10.9 too. Three findings, recorded in the note's Fact-check section and applied:- FC-311: the
-pluginsfailure depends on the version (it fails on 26.10.4, and the pin drifts silently on 25.10.9); inbox #69 reworded; - FC-312: the list form of
NXF_PLUGINS_DEFAULTis undocumented and skips plugin inference; inbox #69 option (a) is [to be validated] and appends the plugins the executor or work directory needs; - FC-313: 26
include:lines and 21 rule files in mosaicatcher, not 20;--list-rulesprints docstrings, which Task 27 strips, with a test.
- FC-311: the
Why¶
nf-core pipelines declare no stages, so without detection 0.0.1 would show a flat list of 50 to 70 processes. The spike shows that the subworkflow scopes are already in every process name, and that the names reach the bridge before any task, so detection costs nothing at run time. The detected names are technical, so lab overlays stay the way to good names. Detection runs on the server so that runs started from a terminal get the same stages.
Evidence¶
-
Detector output, from the spike (
out/detector_nf.txt,out/detector_smk.txt):rnaseq 3.27.0 STAR+Salmon 67 processes -> 8 stages rnaseq 3.27.0 HISAT2 62 processes -> 8 stages sarek 3.11.0 48 processes -> 8 stages methylseq 4.2.0 Bismark 13 processes -> 4 stages methylseq 4.2.0 bwa-meth 15 processes -> 5 stages mosaicatcher v2.5.1 101 rules (--list-rules) -> 8 stages; source only: 204 rules -> 8 synthetic T2 (flat) no detected stages -
Overlays: each of the four matches every name of its fixture, with no overlap (
out/overlays_vs_detected.txt). -
Docs gate,
python3 tools/docs/check.pyon this branch:mermaid: 5 blocks checked diagrams: 28 scripts re-run, 56 SVGs compared media: 138 outputs in the manifest progress: 41 pages checked docs gate: 0 failure(s) -
Mermaid: no diagram added or changed in this step.
- Strict build:
uvx --with mkdocs-material mkdocs build --strictexits 0. The new anchors exist in the built pages:511-detected-stages,2026-10-28-001-shows-stages-declared-or-detected-and-the-processes-or-rules-listand69-nf-spectio-is-enabled-in-a-way-that-breaks-nf-core-runs-or-drops-the-bridge. - Before:
git show 1abd5dd:docs/plans/P1-walking-skeleton.md(Assumption 6: "Structural stage detection … andrun_stagescome later"). After:git diff 1abd5dd -- docs/specs docs/plans docs/decisions docs/reviews/inbox.md.
Figures and media¶
apply6_stages(above), new:tools/diagrams/apply6_stages.py, entryapply6-stagesindocs/assets/media.yaml. Rendered light and dark; both PNGs were opened and checked for overlaps.- The P1 figure
p1_skeletonis not redrawn; its dated note now also names Task 27. - No screenshot or cast: nothing in this step runs a UI.
Findings and open questions¶
- Inbox #68 (assumed (a)): the four example pipelines; detected stages keep technical names; readable names come from overlay files.
- Inbox #69 (not assumed):
-plugins nf-spectio@<ver>replaces an nf-core pipeline's pinned plugins (the run fails on Nextflow 26.10.4 and drifts silently from the pin on 25.10.9), and apluginsblock in~/.nextflow/configsilently drops the bridge;NXF_PLUGINS_DEFAULTworks, through an undocumented list form. It blocks P1 Task 9 (the head script) for real nf-core pipelines. - [to be validated], from the note:
- the same names on a real run with tasks, on SLURM;
onProcessTerminatefor a process whose input never closes;--list-rulesneeding input data on other pipelines;- the order of rules first seen after a checkpoint;
- older nf-core templates;
NXF_PLUGINS_DEFAULTon the EMBL cluster, and its undocumented list form (FC-312);- whether
nf-spectiocan readmanifest.nameandmanifest.versionto match an overlay (checking-scenarios §12.7 note).
- Merge note: the UI-lite review (branch
autopilot/ui-lite-review) owns the lite boards and the P1 Task 18–20 lines; both steps add inbox items, so check the numbers at merge.