The shared judgment spine every scale-gated rule walks:
born-silence -> scale/traffic -> Cerbero.Severity.assess/6 -> finding
assembly (default relations, judged-lock metadata).
Rules parameterize the spine with their target selection and message
text and keep their own wording; the spine owns the invariant mechanics,
so a rule cannot accidentally skip born-silencing or forget to declare
the lock it judged. Extracted from what Cerbero.Check.RawDDLSafety's
private generic judge already was (issue #4 item 8).
Options:
:message(required) — zero-arity fun producing the finding message; lazy so suppressed verdicts never build strings.:severity— post-processes the assessed severity; return:suppressto emit nothing. Default suppresses:noneand keeps the rest. Rules use it for floors (TRUNCATE's unconditional:error) and stricter gates (strict_concurrent_index, fk's error/warning-only).:also_assess— additional tables assessed with the same lock/cost (and the target's traffic); the most severe verdict wins.nilentries are ignored (unknown referenced table). Born-silencing applies to the target only — an FK onto a born table still scans the populated referenced side.:relations— override the default[qualified_target].:engine— engine tag on the finding (defaultnil).
Summary
Types
@type params() :: %{ table: String.t() | nil, lock: Cerbero.DDL.Effect.lock(), cost: Cerbero.DDL.Effect.cost(), line: integer() | nil }
Functions
@spec judge( module(), params(), Cerbero.Migration.t(), Cerbero.Catalog.t(), Cerbero.Config.t(), keyword() ) :: [Cerbero.Finding.t()]