Skip to content

just_dna_enricher.producers

just_dna_enricher.producers

Which pass fills each machine-produced table, from which source, and what it checks while it does.

The counterpart to drafting.DRAFT_PROVIDERS, and it exists for the same reason. An authored table can already answer who drafts me by construction — every drafter declares its table, so a tool or a page walks the registry and gets the truth. A derived table could answer nothing: the writer's name lived in a comment on VALID_VERIFICATION_CHECKS — — enrich, — literature — the source was a SourceRow literal inside ten different passes, and the CLI's help text is prose. So the docs site's per-table reference had exactly two ways to say the enricher fills this one: hand-keep a mapping in the generator, or say nothing. The first is @registry-not-a-list and the very failure gen_table_pages.py's own docstring refuses — a command-surface table rots silently — and the second is what shipped.

Every field here is a fact some other registry already owns, referenced rather than restated. source is a SourceTerms.source from licensing, so a producer cannot name a source this tier does not have terms for. checks are VALID_VERIFICATION_CHECKS members, so a pass cannot claim an attestation the vocabulary has no word for. table is a _FACT_TABLES CSV (plus resolution.csv, which is derived without being a fact table). command is the one thing with no registry behind it — so test_producers.py walks the live Typer tree and asserts each one resolves, the same way CacheLane.build_command is pinned, and for the same incident: a string an operator is asked to type must come from where the command is declared, never from a naming convention.

Not folded into CACHE_LANES, deliberately. A lane is a snapshot — where bytes are cached, who may publish them, how to rebuild. A producer is a pass — which table it fills in a spec directory. Several passes read no lane and one lane feeds several passes, so the two are orthogonal axes and Principle 5 keeps them apart. serves on a lane is prose for an operator reading cache status; it is not this question asked in another place.

DerivedProducer dataclass

DerivedProducer(
    table: str,
    command: str,
    module: str,
    sources: tuple[str, ...],
    checks: tuple[str, ...] = (),
    shares_table_because: str = "",
)

One pass that fills one machine-produced table.

producers_for

producers_for(csv_name: str) -> tuple[DerivedProducer, ...]

The pass(es) that fill csv_name, or an empty tuple for a table no single pass owns.

Source code in enricher/src/just_dna_enricher/producers.py
def producers_for(csv_name: str) -> tuple[DerivedProducer, ...]:
    """The pass(es) that fill `csv_name`, or an empty tuple for a table no single pass owns."""
    return DERIVED_PRODUCERS.get(csv_name, ())