fix(issue-34): the stale-review guard is armed only when the run has sub-jobs
Without --worktree/--base the guard fingerprinted the source on every loop, so a loop whose source holds untracked files that change on every job voided each round: test_tier4_e2e scenario 5 keeps the mock herdr's state file (rewritten on each herdr call) in its repository and failed with rc 1 on3fdbb62(passed on7a4a0c2). A loop without sub-delegation now behaves as before (issue #34 requirement 3); with sub-jobs the guard protects against a deadline-closed sub-job still writing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3fdbb626de
commit
1d4f338b4c
2 files changed
+9
-6
No files matched your search
@@ -690,7 +690,7 @@ class LoopRunner:
|
||||
if reason in ORCHESTRATOR_CLOSED or (status == "error" and not reason):
|
||||
# no recorded reason is not the agent's own report either
|
||||
return "CLOSED-UNCONFIRMED", reason or "-"
|
||||
if status == "cancelled" and (reason == "session_busy" or reason.startswith("rolled back")):
|
||||
if status == "cancelled" and (reason in ("session_busy", "target_not_found") or reason.startswith("rolled back")):
|
||||
return "NOT-DISPATCHED", reason
|
||||
return status, reason or "-"
|
||||
|
||||
@@ -1342,15 +1342,18 @@ class LoopRunner:
|
||||
return 1
|
||||
else:
|
||||
review_path = str(self.worktree_root)
|
||||
else:
|
||||
# Issue #34 (D9): the identity mode's B7 for every loop - a sub-job
|
||||
# closed by deadline may still be writing to the source
|
||||
subjobs = self._subjobs_block(self.round_roots)
|
||||
light = None
|
||||
if not identity and subjobs:
|
||||
# Issue #34 (D9): the identity mode's B7, armed only when this run
|
||||
# has sub-jobs - one closed by deadline may still be writing to the
|
||||
# source. A loop without sub-delegation keeps its old behaviour: its
|
||||
# source may hold untracked files that change on every job.
|
||||
light = self._fingerprint()
|
||||
if light is None and not guard_warned:
|
||||
log_warn(f"cannot fingerprint the source at {self.worktree_root}; "
|
||||
"the stale-review guard is off for this run")
|
||||
guard_warned = True
|
||||
subjobs = self._subjobs_block(self.round_roots)
|
||||
|
||||
if not reviewers:
|
||||
# Creator Self-Review
|
||||
|
||||
Reference in new issue
Block a user