Skip to content

feat: save default reviewers globally with jury agents jury - #112

Merged
zzxwill merged 2 commits into
masterfrom
claude/tender-noether-xh1uz0
Sep 24, 2026
Merged

zzxwill merged 2 commits into
masterfrom
claude/tender-noether-xh1uz0

Conversation

@zzxwill

@zzxwill zzxwill commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #98

What changes

Without --jury, jury review used every enabled reviewer, so a single missing CLI (e.g. grok) aborted every run unless --jury was passed each time or each repository's jury.config.json was edited.

This adds a saved global default reviewer list, mirroring jury agents judge:

  • jury agents jury claude,droid,amp saves "reviewers" in ~/.jury/config.json, beside the global judge; opt-in agents are allowed. jury agents jury --reset removes it.
  • jury agents jury with no arguments opens a checkbox picker on a TTY (install status, opt-in and judge marked, empty selection refused, esc cancels), built on Node's readline — no new dependency (lib/picker.js). Off a TTY it prints the current setting.
  • Precedence: --reviewer/--jury → repository reviewer roles → saved default reviewers → built-in pool.
  • A saved list disables automatic role assignment, as --jury does. The selected judge is excluded; a list containing only the judge is an error rather than an empty jury.
  • A saved reviewer that is uninstalled, disabled by the repository, or no longer an agent stops the run with an error naming the saved setting instead of silently shrinking the jury.
  • jury agents marks saved defaults, notes when a repository overrides them, and bases its exit status on the saved pool.
  • README, docs/configuration.md, lib/help.js and CHANGELOG updated.

Also fixes a race found by this PR's first CI run (Node 24 / macos-latest, web-launch.test.js: "opened URL must select a run available in the API response"): writeRun truncated run.json and rewrote it in place, so a console read landing mid-write saw empty JSON and dropped the live run from /api/run. It now writes a temp file and renames it into place.

Validation

  • New test/default-reviewers.test.js: save/reset round-trip and validation of the global file; precedence across repo roles, saved list and built-in pool; judge exclusion; disabled/unknown saved names; automatic roles turned off; CLI save/show/validate/reset leaving the file unchanged on bad input; jury agents markers; a --dry-run review using the saved list, with --jury and --judge overrides; picker key handling (move, toggle, empty-save refusal, save, esc/q/ctrl-c cancel).
  • Drove the real picker through a pseudo-terminal: enter saves the selection, toggle-then-esc cancels without writing the file.
  • writeRun race: a stress reproduction (rewrite run.json in a loop while listing runs) missed the live run on ~40% of reads before the fix and 0 of ~6,000 after. New runs.test.js case fails without the fix and passes with it.
  • npm test: all pass except loop.test.js "--judge selects one judge…", which fails identically on unmodified master in the dev container because a real claude CLI on PATH triggers automatic role assignment; it passes in CI.
  • npm run test:package passes.

Limitations

  • Repository jury.config.json entries with "role": "reviewer" override the saved list entirely rather than merging with it.
  • jury reply without --reviewer also resolves through the saved defaults, so a saved list that later breaks (e.g. names a now-disabled agent) errors there too.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YWwuLax3VBtTJuujgK748c

Without --jury, a review used every enabled reviewer, so one missing CLI
(e.g. grok) aborted every run unless --jury was passed each time or each
repository's jury.config.json was edited.

`jury agents jury <agent>[,<agent>]` saves a default reviewer list in
~/.jury/config.json beside the global judge; `--reset` removes it, and with
no arguments in a terminal a readline checkbox picker shows install status
and marks the judge. Precedence: --reviewer/--jury, repository reviewer
roles, saved defaults, built-in pool. A saved list disables automatic role
assignment, excludes the judge, and a saved reviewer that is uninstalled or
disabled stops the run with an error naming the setting.

Closes #98

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YWwuLax3VBtTJuujgK748c
writeRun truncated run.json and rewrote it in place. The loop republishes
it throughout a review while the console lists runs, so a read landing
between truncate and write saw empty or partial JSON, skipped the run,
and the live review vanished from /api/run. That race failed
web-launch.test.js on macOS CI (#112, Node 24 / macos-latest): the
opened URL named a run missing from the API response.

Write to a temp file in the run directory and rename it into place.
A stress reproduction went from ~40% missed reads to none; the new
runs.test.js case fails without the fix and passes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YWwuLax3VBtTJuujgK748c
@zzxwill
zzxwill marked this pull request as ready for review September 24, 2026 15:56
@zzxwill
zzxwill merged commit 8a87e9d into master Sep 24, 2026
8 checks passed
@zzxwill
zzxwill deleted the claude/tender-noether-xh1uz0 branch September 24, 2026 15:56
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.

Configure default reviewers globally (CLI + TUI picker)

2 participants