Skip to content

summarize-nextflow: skip-flag guards produce false-positive reference_rebuilds and leak into reference_assets #355

Description

@jmchilton

Filed by Claude (AI assistant) on behalf of @jmchilton, from a review of the #349 fixes.

detectReferenceRebuilds in the summarize-nextflow resolver emits rebuild rules for boolean skip-flag guards that have nothing to do with reference data. The bogus params then leak into reference_assets[], so a downstream reference-data Mold sees skip_fastqc presented as a reference asset built by FASTQC.

Pre-existing on main; unaffected by the #349 work (identical output before and after).

Repro

foundry summarize-nextflow workflow-fixtures/pipelines/nf-core__bacass --no-with-nextflow
reference_rebuilds:
  asset_param=baktadb      guard=!ch_path_baktadb && val_baktadb_download  builder=BAKTA_BAKTADBDOWNLOAD   # legitimate
  asset_param=skip_fastqc  guard=!val_skip_fastqc                          builder=FASTQC_RAW              # bogus
  asset_param=skip_fastp   guard=!val_skip_fastp                           builder=FASTP                   # bogus
  asset_param=skip_fastqc  guard=!val_skip_fastqc                          builder=FASTQC_TRIM             # bogus

reference_assets: ['baktadb', 'skip_fastp', 'skip_fastqc']

3 of the 4 rules are false positives, and 2 of the 3 assets.

Root cause

The detector already tries to filter this shape:

if (/^(skip|no|disable|disabled)_/u.test(negated)) continue;

but it tests the negated identifier, which in bacass is val_skip_fastqc — a val_-prefixed take slot, not skip_fastqc. The prefix defeats the anchored regex, the rule is emitted, and resolveAssetParam then resolves it back to the real skip_fastqc param.

Two independent gaps:

  1. The skip-flag filter is defeated by wrapper prefixes. nf-core subworkflows conventionally rename take slots (val_, ch_, _in). The filter should strip known prefixes before matching, or better, test the resolved asset_param rather than the raw negated identifier.
  2. reference_assets[] trusts reference_rebuilds[] unconditionally. In buildReferenceAssets, params reaching the inventory via rebuildParams bypass the isNonReferenceParam filter and the isPathTypedParam check entirely. A boolean param should never become a reference asset regardless of how it got nominated — the asset inventory should require the param be path-typed (or at minimum non-boolean) even on the rebuild path.

Fixing (2) alone would keep reference_assets[] clean while leaving the bogus rules in reference_rebuilds[]; both are worth doing.

Suggested acceptance criteria

  • bacass emits exactly one rebuild rule (baktadb / BAKTA_BAKTADBDOWNLOAD) and one reference asset (baktadb).
  • A boolean-typed param cannot appear in reference_assets[] via any path.
  • The skip-flag filter survives val_ / ch_ / _in take-slot renaming.
  • sarek (6 rules) and eager (5 rules) are unchanged — both are currently correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions