Skip to content

fix(#1691): a spec's SPEC_DIVERGENCE marker without a timestamp halts the run - #1693

Merged
admarble merged 2 commits into
mainfrom
feature/1691-fix-run-a-spec-phase-spec-divergence-marker-is-dro
Nov 17, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/1691-fix-run-a-spec-phase-spec-divergence-marker-is-dro

Conversation

@admarble

@admarble admarble commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • parseSpecDivergence now reads markers through a shared scanMarkerJson and validates with PhaseMarkerSchema.omit({ timestamp: true }). The spec skill's marker has no timestamp, so the old read dropped it and the run went on to exec. parsePhaseMarkers and phase detection are unchanged.

AC verification

AC Status Evidence
AC-1 ✅ phase-executor.test.ts "divergence without timestamp" (3 cases: spec shape, fenced, exec shape), passing
AC-2 ✅ batch-executor.test.ts "spec divergence without timestamp halts before exec" runs raw output through the real mapAgentSuccessToPhaseResult, then the batch loop; exec is not invoked
AC-3 ✅ phase-detection.test.ts 57 passed

Checks: build, lint pass. Affected set vitest run --changed origin/main in 3 shards: all green except worktree-manager.test.ts "1405 AC-3 a stale tracking ref…", which is outside the diff.

Settled against base

scripts/settle-against-base.sh on that test: passes at HEAD and at base when run alone, so it failed only under shard load (flake, not this change).

Closes #1691

🤖 Generated with Claude Code

Runner verification (2026-11-16)

I ran each AC's Evidence command verbatim in the worktree at ec86064.

  • AC-1: -t "divergence without timestamp", 3 passed, 0 failed.
  • AC-2: -t "spec divergence without timestamp", 1 passed, 0 failed.
  • AC-3: phase-detection.test.ts, 57 passed, 0 failed.

The real case: the exact marker #1688's spec emitted on 2026-11-16 (no timestamp) now returns {"acs":"AC-3", …} from parseSpecDivergence; on main it returned undefined. The same marker inside a fenced code block still returns undefined.

Follow-ups

None raised by spec or QA.

…at follows its skill halts the run

Entire-Checkpoint: 4c21c595c23a
Entire-Checkpoint: 4c21c595c23a
@admarble

Copy link
Copy Markdown
Contributor Author

Read first

Computed from the diff, the issue's Evidence: clauses and git log. Nothing here is written by a model.

Residue

  • CHANGELOG.md (+4 −0): no AC's evidence names it — git diff --numstat origin/main...HEAD -- CHANGELOG.md
  • src/lib/workflow/phase-detection.ts (+20 −7): no AC's evidence names it — git diff --numstat origin/main...HEAD -- src/lib/workflow/phase-detection.ts
  • src/lib/workflow/phase-executor.ts (+13 −6): no AC's evidence names it — git diff --numstat origin/main...HEAD -- src/lib/workflow/phase-executor.ts
  • CHANGELOG.md is hot: 3 fix commits in 28 days — git log --since=28.days --format=%s origin/main -- CHANGELOG.md | grep -cE '^fix(\(|:|!)'

Tests

  • src/lib/workflow/batch-executor.test.ts: mock; mutation record: AC-2 — grep -nE 'vi\.mock|jest\.mock|SKILL\.md' src/lib/workflow/batch-executor.test.ts, gh pr view 1693 --json body
  • src/lib/workflow/phase-executor.test.ts: mock; mocks a module the project does not own: child_process; mutation record: AC-1 — grep -nE 'vi\.mock|jest\.mock|SKILL\.md' src/lib/workflow/phase-executor.test.ts, gh pr view 1693 --json body

Explained

  • src/lib/workflow/phase-executor.test.ts — AC-1
  • src/lib/workflow/batch-executor.test.ts — AC-2

AC verdict: the SEQUANT_QA_VERDICT comment on #1691.

@admarble
admarble merged commit b0eaf80 into main Nov 17, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(run): a spec-phase SPEC_DIVERGENCE marker is dropped because the skill's shape has no timestamp, so the run never halts

1 participant