A Jenkins job that runs scripts/check-drift.sh to compare the Terraform plan of a reference branch against that of a candidate branch, layer by layer and stage by stage. The goal: prove that a refactor produces exactly the same infrastructure plan — so no resource is created, destroyed or changed by accident.
Generic diagram: instances, repositories, channels and modules are named by function. The architecture is shown for illustration, independently of any organisation.
Everything happens on an ephemeral agent: both branches are brought side by side there, secrets are injected then deleted, and each stage is processed layer by layer before Slack gets the verdict.
Both branches each produce a JSON plan against the same state, then jq strips everything that is not deterministic. What remains is the infrastructure intent: that is the only thing compared, and the comparison is strict.