CouncilEx.Rounds.PairwiseElimination (CouncilEx v0.1.0)

Copy Markdown View Source

One bracket level of a tournament. Pairs surviving members from the most recent bracket level (or all members on first invocation) and runs a pairwise judgment per pair, in parallel.

Options

  • :judge — either a 2-arity function fn output_a, output_b -> :a | :b end (deterministic, no LLM) or a chair-style {module, opts} tuple. Default is the council's chair (resolved via run_opts.council_spec.chair).

  • When the chair-style judge is used, the chair is invoked as a Vote member with %CouncilEx.Schemas.Vote{choice: "<member_id>"} over the pair; the choice string must match one of the two member ids.

Inputs read from Context

  • ctx.prior_rounds — last entry whose metadata[:remaining] is non-nil indicates surviving members from the prior bracket level. If absent, the round assumes this is the first bracket level and uses ALL members from the most recent non-bracket round (e.g. :independent_analysis).
  • The Response carried by each surviving member is read from the most recent round whose member_results[id].response is non-nil.

Output

Per-member MemberResult:

  • winners (and bye recipients): :ok, original Response carried forward.
  • losers: :eliminated with metadata: %{reason: :tournament_loss}.
  • members eliminated in earlier levels: :eliminated carried forward.

RoundResult.metadata carries %{remaining: [winner_ids], eliminated: [loser_ids]}.

Multi-level brackets

Wrap in Iterate. converged?/3 halts iteration when one member remains.

Summary

Functions

Custom orchestration entry point invoked by RoundExec.run_round/7 when the round module is PairwiseElimination.

Functions

run(opts, round_name, idx, members, ctx, run_opts)

Custom orchestration entry point invoked by RoundExec.run_round/7 when the round module is PairwiseElimination.