fix(#3864): smart-entry classify() matches the verif* status stem (#4052)

* test(#3864): smart-entry classify must match the verif* status stem (failing first)

* fix(#3864): classify() matches the verif* status stem, aligning with normalizeStateStatus

"verified"/"verification" contain no "verify" substring, so the
exact-word branch never matched: a STATE.md declaring status: verified
fell through to situation "unknown" (or idle-stranded on a clean tree
with unpushed commits — differently wrong, which made it look
intermittent). state-document's normalizeStateStatus already matches
any verif* stem; the classifier now uses the same stem, so the two
owners agree on the invariant. verify_failed is tested earlier in
classify(), so failed verification still wins. Negative controls
(completed/executing/planning/paused) unchanged and pinned.

* test(#3864): review fold-in — the real handler-written verification status pinned both ways

'Phase complete — ready for verification' (state-document.cts's own
Status default) carries the verif stem but names completion: at 5/5 it
must stay complete (isComplete beats the stem), mid-project it must
route to verify-pending (pre-fix it fell through to unknown/idle-
stranded — a real behavior change beyond the literal verified repro,
sanctioned by the issue's own verification→verify-pending table).

* chore(#3864): changeset fragment (pr number backfilled after PR creation)

* chore(#3864): backfill changeset PR number (4052)

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-08-29 15:07:14 -04:00
committed by GitHub
parent 9932929e37
commit d9e906a744
3 changed files with 58 additions and 1 deletions

View File

@@ -599,7 +599,13 @@ export function classify(s: SmartEntrySignals): Situation {
if (isComplete(s)) return 'complete';
if (/\bplanning|planned\b/i.test(s.status)) return 'planning';
if (/\bexecut(e|ing)|active|in.progress|building\b/i.test(s.status)) return 'executing';
if (/\bverify|review|needs.review|pending.review\b/i.test(s.status)) return 'verify-pending';
// #3864: `verif` (not `verify`) — the same stem state-document's
// normalizeStateStatus matches. "verified" and "verification" contain no
// "verify" substring, so the exact word left them falling through to
// `unknown` (or idle-stranded on a clean unpushed tree — differently
// wrong). verify_failed is tested above, so a failed verification still
// wins over this branch.
if (/\bverif|review|needs.review|pending.review\b/i.test(s.status)) return 'verify-pending';
if (isIdleStranded(s)) return 'idle-stranded';
return 'unknown';
}