Skip to main content

build_segmented_prompt

Function build_segmented_prompt 

Source
pub fn build_segmented_prompt(
    perspective: Option<ReviewPerspective>,
    team_rules: &[TeamRuleDigest],
    diff: &str,
    user_instructions: &str,
    repo_context_facts: Option<&str>,
    past_verdicts: Option<&[PastVerdict]>,
) -> SegmentedPrompt
Expand description

Build a SegmentedPrompt split into a hash-stable cacheable prefix and a per-review dynamic suffix. See SegmentedPrompt for layout.

Ordering (top → bottom):

  • stable_prefix: base instructions → perspective addendum → team rules digest (sorted by id) → repo context facts.
  • dynamic_suffix: past verdicts → current diff → user instructions.

Concatenating the two halves yields the same flat prompt that build_system_prompt reassembles for compatibility.