The drift command compares the snapshot written by the last sn execute against the current state of the same resolved target instance. It blocks if .sn-results/ was written for a different target key. In its default mode it reports differences and exits non-zero when any are found; it also supports re-applying the manifest (--fix), previewing remote changes (--pull), refreshing the review queue (--review), persisting safe per-field accept decisions (--accept), and dropping overlays (--clear-pulls). Treat the instance as shared configuration state: pull or review remote changes first, then merge intentional source changes back into the manifest.
drift
Compare last execute's snapshot against the live instance.
sn drift <manifest.ts> [--target <name>] [--profile <name>] [--fix | --pull | --review | --accept <spec> | --clear-pulls] [--strict] [--only <stepId>] [--skip-skill <name>] [--dry-run] [--json] Detect, re-apply, or reconcile manifest drift against the instance.
Arguments
| Name | Required | Description |
|---|---|---|
| manifest.ts | Yes | Path to the manifest. |
Flags
| Flag | Default | Description |
|---|---|---|
| --target <name> | — | Compare against this instance registry key. Must match the target saved by the last execute. |
| --profile <name> | — | Credential profile for drift reads and `--fix` re-execution. |
| --fix | — | Re-execute the manifest to overwrite drifted instance values. Exits 1 on any step failure. |
| --pull | — | Read-only preview of the remote-vs-local diff. No writes. |
| --review | — | Refresh and list `<manifest-dir>/.sn-review/<basename>.queue.json` with review items for drift and reconciliation events. |
| --accept <spec> | — | Persist an accept decision for safe leaf fields. Spec form: `<stepId>[.<field>]=<remote|local>`. Repeatable. Script/blob fields are guarded and must be merged into source manually. |
| --clear-pulls | — | Drop overlay entries (whole overlay, or only the given step with `--only`). |
| --strict | — | Also treat untracked records as drift (default: warn-only). |
| --only <stepId> | — | Scope detection/clear to one step. Repeatable. |
| --skip-skill <name> | — | Exclude a skill from detection. Repeatable. |
| --dry-run | — | Print the overlay changes `--accept` or `--clear-pulls` would write. |
| --json | — | Machine-readable drift report. |
Examples
sn drift manifests/payroll/manifest.ts2 step(s) drifted:
create-br.description remote: "Updated in prod" local: "Initial description"
create-br.active remote: false local: true
Run `sn drift manifests/payroll/manifest.ts --pull` to preview, or `--fix` to overwrite.
sn drift manifests/payroll/manifest.ts --accept "create-br.description=remote" --accept "create-br.active=local"sn drift manifests/payroll/manifest.ts --review --status openReview queue: manifests/payroll/manifest.ts
Open: 2 Accepted: 0 Applied: 0 Skipped: 0 Blocked: 0
open remote_difference create-br.description drifted
open unsafe_remote_difference create-br.script drifted
| Mode | Side effect | Exit 1 when |
|---|---|---|
| default (detect) | None | Any drift; `--strict` also fires on untracked |
| --fix | Re-executes the manifest | Any step fails |
| --pull | None | Never (always exit 0) |
| --review | Writes `.sn-review/` queue | Drift detection fails |
| --accept | Writes overlay + snapshot patches | Spec is malformed (exit 2) |
| --clear-pulls | Drops overlay | Never |
side=remote on --accept patches the snapshot so the next sn drift sees the remote value as the new baseline. side=local reverts the overlay so the next sn execute overwrites the instance back to manifest values. Script-like fields are intentionally excluded from remote overlays; use sn drift --pull, review the remote code, and edit the manifest source.