Skip to content

latent.lint.rules.lt017

LT017 — A declared parameter nothing consumes — config that documents a lie.

Functions

lt017

lt017(ctx: RuleContext) -> Iterator[tuple[int, str]]

A declared parameter nothing consumes — config that documents a lie.

A key nobody reads still reads as configuration: an enabled: false that switches nothing off, threshold numbers a reviewer takes for the gates the run enforces. The framework will not complain, because merging a key costs nothing, so the only signal is this one.

Four silences, each because the question stops being decidable rather than because the answer is "alive":

  • any use of the whole params object (:func:_params_opaque) — one getattr(params, name) or **params reaches keys no literal names;
  • a get_config()/load_flow_config() call anywhere in the dir, for the same reason one call reaches every key;
  • a dir that reads no literal key at all, which is not "every key is dead" but "nothing here shows how this dir reads its configuration" — the same evidence gate LT010 puts on a missing sidecar;
  • a config_schema= whose fields cannot be listed from the dir's own source (:func:_schema_field_names) — an imported, inherited, aliased or attribute-spelled schema accepts keys nothing here can enumerate.

Only top-level keys are checked. A dead key inside a mapping (agent.temperature) is invisible here, because params.get("agent") hands the whole mapping over and what the reader does with it is not a static fact. Reads are counted across the whole subtree (:func:_subtree_nodes), and a cross-flow other.key literal counts for both spellings — a helper outside the dir is the remaining blind spot, which is why the message says "no module in the flow dir" rather than "nothing", and why the fix for one is a waiver.