Skip to content

feat(ready/qa): first-class human-decision ACs — stop the ready loop cleanly instead of burning its budget #942

Open

Description

@admarble

Motivation

There is no first-class way for an issue to say "this point is a product decision — ask, don't infer." The nearest mechanism is §3a manual-test detection: ACs naming manual steps become PENDING, which routes the verdict to NEEDS_VERIFICATION. But in sequant ready's loop, NEEDS_VERIFICATION can never satisfy either policy — isAtThreshold (src/lib/workflow/ready-gate.ts:195-202) returns true only for READY_FOR_MERGE (both policies) or AC_MET_BUT_NOT_A_PLUS (ac policy). A pending human question therefore burns the entire iteration budget re-running qa/loop cycles that cannot resolve it, then exits MAX_ITERATIONS — the failure is reported as loop exhaustion when the true state is "waiting on a human answer." Tokens are spent to discover nothing.

The behavioral risk on the other side: an agent that is not told a decision is human-owned will infer it. The audit's requirement-gap catch (#785 — an AC phrase "literally undefined for two-thirds of the verdicts") shows what inference produces: a confident implementation of one arbitrary interpretation, caught only by the manual second look.

Proposal

A declared human-decision class with a clean early stop.

Declaration (two forms, both line-anchored single lines):

- [ ] **AC-4:** Resend extends invite expiry (Human decision: extend or preserve?)

and/or an issue-level section:

## Human decisions required
- Should resending an existing invitation extend expiry or preserve it?

Parser: parseACLine sets a new humanDecision: boolean on ACs carrying the (Human decision: ...) clause; a ## Human decisions required section parses like parseNonGoals (heading-bounded list).

Consumers:

  1. /spec must not plan an implementation for an undeclared side of a human decision — it lists open decisions in the plan comment and stops short of choosing (matches the existing plan-approval flow).
  2. /qa routes humanDecision ACs to PENDING (reusing the §3a → NEEDS_VERIFICATION path — zero new verdicts).
  3. sequant ready: when the only non-MET ACs are humanDecision ACs, stop immediately with a new terminal reason WAITING_FOR_HUMAN_DECISION (joins the existing nine ReadyTerminalReason values) instead of iterating to MAX_ITERATIONS. Exit code stays 1 (needs-human), status stays blocked — the enum value is the only addition.
  4. The structured gap report (if the gap-schema issue lands first) emits these as requirement_gap / pause_for_human findings; otherwise they render in the existing report prose.

Non-Goals

Tailored caveats

  • Single-line AC clause (line-anchored parser); the section parser reuses the parseNonGoals boundary rule (next heading of any level closes it) rather than inventing a new one.
  • ready's loop-context prompt (buildLoopContext) must exclude humanDecision ACs from "fix ONLY the unmet ACs" instructions, or the loop will thrash trying to implement an unanswerable AC before the stop check runs.
  • New ReadyTerminalReason value must be added to getReadyExitCode, formatReadyReport, the --json payload, and (if feat(ready): sequant ready never records run metrics — no visibility into escalation, iteration counts, or gate outcomes #929 has landed) the metrics record — enum-widening has a history of silent partial consumers (grep-as-checklist across all ReadyTerminalReason switch sites).
  • State CLI rejects derived AC IDs — fixtures use trailing sequential IDs.

Acceptance Criteria

  • AC-1: The (Human decision: ...) AC clause and the ## Human decisions required section both parse into state, line-anchored, with prose quotes not triggering. Evidence: parser unit tests including a false-positive prose fixture.
  • AC-2: /qa marks humanDecision ACs PENDING via the §3a path with no new verdict values. Evidence: scoped gate test on §3a text, mutation-verified; QaVerdictSchema unchanged.
  • AC-3: sequant ready stops on the first QA pass when only humanDecision ACs are non-MET, with terminal reason WAITING_FOR_HUMAN_DECISION, exit code 1, zero loop dispatches. Evidence: unit test on runReadyGate with a stubbed QA result asserting zero loop calls and the new reason.
  • AC-4: All ReadyTerminalReason consumers handle the new value (exit-code map, report formatter, --json, metrics if present). Evidence: grep-derived checklist of switch/map sites in the PR body, each with a covering assertion.
  • AC-5: buildLoopContext excludes humanDecision ACs from fix instructions. Evidence: unit test asserting the generated prompt omits the human-decision AC and names it as excluded.
  • AC-6: The verbatim motivating scenario — an issue whose sole open item is a product question — exists as a fixture driving AC-3's test. Evidence: fixture file referenced by the test.

Human decisions required

  • Should WAITING_FOR_HUMAN_DECISION also post an issue comment listing the open questions (piggy-backing the gap-schema issue's comment if that lands first, standalone comment otherwise)?

Context

From the 2026-08-13 strategy review (per-issue contract fields; the "Autonomy" clause reshaped onto existing machinery). Fits the autonomy roadmap (#817/#818/#819 — the human merge gate stays; this adds a human decision gate with the same philosophy). Related: #785 (inference-on-undefined-AC catch), ready-gate budget-burn analysis from the flow map.

Activity

  1. admarble commented on Oct 16, 2026

    @admarble
    ContributorAuthor

    Field input from varius: a DEFERRED AC status (2026-08-15, local /qa override).

    varius #3's AC-4 needed the gmail.modify OAuth scope, which the project's permission policy holds back for a validation week. The tool was built, live-tested (it returned 403), removed, and the AC was deferred to #12. Stock /qa floors that at AC_NOT_MET, so every recurrence needs a hand-written override. The local rule adds DEFERRED, allowed only when all three hold and are stated in the AC row:

    1. A specific blocker outside the code (a scope or permission gate, a policy waiting period, another team's system). "Out of time" or "decided not to" doesn't count.
    2. A follow-up issue filed and linked, naming the unblock condition.
    3. No half-built code left behind: the implementation was removed or never started.

    It is routed like PENDING: pending + deferred > 0 with no NOT_MET or PARTIALLY_MET gives NEEDS_VERIFICATION.

    How it relates to this issue and to existing machinery:

    Recorded here as input to #942's design, not as a separate request.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions