Repository navigation
fix(#848): pre-flight rejections exit non-zero across run/update/state/status/init - #852
Merged
admarble merged 3 commits intoJul 29, 2026
Conversation
…exit non-zero Two sequant run pre-flight paths (not-initialized, --stacked/--no-chain) printed a red error but bare-returned at exit 0, so CI/shell gating on $? read the failure as success. The AC-3 audit found the same defect across run.ts (+2 sites), update.ts, state.ts, status.ts (3 sites the issue's own table missed), and init.ts --upgrade-skills. Each rejection now sets process.exitCode = 1 (not process.exit(1), matching the sync.ts reference so output/cleanup drains). --json failure branches in state/status also set the code so scripted consumers can gate on $?. Adds unit tests per fixed site plus a negative test pinning that a passing pre-flight leaves the exit code unset. Entire-Checkpoint: 687aaddd9868
Closed
3 tasks
…ialized dir The #848 exit-code fix makes run.ts's not-initialized guard exit 1 (was 0). The four run flag-parsing tests in cli.integration.test.ts used exit-0 as a "Commander parsed OK" proxy, so they broke on the corrected behavior. Replace the runDryRun helper with expectFlagAccepted: spawnSync the command and assert it reached the not-initialized guard (which only prints after all flags parse successfully) and was not rejected as an unknown option. This asserts the actual intent — the flag is accepted by Commander — independent of the exit code. Mutation-verified: an unknown flag fails the assertion. Entire-Checkpoint: 55ace59dac43
…-code fix The four process.exitCode=1 inserts pushed run.ts from 199 to 203 lines, over the #503 AC-2 thin-adapter cap enforced by run-orchestrator.integration.test.ts. Consolidate the four pre-flight rejections into a rejectPreflight() helper that prints the red message and sets process.exitCode. This satisfies both the exit- code requirement (#848) and the LOC cap, and reads better than four repeated console.log + exitCode + return triples. Behavior is unchanged — verified by run-preflight-exit.test.ts (all sites still set exit 1) and the LOC test. Entire-Checkpoint: 2897c1e3fa4f
admarble
deleted the
feature/848-sequant-run-exits-0-on-pre-flight-rejections-not-i
branch
July 29, 2026 06:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sequant runprinted a red error but returned exit code 0 on two pre-flight rejection paths (not-initialized,--stacked+--no-chain), so any CI wrapper or shell script gating on$?read the failure as success. Both bare-returned instead of settingprocess.exitCode = 1.Following AC-3, an audit of every
console.log(chalk.red(…))+ bare-returnpair acrosssrc/commands/found the defect was wider than the two named sites — and turned up three sites the issue's own audit table missed (status.ts).Pre-PR AC Verification
run.ts:55; testrun-preflight-exit.test.ts+ e2e (exit 1)--stacked+--no-chainsets non-zero exitrun.ts:64; test + e2e (exit 1)AC-3 audit — every command-level rejection now sets
process.exitCode = 1run.tsnot-initializedrun.ts--stacked+--no-chainrun.ts--chain+--batchrun.tsinvalid--concurrencyupdate.tsnot-initializedstate.tsinit / rebuild / clean failures--jsonbranches)status.ts--rebuild/--cleanup/ state-read--jsonbranches)init.ts--upgrade-skillsno-skills-dirlocks.ts(×3),dashboard.tsDesign notes
process.exitCode = 1, notprocess.exit(1), matching thesync.ts:274reference so pending output/cleanup drains naturally.--jsonfailure branches instate/statusalso set the code so scripted consumers reading structured output can still gate on$?.update.tswas not a correct reference — its not-initialized branch had the identical bug. Onlysync.tsset the code on that branch.Test plan
npm run build— passesnpm run lint— passes (0 warnings)run.tsAC-1 fix fails exactly the AC-1 test, nothing elserun 999999 --dry-runin an uninitialized dir) now exits1(was0);updateand the--stacked+--no-chainconflict likewiseCloses #848