Skip to content

fix(peer-review): --fresh-judge actually forces the judge to re-run#267

Merged
jacsamell merged 1 commit into
mainfrom
fix/fresh-judge-actually-reruns
Jun 2, 2026
Merged

fix(peer-review): --fresh-judge actually forces the judge to re-run#267
jacsamell merged 1 commit into
mainfrom
fix/fresh-judge-actually-reruns

Conversation

@jacsamell
Copy link
Copy Markdown
Contributor

@jacsamell jacsamell commented Jun 2, 2026

Caught dogfooding the Playwright MCP work — --fresh-judge cleared the session but left the HEAD pin + decision file, so the skip-guard short-circuited the re-run.

Problem: The --fresh-judge flag was incomplete—it cleared only the session ID but left the HEAD SHA pin and prior decision file intact. Since the _judge_already_approved_at skip-guard checks these sidecars, the judge was marked SKIPPED instead of re-running.

Solution: Extended _clear_named_judge_sessions to fully reset judge state by clearing three artifacts:

  1. Session ID (existing)
  2. HEAD pin file (prevents the skip-guard from short-circuiting)
  3. Prior decision file (archived rather than deleted to preserve the verdict trail)

Implementation details:

  • Handles both filename variants (judge_4 and judge-4)
  • Gracefully tolerates filesystem errors during cleanup with warnings
  • Integrates with existing _archive_decisions pattern for audit trail preservation
  • 716/716 tests passing

This ensures judges with prior approvals actually re-evaluate when --fresh-judge is invoked, fixing the regression observed during Playwright MCP testing.

The flag cleared the saved session id but left two sidecars in place:
the HEAD-sha pin and the canonical decision file. Both are inputs to
the ``_judge_already_approved_at`` skip-guard. Net effect: cube prv
--fresh-judge judge_4 cleared the session, hit the skip-guard,
marked judge_4 SKIPPED, and never ran. Caught dogfooding the
slice-A/B/C Playwright MCP work on PR #1571 — judge_4 had already
approved the prior round, so the new MCP-armed run was supposed to
re-review with Playwright but the guard short-circuited it.

Fix: when --fresh-judge fires, also drop the HEAD pin and ARCHIVE
(not delete) the prior decision file so the verdict trail survives.
Handles both filename variants (judge_4 / judge-4).

716/716 tests pass.
@jacsamell jacsamell merged commit 67875d0 into main Jun 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 408afe22-a223-4e95-a9c8-b189cf8c41ce

📥 Commits

Reviewing files that changed from the base of the PR and between 7041352 and 0104f54.

📒 Files selected for processing (1)
  • python/cube/commands/peer_review.py

Walkthrough

This pull request extends the --fresh-judge command-line option to perform comprehensive judge state resets. The change adds get_sessions_dir import and expands _clear_named_judge_sessions to clear three categories of persisted state: the saved session ID, the per-judge HEAD pin (which normally prevents re-approval checks), and archived decision JSON files in both underscore and hyphen naming variants. The function creates timestamped archive directories and tolerates filesystem errors during moves and unlinking with warning logging, ensuring fresh judge execution can proceed reliably.

Possibly related PRs

  • aetheronhq/agent-cube#185: Both modify peer-review judge-panel session-reset behaviour to support relaunching judges by clearing named-judge state; main PR fully resets via decision archival whilst the retrieved PR adds fallback plumbing for fresh judge availability.

  • aetheronhq/agent-cube#176: Both address fresh peer-review execution: main PR expands --fresh-judge state clearing, whilst the retrieved PR ensures resumed judges read correct worktree and HEAD by adjusting worktree selection and prompt routing.


Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant