Skip to main content

Module facade

Module facade 

Source
Expand description

The narrow workspace surface the review-conversation tools call, plus the production impl on Workspace and a mock for unit tests.

Mirrors crate::mcp::peers::facade: the four Tool impls hold an Arc<dyn ReviewFacade> so tests drive them with a MockReviewFacade instead of a live Workspace. resolve_scope maps the caller to its (project, branch) review scope - project via the shared crate::mcp::caller_context, branch via a git query on the caller’s cwd - matching the key the /diff overlay persists under.

Re-exportsΒ§

use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::Weak; πŸ”’
use async_trait::async_trait; πŸ”’
use forge_primitives::git_diff::RepoGate; πŸ”’
use crate::SessionSlot; πŸ”’
use crate::mcp::caller_context::CallerContext; πŸ”’
use crate::mcp::review::CommentAnchorView; πŸ”’
use crate::mcp::review::ReviewDetail; πŸ”’
use crate::mcp::review::ReviewSummary; πŸ”’
use crate::workspace::Workspace; πŸ”’

StructsΒ§

ProdReviewFacade
Production impl over a Weak<Workspace> (the same cycle-breaking shape crate::mcp::peers::facade::ProdWorkspaceFacade uses).
ReviewScope
The caller’s resolved review context. (project, branch) is the store key both the /diff overlay and these tools address; author_label is how a review__reply from this caller is attributed in the thread; caller is the session whose turn buffer accumulates the activity so the reviewer gets one batched notice at turn end.

EnumsΒ§

ScopeError
Which step of ReviewFacade::resolve_scope’s chain failed. One variant per step so the caller-facing Self::message states only what was observed: the prior single string asserted a detached HEAD for every failure, and workers chased their own HEAD over a step that had failed earlier.

TraitsΒ§

ReviewFacade
Narrow surface the review-conversation tools depend on. resolve_scope is async (it shells out to git for the branch); the store ops are synchronous over the resolved scope.

FunctionsΒ§

warn_unresolved πŸ”’
The one WARN a failed scope resolution emits, carrying every field that discriminates the failing step. This is the line to reach for when a caller reports it cannot read its reviews.