Skip to content

fix(state): the AC record is written once and never refreshed — an amended AC stays stale in state, the run log and the do-not-run block #1692

Open

Description

@admarble

Problem

acRecordFor (src/lib/workflow/ac-status.ts:218, #1525) writes an issue's AC record from its body the first time it's asked, and never again: if (issueState.acceptanceCriteria) return issueState.acceptanceCriteria. An AC amended on GitHub afterwards stays as it was in state.json. Three consumers read the record: the per-AC status written after qa, the run log's acs[], and since #1688 the do-not-run block for every phase.

Observed: sequant #1688's AC-3 was rewritten on 2026-11-16 with the owner's consent. Its record in .sequant/state.json still holds the old Evidence (the four-file vitest run). #1688 makes the window wider: the record is now written at the first phase dispatch (spec), where #1652 wrote it at the first qa. So an AC amended after spec, the usual moment for an amendment (the spec raises it and the owner edits), never reaches the record.

Two related gaps, from #1688's spec and QA:

  • classifyIssueEvidence (batch-executor.ts), which feeds the run log's reach, has no body fallback for an issue with no state record. executePhase does have one.
  • phase-executor.ts caches untracked issues' bodies in a module-level Map, so a long-lived MCP server process never sees an edit.

Prior fixes / producers

  • AC record writers: acRecordFor (ac-status.ts) and updateAcceptanceCriteria callers (git grep -n updateAcceptanceCriteria src).
  • AC record readers: recordAcStatuses, classifyIssueEvidence and dispatchNeedsHumanAcs.
  • So the ACs state the outcome for the record, not for any one reader.

Acceptance Criteria

  • AC-1: When an issue's body changes its ACs after the record was written, the next run's record carries the new ACs, and a status already recorded for an AC whose text didn't change is kept. Evidence: npx vitest run src/lib/workflow/ac-status.test.ts -t "refresh" → ≥ 2 passed, 0 failed
  • AC-2: The run log's reach and the do-not-run block agree for an issue with no state record. Evidence: npx vitest run src/lib/workflow/evidence-reach-dispatch.test.ts -t "run log reach" → ≥ 1 passed, 0 failed

Non-Goals

Done when

An AC amended on GitHub reaches the state record, the run log and the do-not-run block on the next run.

Activity

  1. added a commit that references this issue on Nov 16, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions