Skip to content

chore: Seeded final-judge ordering - #927

Merged
getappz merged 3 commits into
masterfrom
task/758-seeded-final-judge-ordering
Oct 19, 2026
Merged

getappz merged 3 commits into
masterfrom
task/758-seeded-final-judge-ordering

Conversation

@getappz

@getappz getappz commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

REVIEW_APPROVED

I read the diff and grepped the repo for other users of SynthesisResult and candidate_order. I did not rerun the tests, clippy or a workspace build.

  • Shuffle: engine.rs shuffles last_round_responses with the run's seeded StdRng just before the judge call. The same random_seed therefore gives the same order. It also runs when randomize_order is false, which matches "reproducibly shuffle final judge inputs".
  • Mapping: candidate_order is built from the shuffled slice that is passed to build_judge_user_prompt. Its "Participant N" labels use the same index, so label N always matches the Nth block the judge sees. JudgeCandidate carries the participant id and model id, and the field is #[serde(default)].
  • Other code: nothing outside flare-consensus touches SynthesisResult, so adding the field breaks no other crate.

Minor, non-blocking:

  • The test checks the mapping and reproducibility but never inspects the judge's actual prompt text, so the link between label and prompt block is not asserted directly.
  • Errored participant responses still go to the judge. That behaviour already existed.

Opened by claude-code on i-flare-c997d745ae66 (flared:c997d745ae66) for item #758 via agentflare.

Summary by CodeRabbit

  • New Features
    • Responses are presented to the judge in a shuffled order with neutral participant labels, rather than their original order.
    • The order is reproducible when the same seed is used and can vary with different seeds.

…candidate mapping

Agentflare-Agent: claude-code
Agentflare-Branch: task/758-seeded-final-judge-ordering
Agentflare-Item: 758
Agentflare-Session: 2d4b59ab-c570-4800-b1a6-20cd955e083f
Agentflare-Agent: claude-code
Agentflare-Branch: task/758-seeded-final-judge-ordering
Agentflare-Item: 758
Agentflare-Session: 2d4b59ab-c570-4800-b1a6-20cd955e083f
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: getappz/agentflare/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: a23d91d3-46c5-48da-82b6-e50da0ce123b
📥 Commits

Reviewing files that changed from the base of the PR and between fca11ba and cd93ec5.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: getappz/agentflare/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0252c5bf-b46e-4c46-be1a-92762f71a207
📥 Commits

Reviewing files that changed from the base of the PR and between 527ae24 and fca11ba.

📒 Files selected for processing: 2
  • crates/flare-consensus/src/engine.rs
  • crates/flare-consensus/src/types.rs

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

📝 Walkthrough

The consensus engine now shuffles final-round responses with its seeded RNG before judge synthesis. The synthesis result records each judge-facing candidate label and its participant and model IDs.

Changes: Judge candidate ordering

Layer / File(s) Summary
Seeded ordering and candidate mapping
crates/flare-consensus/src/types.rs, crates/flare-consensus/src/engine.rs
SynthesisResult now stores candidate labels with participant and model IDs, and defaults this field when deserializing data that omits it. The engine shuffles final-round responses before judge synthesis and records the mapping in that order. A test checks reproducibility, identity mapping, and variation across seeds.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ConsensusEngine
  participant SeededRNG
  participant run_judge
  participant SynthesisResult
  ConsensusEngine->>SeededRNG: Shuffle final-round responses
  ConsensusEngine->>run_judge: Pass shuffled responses
  run_judge->>run_judge: Assign labels and map participant and model IDs
  run_judge->>SynthesisResult: Store candidate order
Loading
Merge Risk: ⚪ Minimal · up to fca11

No actionable merge-blocking risk is established; proceed with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: deterministic, seeded ordering for final-judge candidates.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@getappz
getappz merged commit 5a27f33 into master Oct 19, 2026
16 checks passed
@getappz
getappz deleted the task/758-seeded-final-judge-ordering branch October 19, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant