Repository navigation
Description
Summary
sequant sync --dry-run exits non-zero (process.exitCode = 1) when work is pending, so CI/automation can gate on it (the #709 "trustworthy preview" intent). sequant update --dry-run does not — it always returns exit 0 regardless of pending changes (src/commands/update.ts:226-228), so a CI job scripting update --dry-run has to parse stdout to detect drift.
This is the exit-code asymmetry surfaced during QA of #722 / PR #723. PR #723 made the sync surface CI-gateable; this issue tracks bringing update's preview to parity.
Current behavior
// src/commands/update.ts (dry-run tail)
if (options.dryRun) {
console.log(chalk.gray("\n(dry-run mode - no changes made)"));
return; // exit code stays 0 even when newFiles/modifiedFiles are non-empty
}update already computes applySet ([...newFiles, ...modifiedFiles], plus localOverrides under --force) from a single computeTemplateChanges() call, so the pending-work signal is already in hand — it just isn't surfaced as an exit code in dry-run mode.
Suggested fix
In the dry-run branch, set process.exitCode = 1 when the apply set is non-empty, mirroring sync --dry-run:
if (options.dryRun) {
console.log(chalk.gray("\n(dry-run mode - no changes made)"));
if (applySet.length > 0) process.exitCode = 1;
return;
}(Note: the early "Everything is up to date!" short-circuit at update.ts:188-199 returns before the dry-run tail, so the no-op case correctly stays exit 0.)
Compatibility caveat (why this is a follow-up, not folded into #723)
This changes the exit code of update --dry-run from always-0 to 1-on-pending. Any existing script that runs update --dry-run and treats exit 0 as "command ran" (rather than "nothing to do") would start seeing failures. Low risk — update is the interactive command and sync is the documented non-interactive/CI surface — but it warrants its own release note rather than riding along in #722's fix.
Acceptance criteria
-
update --dry-runsetsprocess.exitCode = 1whenapplySet.length > 0(new + modified; + local-overrides under--force). -
update --dry-runexits0when there is nothing to apply (no-op case unchanged). - Unit test in
src/commands/update.test.tscovering both exit codes. - CHANGELOG entry noting the exit-code behavior change (potential breaking change for scripts).
Activity
admarble commentedon Jun 9, 2026
/fullsolve Complete
Issue: #724
Status: READY_FOR_MERGE
PR: #725
AC Coverage — 4/4 MET
update --dry-runsetsprocess.exitCode = 1whenapplySet.length > 0(new + modified; + local-overrides under--force)0on the no-op case (short-circuits at "Everything is up to date!" before the dry-run tail)src/commands/update.test.tscovering both exit codes (4 cases)### Changednoting the potential breaking changeChange
One guarded line in the
update.tsdry-run tail, reusing the existingapplySet(the same[...newFiles, ...modifiedFiles], +localOverridesunder--force) — no new comparison logic. Mirrorssync --dry-runexactly.Quality
update11/11,sync27/27 — all passtscclean-d, --dry-runalready registered forupdateIterations
docs/troubleshooting.mdthat previously steered CI users only tosync)Ready for human review and merge.
docs(#724): clarify update --dry-run exit code in manual test checklist