Baseline Tracking
Baselines let you track changes over time — distinguishing new findings (regressions) from known issues. nfr-review supports two types of baselines.
Finding baselines
Section titled “Finding baselines”A finding baseline is a JSONL snapshot of all findings from a scan. When you provide a baseline to a subsequent scan, the output classifies each finding as new, existing, or resolved.
Setting up the baseline loop
Section titled “Setting up the baseline loop”-
Nightly scan saves the baseline:
# In your nightly workflow- name: Upload baselineuses: actions/upload-artifact@v7with:name: nfr-review-baselinepath: ${{ steps.nfr.outputs.jsonl-path }}retention-days: 90 -
PR scan downloads and diffs against it:
- name: Download baselinerun: |gh run download "$RUN_ID" \--name nfr-review-baseline \--dir baseline/- name: Run with baselineuses: JimAKennedy/nfr-review@v1with:baseline: baseline/nfr-review-output.jsonl
Interpreting baseline diffs
Section titled “Interpreting baseline diffs”| Classification | Meaning | Action |
|---|---|---|
| New | Not in the baseline — potential regression | Investigate and fix |
| Existing | Already known from the baseline | Track or suppress |
| Resolved | Was in the baseline, now gone | Celebrate |
Manual baseline workflow
Section titled “Manual baseline workflow”# Create initial baselinenfr-review report ./my-repo --format jsonl -o baseline/
# Later, compare against itnfr-review report ./my-repo --baseline baseline/report.jsonlDesign-change baselines
Section titled “Design-change baselines”Design-change baselines track structural metrics (class counts, dependency lists, API endpoints) and surface drift as findings when thresholds are exceeded.
Setting up
Section titled “Setting up”# First run — creates the baselinenfr-review run ./my-repo --design-baseline-dir ./baselines
# Subsequent runs — diffs against itnfr-review run ./my-repo --design-baseline-dir ./baselinesCommitting design baselines
Section titled “Committing design baselines”Design-change baseline files are small JSON documents. Commit them to version control for history tracking:
git add baselines/my-repo-structural-baseline.jsongit commit -m "Update design-change baseline"This lets you see when architectural shifts were introduced by diffing baseline files across commits.
Threshold tuning
Section titled “Threshold tuning”If baselines trigger too many or too few findings, adjust thresholds:
design_change: thresholds: class_count: 30.0 # looser: 30% change before flagging dependency_count: 10.0 # tighter: 10% change triggers alertSee the Design Change Detection chapter for the full threshold reference.
Combining both baselines
Section titled “Combining both baselines”For maximum coverage, use both baseline types together:
nfr-review report ./my-repo \ --baseline baseline/report.jsonl \ --design-baseline-dir ./baselines \ --output-dir results/This catches both new rule violations (finding baseline) and structural drift (design-change baseline) in a single scan.