pub struct ContextValidator {
config: PCPConfig,
checkpoints: Vec<PCPCheckpoint>,
}Expand description
The main validation and checkpoint engine (formerly PCPRuntime).
Fields§
§config: PCPConfig§checkpoints: Vec<PCPCheckpoint>Implementations§
Source§impl ContextValidator
impl ContextValidator
Sourcepub fn validate_context_integrity(
&self,
scope: &Scope,
artifacts: &[Artifact],
current_tokens: i32,
) -> CellstateResult<ValidationResult>
pub fn validate_context_integrity( &self, scope: &Scope, artifacts: &[Artifact], current_tokens: i32, ) -> CellstateResult<ValidationResult>
Validate context integrity.
fn check_dosage_limits( &self, result: &mut ValidationResult, artifact_count: i32, token_count: i32, )
fn check_stale_scope(&self, result: &mut ValidationResult, scope: &Scope)
fn check_artifact_integrity( &self, result: &mut ValidationResult, artifact: &Artifact, )
Source§impl ContextValidator
impl ContextValidator
Sourcepub fn detect_contradictions(
&self,
artifacts: &[Artifact],
) -> CellstateResult<Vec<Contradiction>>
pub fn detect_contradictions( &self, artifacts: &[Artifact], ) -> CellstateResult<Vec<Contradiction>>
Detect contradictions between artifacts using embedding similarity.
Source§impl ContextValidator
impl ContextValidator
Sourcepub fn apply_dosage_limits(
&self,
artifacts: &[Artifact],
current_tokens: i32,
) -> CellstateResult<DosageResult>
pub fn apply_dosage_limits( &self, artifacts: &[Artifact], current_tokens: i32, ) -> CellstateResult<DosageResult>
Apply dosage limits to artifacts and tokens.
Source§impl ContextValidator
impl ContextValidator
Sourcepub fn lint_artifact(
&self,
artifact: &Artifact,
existing_artifacts: &[Artifact],
) -> CellstateResult<LintResult>
pub fn lint_artifact( &self, artifact: &Artifact, existing_artifacts: &[Artifact], ) -> CellstateResult<LintResult>
Lint an artifact for quality issues.
fn check_artifact_size(&self, result: &mut LintResult, artifact: &Artifact)
fn check_artifact_duplicates( &self, result: &mut LintResult, artifact: &Artifact, existing_artifacts: &[Artifact], )
fn check_artifact_embedding(&self, result: &mut LintResult, artifact: &Artifact)
fn check_artifact_confidence( &self, result: &mut LintResult, artifact: &Artifact, )
fn check_artifact_semantics(&self, result: &mut LintResult, artifact: &Artifact)
Sourcepub fn lint_artifacts(
&self,
artifacts: &[Artifact],
) -> CellstateResult<LintResult>
pub fn lint_artifacts( &self, artifacts: &[Artifact], ) -> CellstateResult<LintResult>
Lint multiple artifacts at once.
Source§impl ContextValidator
impl ContextValidator
Sourcepub fn create_checkpoint(
&mut self,
scope: &Scope,
artifacts: &[Artifact],
note_ids: &[NoteId],
) -> CellstateResult<PCPCheckpoint>
pub fn create_checkpoint( &mut self, scope: &Scope, artifacts: &[Artifact], note_ids: &[NoteId], ) -> CellstateResult<PCPCheckpoint>
Create a checkpoint for a scope.
fn enforce_checkpoint_limit(&mut self)
Sourcepub fn recover_from_checkpoint(
&self,
checkpoint: &PCPCheckpoint,
) -> CellstateResult<RecoveryResult>
pub fn recover_from_checkpoint( &self, checkpoint: &PCPCheckpoint, ) -> CellstateResult<RecoveryResult>
Recover a scope from a checkpoint.
Sourcepub fn get_latest_checkpoint(&self, scope_id: ScopeId) -> Option<&PCPCheckpoint>
pub fn get_latest_checkpoint(&self, scope_id: ScopeId) -> Option<&PCPCheckpoint>
Get the latest checkpoint for a scope.
Sourcepub fn get_checkpoints_for_scope(
&self,
scope_id: ScopeId,
) -> Vec<&PCPCheckpoint>
pub fn get_checkpoints_for_scope( &self, scope_id: ScopeId, ) -> Vec<&PCPCheckpoint>
Get all checkpoints for a scope.
Sourcepub fn delete_checkpoint(&mut self, checkpoint_id: Uuid) -> bool
pub fn delete_checkpoint(&mut self, checkpoint_id: Uuid) -> bool
Delete a checkpoint.
Sourcepub fn clear_checkpoints_for_scope(&mut self, scope_id: ScopeId) -> usize
pub fn clear_checkpoints_for_scope(&mut self, scope_id: ScopeId) -> usize
Clear all checkpoints for a scope.
Source§impl ContextValidator
impl ContextValidator
Sourcepub fn check_summarization_triggers(
&self,
scope: &Scope,
turn_count: i32,
artifact_count: i32,
policies: &[SummarizationPolicy],
) -> CellstateResult<Vec<(SummarizationPolicyId, SummarizationTrigger)>>
pub fn check_summarization_triggers( &self, scope: &Scope, turn_count: i32, artifact_count: i32, policies: &[SummarizationPolicy], ) -> CellstateResult<Vec<(SummarizationPolicyId, SummarizationTrigger)>>
Check which summarization triggers should fire based on current scope state.
Sourcepub fn get_abstraction_transition(
&self,
policy: &SummarizationPolicy,
) -> (AbstractionLevel, AbstractionLevel)
pub fn get_abstraction_transition( &self, policy: &SummarizationPolicy, ) -> (AbstractionLevel, AbstractionLevel)
Calculate what abstraction level transition should occur for a policy.
Sourcepub fn validate_abstraction_transition(
&self,
source: AbstractionLevel,
target: AbstractionLevel,
) -> bool
pub fn validate_abstraction_transition( &self, source: AbstractionLevel, target: AbstractionLevel, ) -> bool
Validate an abstraction level transition.
Trait Implementations§
Source§impl Clone for ContextValidator
impl Clone for ContextValidator
Source§fn clone(&self) -> ContextValidator
fn clone(&self) -> ContextValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContextValidator
impl RefUnwindSafe for ContextValidator
impl Send for ContextValidator
impl Sync for ContextValidator
impl Unpin for ContextValidator
impl UnwindSafe for ContextValidator
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
Mutably borrows from an owned value. Read more