Skip to content

Baseline

Most projects that adopt assay already have violations. The baseline records them in assay_baseline.json at the project root. Commit it: the project judgement in CI then fails only on new violations while you work off the old ones. The two commands that show and maintain it are on assay baseline.

Terminal window
assay baseline update --add
╭─ assay baseline update --add ────────────────────────────────────────────────╮
│ Preset recommended │
│ Rules 109 │
│ Files 2 │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ ✓ Baseline created ─────────────────────────────────────────────────────────╮
│ 4 entries · growth record 1 │
│ → Next: commit `assay_baseline.json`. │
╰──────────────────────────────────────────────────────────────────────────────╯

It records every current violation of both tiers, of assay’s rules, the SDK lints, the cross-file checks and the project-file checks, but no compile error. Its entries are sorted, so a change to it is a small diff. Each entry is a fingerprint of the rule, the file, the text of the line and its position among identical lines. So:

  • a violation is still recognised after the code around it moves;
  • editing the violating line makes the violation new;
  • moving or renaming the file drops it from the baseline.
{
"schema": "assay.baseline/1",
"growth": [
{"seq": 1, "at": "2026-11-23T21:44:29Z", "added": 4}
],
"entries": [
{"fingerprint": "b1fee273…", "rule": "avoid_non_null_assertion", "file": "lib/prices.dart", "lineDigest": "0f085386…", "ordinal": 0, "addedIn": 1},
…
]
}

(Digests cut short here.)

By itself. When check or gate judges a file and finds no matching violation, or the file is gone, it removes the entry; baseline update does so on request. The gate only ever removes, under a lock. A removed entry is not matched again if the violation returns.

╭─ assay check ────────────────────────────────────────────────────────────────╮
│ Preset recommended │
│ Rules 109 │
│ Files 2 │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ ✓ PASS ─────────────────────────────────────────────────────────────────────╮
│ 0 blocking · 0 advisory · 0 of 2 files · 3 in the baseline │
│ ! 3 known violations in the baseline · listed by │
│ `assay check --no-baseline` │
│ Removed 1 entry that no longer matches from assay_baseline.json. │
╰──────────────────────────────────────────────────────────────────────────────╯

Known violations are counted but not listed on the terminal. assay check --no-baseline lists them, and the gate’s full report marks each one.

Only assay baseline update --add grows the baseline. Each run that adds entries appends a growth record (a sequence number, the time, the number added) and stamps the new entries with it, so growth shows in the diff and to the gate.

Terminal window
assay baseline status
╭─ assay baseline status ──────────────────────────────────────────────────────╮
│ Preset recommended │
│ Rules 109 │
│ Files 2 │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Growth records ───────────────────────────────────────────────────────── 1 ─╮
│ # When Added │
│ ────────────────────────────── │
│ 1 2026-11-23T21:44:29Z 4 │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ ✓ Baseline ─────────────────────────────────────────────────────────────────╮
│ 4 entries · 0 no longer match │
╰──────────────────────────────────────────────────────────────────────────────╯

The baseline applies to whole-project judgements only: the gate’s project judgement, check, and the cross-file and project-file results at turn end. A violation in a file an agent’s session changed blocks even when the baseline knows it; see The two judgements.

Entries of the cross-file and project-file checks
  • check runs neither kind of check and leaves their entries alone. The gate and baseline update remove the entries their checks no longer find; on a change, the gate keeps those of shipped files the change did not touch.
  • A project-file result is fingerprinted by its place (the element or keys) and the text of its range, never the rest of its line, or by the empty text for a whole file such as a key store. Its message holds no secret and the fingerprint is a digest, so the baseline holds no secret.
  • Where pubspec.yaml is not valid YAML, secret_in_shipped_file cannot tell which files ship, and the gate and baseline update keep all its entries.