Cite.Judge (Cite v0.1.0)

Copy Markdown View Source

Round 2, minus the client call: a gathered finding becomes one request on its own evidence, and the reply becomes a Cite.Finding under the verdict rules. Pure. Internal.

Summary

Functions

The round-2 request. A directly screened concern: its passages under the source's as, a confirm per passage keyed "confirm:<id>", the descriptors over all of them. A concern built from factors: each role at the top level, the checks that apply, the descriptors over every role.

Folds judged findings into the run, as Cite.Screen.resolve/2 does for round 1. It sets findings, adds one Cite.Error per failed request, and adds each reply's usage and model to the run's. The run's review_band, {low, high}, sets the verdicts.

Types

outcome()

@type outcome() :: {Cite.Gathered.t(), {:ok, Cite.verdict()} | {:error, term()}}

Functions

request(run, gathered)

@spec request(Cite.Run.t(), Cite.Gathered.t()) :: map()

The round-2 request. A directly screened concern: its passages under the source's as, a confirm per passage keyed "confirm:<id>", the descriptors over all of them. A concern built from factors: each role at the top level, the checks that apply, the descriptors over every role.

resolve(run, outcomes)

@spec resolve(Cite.Run.t(), [outcome()]) :: Cite.Run.t()

Folds judged findings into the run, as Cite.Screen.resolve/2 does for round 1. It sets findings, adds one Cite.Error per failed request, and adds each reply's usage and model to the run's. The run's review_band, {low, high}, sets the verdicts.

Each confirm drops its passage at or below low, cites it for review below high, and holds it at or above. A passage filling a role holds, once. A finding fails on an asked check at or below low or with nothing left to cite, holds when every asked check is at or above high and a citation holds, and is sent to review otherwise.