Skip to content

chore(#795): deprecate --qa-gate, an inert no-op flag - #807

Merged
admarble merged 3 commits into
mainfrom
feature/795-chore-run-qa-gate-is-an-inert-no-op-flag-remov
Jul 26, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/795-chore-run-qa-gate-is-an-inert-no-op-flag-remov

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

--qa-gate was a no-op. The chain loop in run-orchestrator.ts broke on any failed link unconditionally, immediately after the qaGate branch that re-tested for a QA failure — so the branch could only ever reach the same break that followed it. The flag produced identical behavior whether set or not, and no runtime path ever wrote the waiting_for_qa_gate status it advertised.

Decision (AC-1): deprecate, don't implement. Three reasons, the second decisive:

  1. Option 2 adds nothing on the halt side. "Wait for QA pass before the next issue" is already what --chain does, and more strictly — it halts on every failing phase, not just qa.
  2. Option 2's only real delta is unsafe here. The one behavior it could add is continuing past a non-QA failure. But --chain rebases each successor onto the predecessor's committed work. Continuing past a failed exec (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.
  3. Nothing was half-built. waiting_for_qa_gate is 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 unconditional break now carries a comment explaining why a chain halts on any failed link.
  • run-flags.ts — new pure deprecatedFlagNotices() + a thin warnDeprecatedFlags() printer. Kept out of run.ts because 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.ts is already the argv-normalization module.
  • run.ts — dropped the ❌ --qa-gate requires --chain flag early 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 the QA gate: enabled (chain waits for QA pass) header line, the same false claim in a second place.

Retained deliberately (AC-4)

Docs

  • docs/reference/run-command.md — the ~75-line "QA Gate Mode" section documented a ⏸️ QA Gate pause 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-gate case, 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.

  • Four-case matrix in run-orchestrator.test.ts varying failing phase (qa / exec) and flag independently — asserts the halt is identical across all four.
  • Explicit test that --qa-gate does not let a chain continue past a non-QA failure, pinning the rejected option-2 semantics so a future re-implementation is deliberate.
  • Unit tests for deprecatedFlagNotices — message content, --chain independence, and absence of the removed "requires --chain" wording.
  • CLI integration tests — --qa-gate parses and warns with and without --chain; run --help shows DEPRECATED and no longer says "Wait for QA pass". (These failed before the fix and pass after — verified empirically, not assumed.)
  • state-cleanup / reconcile / status suites pass with zero edits (AC-4).
  • #749 test that re-created the deleted predicate inline rewritten to assert the phase result that actually drives the chain.
  • Full suite: 200 files, 4,268 tests green. npm run build, npm run lint, lint:skill-sync, lint:skill-calls all clean.

AC Verification

AC Description Status Evidence
AC-1 Decision recorded with rationale ✅ Above, plus CHANGELOG and the issue's spec comment
AC-2 Flag still parses, warns; dead branch + misleading help gone ✅ run-flags.ts, run.ts, bin/cli.ts:299, run-orchestrator.ts:1345, run-display.ts
AC-3 If making it gate… N/A Option 2 rejected — see AC-1 rationale
AC-4 waiting_for_qa_gate retained and still handled ✅ Zero edits to state-schema.ts / status.ts / reconcile.ts / state-cleanup.ts; suites green
AC-5 CHANGELOG [Unreleased] entry ✅ New ### Deprecated section

Notes for review

  • Behavior change beyond "no-op": --qa-gate without --chain no 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.
  • Out of scope, worth a follow-up: this issue's own ACs are written as - [ ] **AC-1** … (bold, no colon), which the four line-anchored patterns at src/lib/ac-parser.ts:47-53 do not match — extractAcceptanceCriteria returns 0 items, so no AC rows reach .sequant/state.json. Not fixed here; a parser widening deserves its own regression corpus.

Fixes #795

--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
admarble added 2 commits July 25, 2026 12:46
…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
admarble merged commit c835a3c into main Jul 26, 2026
5 checks passed
@admarble
admarble deleted the feature/795-chore-run-qa-gate-is-an-inert-no-op-flag-remov branch July 26, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(run): --qa-gate is an inert no-op flag — remove or make it actually gate

1 participant