Repository navigation
Description
Epic: graph-2026-11-simplify (found by the #1655 smoke) Tier: judgment Execution: split
Problem
D-8: Evidence that names an env file, a production CLI or a live URL goes to a person instead of being run. #1652 hands the qa dispatch a "do not run" block, and #1681 extends it to the ready gate's qa passes. The #1655 smoke (2026-11-16, main at 677e1bbde, notes-fixture #37) showed the qa agent obeying the block: it didn't run AC-2's npx tsx --env-file=.env.local scripts/smoke-check.ts and reported it PENDING. The exec agent ran that exact command in both of its attempts, as part of checking its own work. Only the sandbox and the missing file stopped it (node: .env.local: not found). E2c's 6 of 15 production-credential attempts came from phase agents generally, not only qa.
Prior fixes / producers
- This is the third patch of one class: feat(qa): Evidence that names an env file, a production CLI or a live URL is handed to a person — classified in code, listed in the qa prompt as "do not run", recorded per AC in the run log, printed with its command in the run summary #1652 (phase-loop qa dispatch), feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681 (
--ready-gateandsequant readyqa passes), and now exec. Each wraps one call site withwithEvidenceReachContext. - Two kinds of producer feed the block:
classifyIssueEvidence(batch-executor.ts, from the state record throughacRecordFor) and feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681's ready path. Per feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681's spec, an issue with no state record gets no block, silently. - The prompt is built in one place for every phase:
getPhasePrompt(phase-executor.ts). So the ACs state the outcome for every dispatch and leave the site to spec. If one site inphase-executor.tsserves every path, prefer it over a fourth per-site wrap.
Acceptance Criteria
- AC-1: For an issue with one needs-human AC, the spec, exec, qa and loop prompts each carry one block that names that AC and its command, and an issue with none gets no block. Evidence:
npx vitest run src/lib/workflow/evidence-reach-dispatch.test.ts→≥ 5 passed, 0 failed - AC-2: An issue with no state record is classified from its body, so
sequant readyon an untracked issue still gets the block. Evidence:npx vitest run src/lib/workflow/evidence-reach-dispatch.test.ts -t "no state record"→≥ 1 passed, 0 failed - AC-3: The classifier's tests still pass. The five assertions that pinned the per-site qa wrap move to the prompt seam in the new test file, and no caller wraps the config any more. Evidence:
npx vitest run src/lib/evidence-reach.test.ts src/lib/workflow/evidence-reach-dispatch.test.ts→0 failed, andgrep -c 'withEvidenceReachContext(' src/lib/workflow/batch-executor.ts src/commands/ready.ts | awk -F: '{s+=$2} END{print s}'→0(constraint; amended 2026-11-16 with the owner's consent, option A in the spec comment)
May touch
src/lib/workflow/phase-executor.ts (prompt assembly), src/lib/workflow/batch-executor.ts, src/lib/workflow/ready-gate.ts, src/commands/ready.ts, src/lib/evidence-reach.ts (helpers only; P-9's rules are unchanged), the new test, CHANGELOG.
Non-Goals
- The classifier's rules (feat(qa): evidence reach sees production CLIs behind env, npm exec and sh -c, and flyctl #1682).
- Skill text (frozen).
- Blocking commands in a hook (D-5).
Done when
No phase dispatch on any path is handed a needs-human Evidence command without the block, whether or not the issue has a state record. A re-run of the #1655 smoke shows no phase executing the env-file command.
Activity
admarble commentedon Nov 16, 2026
Runner context, 2026-11-16
mainis atfd2a47552, with feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681 merged. The block reaches three qa dispatch sites today, each by wrapping its config withwithEvidenceReachContext(exported frombatch-executor.ts):dispatchLoopPhase(feat(qa): Evidence that names an env file, a production CLI or a live URL is handed to a person — classified in code, listed in the qa prompt as "do not run", recorded per AC in the run log, printed with its command in the run summary #1652);runReadyGateForIssue(feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681);src/commands/ready.ts(feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681).getPhasePrompt(phase-executor.ts, thepromptContextsentinel) builds every phase's prompt.What the smoke showed (report on smoke(simplify): first real use — one detached run of a
mainbuild on two notes-fixture smoke issues, after #S-01 to #S-07 merge; the owner reads the report #1655): the exec agent ran the needs-human Evidence command itself while checking its work, once per attempt. The qa agent didn't. So the block's wording for spec, exec and loop needs to fit those phases, which run commands to check their own work. "Report as PENDING" is qa's instruction.This is the third patch of the class. If one site serves every phase on every path, prefer it to a fourth wrap. If that site needs a file outside "May touch", stop in the spec comment and say so.
An issue with no state record:
classifyIssueEvidencereads the AC record throughacRecordFor. AC-2 asks for classification from the issue body when there's no record (extractAcceptanceCriteriainsrc/lib/ac-parser.ts).Run vitest only in the worktree, never in the main checkout.
vitest.global-setup.tsrunsnpm run build, and spec runs in the main checkout, so a vitest run there rebuilds the livedist/.AC-1's test file doesn't exist on
main.admarble commentedon Nov 16, 2026
Complexity: Standard (3 ACs, 3 directories)
AC Quality Check
lintAcceptanceCriteria: all 3 pass. Each AC has anEvidence:clause (all resolve to unit_test). AC-1 and AC-2 point atevidence-reach-dispatch.test.ts, which doesn't exist onmain, so they fail today and can only pass once the work is done. AC-3 passes today, which is expected for a constraint. vitest wasn't run in the main checkout (runner note: global setup rebuildsdist/).Scope Assessment
Non-Goals: present (classifier rules #1682, skill text, hook blocking D-5).
src/lib/workflow,src/lib,src/commands)Verdict: ✅ SCOPE_OK
The class fix (one site in
executePhase, three per-site wraps removed) can't keep these existing assertions green, because they pin the old seam:batch-executor.evidence-reach.test.ts"puts the needs-human AC and its command in the qa config's promptContext". This asserts the block on the config passed toexecutePhaseWithRetry. Once the block is built insideexecutePhase, the config no longer carries it.ready-gate.evidence-reach.test.ts"--ready-gate … names the needs-human AC and its command". Same seam.ready-gate.evidence-reach.test.ts"sequant ready … names the needs-human AC and its command". Same seam.phase-executor.evidence-reach.test.ts"adds no block to a non-qa phase". This asserts the opposite of AC-1.ready-gate.evidence-reach.test.ts"gives an untracked issue no block and does not throw". It would still pass, because it checks the config, but its title says the opposite of AC-2.Owner decision needed. The recommended option is A.
evidence-reach-dispatch.test.tsas prompt-level assertions." Result: one site and no wraps, which fits the simplify epic and the runner note ("prefer it to a fourth wrap").promptContextalready holds the block. All tests stay green with no edits. The cost is three redundant wraps plus a dedupe guard, which is four sites where there should be one. Item 5's title keeps contradicting the behaviour.Acceptance Criteria
AC-1: spec/exec/qa/loop prompts each carry one block; no needs-human AC → no block
Verification: Unit Test (dispatch-level).
Scenario: Given a state record with AC-2
npx tsx --env-file=.env.local …→ WhenexecutePhaseWithRetryruns each of spec, exec, qa and loop withdryRun: true(dry run returns the built prompt asoutput) → Then each prompt has exactly one sentinel block naming AC-2 and the command verbatim. With no needs-human AC, there is no block. That makes ≥ 5 cases.Assumptions: The loop's own
promptContext(QA findings) and the block join into one sentinel block. This is the same joinwithEvidenceReachContextalready does.AC-2: no state record → classified from the issue body
Verification: Unit Test,
-t "no state record".Scenario: Given
getIssueState→ null andfetchIssueBodySync→ a body whose AC has an env-file Evidence → When a phase is dispatched → Then the prompt carries the block, and nothing is written to state.Assumptions: A failed body fetch yields no block (counted under
noteSuppressed) and never throws.AC-3: existing reach tests pass (constraint)
Verification: Unit Test. See the divergence above. As written, this holds only under option B.
Implementation Plan (option A)
Phase 1: Helpers (
src/lib/evidence-reach.ts, helpers only)buildEvidenceReachContext(acs, phase = "qa"): qa keeps today's wording ("Report … asPENDING"). spec, exec and loop get: "Do not run them, including to check your own work. Leave them for a person and list them as unverified in your output." The default keepsevidence-reach.test.tsunchanged. P-9's rules are not touched.Phase 2: One site (
src/lib/workflow/phase-executor.ts)resolveNeedsHumanAcs(issueNumber, deps). It reads the record throughacRecordFor(issueNumber, getStateManager()). When that returns null (an untracked issue), it falls back toextractAcceptanceCriteria(fetchIssueBodySync(...))without writing state, thenneedsHumanAcs(...). Errors becomenoteSuppressedplus an empty list.executePhase, beforegetPhasePrompt, join the block for every phase intoconfig.promptContext. MovewithEvidenceReachContexthere, generalised to all phases and taking the phase for wording, so there is one sentinel block per prompt. This covers the phase loop,--ready-gate,sequant ready, spec-only runs and the ready gate's loop pass, because every one of them dispatches throughexecutePhaseWithRetry→executePhase.Phase 3: Remove the per-site wraps
batch-executor.ts: drop the wrap indispatchLoopPhaseand inrunReadyGateForIssue. KeepclassifyIssueEvidence, which still feeds the per-ACreachin the run log and the summary (feat(qa): Evidence that names an env file, a production CLI or a live URL is handed to a person — classified in code, listed in the qa prompt as "do not run", recorded per AC in the run log, printed with its command in the run summary #1652). KeepwithEvidenceReachContextas a re-export frombatch-executor.ts, or update the one import inready.ts.src/commands/ready.ts: drop the wrap and theacRecordForblock (lines ~351–371).Phase 4: Tests and changelog
src/lib/workflow/evidence-reach-dispatch.test.ts: the AC-1 cases (4 phases + none) and the AC-2 case "no state record". Rewrite items 1–5 above to the prompt seam.## [Unreleased]withchangelog.d/fragments. If it merges first, add a fragment instead.Design Review
executePhase(phase-executor.ts): the one function that turns a config into a prompt for every dispatch path. No file outside "May touch" is needed (acRecordForandgetStateManagerare imported, not changed).ExecutionConfig.needsHumanfield, which still needs every caller to fill it and touchestypes.ts(outside "May touch").withEvidenceReachContextper-site wraps: 4d02df1 (feat(qa): Evidence that names an env file, a production CLI or a live URL is handed to a person — classified in code, listed in the qa prompt as "do not run", recorded per AC in the run log, printed with its command in the run summary #1652) and fd2a475 (feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681). That is two prior fixes, so the rule is fix the class, don't add a third wrap. This is what drives the divergence on AC-3.ghcall for untracked issues." The state read is cheap. The body fetch happens only when there is no record, which in practice meanssequant readyon an untracked issue. A second challenge: "dry-run now callsgh." This is acceptable; the fetch failing yields no block.dispatchLoopPhase,runReadyGateForIssueandready.ts. After the change there is one producer,executePhase. Consumers:getPhasePrompt(the sentinel wrap) and/loop's sentinel detection (bug(loop): orchestrated Step 1A re-fetches QA findings from GitHub instead of trusting the promptContext already embedded in its own prompt #960). That detection is unaffected, since the block joins the same single sentinel. The run-logreachfield (classifyIssueEvidence→recordAcStatuses, the summary) is a separate consumer of the classification and stays as it is.Feature Quality Planning
Notable items:
reachfield still comes fromclassifyIssueEvidence, which has no body fallback. An untracked issue undersequant runis rare because the run tracks the issue first. Out of scope; noting it here.Open Questions
mainbuild on two notes-fixture smoke issues, after #S-01 to #S-07 merge; the owner reads the report #1655): this is not an AC. Recommendation: run it manually after merge and record the result on smoke(simplify): first real use — one detached run of amainbuild on two notes-fixture smoke issues, after #S-01 to #S-07 merge; the owner reads the report #1655.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: The change is narrow, and the ACs already declare unit-test Evidence with named files. testgen would only stub a file exec writes anyway.
Label Review
Current: graph-2026-11-simplify. Recommended: add
enhancement. Quality loop won't auto-enable (SCOPE_OK).admarble commentedon Nov 16, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 3/3 met
Gaps:
mainbuild on two notes-fixture smoke issues, after #S-01 to #S-07 merge; the owner reads the report #1655 smoke re-run after merge is not done or trackedReviewed in a separate session by claude-code (claude-opus-5-5); the change was written by claude-code (claude-opus-5-5).
admarble commentedon Nov 16, 2026
Owner decision, 2026-11-16: option A. AC-3 is amended (see the issue body).
The branch currently holds option B (PR #1690:
15943df8cand1a0f70f0d). Rework it to the spec comment's option-A plan:executePhase(phase-executor.ts) joins the block for every phase, with per-phase wording. It classifies through the state record, and falls back to the issue body without writing state.dispatchLoopPhase,runReadyGateForIssueandsrc/commands/ready.ts, and remove the dedupe guard B added.withEvidenceReachContext's definition out ofbatch-executor.ts. AC-3's grep countswithEvidenceReachContext(inbatch-executor.tsandready.ts, so a definition left there counts. A plain re-export has no(and doesn't count.classifyIssueEvidence. It still feeds the run log'sreachfield and the summary.evidence-reach-dispatch.test.tsas prompt-level assertions. Delete or retitle the old ones so no test title contradicts the behaviour.ready.ts's helper can go ifexecutePhasecovers it.The spec's
SPEC_DIVERGENCEdidn't stop the first run because its marker had notimestamp(filed as #1691). Don't fix that here.Run vitest only in the worktree.
vitest.global-setup.tsrebuildsdist/.refactor(#1688): option A — the needs-human block joins only in execu…
admarble commentedon Nov 16, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 3/3 met
Gaps:
Reviewed in a separate session by claude-code (claude-opus-5-5); the change was written by claude-code (claude-opus-5-5).
docs(#1688): the changelog notes that the AC record is now written at…