feat: save default reviewers globally with jury agents jury - #112
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #98
What changes
Without
--jury,jury reviewused every enabled reviewer, so a single missing CLI (e.g. grok) aborted every run unless--jurywas passed each time or each repository'sjury.config.jsonwas edited.This adds a saved global default reviewer list, mirroring
jury agents judge:jury agents jury claude,droid,ampsaves"reviewers"in~/.jury/config.json, beside the global judge; opt-in agents are allowed.jury agents jury --resetremoves it.jury agents jurywith no arguments opens a checkbox picker on a TTY (install status, opt-in and judge marked, empty selection refused, esc cancels), built on Node'sreadline— no new dependency (lib/picker.js). Off a TTY it prints the current setting.--reviewer/--jury→ repositoryreviewerroles → saved default reviewers → built-in pool.--jurydoes. The selected judge is excluded; a list containing only the judge is an error rather than an empty jury.jury agentsmarks saved defaults, notes when a repository overrides them, and bases its exit status on the saved pool.docs/configuration.md,lib/help.jsand 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"):writeRuntruncatedrun.jsonand 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
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 agentsmarkers; a--dry-runreview using the saved list, with--juryand--judgeoverrides; picker key handling (move, toggle, empty-save refusal, save, esc/q/ctrl-c cancel).writeRunrace: a stress reproduction (rewriterun.jsonin a loop while listing runs) missed the live run on ~40% of reads before the fix and 0 of ~6,000 after. Newruns.test.jscase fails without the fix and passes with it.npm test: all pass exceptloop.test.js"--judge selects one judge…", which fails identically on unmodifiedmasterin the dev container because a realclaudeCLI on PATH triggers automatic role assignment; it passes in CI.npm run test:packagepasses.Limitations
jury.config.jsonentries with"role": "reviewer"override the saved list entirely rather than merging with it.jury replywithout--revieweralso 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