Skip to content

Add the conditional (status-aware) self-consistency rules deferred by #314 #322

Description

@NoopDog

Follow-up to #314. The spike shipped only the flat/deterministic invariants (modality⟺assay, imaging exclusivity, sequencing-platform⟺histology, checksum/log inertness). The three status-aware rules from #314's rule set were deferred because they need engine work, not just YAML.

Rules to add

  1. data_type ⟺ modality (Self-consistency check: cross-field semantic rules over each classified record (no ground truth needed) #314 rule 2): variants*/genotypes → genomic; expression_matrix/quantification → transcriptomic.*; peaks → epigenomic.*; images → imaging.histology; pangenome*/assembly*/sequence → genomic; array_signal → epigenomic.methylation.
  2. reference applicability (rule 4): anchored types (alignments/variants*/annotations/peaks/signal) ⟹ reference_assembly must not be not_classified (a readable variants file with a blank reference is suspect; not_applicable is fine for de-novo). Unanchored types (reads/images/checksum/log/statistics) ⟹ reference not_applicable.
  3. degenerate guard (rule 7): a readable data file with all five dimensions not_applicable is a red flag.

Engine work required (why this isn't just more YAML)

  • A prefix matcher in the require clause (for "modality must be transcriptomic.*") — currently only when has prefix.
  • A forbidden-state rule shape for rule 7: the when-state itself is the violation (there is no require that fails). The current model always needs a failing require.
  • A "data file vs companion" predicate for rules 4 and 7 (a checksum with all-NA is fine; a BAM with all-NA is not). Needs a notion of "readable data file" beyond a single field.
  • Extend the load-time matcher validation (_WHEN_MATCHERS/_REQUIRE_MATCHERS) to cover any new matcher forms.

Definition of done

  • The three rules encoded and unit-tested (clean + violating records).
  • Engine extensions above, with load-time validation kept in lockstep.
  • Run over the corpus; triage any violations surfaced (these are more likely to fire than the flat rules).

Relates: #314. Note: index-inertness is tracked under #312, not here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions