Your First Baseline
A baseline is nolapse’s reference point. Every time nolapse run executes, it compares the current coverage against the most recent baseline and reports the delta. This page explains nolapse init in detail — what it does, what it creates, and how to work with it over time.
Running nolapse init
Section titled “Running nolapse init”Go project
Section titled “Go project”nolapse init --repo /path/to/your/repoPython project
Section titled “Python project”nolapse init --repo /path/to/your/repo --lang pythonIf --repo is omitted, nolapse defaults to the current working directory.
What happens during init
Section titled “What happens during init”- nolapse detects (or reads from
--lang) whether this is a Go or Python project. - It runs the appropriate test suite with coverage instrumentation.
- It reads the total coverage percentage from the tool output.
- It records the current git commit SHA via
git rev-parse HEAD. - It writes
.audit/coverage/baseline.mdwith those values. - It writes
nolapse.yamlat the repo root with sensible defaults.
The files init creates
Section titled “The files init creates”.audit/coverage/baseline.md
Section titled “.audit/coverage/baseline.md”coverage: 82.50%timestamp: 2026-01-15T09:00:00Zcommit: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2| Field | Description |
|---|---|
coverage | Total coverage percentage at the time of init, rounded to two decimal places. |
timestamp | UTC ISO-8601 timestamp of when init ran. |
commit | 40-character git SHA of the current HEAD at init time. |
The file is append-only. Each call to nolapse baseline update appends a new line in pipe-delimited format:
coverage: 82.50%timestamp: 2026-01-15T09:00:00Zcommit: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
2026-02-01T14:22:00Z | 83.10% | b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c32026-02-15T11:05:00Z | 84.00% | c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4nolapse run always reads the header block (the first three fields) as the authoritative baseline. The appended lines are an audit trail consumed by nolapse audit list.
nolapse.yaml
Section titled “nolapse.yaml”lang: go # go | pythonwarn_threshold: -1.0 # warn when delta drops below this (percentage points)fail_threshold: -5.0 # fail when delta drops below this (percentage points)strict_mode: false # if true, warn outcome exits 1 instead of 0Edit nolapse.yaml to tighten or relax thresholds for your project. Values here are overridden by flags passed directly to nolapse run. See CLI Reference for the full flag list.
Why the baseline lives in git
Section titled “Why the baseline lives in git”Storing baseline.md in version control means:
- Every branch carries its own history. When two feature branches diverge from
main, each has a valid baseline to measure against. No external state store is needed. - Reviews are auditable. A pull request that updates the baseline is visible in the diff. Reviewers can see that coverage moved and why.
- Rollbacks are safe. If a merge introduces a regression and you revert, the baseline reverts with it.
- CI is stateless. The GitHub Action does not need database credentials or a remote API call to fetch the baseline — it reads the file from the checkout.
Commit both generated files immediately after init:
git add .audit/coverage/baseline.md nolapse.yamlgit commit -m "chore: add nolapse coverage baseline"The —force flag
Section titled “The —force flag”By default, nolapse init refuses to overwrite an existing baseline.md. This protects against accidentally resetting a carefully maintained baseline. Use --force to overwrite:
nolapse init --repo . --forceUse cases for --force:
- You have significantly refactored the project and the old baseline no longer reflects a meaningful reference point.
- You need to reset after a large test suite rewrite.
- You are re-running init in a CI seed job that expects to always produce a fresh baseline.
--force overwrites the header block of baseline.md and regenerates nolapse.yaml. Appended audit lines are cleared.
Updating the baseline over time
Section titled “Updating the baseline over time”After merging a pull request that legitimately raises (or resets) coverage, update the baseline so future PRs are measured against the new level:
nolapse baseline update --repo .This appends a new timestamped entry to baseline.md, promotes it to the active header, and creates a git commit. See CLI Reference — baseline update for details.
Next step
Section titled “Next step”With a baseline committed, open a pull request and run Your First Enforcement to see pass, warn, and fail in action.