just_dna_compiler.compiler.resolution_step¶
just_dna_compiler.compiler.resolution_step ¶
The resolution step, once, for both commands (RM367).
validate_spec is the pre-flight for compile_module (@validate-refuses-all), and resolution is where
the two kept learning to disagree: each read resolution.csv in its own loop, and the compile then ran
resolve_from_table and a run of checks over the resolved rows that the pre-flight had no copy of. The
standing exemption said a check over resolved rows is compile-only. It never held for this table:
resolving it is pure computation over bytes the pre-flight has already loaded, and asks no reference and
no network. What the pre-flight genuinely cannot see is a reference it is not handed, the deprecated
ensembl_cache, so that path stays the compile's alone and is the one entry left in check_paths.
Five functions, each called by both commands:
read_resolutionreads the table and returns the active view. Under--no-resolvethe view is empty, and every consumer reads the view, so the switch reaches every check, count, signature and writer at once rather than one at a time (@off-switch-needs-a-probe). The file is still parsed, for the row count theresolution_disabledwarning publishes and for its own load errors.resolve_variantsfills and expandsvariants.csvfrom the active view, or says that nothing was injected, and returns the refusals in the strings the compile publishes.identity_after_resolution,ploidy_after_resolutionandunplaced_refusalare what the resolved rows owe: the identity checks an expansion can break, the ploidy guardrail on thechromresolution filled, and the strict aggregate over rows still unplaced.
InjectedResolution
dataclass
¶
InjectedResolution(
present: bool = False,
loaded: list[ResolutionRow] = list(),
rows: list[ResolutionRow] = list(),
errors: list[str] = list(),
warnings: list[str] = list(),
deferred: list[tuple[tuple[str, str], bool]]
| None = None,
consulted: bool = False,
)
resolution.csv as both commands read it: located, parsed, overlaid, self-checked.
rows is the active view — post-overlay, and empty under --no-resolve. loaded is every row
the file parsed to, read only for the size of what the switch skipped. present answers whether the
module carries the file at all, which the overlay's missing-target warning asks, whatever the switch.
deferred is RM137's stash of unmatched update targets, None when the view is inactive.
consulted says the view is active: the file parsed and the switch is on.
table
property
¶
The active rows by variant_key, in file order — what resolution and membership look up.
asserted
property
¶
Every row the module asserts, read whatever the switch says: post-overlay where the view is
active, and the parsed rows where it is not. For sources_in_use, whose question is about the
module's files, not about what resolution consulted.
named_table
property
¶
What a diagnosis may NAME: the active view, or under --no-resolve every row the file holds.
Only for a sentence saying what was skipped (the positional joinability report's "resolution.csv names N of them and was not consulted"); nothing reads it to place, verify or count a row.
ResolvedVariants
dataclass
¶
ResolvedVariants(
variants: list[VariantRow],
refusals: list[str] = list(),
warnings: list[str] = list(),
expanded_keys: int | None = None,
expanded_rows: int | None = None,
)
variants.csv after the injected table was applied, and what applying it found.
refusals holds the strings the compile publishes, prefixed as it publishes them: resolution: …
(fatal in both modes) and, under strict, strict resolution: … (the round-trip ladders, routed
through route, RM359). expanded_keys/expanded_rows are S33's counts, None where no table was
applied.
resolution_disabled ¶
The --no-resolve notice, with the size of what it skipped (rows, and the keys they cover).
Source code in compiler/src/just_dna_compiler/compiler/resolution_step.py
read_resolution ¶
read_resolution(
spec_dir: Path,
overrides: list[OverrideRow],
*,
resolve: bool,
genome_build: str,
strict: bool,
) -> InjectedResolution
Read resolution.csv into the view every consumer reads (see the module docstring).
The self-checks run here, on the active rows only: the table-kind coherence check, _verify_vrs_ids
(a mismatch refuses in both modes), the VRS coverage count, and whether one rsID is placed two ways
by two of the table's subjects (RM374, a ladder: a warning, and under strict a refusal in
errors). Under --no-resolve none of them runs, because none of what they judge reaches the
artifact. Asked here rather than in resolve_variants because it is a property of the table, which a
module with no variants.csv (a PGx-only one) carries too.
Source code in compiler/src/just_dna_compiler/compiler/resolution_step.py
resolve_variants ¶
resolve_variants(
variants: list[VariantRow],
table: dict[str, list[ResolutionRow]],
genome_build: str,
*,
strict: bool,
) -> ResolvedVariants
Apply the active table to variants, or say once that nothing was injected.
The caller decides whether resolution runs at all (resolve_with_ensembl, and the compile's
deprecated ensembl_cache path, which places rows this function cannot see).
Source code in compiler/src/just_dna_compiler/compiler/resolution_step.py
identity_after_resolution ¶
The identity checks an expansion or a fill can break, over the resolved rows, prefixed.
Filling a coordinate or expanding a one-to-many rsID may collide with an already-authored row, and a filled coordinate must be possible in the build. The pre-flight ran both over the authored rows; these are the resolved rows' answers.
Source code in compiler/src/just_dna_compiler/compiler/resolution_step.py
ploidy_after_resolution ¶
The non-diploid guardrail where chrom is final — an rsID-authored MT or Y row has one only now.
Source code in compiler/src/just_dna_compiler/compiler/resolution_step.py
unplaced_refusal ¶
strict's all-or-nothing aggregate: rows that still carry no position once resolution is done.
Over the rows resolution left, whatever left them unplaced: no table, a table without the key, a
non-GRCh38 module (which the table path skips wholesale), every candidate locus rejected, or
--no-resolve. RM359 kept this aggregate out of its one-channel rule on purpose — it is a different
finding from the per-subject warnings beside it — and that decision stands here.