Skip to main content

Crate panoptico

Crate panoptico 

Source
Expand description

AI Code Reviewer — automated code review using Claude via Azure AI Foundry.

This crate provides the core pipeline for AI-powered PR code review: diff extraction, hunk parsing, batch grouping, prompt construction, hallucination validation, and cost tracking.

§Architecture

The main entry point is Panoptico, which orchestrates the full review pipeline. Create an instance with a config::ReviewConfig and call Panoptico::run with a Command.

use panoptico::{Panoptico, Command};
use panoptico::config::ReviewConfig;

let config = ReviewConfig::default();
let reviewer = Panoptico::new(config);
reviewer.run(Command::Test).await?;

Re-exports§

pub use reviewer::Command;
pub use reviewer::Panoptico;

Modules§

backend
Backend trait and shared types for AI code review.
batch
Batch grouping — groups hunks into batches respecting a line limit.
config
Configuration types for the AI code reviewer.
context
File context enrichment for review prompts.
credential
Secure credential storage — resolves API keys from multiple sources.
crypto
Self-contained cryptographic module — key derivation, authenticated encryption, and forward error correction.
error
Error types for the AI code reviewer.
finding_id
Deterministic finding ID generation for stable deduplication.
git
Git diff extraction — runs git commands to get PR diffs.
hunk
Hunk parser — splits unified diffs into atomic reviewable units.
languages
Language-aware semantic extraction for source code.
metrics
Cost tracking — tracks token usage and calculates review costs.
prompt
Prompt construction for review and synthesis requests.
reviewer
Core application class — orchestrates the full review pipeline.
validator
Hallucination guard — validates findings against actual diff files.