% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scan_prompt.R
\name{.semantic_review}
\alias{.semantic_review}
\title{Run semantic reviewer checks}
\usage{
.semantic_review(text, reviewer, policy_name)
}
\arguments{
\item{text}{Text to review.}

\item{reviewer}{Function or chat object.}

\item{policy_name}{Policy name.}
}
\value{
A list of finding lists.
}
\description{
Asks a reviewer model or function for JSON findings.
}
\details{
The reviewer prompt asks for an array of objects containing \code{rule_id},
\code{owasp}, \code{severity}, and \code{description}. Reviewers may also return
\code{confidence}, \code{evidence}, \code{recommended_action}, and \code{span}. \code{span} may be a
two-element numeric vector or an object with \code{start} and \code{end}. The reviewer
can be a function or an object with \verb{$chat()}. Malformed JSON is treated as a
soft failure because deterministic rule findings should still be usable.
Custom reviewer instructions should be added by wrapping the reviewer and
prepending context before delegating to the model, while keeping this JSON
schema intact.
Structured parse and schema errors are attached to the report metadata by the
public scanner wrappers.
}
\keyword{internal}
