Skip to content

Determinism

Why the same input always produces the same findings in CodeCharter.

CodeCharter guarantees: the same source code state, the same rule set, and the same CodeCharter version will always produce exactly the same findings, regardless of machine, time of day, system load, or locale settings.

What Can Change the Output

Three factors, and only three:

  1. The source code changes.
  2. The rule set changes. A .ccr file is added, removed, or modified.
  3. The CodeCharter version changes. New versions may refine built-in rules or add new schema properties.

For reproducible builds: pin your CodeCharter version in CI. See Versioning.

How We Enforce This

  • No random numbers in the critical path. Sorting is explicit and deterministic.
  • No DateTime.UtcNow calls in the analysis itself. Findings contain no run-dependent timestamps.
  • No filesystem ordering. Directory listings are sorted before processing.
  • No AI in the critical path. No LLM endpoint, no heuristic that changes between invocations.

Consequences for Your Workflow

If a locally green build turns red in CI, it is always due to one of the three factors above. Typical causes:

  • Local and CI CodeCharter versions have diverged.
  • The .codecharter/ configuration was not committed.
  • A new rule was added but the local environment was not refreshed.

See Local Findings Differ from CI for the debugging steps.