CodeCharter guarantees: the same source code state, the same rule set, the same CodeCharter version, and the same analysis options will always produce exactly the same findings, regardless of machine, time of day, system load, or locale settings.
This guarantee is structural, not best-effort: the analysis is stateless, so it never depends on wall-clock time, random values, or filesystem ordering. The same input always maps to the same output, every output format reports the same findings, and the rule-package schema stays stable across patch releases so custom rules keep working.
What Can Change the Output
If any of these change, the findings can change:
- The source code changes. This includes
.codecharter/config.ymland inline suppression comments (// codecharter-disable), which travel with the source and also affect what is reported. - The rule set changes. A
.ccrfile is added, removed, or modified; a profile in.codecharter/config.ymlis changed;codecharter.lock.jsonis updated to a new resolution; or a rule'sseverityoverride orignoreentry is edited. - The CodeCharter version changes. New versions may refine built-in rules or add new schema properties.
- The analysis options change.
--severity,--fail-on,--diff/--git-ref, and--baselineall affect what is reported, so they must match between environments.
For reproducible builds: pin your CodeCharter version in CI (see
Versioning) and commit the .codecharter
directory (config.yml and codecharter.lock.json). The lockfile pins each profile by
content hash, and analyze stops with exit code 4 if a rule bundle no longer
matches the hash recorded in the lockfile.
Consequences for Your Workflow
If a locally green build turns red in CI, one of the factors above has diverged. Typical causes:
- Local and CI CodeCharter versions have diverged.
.codecharter/config.ymlorcodecharter.lock.jsonwas not committed. (The.codecharter/cache/directory is a local cache and does not belong in version control.)codecharter.lock.jsonwas updated in one environment but not the other, for example aftercodecharter update. Runcodecharter verifyto check the local rule cache against the lockfile; it exits with code1on drift.- The CI pipeline passes different analysis options than your local run.
See Local Findings Differ from CI for the debugging steps.