Skip to content

chore(cli)!: remove --stacked, --reflect and --full-qa — flags, run.fullQa, the MCP fullQa parameter and run-reflect.ts; --chain keeps working #1648

Closed

Description

@admarble

Epic: graph-2026-11-simplify (F-10 cluster of #1501) Tier: mechanical Execution: sequant_run Blocked by: #1647 (both edit bin/cli.ts, KNOWN_KEYS in settings.ts, types.ts and src/commands/run.ts)

Problem

D-1. In 453 recorded runs --stacked, --reflect and --full-qa were each used 0 times. --reflect is read once (run-display.ts:297) and calls run-reflect.ts (291 lines). --stacked implies --chain (run.ts:67-74) and threads a predecessor base through worktree-manager.ts and batch-executor.ts:1406. --full-qa exists as a flag, the run.fullQa setting (#982) and a fullQa parameter on MCP sequant_run (src/mcp/tools/run.ts:655). D-3 keeps --chain, so the stacked-only paths go and the chain paths stay. Founding doc §4, OQ-1.

Decisions

ID Decision Rejected
X-1 ExecutionConfig.fullQa (#683) stays: sequant ready forces it on every gate pass (settings.ts:383-389). Only the opt-in surfaces go: --full-qa, run.fullQa, the MCP fullQa parameter removing the config field (breaks sequant ready)
X-2 The MCP input schema strips unknown keys (no .strict() in src/mcp/tools/run.ts), so a caller still passing fullQa is ignored, not refused. OQ-1's grep is the check; no new warning surface a strict schema for one removed key

Prior fixes / producers

Acceptance Criteria

  • AC-1: None of the three flags appears on run or ready. Evidence: for c in run ready; do npx tsx bin/cli.ts $c --help; done | grep -cE -- '--stacked|--reflect|--full-qa' → 0
  • AC-2: run-reflect.ts is gone and nothing imports it. Evidence: grep -rl 'run-reflect' src bin --include='*.ts' | wc -l | tr -d ' ' → 0
  • AC-3: The MCP tool no longer accepts fullQa and the setting is gone. Evidence: { grep -c 'fullQa' src/mcp/tools/run.ts; awk '/^const REMOVED_KEYS/,/^};/{next} {print}' src/lib/settings.ts | grep -c 'fullQa'; } | awk '{s+=$1} END{print s}' → 0 (the REMOVED_KEYS block is excluded, because AC-4's warning names the key there; rewritten 2026-11-09 with the owner's consent)
  • AC-4: A settings file that sets run.fullQa loads with one warning naming the removal in 3.0. Evidence: npx vitest run src/lib/settings.removed-keys.test.ts -t "fullQa" → ≥ 1 passed, 0 failed
  • AC-5: --chain still provisions, rebases and resumes. Evidence: npx vitest run src/lib/workflow/chain-preflight.test.ts src/lib/workflow/chain-resume.test.ts src/lib/workflow/chain-rebase.integration.test.ts → 0 failed (constraint)
  • AC-6: User docs no longer offer them. Evidence: grep -rlE -- '--stacked|--reflect|--full-qa|fullQa' README.md docs/reference docs/features docs/guides docs/getting-started | wc -l | tr -d ' ' → 0
  • AC-7: The changelog records the removal. Evidence: awk '/^## \[Unreleased\]/,/^## \[[0-9]/' CHANGELOG.md | grep -cE -- '--stacked|--reflect|--full-qa' → ≥ 1
  • AC-8: No skill-directory edits. Evidence: git diff --name-only $(git merge-base origin/main HEAD)..HEAD | grep -cE '^(plugin/|\.claude/skills/|templates/skills/)' → 0 (constraint)

OQ-1 (does any MCP caller pass fullQa): exec greps ~/Projects/harness and docs/internal/graph-*/HANDOFF.md and records the count in the PR body; no AC depends on it.

May touch

bin/cli.ts (the three .option( blocks only), src/lib/settings.ts, src/mcp/tools/run.ts and test, src/commands/run.ts, src/commands/run-display.ts, src/lib/workflow/run-reflect.ts and test (deleted), full-qa.test.ts (deleted), types.ts, batch-executor.ts and worktree-manager.ts (stacked branches only), their tests, docs/reference/run-command.md (flag rows only), CHANGELOG.

Non-Goals

Done when

No flag, setting, MCP parameter or user doc offers stacked PRs, reflection or full-weight QA, and the chain suite is green.

Activity

  1. added
    graph-2026-11-simplify
    on Nov 7, 2026
  2. admarble commented on Nov 10, 2026

    @admarble
    ContributorAuthor

    Runner context, 2026-11-09: repo state since this issue was written

    #1647 merged as fad6b401e (PR #1664). Read main at fad6b401e.

  3. admarble commented on Nov 10, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (8 ACs, ~9 directories)

    AC Quality Check

    • AC-1: Evidence is command-shaped and fails today (three flags exist in bin/cli.ts:363,423,459). Note ready has no such options today, so that half passes vacuously; the run half gates the work.
    • AC-2, AC-3, AC-6, AC-7: fail on main today (run-reflect imported at run-display.ts:28; AC-3 returns 12 per runner context; docs hit in README, run-command.md, features/stacked-prs.md; no changelog entry).
    • AC-4: needs a new test named with fullQa in src/lib/settings.removed-keys.test.ts. AC-5, AC-8 are constraints, not gates.
    • AC-6 greps docs/features, so docs/features/stacked-prs.md must be deleted, and any links to it fixed.

    Scope Assessment

    Non-Goals: present (/reflect skill text, --chain, #1651, sequant ready).

    Metric Value Status
    Feature count 3 flags, one removal class ⚠️
    AC items 8 ✅
    Directory spread ~9 ⚠️

    Verdict: ⚠️ SCOPE_WARNING (many files, mechanical)

    Acceptance Criteria

    AC-1 — flags gone from run/ready

    Verification: Integration Test (CLI help grep). Scenario: Given the CLI → When run --help → Then no --stacked|--reflect|--full-qa.

    AC-2 — run-reflect.ts deleted, no importers

    Verification: Integration Test (grep). Remove run-display.ts:28 import and the :297 block.

    AC-3 — MCP fullQa and run.fullQa setting gone

    Verification: Integration Test (the rewritten grep; 12 today). Keep the REMOVED_KEYS entry.

    AC-4 — run.fullQa in a settings file warns once

    Verification: Unit Test. Add "run.fullQa" to REMOVED_KEYS (settings.ts:840) and a fullQa test. Reuse the #1647 mechanism.

    AC-5 — chain still works

    Verification: Unit/Integration Test (the three chain suites). Constraint.

    AC-6 — user docs clean

    Verification: Integration Test (grep).

    AC-7 — changelog entry

    Verification: Integration Test (awk/grep) under [Unreleased].

    AC-8 — no skill-dir edits

    Verification: Integration Test (git diff grep). Constraint.

    Implementation Plan

    Phase 1: Remove surfaces

    1. bin/cli.ts: delete the three .option( blocks (363, 423, 459).
    2. src/commands/run.ts:67-74: delete the --stacked implies---chain block and the --no-chain rejection.
    3. run-display.ts: drop the import (28) and the --reflect block (297). Delete run-reflect.ts and run-reflect.test.ts.
    4. settings.ts: remove RunSettings.fullQa (365), schema (621), KNOWN_KEYS entry (793), default (1076), and doc comments (361-363, 619). Add "run.fullQa" to REMOVED_KEYS.
    5. src/mcp/tools/run.ts: remove the fullQa schema (659), type, destructure, the --full-qa push (695), and the passthrough (728-759).
    6. config-resolver.ts:571: set fullQa to false or drop it. Per X-1, ExecutionConfig.fullQa (types.ts:218) stays; ready-gate.ts:726 still sets it.

    Phase 2: Stacked-only paths (keep chain)

    1. types.ts: remove stacked (543), reflect (610), run-options fullQa (697), and the stackManifest field (863) plus the predecessor-base fields that only stacked sets (~854-861). Check whether predecessorBranch has chain-only users before removing.
    2. run-orchestrator.ts: delete buildStackManifest (125) and the options.chain && options.stacked block (2097-2115). Keep the chain rebase and resume code at ~2029-2071.
    3. batch-executor.ts:1383-1391 and worktree-manager.ts (resolvePrBase's stackPrBase, stackManifest, stackOptions): remove the stacked branches, keeping the baseBranch and --base logic from fix(run): --base creates the worktree from the branch but opens the PR against the repo default branch #1386.

    Phase 3: Tests, docs, changelog

    1. Delete full-qa.test.ts. Update run.test.ts, mcp/tools/run.test.ts, worktree-manager.test.ts, run-options-dead-surface.test.ts, run-preflight-exit.test.ts. ready-gate.test.ts and assess-collision-detect.test.ts likely stay (check; the latter's "reflect" is the skill name).
    2. Docs: the flag rows at run-command.md:54,69, the "Stacked PRs" section (~497-550), and the fullQa snippets (818, 835). Edit README.md:199-202 and :332. Delete docs/features/stacked-prs.md and fix inbound links.
    3. CHANGELOG [Unreleased]: one entry beside feat(run): the quality loop halts on a second consecutive AC_NOT_MET — its own counter, no ladder needed; maxIterations stays 3 #1646/chore(cli)!: remove the model ladder and effort escalation — modules, --model-ladder and --escalate-effort on run and ready, their settings and docs; old logs and settings still load #1647/fix(run)!: no label adds the test phase to a phase list the user or detection chose — remove the UI-label insertion in determinePhasesForIssue (closes #1631) #1649 (names all three flags and the run.fullQa warning).
    4. OQ-1: grep ~/Projects/harness and docs/internal/graph-*/HANDOFF.md for fullQa, and record the count in the PR body.

    Design Review

    1. Where does it belong? Per-surface removal, as the issue says. ExecutionConfig.fullQa stays (X-1).
    2. Simplest approach: delete; reuse chore(cli)!: remove the model ladder and effort escalation — modules, --model-ladder and --escalate-effort on run and ready, their settings and docs; old logs and settings still load #1647's REMOVED_KEYS. No new mechanism and no strict schema (X-2). Rejected: removing the config field, which would break sequant ready.
    3. Pattern: removals arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503–arch: in-process MCP engine — eliminate subprocess indirection and enable real-time streaming #508 and chore(cli)!: remove the model ladder and effort escalation — modules, --model-ladder and --escalate-effort on run and ready, their settings and docs; old logs and settings still load #1647. The removed-key warning follows the same pattern, so it is not a re-patch.
    4. Reviewer challenge: "why does ExecutionConfig.fullQa remain?" Because ready needs it.
    5. Producers/consumers (grepped): fullQa is set by config-resolver, ready-gate and MCP, and read by phase-executor.ts:1679. stackManifest and prBase are produced only by run-orchestrator and consumed by batch-executor and worktree-manager. No divergence from the issue's prescription.

    Feature Quality Planning

    • AC-3 and AC-4 interact: the grep excludes only the REMOVED_KEYS block, so keep the fullQa string out of any comment elsewhere in settings.ts.
    • AC-6 greps for fullQa in docs. Check that docs/reference/run-command.md does not describe ExecutionConfig.fullQa or sequant ready using that word.
    • Strip stale comments mentioning --stacked (e.g. worktree-manager.ts:899).
    • Run vitest in the worktree, not the main checkout (per runner context).

    Open Questions

    1. predecessorBranch removal. Recommendation: remove it if only stacked sets it. Impact if wrong: breaks the chain base path. Confirm with the chain tests (AC-5).

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Mechanical removal with explicit ACs. No UI. Evidence is grep-based, so no testgen. AC-4 is a single test that exec writes.

    Label Review

    Current: graph-2026-11-simplify. Recommended: add planned. Quality Loop: won't auto-enable.

  4. added
    planned
    on Nov 10, 2026
  5. added a commit that references this issue on Nov 10, 2026
  6. admarble commented on Nov 10, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 8/8 met

    Gaps:

    • /assess still recommends the removed --stacked flag and /merger still documents stacked-PR detection; AC-8 kept skill edits out of this PR, so a follow-up issue is needed
    • OQ-1 MCP-caller count (0) not recorded in the PR body as the issue asked; no AC depends on it
    • /assess still recommends a flag that no longer exists. .claude/skills/assess/SKILL.md:217 and templates/skills/assess/SKILL.md:217 describe --stacked, and sequant run 1 --stacked now prints error: unknown option '--stacked'.
    • /merger (SKILL.md:630, 667, 672) still describes how to detect sequant run --stacked PRs. It is harmless, but it is dead guidance.
    • AC-8 (no skill edits) correctly kept both out of this PR, so they need a follow-up issue.

    Suggestions:

    • Three edited comments are left as overlong lines because prettier does not re-wrap comments:
    • run-orchestrator.ts:2011
    • run-orchestrator.ts:2051-2052
    • worktree-manager.ts:2740
    • OQ-1's count is not recorded in the PR body, as the issue asked. I ran the grep: 0 hits for fullQa in ~/Projects/harness and 0 in docs/internal/graph-*/HANDOFF.md.
    • docs/adr/0004-…md:14,28 still mentions --stacked. That is acceptable, because an ADR is a historical record.

    Reviewed in a separate session by claude-code (claude-opus-5-5); the change was written by claude-code (claude-sonnet-5-5).

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

    graph-2026-11-simplifyplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions