Expand description
Review trajectory builder.
A trajectory is the ordered decision trail for a single review run: what chunks were retrieved, what rules were applied, which LLM calls fired, what past verdicts were recalled, what the self-check kept vs dropped, and which issues were finally emitted.
The builder is deliberately additive and optional: the review pipeline
threads an Option<&mut TrajectoryBuilder> through its hot path, so callers
that do not need trajectory data pass None.
The JSON shape produced by into_json() is byte-compatible with the
TypeScript discriminated union in
difflore-cloud/src/types/trajectory.ts. When that shape changes,
BOTH sides must be updated in lockstep — the saveTrajectory oRPC
endpoint validates the payload with the matching Zod schema on
ingress, so any drift fails the round-trip test.
Structs§
- Recalled
Verdict - One past verdict recalled from the review-memory store, surfaced on
the cloud detail page so reviewers can see which prior decisions
influenced the current run. Shape:
{ id, title, similarity, excerpt }. Theexcerptfield is truncated by callers to ~200 characters (with a trailing…) so the trajectory payload stays compact. - Trajectory
Builder - Ordered collector for
TrajectorySteps. Threaded through the review pipeline asOption<&mut TrajectoryBuilder>so absence is a no-op.
Enums§
- Rule
Source - Where a
rules_appliedstep’s rules came from. Matches the TSTrajectoryRuleSourceliteral set exactly. - Trajectory
Step - Ordered discriminated step. Serialized with
tag = "kind"so the JSON shape matches the TS union; every new variant must add a matching zod arm indifflore-cloud/src/types/trajectory.ts.