diff --git a/cmd/orchestra-worker/main.go b/cmd/orchestra-worker/main.go index 8579e9a..954a508 100644 --- a/cmd/orchestra-worker/main.go +++ b/cmd/orchestra-worker/main.go @@ -1990,6 +1990,17 @@ func (w *worker) requestPhase(ctx context.Context, id string, s herdr.Session) b if err := os.Remove(path); err != nil { w.recordError(fmt.Errorf("phase request %s: %w", id, err)) } + if phase == domain.WorkPhaseReview { + // Each entry into review starts without the previous cycle's findings. + // The worktree survives a changes-requested round trip, so a reviewer + // that writes .orchestra/done without rewriting the file would have + // the earlier review sealed against the new commit — and submit binds + // whatever it reads to the commit it is submitting, so a stale pass + // would look exactly like a fresh one. + if err := os.Remove(filepath.Join(s.Worktree, ".orchestra", reviewFile)); err != nil && !os.IsNotExist(err) { + w.recordError(fmt.Errorf("clear stale review %s: %w", id, err)) + } + } t.WorkPhase = phase w.tasks[id] = t log.Printf("phase request %s accepted: %s to %s", id, req.From, phase)