Repository navigation
chore(#795): deprecate --qa-gate, an inert no-op flag - #807
Merged
admarble merged 3 commits intoJul 26, 2026
Merged
Conversation
--qa-gate promised to "wait for QA pass before starting the next issue in chain", but the chain loop broke on any failed link unconditionally right after the qaGate branch that re-tested for a QA failure. The branch could only reach the same break that followed it, so the flag produced identical behavior whether set or not, and no runtime path ever wrote the waiting_for_qa_gate status it advertised. Decision: deprecate rather than implement. The only behavior "make it actually gate" could add is the continue side — halt on QA failure but continue past a non-QA failure — and that is unsafe in chain mode specifically, since every successor rebases onto its predecessor's committed work. Continuing past a failed exec would build each successor on an absent base, the exact failure chain mode exists to prevent. - Delete the inert branch in run-orchestrator.ts; the unconditional break now carries a comment explaining why a chain halts on any failed link. - Keep the flag parseable so existing scripts do not hard-error; it prints a deprecation notice via a new pure deprecatedFlagNotices() resolver in run-flags.ts (kept out of run.ts to respect the #503 200-LOC budget). - Drop the "--qa-gate requires --chain" early return, which aborted the whole run — precisely the hard error a deprecation window must avoid. - Remove the misleading CLI help text and the "QA gate: enabled (chain waits for QA pass)" run-header line. - Retain the waiting_for_qa_gate status enum and its status/reconcile/ state-cleanup handling for legacy state files (#606), and keep qaGate in the run-log config and metrics cliFlags so residual usage stays visible. - Replace the ~75-line "QA Gate Mode" docs section, which described a pause banner and recovery flow no code produced, with a migration note; update cheat-sheet and git-workflows; date the chain-mode forensics doc. Tests: the prior chain test asserted only QA-failure-with-qaGate, which the unconditional break satisfies either way — it passed against the inert code and could not detect the defect. Replaced by a four-case matrix varying failing phase and flag independently, plus unit tests for the notice and CLI integration tests pinning parse/warn/help behavior. The #749 test that re-created the deleted predicate inline now asserts the phase result that actually drives the chain. Fixes #795
5 tasks
…quiet QA flagged that the notice printed via console.log and was not gated on --quiet, diverging from the version warning beside it. Resolving that divergence surfaced the real defect: the mechanism, not the policy. Deprecation notices are warnings, and warnings belong on stderr — the convention across node, python, gcc, and already in this repo at abort.ts:117. Routing there keeps a consuming script's piped stdout clean, which also dissolves the --quiet question: quiet suppresses progress and version chatter, not warnings, and the scripts most likely to still pass --qa-gate (CI) are the most likely to pass --quiet. Gating there would silence the deprecation window for exactly its target audience. - warnDeprecatedFlags now writes to console.error, with the two deliberate choices (stderr; not quiet-gated) documented so neither reads as an oversight later. - bin/cli.ts gains a comment explaining why --qa-gate is a visible .option() while --experimental-tui uses .hideHelp(): the former shipped in #133 and is documented in four places, so users must be able to find the deprecation; the latter was never advertised. A flag that works but is absent from --help is the worst of both worlds. - New unit tests assert the notice goes to stderr (and not stdout), still fires under --quiet, and stays silent when the flag is absent. - CLI integration tests switch from execSync to spawnSync: no shell means no cmd.exe-vs-sh redirection difference, and separable streams let one run assert "on stderr AND not on stdout". - CHANGELOG and run-command.md record the stderr routing and the quiet-exemption rationale. All six new/updated assertions were verified to fail against console.log and pass against console.error.
…-qa-gate-is-an-inert-no-op-flag-remov # Conflicts: # CHANGELOG.md
admarble
deleted the
feature/795-chore-run-qa-gate-is-an-inert-no-op-flag-remov
branch
July 26, 2026 03:19
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
--qa-gatewas a no-op. The chain loop inrun-orchestrator.tsbroke on any failed link unconditionally, immediately after theqaGatebranch that re-tested for a QA failure — so the branch could only ever reach the samebreakthat followed it. The flag produced identical behavior whether set or not, and no runtime path ever wrote thewaiting_for_qa_gatestatus it advertised.Decision (AC-1): deprecate, don't implement. Three reasons, the second decisive:
--chaindoes, and more strictly — it halts on every failing phase, not justqa.--chainrebases each successor onto the predecessor's committed work. Continuing past a failedexec(no commits) or a failed PR creation means every successor builds on a broken or absent base — the exact failure mode chain mode exists to prevent. Option 2 asks the flag to violate its own mode's core invariant.waiting_for_qa_gateis read in four places and written by zero, so "make it gate" is net-new work, not completion.Changes
Runtime
run-orchestrator.ts— deleted the inert branch; the unconditionalbreaknow carries a comment explaining why a chain halts on any failed link.run-flags.ts— new puredeprecatedFlagNotices()+ a thinwarnDeprecatedFlags()printer. Kept out ofrun.tsbecause that adapter has a hard 200-LOC budget (arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503 AC-2) with only 2 lines of headroom;run-flags.tsis already the argv-normalization module.run.ts— dropped the❌ --qa-gate requires --chain flagearly return, which aborted the whole run. That was itself the hard error a deprecation window exists to avoid, so it is replaced by a non-fatal notice printed ahead of the manifest/settings checks (a dead flag is a fact about argv, not project state).bin/cli.ts— help text now says DEPRECATED instead of promising gating.run-display.ts— removed theQA gate: enabled (chain waits for QA pass)header line, the same false claim in a second place.Retained deliberately (AC-4)
waiting_for_qa_gateenum and itsstatus.ts/reconcile.ts/state-cleanup.tshandling — legacy.sequant/state.jsonfiles contain it and must still reconcile (fix(run): pre-flight guard misses waiting_for_qa_gate issues already merged on GitHub (sibling of #592) #606). Zero edits to those files; their suites pass untouched.qaGatein the run-log config and metricscliFlags, so residual usage stays measurable and can inform when hard removal is safe.Docs
docs/reference/run-command.md— the ~75-line "QA Gate Mode" section documented a⏸️ QA Gatepause banner and a recovery flow that no code ever produced. Replaced with a deprecation + migration note.cheat-sheet.md,git-workflows.md— updated; examples now use plain--chain.chain-mode-analysis-2026-05.md— left intact with a dated "superseded" note. It is a forensics record of a May 2026 state; rewriting it would falsify history.Test plan
The test this replaces (
should stop chain if QA fails with qaGate enabled) was a false negative, not merely stale: it asserted only the QA-failure-with---qa-gatecase, which the unconditional break satisfies with or without the gate. It passed against the buggy code and against the fix, so it never had power to detect the defect.run-orchestrator.test.tsvarying failing phase (qa/exec) and flag independently — asserts the halt is identical across all four.--qa-gatedoes not let a chain continue past a non-QA failure, pinning the rejected option-2 semantics so a future re-implementation is deliberate.deprecatedFlagNotices— message content,--chainindependence, and absence of the removed "requires --chain" wording.--qa-gateparses and warns with and without--chain;run --helpshows DEPRECATED and no longer says "Wait for QA pass". (These failed before the fix and pass after — verified empirically, not assumed.)state-cleanup/reconcile/statussuites pass with zero edits (AC-4).#749test that re-created the deleted predicate inline rewritten to assert the phase result that actually drives the chain.npm run build,npm run lint,lint:skill-sync,lint:skill-callsall clean.AC Verification
run-flags.ts,run.ts,bin/cli.ts:299,run-orchestrator.ts:1345,run-display.tswaiting_for_qa_gateretained and still handledstate-schema.ts/status.ts/reconcile.ts/state-cleanup.ts; suites green[Unreleased]entry### DeprecatedsectionNotes for review
--qa-gatewithout--chainno longer aborts the run. This is deliberate and required by AC-2 ("no hard error for existing scripts") — gating a no-op on another flag was theater. No test asserted the old error string.- [ ] **AC-1** …(bold, no colon), which the four line-anchored patterns atsrc/lib/ac-parser.ts:47-53do not match —extractAcceptanceCriteriareturns 0 items, so no AC rows reach.sequant/state.json. Not fixed here; a parser widening deserves its own regression corpus.Fixes #795