just_dna_compiler.compiler.manifest¶
just_dna_compiler.compiler.manifest ¶
Manifest assembly: the files collected beside the artifact, the stats, the per-table fact blocks,
the sources and licence gate, the verification and closure blocks, and _build_manifest.
discover_logs ¶
discover_logs(
spec_dir: Path, explicit: list[Path] | None
) -> tuple[list[tuple[str, Path]], list[str]]
Which logs ship, as (name in the module dir, source file), and a warning for each left behind.
Read-only, so the pre-flight asks it too (RM367): log_file_not_shipped used to reach an author only
from the compile, which also copied as it judged. _collect_logs copies what this returns.
Source code in compiler/src/just_dna_compiler/compiler/manifest.py
ancillary_errors ¶
ancillary_errors(
spec_dir: Path,
*,
provenance_file: Path | None = None,
logo_file: Path | None = None,
readme_file: Path | None = None,
) -> list[str]
Every refusal the ancillary files can draw, read-only, before anything is written (RM367).
The compile shipped provenance.json, the logo and the readme after the parquets were written,
and judged them while copying, so a malformed document refused a compile that had already filled its
output directory, and validate_spec never read them at all. A provenance.json that is not UTF-8
escaped as an exception. Both commands ask this now, the compile before output_dir.mkdir(), with
the same discovery the collectors use and the compile's own wording.
Source code in compiler/src/just_dna_compiler/compiler/manifest.py
variant_stats ¶
The variants.csv-derived facets of ValidationResult.stats / manifest.stats.
Its own function because it now has two callers, and the second is why: compile_module may
discard a row for carrying an unusable symbolic allele (RM5), and the stats were computed by
validate_spec before that happened. weights_rows counts the parquet and so is post-drop, so a
published manifest claimed a variant_count one higher than the artifact contained — the RM44
class of defect exactly, a manifest number a catalog keys on and cannot check.
Source code in compiler/src/just_dna_compiler/compiler/manifest.py
clin_sig_tier_counts ¶
manifest.stats.clin_sig_counts and clin_sig_variant_counts (RM300).
Every VALID_CLIN_SIG member is a key, zeros included, in sorted order: the vocabulary is closed
and fixed per compiler_version, so an absent key would be ambiguous between zero and not counted.
The tier is the row's effective clin_sig, so a boolean-only row counts where
clin_sig_from_booleans can name one; a row with no derivable tier counts nowhere, and its number
is readable as a total minus the sum rather than stored (@derived-not-stored).
Source code in compiler/src/just_dna_compiler/compiler/manifest.py
module_stats ¶
module_stats(
variants: list[VariantRow],
kind_rows: dict[str, list[Any]] | None = None,
) -> dict[str, Any]
variant_stats plus the gene facets taken over every authored table, not just variants.
PUBLIC, and it exists rather than a second parameter on variant_stats because that function's
name is a promise about which table it reads and renaming it would be a major (S14's rule). What
the two return differs in exactly two keys.
stats describes the module, and Stats has always said so — "card/detail stats derived from
the spec", not from one table of it. variant_stats nevertheless derived genes from
variants.csv alone, so a module whose lead table is diplotypes.csv, allele_function.csv,
copynumbers.csv or any other gene-bearing kind published gene_count: 0, genes: [] however many
of its rows named a gene — and a registry's gene index is fed from that field, so the module was
unreachable by a gene search (S57). Measured on reference_examples/cyp2c19_star_alleles/: 1,332
rows carrying gene=CYP2C19 across three tables, and genes: [].
The honest workaround an author was left with was prose in the README, and the dishonest one —
inventing an empty variants.csv to be discoverable — is what makes this ours to fix rather than a
documentation note.
Only authored kinds count. The genes are subjects.module_subjects' (RM362), whose roster derives
from _TABLE_KINDS, which deliberately excludes the derived fact sidecars, so a gene reaching
gene_metrics.csv because a pass looked it up never becomes a gene the module claims to be about;
the orphan checks and the enricher's gene scope ask the same function, so the three cannot differ.
Source code in compiler/src/just_dna_compiler/compiler/manifest.py
sources_in_use ¶
The sources the module's derived tables name, which _source_checks reads sources.csv against.
One function for both commands (RM367): the compile asked it in a closure the pre-flight had no copy
of, so source_row_unused reached an author only at compile. resolution_rows are every row the file
holds, active or not: a source row is about the module's files, and --no-resolve does not make the
resolution layer's terms stale. Resolution contributes its authority (which link answered, RM33)
and each placement witness (RM267), never its source; sources.csv cannot vouch for itself, and a
literature row's source names the registry that answered, whose terms are per article (RM46).
Source code in compiler/src/just_dna_compiler/compiler/manifest.py
build_disagreement_error ¶
The one recorded finding strict refuses on, or None (S78, RM143).
This does not move the strict line, and the distinction is the whole item. strict means
reproducible, never right — the compiler has no reference, so it cannot check a coordinate, and
a whole file shifted by one base still passes. genome_build_agreement is the exception on
internal-consistency grounds rather than correctness ones: a recorded finding there says the
module's rows are on a different assembly than the genome_build it declares, which is one
authored file contradicting another. Every other recorded finding is a disagreement between the
module and an outside archive, where the archive is the stale side often enough that failing a
build would have the format arbitrate someone else's dispute — that reasoning is unchanged and
covers clinical_significance, reference_allele and the rest.
A fact the toolchain already established, not a check re-run here. The judgement is the
enricher's, made against the GRCh37 service the compiler may never call (Principle 2); what changed
is that it stops being discarded at the boundary. So the gate keys on a record the enricher
wrote — findings > 0 on that one check — and the compiler adds no reference, no network and no
opinion of its own.
Silent when no attestation exists, deliberately, and that is not a hole this leaves open: an
unverified module is the ordinary case, _read_verification_block says nothing about it on purpose,
and refusing there would fail every module that has never been enriched. What this closes is the
case where the answer was obtained and thrown away.
A stale attestation is dropped before this sees it, which is the correct order: bytes that moved since the check ran are bytes the check did not judge.