Reconcile goal recovery with human intent and model state transitions

This commit is contained in:
ms2k 2026-10-18 19:21:26 +09:00
commit 548eb69211

View file

@ -120,14 +120,14 @@ func TestSchedule(t *testing.T) {
}
}
func TestChangedBlock(t *testing.T) {
func TestSnapshotReset(t *testing.T) {
w := failedWatch()
w.Failures = 3
w.Due = time.Now()
g := testGoal(blocked)
g.UpdatedAt++
w.update(g)
if w.eligible() || !w.Due.IsZero() {
t.Fatal("resumed a changed blocked goal")
w.update(testGoal(active))
w.observe(turn{ID: "turn-2", Status: "completed"})
if w.Failures != 0 || !w.Due.IsZero() || w.eligible() {
t.Fatalf("successful snapshot retained recovery state: %+v", w)
}
}