pub struct ResearchReviewBatchV1 {
pub schema: String,
pub batch_id: String,
pub project_id: String,
pub run_id: String,
pub evaluation_record_digest: String,
pub evidence_digest: String,
pub findings: Vec<ResearchReviewFindingV1>,
pub batch_digest: String,
}Expand description
One immutable projection of an evaluator result into bounded findings.
A batch does not define a rubric or a business decision. It only prevents a host from publishing a partially mixed reviewer response: every finding must belong to the same project/run, evaluation record, and evidence snapshot. A batch may contain zero findings to represent a clean reviewer result; the evaluator record remains the authoritative result and evidence identity. Human resolution remains an explicit operation on each finding.
Fields§
§schema: String§batch_id: String§project_id: String§run_id: String§evaluation_record_digest: String§evidence_digest: String§findings: Vec<ResearchReviewFindingV1>§batch_digest: StringImplementations§
Source§impl ResearchReviewBatchV1
impl ResearchReviewBatchV1
Sourcepub fn new_for_run(
batch_id: impl Into<String>,
run: &ResearchRunV1,
record: &EvaluationRecordV1,
evidence_digest: impl Into<String>,
findings: Vec<ResearchReviewFindingV1>,
) -> Result<Self, ResearchContractError>
pub fn new_for_run( batch_id: impl Into<String>, run: &ResearchRunV1, record: &EvaluationRecordV1, evidence_digest: impl Into<String>, findings: Vec<ResearchReviewFindingV1>, ) -> Result<Self, ResearchContractError>
Construct a batch against the admitted Run and exact evaluator record.
The identity-only new constructor remains available for
compatibility with callers that only have wire-level digests. New
reviewer pipelines should use this constructor so the project/run
namespace and evaluator evidence snapshot are closed at admission. A
newly admitted batch must contain only open findings; resolved or
waived findings must be restored from the already-published batch and
changed through the explicit transition methods below.
pub fn new( batch_id: impl Into<String>, project_id: impl Into<String>, run_id: impl Into<String>, evaluation_record_digest: impl Into<String>, evidence_digest: impl Into<String>, findings: Vec<ResearchReviewFindingV1>, ) -> Result<Self, ResearchContractError>
pub fn validate(&self) -> Result<(), ResearchContractError>
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, ResearchContractError>
pub fn from_slice(bytes: &[u8]) -> Result<Self, ResearchContractError>
Decode a bounded JSON batch and validate every nested finding and digest before returning it to a caller at a process boundary.
Sourcepub fn to_vec(&self) -> Result<Vec<u8>, ResearchContractError>
pub fn to_vec(&self) -> Result<Vec<u8>, ResearchContractError>
Encode a validated batch for a process boundary.
Sourcepub fn validate_for_run(
&self,
run: &ResearchRunV1,
record: &EvaluationRecordV1,
) -> Result<(), ResearchContractError>
pub fn validate_for_run( &self, run: &ResearchRunV1, record: &EvaluationRecordV1, ) -> Result<(), ResearchContractError>
Validate this batch against the admitted Run and exact evaluator record that the host intends to publish.
Sourcepub fn resolve_finding(
&mut self,
finding_id: &str,
resolution_digest: impl Into<String>,
) -> Result<(), ResearchContractError>
pub fn resolve_finding( &mut self, finding_id: &str, resolution_digest: impl Into<String>, ) -> Result<(), ResearchContractError>
Resolve one finding and rebind the batch identity atomically.
Sourcepub fn waive_finding(
&mut self,
finding_id: &str,
resolution_digest: impl Into<String>,
) -> Result<(), ResearchContractError>
pub fn waive_finding( &mut self, finding_id: &str, resolution_digest: impl Into<String>, ) -> Result<(), ResearchContractError>
Waive one finding and rebind the batch identity atomically.
Trait Implementations§
Source§impl Clone for ResearchReviewBatchV1
impl Clone for ResearchReviewBatchV1
Source§fn clone(&self) -> ResearchReviewBatchV1
fn clone(&self) -> ResearchReviewBatchV1
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResearchReviewBatchV1
impl Debug for ResearchReviewBatchV1
Source§impl<'de> Deserialize<'de> for ResearchReviewBatchV1
impl<'de> Deserialize<'de> for ResearchReviewBatchV1
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ResearchReviewBatchV1
Source§impl PartialEq for ResearchReviewBatchV1
impl PartialEq for ResearchReviewBatchV1
Source§impl Serialize for ResearchReviewBatchV1
impl Serialize for ResearchReviewBatchV1
impl StructuralPartialEq for ResearchReviewBatchV1
Auto Trait Implementations§
impl Freeze for ResearchReviewBatchV1
impl RefUnwindSafe for ResearchReviewBatchV1
impl Send for ResearchReviewBatchV1
impl Sync for ResearchReviewBatchV1
impl Unpin for ResearchReviewBatchV1
impl UnsafeUnpin for ResearchReviewBatchV1
impl UnwindSafe for ResearchReviewBatchV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more