Skip to content

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

Closed

Description

@admarble

Summary

The --qa-gate flag for sequant run is functionally dead code as of v2.9.0. It is
defined, plumbed, and validated, but the code path it feeds can never change runtime behavior.
Its help text promises gating behavior it does not deliver, which is misleading.

Surfaced by the July 2026 build-vs-adopt / boring-tech audit; PR #759 already removed it from
/assess chain suggestions but deliberately left the flag itself in place pending this decision.

Evidence (verified against main @ v2.9.0)

The chain loop in src/lib/workflow/run-orchestrator.ts breaks on any failed link,
unconditionally, right after the qaGate branch:

if (!result.success) {
  if (options.qaGate && options.chain) {           // 1346
    const qaFailed = result.phaseResults.some(
      (p) => p.phase === "qa" && !p.success,
    );
    if (qaFailed) break;                            // 1350  (can only reach the same break below)
  }
  break;                                            // 1352  UNCONDITIONAL — negates the branch above
}

Because line 1352 breaks regardless, the entire qaGate conditional (1346–1350) is inert: with
or without --qa-gate, and whether the failure was QA or not, the chain halts on the first
non-success link.

Supporting facts:

  • Flag defined: bin/cli.ts:299 — help text: "Wait for QA pass before starting next issue in chain (requires --chain)".
  • Plumbing: src/lib/workflow/types.ts:335, run-orchestrator.ts:652,1346,1548, commands/run-display.ts:85; validation (errors without --chain) at commands/run.ts:81.
  • The waiting_for_qa_gate IssueStatus exists in state-schema.ts:54 and is read by commands/status.ts, reconcile.ts, and state-cleanup.ts, but is never written by any runtime path (no status: "waiting_for_qa_gate" assignment anywhere in src/ outside tests).

Decision to make

Pick one during spec:

  1. Remove the flag (with deprecation). Keep it parsing so existing scripts don't hard-error;
    emit a one-line deprecation notice; delete the dead 1346–1350 branch and the misleading help
    text. Lowest surface, matches the boring-tech "reduce dead surface" goal.
  2. Make it actually gate. Change the loop so --qa-gate means halt only on a QA failure and
    continue past non-QA failures
    (the behavior the help text implies). Higher risk; only worth it
    if there's a real use case for continuing a chain past a non-QA failure.

Default lean: option 1 (remove-with-deprecation) unless a concrete need for gate-only-on-QA
surfaces — nobody is known to rely on "continue past non-QA failures".

Constraints

Acceptance Criteria

  • AC-1 Decision recorded (remove-with-deprecation vs make-it-actually-gate) with rationale.
  • AC-2 If removing: --qa-gate still parses (no hard error for existing scripts) but prints a deprecation notice; the dead 1346–1350 branch and the misleading help text are gone.
  • AC-3 If making it gate: the loop halts on a QA-phase failure but continues past a non-QA failure when --qa-gate is set; help text matches actual behavior; a regression test pins the branch/continue behavior.
  • AC-4 waiting_for_qa_gate status enum retained; status.ts/reconcile.ts/state-cleanup.ts still handle it (legacy-state compat).
  • AC-5 CHANGELOG [Unreleased] entry describing the change.

References

Activity

  1. admarble commented on Jul 25, 2026

    @admarble
    ContributorAuthor

    Plan (/spec) — #795

    Complexity: Standard (5 ACs, 4 directories)

    AC Quality Check

    ⚠️ The issue's own ACs do not parse. extractAcceptanceCriteria returns 0 items for this body. The four parser patterns in src/lib/ac-parser.ts:47-53 all require a colon bound to the ID (**AC-1:** or AC-1:); this issue writes - [ ] **AC-1** Decision recorded… — bold, no colon. Consequence: no AC rows land in .sequant/state.json, so downstream /qa AC tracking is blind for this issue.

    Not in scope here — tracked as an open question below. AC tracking for this run is done inline.

    Content lint (manual): AC-1/AC-4/AC-5 are measurable. AC-2 and AC-3 are mutually exclusive branches gated on AC-1's decision — only one can ever be satisfied. Effective AC count is 4.


    Scope Assessment

    Non-Goals: ⚠️ No explicit Non-Goals section. The Constraints section serves the same purpose (keep the waiting_for_qa_gate enum; no hard-removal without a deprecation window) and is treated as binding.

    Metric Value Status
    Feature count 1 (retire one inert CLI flag) ✅
    AC items 4 effective (5 listed, 2 mutually exclusive) ✅
    Directory spread 4 (bin/, src/, __tests__/, docs/) ✅

    Verdict: ✅ SCOPE_OK

    In-flight conflict check: only worktree is main, origin/main is 0 commits ahead. No overlap risk.


    AC-1 — Decision: Option 1, remove-with-deprecation

    Verification: Manual Test (decision + rationale recorded in this comment, the CHANGELOG entry, and the PR body)

    Rationale — three independent reasons, the second being decisive:

    1. Option 2 delivers nothing new. Its promise ("wait for QA pass before starting the next issue") is already what plain --chain does, and more strictly: the unconditional break at run-orchestrator.ts:1352 halts on any failure, QA included. There is no user-visible behavior --qa-gate could add on the halt side.

    2. Option 2's actual semantics are unsafe in chain mode specifically. The only behavioral delta Option 2 can offer is the continue side — "continue past a non-QA failure." But --chain rebases each successor onto the predecessor's committed work. If a predecessor fails at exec, there is no committed work; if it fails at PR creation, the base is half-formed. Continuing the chain past such a failure means every successor builds on a broken or absent base — the precise failure mode chain mode exists to prevent. Option 2 asks the flag to violate its own mode's core invariant.

    3. There is nothing half-built to finish. waiting_for_qa_gate is read in four places but written by zero runtime paths — it was never a partially-wired feature, so "make it actually gate" is net-new work, not completion.

    Rejected alternative (hard removal, no deprecation): --qa-gate is user-facing surface shipped since #133; a hard removal turns any existing script into a commander parse error. Deprecate-then-remove per the issue's own constraint.


    AC-2 — Remove with deprecation

    Verification: Unit Test (chain-break behavior) + Integration Test (flag still parses, run not aborted)
    Scenario: Given a script invoking sequant run 1 2 3 --chain --qa-gate → When run → Then the flag parses, one deprecation line prints, and the chain behaves exactly as --chain alone.
    Assumptions: No consumer depends on the current --qa-gate requires --chain hard error (grep confirms no test asserts that string).

    Four edits:

    Site Change
    run-orchestrator.ts:1345-1352 Delete the inert qaGate branch; keep the unconditional break with a comment stating chain halts on any failed link
    bin/cli.ts:299-301 Help text → deprecated/no-op wording (kept visible, not hidden — see Q2)
    run.ts:81-84 Replace the fatal ❌ --qa-gate requires --chain early-return with a non-fatal yellow deprecation notice; the run proceeds
    run-display.ts:84-87 Drop the QA gate: enabled (chain waits for QA pass) config line — same misleading claim in a second place

    Note the run.ts change is the load-bearing part of "no hard error for existing scripts": today --qa-gate without --chain aborts the run outright.


    AC-3 — Not applicable

    Option 2 not selected. AC-3 will be marked N/A with AC-1's rationale as the justification.


    AC-4 — Retain waiting_for_qa_gate

    Verification: Unit Test (existing state-cleanup.test.ts / reconcile.test.ts suites pass unchanged)
    Scenario: Given a legacy .sequant/state.json with status: "waiting_for_qa_gate" → When reconcileStateAtStartup runs against a merged PR → Then the entry escalates to merged (the #606 path).
    Assumptions: Zero edits to state-schema.ts:54, status.ts, reconcile.ts, state-cleanup.ts — verified by diff.

    Also retained deliberately: qaGate on RunOptions (types.ts:335), RunConfig (run-log-schema.ts:234), and the cliFlags push at run-orchestrator.ts:1548. Keeping the flag in run logs and metrics gives us usage telemetry to decide when hard removal is safe — deleting it now would blind that decision.


    AC-5 — CHANGELOG

    Verification: Manual Test ([Unreleased] section contains the entry)


    Implementation Plan

    Phase 1 — Runtime

    1. Delete the dead branch in run-orchestrator.ts; comment the unconditional break.
    2. bin/cli.ts help text → deprecated.
    3. run.ts: fatal validation → non-fatal deprecation notice.
    4. run-display.ts: remove the misleading config line.

    Phase 2 — Tests
    5. Rewrite __tests__/run-orchestrator.test.ts:309 — it is now tautological (it asserts a chain halt on QA failure, which the unconditional break produces with or without the flag, so it passes even against the bug). Replace with three assertions that actually discriminate: chain halts on a non-QA failure with --qa-gate set; identical halt without it; and --qa-gate absent --chain no longer aborts the run.
    6. Confirm state-cleanup / reconcile suites are untouched and green (AC-4).

    Phase 3 — Docs + CHANGELOG
    7. docs/reference/run-command.md — the flag row (:55) plus the ~75-line "QA Gate Mode" section (:380-455). That section documents a pause output block that is never printed and a waiting_for_qa_gate status that is never written; it is the largest single piece of misleading surface in the repo and is replaced by a short deprecation note.
    8. docs/reference/cheat-sheet.md:126,187 and docs/guides/git-workflows.md:169-174 — same treatment.
    9. docs/reference/chain-mode-analysis-2026-05.md:103 — left as-is with a dated note; it is a forensics record quoting a May 2026 state, and #759 already changed the live /assess suggestion it quotes. Rewriting history in a forensics doc would be wrong.
    10. CHANGELOG [Unreleased] entry.


    Design Review

    1. Where does this logic belong? Nowhere — that's the finding. The deprecation notice belongs in run.ts alongside the other constraint validations, since that is already the single place RunOptions combinations are vetted.
    2. Simplest correct approach? Delete the dead branch, downgrade the fatal validation to a warning, fix the four prose sites. No new abstraction, no deprecation framework — one console.log matches how every other run.ts validation reports.
    3. Existing pattern? Deprecate-in-place, mirroring solve-comment-parser.ts and the /solve → /assess alias: the old surface keeps working, says so loudly, and is removed on a later major.
    4. What would a senior reviewer challenge? "You're deleting the requires --chain validation — isn't that a silent behavior change?" It is a deliberate one: gating a no-op on another flag is theater, and keeping the abort would violate AC-2's "no hard error for existing scripts." The deprecation line replaces it and is strictly more informative. Second likely challenge: "why keep qaGate in the metrics cliFlags?" — answered under AC-4 (telemetry drives the hard-removal date).

    Feature Quality Planning

    All standard checks pass. Notable items:

    • The existing test is a false negative, not just stale. run-orchestrator.test.ts:309 passes against the buggy code and the fixed code — it never had power to catch this. Replacing it with a discriminating test is part of the fix, not cleanup.
    • Backward compat is the whole risk surface. The one real regression path is a user script that passes --qa-gate; it must not hard-fail. Covered by the AC-2 integration assertion.
    • No security, performance, migration, or accessibility dimension.

    No derived ACs.


    Open Questions

    1. AC parser misses **AC-1** (bold, no colon) — this issue's five ACs parse as zero. Recommendation: file a follow-up to widen the patterns at ac-parser.ts:47-53; do not widen it inside this PR (unrelated surface, and a parser change deserves its own regression corpus). Impact if ignored: any issue written in this style silently gets no AC tracking in state.
    2. Keep --qa-gate visible in --help, or hide it? Recommendation: visible, labeled deprecated. A deprecation window's purpose is to be discovered by people reading help output; hiding it converts a soft removal into a silent one. Impact if wrong: minor help-text noise for one release cycle.
    3. Hard-removal timing. Recommendation: next major, informed by the cliFlags telemetry retained under AC-4. Not decided in this PR.

    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: disabled (SCOPE_OK, single-feature removal)
    Reasoning: No ui/frontend/admin labels and no UI surface → no /test. testgen skipped despite Unit/Integration verification methods: this is a chore that modifies an existing test file, with no new module to stub — the testgen table's "bug fix / no new code stubs" row applies.


    Label Review

    Current: none
    Recommended: chore, no-browser-test
    Reason: CLI-surface cleanup with zero UI; no-browser-test makes the /test skip explicit rather than incidental.
    Quality Loop: Won't auto-enable — scope is green.

  2. added
    refactor
    cli
    no-browser-test
    planned
    on Jul 25, 2026
  3. admarble commented on Jul 25, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #795

    PR: #807 · Commit: 78364f2 · Reviewed inline (388-line diff, under the 600-line threshold where checker sub-agents become unreliable on worktree code).

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Decision recorded with rationale MET Option 1 (remove-with-deprecation). Rationale in the spec comment, PR body, commit message, and CHANGELOG. Decisive reason recorded: option 2's only behavioral delta is continuing past a non-QA failure, which contradicts chain mode's invariant that each successor rebases onto its predecessor's committed work.
    AC-2 Original Flag still parses, no hard error, prints deprecation; dead branch + misleading help gone MET Verified literally, clause by clause — see the breakdown below.
    AC-3 Original If making it gate… N/A Conditional on AC-1 selecting option 2; option 1 was selected. A regression test pins the rejected semantics so a future re-implementation is deliberate.
    AC-4 Original waiting_for_qa_gate enum retained; three consumers still handle it MET state-schema.ts, status.ts, reconcile.ts, state-cleanup.ts are absent from the diff (git diff --name-only confirms zero edits). Enum occurrences intact: state-schema 1, status 5, reconcile 1, state-cleanup 6. state-cleanup/reconcile/status suites pass untouched.
    AC-5 Original CHANGELOG [Unreleased] entry MET New ### Deprecated section with (#795).

    Coverage: 4/4 applicable AC met (AC-3 N/A by design). No derived ACs.

    AC-2 literal verification

    The AC has four independent clauses; each was checked against code, not intent:

    Clause Evidence
    "still parses (no hard error)" bin/cli.ts:299 still registers --qa-gate; integration test drives run 1 --qa-gate --dry-run and --qa-gate --chain — both exit 0
    "prints a deprecation notice" run-flags.ts:deprecatedFlagNotices → warnDeprecatedFlags, called at run.ts:32; asserted at unit and CLI level
    "the dead 1346–1350 branch is gone" grep qaFailed src/lib/workflow/run-orchestrator.ts → no match; the block is now a single if (!result.success) break;
    "the misleading help text is gone" run --help no longer matches /Wait for QA pass/, now matches /DEPRECATED/ — asserted in cli.integration.test.ts

    A fifth site the AC did not name but which carried the same false claim — run-display.ts's QA gate: enabled (chain waits for QA pass) header line — was also removed.


    Precheck Findings

    Section Status Surfaced
    Fixtures pass 1 motivating-example fixture (the buggy run-orchestrator.ts block quoted in the issue)
    Sibling-grep pass 2 new identifiers, 0 cross-file sibling sites
    AC literal-diff pass Issue lists AC-1…AC-5; PR body carries all five — missingInPR: []

    Source: .sequant/gap-precheck.json (schemaVersion 1)

    Fixture verification: the issue's motivating example is the defective code block. The AC-claimed post-fix result is that it no longer exists — confirmed by grep. Note this fixture is a bug reproduction, so "it matches nothing" is the passing condition, the inverse of the usual fixture check.


    CI Status

    Check State Bucket Impact
    typecheck SUCCESS pass ✅
    build (22.x) SUCCESS pass ✅
    node-floor-guard SUCCESS pass ✅
    validate-skills SUCCESS pass ✅
    validate-plugin SUCCESS pass ✅

    CI Summary: 5 passed, 0 pending, 0 failed. No CI-related ACs. (Markdown-only relaxation not applicable — the diff touches TypeScript; CI was waited out rather than relaxed.)


    Quality Metrics

    Metric Value Status
    Type issues (any added) 0 OK
    Deleted tests 0 OK
    Files changed 14 OK
    Lines added +270 —
    Lines deleted -118 —
    Security-sensitive paths 0 OK
    package.json changed No OK

    Local: npm run build ✅ · npm run lint ✅ (--max-warnings 0) · lint:skill-sync ✅ 42/42 · lint:skill-calls ✅ · full suite 200 files, 4,268 tests, 0 failures.


    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/lib/workflow/run-orchestrator.ts Standard ✅ __tests__/run-orchestrator.test.ts (new 4-case matrix)
    src/commands/run-flags.ts Standard ✅ src/commands/run-flags.test.ts (4 new cases)
    src/commands/run.ts Standard ✅ src/commands/cli.integration.test.ts (end-to-end)
    bin/cli.ts Optional ✅ src/commands/cli.integration.test.ts (run --help)
    src/commands/run-display.ts Optional ✅ src/commands/run-display.test.ts

    Coverage: 5/5 changed source files have corresponding tests. Critical paths without tests: none.


    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Assertions are on observable outcomes (results length, call count, stdout, help text), not internals
    Coverage Depth ✅ OK Matrix varies failing phase × flag; the rejected option-2 semantics is pinned explicitly
    Mock Hygiene ✅ OK Reuses the file's existing mock harness; nothing new mocked
    Test Reliability ✅ OK Deterministic; the integration tests shell out to the built CLI

    Notable — the replaced test was a false negative, not merely stale. should stop chain if QA fails with qaGate enabled asserted only the QA-failure-with---qa-gate case, which the unconditional break satisfies with or without the gate. It passed against the defective code and against the fix, so it never had power to detect the bug. Replacing it is part of the fix, not cleanup.

    Similarly, phase-executor.test.ts's #749 case re-created the chain-break predicate inline ([qaResult].some(p => p.phase === "qa" && !p.success)) and asserted on that local expression. Once #795 deleted that predicate from production, the assertion corresponded to nothing. Rewritten to assert the phase result that actually drives the chain (success === true) — a real call into mapAgentSuccessToPhaseResult.

    Verified empirically, not assumed: the new CLI integration tests were observed failing before the fix landed (the first attempt printed ❌ Sequant is not initialized because the notice sat behind the manifest guard) and passing after it was moved. This is a genuine fail-before/pass-after, not a post-hoc rationalization.


    Anti-Pattern Detection

    Dependency Audit: N/A — no package.json change.

    Code Patterns: no findings. No any, no empty catch, no secrets, no SQL concatenation, no uncleared timers, no await in a loop.

    One deliberate cleanup worth flagging as reviewed and reverted: npm install in the worktree rewrote package-lock.json to drop libc fields from optional platform deps (an npm-version artifact). That churn was reverted out of the PR — the lockfile is unmodified.


    Call-Site Review

    New exported functions: 2

    Function Call Sites Loop? Conditions AC Match
    warnDeprecatedFlags() src/commands/run.ts:32 No Unconditional; the flag guard lives inside ✅ Matches AC-2
    deprecatedFlagNotices() run-flags.ts:warnDeprecatedFlags + 4 unit tests No Pure ✅ Matches AC-2

    Entry-point completeness check (the real risk here): if any code path reaches a run without going through runCommand, --qa-gate would silently skip its notice. Traced: bin/cli.ts:362 is .action(runCommand) — the sole entry — and grep qaGate src/mcp/ returns nothing, so the MCP sequant_run surface never accepts the flag. The notice covers 100% of the flag's reachable surface.


    CLI Registration Verification

    Interface Field Runtime Usage CLI Registered Status
    qaGate run-flags.ts (notice), run-orchestrator.ts:652 (run log), :1545 (metrics cliFlags) --qa-gate in bin/cli.ts:299 ✅ OK

    Verification Status: Passed. No fields added or removed from RunOptions; qaGate is deliberately retained on the interface so residual usage keeps flowing into run logs and metrics, which is what will tell us when hard removal is safe.


    Execution Evidence

    Test Type Command Exit Code Result
    Help text node dist/bin/cli.js run --help 0 Shows DEPRECATED (#795); no "Wait for QA pass"
    Smoke (no chain) node dist/bin/cli.js run 1 --qa-gate --dry-run 0 Prints deprecation notice; run proceeds (previously aborted)
    Smoke (with chain) node dist/bin/cli.js run 1 --qa-gate --chain --dry-run 0 Prints deprecation notice
    Build npm run build 0 Clean
    Lint npm run lint 0 Clean

    Evidence status: Complete. All three CLI invocations are pinned as automated tests rather than one-off manual runs.


    Smoke Test

    Test Command Result Notes
    Happy path run 1 --qa-gate --chain --dry-run ✅ Warns, proceeds
    Edge case run 1 --qa-gate --dry-run (no --chain) ✅ Warns, proceeds — the previously-fatal combination
    Error handling run --help ✅ Deprecated wording present

    Smoke Test Status: Complete.


    Skill Command Verification

    N/A — no .claude/skills/**/*.md files changed. (§6c Detection Pattern Verification precondition is false — no skill markdown with regex/grep/awk/jq/sed in the diff hunks — so that section is omitted rather than recited.)


    Behavior-Rule Survival Check

    Status: N/A — no AC meets the ≥2-keyword behavior-rule heuristic (AC-3 has one occurrence of behavior; no other AC matches).


    Quality Plan Verification

    Dimension Items Planned Items Addressed Status
    Completeness 4 (runtime, tests, docs, changelog) 4 ✅ Complete
    Error Handling 0 (no new error paths) — N/A
    Code Quality 2 (no new abstraction, follow deprecate-in-place precedent) 2 ✅ Complete
    Test Coverage 2 (replace false-negative test, backward-compat assertion) 2 ✅ Complete
    Best Practices 1 (deprecate-then-remove) 1 ✅ Complete
    Polish — — N/A (not a UI feature)

    Derived ACs: none. Quality Plan Status: Complete.


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes (conventional-commit gate) Commit prefix is chore(#795), outside the feat|fix|perf|refactor|docs detection set — so the gate is not triggered
    [Unreleased] entry ✅ Present anyway (required by AC-5)
    Entry format ✅ Under ### Deprecated, includes (#795)

    Result: Requirements met. Worth noting the gate would have skipped silently here — AC-5, not the automated check, is what forced the entry.


    Risk Assessment

    • Likely failure mode: A user or script passing --qa-gate without --chain now proceeds into a real run where it previously aborted at the validation gate. If someone had (accidentally) been relying on that abort as a guard — e.g. a script that passes --qa-gate expecting a no-op exit — it would now execute a full workflow. This is the intended behavior per AC-2's "no hard error", and no test or doc ever described the abort as a feature, but it is the one behavioral change that goes beyond "the flag does nothing."
    • Not tested: the notice's interaction with --quiet/-s is not asserted either way (see the divergence noted below). Nothing exercises --qa-gate through an actual multi-issue chain end-to-end — the chain behavior is covered at the orchestrator unit level with a mocked runIssue, not by a real three-issue run.
    • Sibling sites considered (cross-file): Swept every RunOptions field for the same "declared but unconsumed" defect class. testgen and smartTests are genuinely consumed. experimentalTui is a deliberate no-op — but note it is registered via .addOption(new Option(...).hideHelp()), i.e. the repo's existing precedent hides deprecated flags from help, which this PR diverges from (see below). reuseWorktrees (types.ts:319) is a real sibling: it carries a doc comment promising behavior ("Reuse existing worktrees instead of creating new ones"), has no CLI flag, and has zero consumers anywhere in src/, bin/, or scripts/. Milder than --qa-gate (no user-facing false promise, since no flag exposes it) and deliberately not fixed here — see follow-ups.
    • Sibling-line audit (intra-file): the chain loop in run-orchestrator.ts was re-read for other conditionals that re-test a predicate immediately before an unconditional exit. The only other early exit is the chain-link provisioning guard at ~:1300 (abortReason: chain link could not be established), which breaks on a genuinely distinct condition and has no redundant inner branch. No further inert branches in this function.

    Adversarial Re-Read

    Findings — four surfaced, none blocking:

    1. --quiet divergence (design decision, flagged for review). warnDeprecatedFlags is called before the if (!options.quiet) block, so the notice prints even under -s/--quiet. The file's existing precedent gates the version warning on !options.quiet, so this is inconsistent with the surrounding convention. It was done deliberately: CI scripts — the population most likely to still pass --qa-gate — are also the population most likely to use --quiet, and suppressing the notice there would defeat the deprecation window's whole purpose. Reviewer may overrule; the trade-off is one extra line in quiet CI output.

    2. hideHelp() precedent divergence (design decision, flagged for review). --experimental-tui, this repo's only other deprecated-to-no-op flag, is hidden from --help. This PR keeps --qa-gate visible and labelled DEPRECATED. Rationale: --qa-gate was documented across four user-facing docs and shipped since Chain mode: Add QA gate option to prevent stale downstream issues #133, so users need to find the deprecation notice; --experimental-tui was always an unadvertised experimental alias. Defensible, but it is a conscious break from local precedent and the reviewer should know it was a choice rather than an oversight.

    3. Scope expansion forced by an unrelated guard (disclosed). The notice could not live inline in run.ts: that file has a hard ≤200-LOC "thin adapter" guard (__tests__/integration/run-orchestrator.integration.test.ts, arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503 AC-2) with only 2 lines of headroom, and the first attempt pushed it to 208 and failed that test. This is why run-flags.ts gained two functions. Reported here because it is real added surface that AC-2 did not ask for; the alternative was raising a guard that exists for a reason.

    4. Non-Goals check. The issue's Constraints section functions as its Non-Goals: (a) keep the waiting_for_qa_gate enum — honored, zero edits to its four consumers; (b) prefer deprecate-then-remove over hard removal — honored. Neither has silently expanded.

    Evidence-claim audit: the one claim that could have been a bug-repro-dressed-as-validation — "the new integration tests prove the fix" — was checked: those tests were observed red before and green after, and the change that flipped them is identified (moving the notice ahead of the manifest guard).

    Status: Gaps Found


    Verdict: AC_MET_BUT_NOT_A_PLUS

    Every applicable acceptance criterion is met and verified literally, all five CI checks pass, the full local suite is green (4,268 tests), and the change is well-tested — including replacing a test that had no power to detect the defect it claimed to cover.

    Short of A+ for one reason: the PR contains two deliberate divergences from local precedent (printing under --quiet; keeping the flag visible in --help where --experimental-tui is hidden) that are judgment calls a reviewer may want to overrule, plus added surface in run-flags.ts that AC-2 did not request, forced by the run.ts LOC guard. None is a defect; all three deserve a human's eye before merge rather than an automatic pass.

    Per project policy this verdict breaks to PR — do not run /loop on it.

    Documentation

    • docs/reference/run-command.md updated (flag table + the ~75-line "QA Gate Mode" section replaced with a migration note)
    • docs/reference/cheat-sheet.md, docs/guides/git-workflows.md updated
    • docs/reference/chain-mode-analysis-2026-05.md annotated as superseded (left intact — it is a dated forensics record)
    • CHANGELOG [Unreleased] entry added
    • Main README / marketplace README checked — neither mentions --qa-gate

    Next Steps

    1. Review the two flagged design divergences (--quiet behavior, --help visibility). Both are one-line changes if you want them the other way.
    2. Merge PR chore(#795): deprecate --qa-gate, an inert no-op flag #807 if the divergences are acceptable.
    3. Suggested follow-ups — not filed, your call:
      • reuseWorktrees (types.ts:319) is declared with a behavior-promising doc comment and has zero consumers. Same dead-surface class as --qa-gate, milder because no CLI flag exposes it. Would fit the boring-tech audit's remaining backlog.
      • src/lib/ac-parser.ts:47-53 requires a colon bound to the AC id (**AC-1:** or AC-1:). This issue writes - [ ] **AC-1** …, so extractAcceptanceCriteria returned 0 items and no AC rows reached .sequant/state.json for this run. Any issue authored in that style silently loses AC tracking. Deliberately not widened here — a parser change needs its own regression corpus.
  4. added
    needs-improvement
    on Jul 25, 2026
  5. added a commit that references this issue on Jul 25, 2026
  6. admarble commented on Jul 25, 2026

    @admarble
    ContributorAuthor

    QA Re-Review for Issue #795 — gaps addressed

    PR: #807 · Commit: 1d314ef · Previous verdict AC_MET_BUT_NOT_A_PLUS (78364f2).

    All four gaps from the prior review are resolved. Resolving gap 1 surfaced a real defect underneath it.

    Gap resolutions

    # Gap Resolution
    1 Notice printed under --quiet, diverging from the version warning Policy kept, mechanism fixed. The divergence was correct — quiet suppresses progress/version chatter, not warnings — but the notice was on console.log. Deprecation warnings belong on stderr (node/python/gcc convention, and already this repo's own at abort.ts:117). Now console.error, which also keeps a consuming script's piped stdout clean, dissolving the original objection.
    2 --qa-gate visible in --help while --experimental-tui uses hideHelp() No change — the split is correct. Deprecated-but-supported flags stay visible marked deprecated (kubectl/docker/git); hideHelp is for never-advertised flags. --qa-gate shipped in #133 and is documented in four places; --experimental-tui never was. Added a comment at bin/cli.ts:298 so this doesn't get "fixed" later.
    3 run-flags.ts surface AC-2 didn't request Not a defect — closing as by-design. #503's intent is "run.ts is a thin adapter"; moving flag logic out serves that intent. run.ts is 199/200.
    4 Follow-ups: reuseWorktrees, ac-parser ac-parser was independently fixed and merged as #808/PR #809 while this PR was open. reuseWorktrees filed as #810.

    The defect found under gap 1

    warnDeprecatedFlags wrote to stdout. Any script doing sequant run … | … would have received the deprecation line in its data stream. Now on stderr, with both choices documented in the function's JSDoc so neither reads as an oversight.

    Fail-before/pass-after verified: temporarily reverting console.error → console.log fails 6 of 6 new assertions; restoring passes all 35 in the two files. Not assumed — observed both directions.

    New tests

    Test Pins
    warnDeprecatedFlags → stderr, not stdout unit, spies on both streams
    warnDeprecatedFlags still fires under --quiet unit
    silent when no deprecated flag set unit
    CLI: notice on stderr integration
    CLI: stdout stays clean integration
    CLI: still warns under --quiet integration

    The CLI integration tests moved from execSync to spawnSync: no shell means no cmd.exe-vs-sh redirection difference (my first version used 2>/dev/null + an explicit /bin/sh, which would have broken any Windows contributor running npm test — CI is Linux-only so it would have passed unnoticed), and separable streams let one run assert "on stderr and not on stdout".

    Merge with main

    Branch was 3 commits behind. Merged (not rebased — it's pushed). One conflict in CHANGELOG.md: my ### Deprecated vs #808's ### Fixed, both under [Unreleased]. Resolved by keeping both in Keep-a-Changelog order. phase-executor.test.ts auto-merged; verified my rewritten #749 test survived intact.

    Bonus validation: #808's parser fix now reads this very issue's ACs — extractAcceptanceCriteria returns 5 where it previously returned 0.

    Verification

    Check Result
    CI (5 checks) ✅ all SUCCESS on 1d314ef
    Mergeable ✅ MERGEABLE / CLEAN
    npm run build / npm run lint ✅ clean
    Targeted suites (8 files) ✅ 401 passed
    __tests__ + workflow + merge-check ✅ 2261 passed, 0 failed
    run.ts LOC guard (#503) ✅ 199/200

    On intermittent failures: an earlier full-src run showed 16, then 9, then 2 failures across runs — all timeouts in process-spawning integration tests (semgrep, locks, phase-registry), none touching this PR's code. Confirmed environmental by running src/lib/semgrep.test.ts on clean main, where the same 3 tests fail identically. Clean re-runs are green. This is the known worktree-timeout class, not a regression here.

    AC Coverage (unchanged)

    AC-1 MET · AC-2 MET · AC-3 N/A (option 2 rejected) · AC-4 MET · AC-5 MET

    Verdict: READY_FOR_MERGE

    The three flagged divergences are resolved — one by fixing a real defect it was masking, two by confirming and documenting the choice. Both follow-ups are dispatched (#810 filed; ac-parser fixed upstream by #808). CI green, branch merged with main, clean.

  7. added
    ready-for-review
    and removed
    needs-improvement
    on Jul 25, 2026
  8. added a commit that references this issue on Jul 26, 2026
  9. added 8 commits that reference this issue on Jul 26, 2026
  10. added 2 commits that reference this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clino-browser-testplannedready-for-reviewrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions