TractorStackdocs
Docs menu

Docs / Guardrails

Drift checks

Planned design. TractorStack is in development. This page describes how it is designed to work; nothing here is available to install yet. See the roadmap for the status of each part.

Planned Part of the routine checks that run across every stage. Everything below is the planned design.

Drift detection for on-premise infrastructure answers one question every night: does what is running still match what the repository says should be running? Someone fixes a firewall rule by hand at 2 a.m., a VM gets an extra disk from the hypervisor console, a package is upgraded outside the patch window. None of that is wrong in the moment, but if it never makes it back into Git, the next planned change can quietly undo it, or fail in a way nobody expects.

Drift detection: the nightly checks

The design runs two dry runs on the site runner each night, against the main branch of each environment’s repository:

None of these checks change anything. They only read, compare and report. Argo CD can also be set to correct drift on its own; whether to allow that is a per-application decision written in the repository.

# planned example: nightly drift job on the site runner
tofu -chdir=tofu/site-a plan -detailed-exitcode -lock=false
ansible-playbook -i inventory site.yml --check --diff

What counts as drift

Not every difference is worth a message. The planned rules:

DifferenceTreated as
A resource or setting differs from the codeDrift, reported
Something exists that the code doesn’t know about, in a place the code managesDrift, reported
Values that change by nature, such as timestamps or runtime countersIgnored, listed in the repository so the list is reviewed
A plan or check that fails to run at allA failed check, reported separately from drift

Ignore lists live in Git like everything else. Adding an entry is a change request, so nobody can hide drift by muting it on the side.

Reporting

Results go into the one-page status report: each environment, when it was last checked, and either “matches the repository” or a short list of what differs, with the plan or diff attached. Drift found on a production environment raises an alert. Drift on a test environment is shown in the report but doesn’t page anyone.

A clean result is recorded too. Knowing that a site matched its code last night is useful on its own, and it feeds the audit trail.

Fixing drift: by code, not by hand

When drift is found there are two honest answers, and both go through Git:

  1. The manual change was right. Write it into the repository, open a merge request as a change request, get it approved. The next nightly check comes back clean.
  2. The manual change was wrong or unknown. Re-apply the code through the normal GitLab CI pipeline (or let Argo CD sync it, for Kubernetes applications), which puts the system back to what was approved.

What the design avoids is a third answer: logging in and reversing the change by hand. That replaces one undocumented change with another, and leaves no record of why.

Emergency fixes by hand will still happen, and that is fine. Drift checks make sure they are caught within a day and written down, instead of found months later during an upgrade.

Last updated 25 October 2026 · Questions or corrections: sales@infratractor.com