Skip to main content

Module workload_lint

Module workload_lint 

Source
Expand description

Load-time authoring lints for semantic surfaces serde cannot check (SRD-83 follow-up). Runs once at workload load — before any phase dispatch, dryrun included — per the dryrun-as-validation-floor doctrine and “never ignore silently”.

Three checks:

  1. Error-router specs parse. Every errors: spec — phase-level and op-level — goes through the real [ErrorRouter] parser, so a bad verb or regex is a load error naming its phase/op instead of a first-error-at-runtime surprise. Specs carrying {param} interpolation are skipped here (they resolve later and are parsed again at scope init).
  2. Error-router catch-all lint. An error class matching no rule falls through to stop with only an eprintln; a router without a literal .* rule therefore has a silent fall-through mode. One warning per such spec.
  3. Metric-family lint. metric('family, …', 'stat') and metric_window(…) selectors inside stop_when, continue_if, and phase poll.until predicates read 0.0 SILENTLY when the family never registers — a typo’d family makes a coordination gate pass instantly or hang to its timeout. Family tokens are checked against the built-in activity instrument namespace plus every phase-declared metrics: name. Unknown families WARN rather than fail: adapter counters and relevancy families are registered at runtime and are not statically knowable.

Hard failures come back as Err; warnings come back as strings for the caller to route through diag! (keeps this module pure and directly testable).

Functions§

lint_workload
Run every lint over the loaded workload. Ok(warnings) — the run may proceed, with each warning routed to the operator; Err — a spec is malformed and the load fails.