pub struct KnowledgeRecord {
pub schema_version: u32,
pub record_id: String,
pub kind: KnowledgeRecordKind,
pub scope: KnowledgeScope,
pub source: KnowledgeSource,
pub confidence: KnowledgeConfidence,
pub invalidation: KnowledgeInvalidation,
pub data: Value,
pub history: Vec<KnowledgeLifecycleEvent>,
}Expand description
A versioned knowledge record. data is deliberately opaque to this layer,
but its shape, size, and sensitive field names are strictly bounded.
Fields§
§schema_version: u32§record_id: String§kind: KnowledgeRecordKind§scope: KnowledgeScope§source: KnowledgeSource§confidence: KnowledgeConfidence§invalidation: KnowledgeInvalidation§data: Value§history: Vec<KnowledgeLifecycleEvent>Implementations§
Source§impl KnowledgeRecord
impl KnowledgeRecord
Sourcepub fn from_page_observation(
observation: &SemanticObservation,
options: KnowledgeRecordBuildOptions,
) -> Result<Self, KnowledgeValidationError>
pub fn from_page_observation( observation: &SemanticObservation, options: KnowledgeRecordBuildOptions, ) -> Result<Self, KnowledgeValidationError>
Build an observed page-family record from fresh semantic structure.
Only page/region kinds are retained. Current revisioned target references, labels, text, accessibility trees, and form values are not copied into persistent knowledge.
Sourcepub fn from_intent_candidate(
candidate: &SemanticIntentCandidate,
options: KnowledgeRecordBuildOptions,
) -> Result<Self, KnowledgeValidationError>
pub fn from_intent_candidate( candidate: &SemanticIntentCandidate, options: KnowledgeRecordBuildOptions, ) -> Result<Self, KnowledgeValidationError>
Build an observed target-fingerprint record from one fresh intent candidate. Only a digest and non-sensitive semantic dimensions are retained; the candidate’s current reference and accessible name are never persisted.
Sourcepub fn from_workflow_definition(
workflow: &WorkflowDefinition,
options: KnowledgeRecordBuildOptions,
) -> Result<Self, KnowledgeValidationError>
pub fn from_workflow_definition( workflow: &WorkflowDefinition, options: KnowledgeRecordBuildOptions, ) -> Result<Self, KnowledgeValidationError>
Build a candidate workflow-entry record from a validated definition. Only hashed workflow identity, hashed step/output IDs, and bounded shape counts are retained; inputs, locators, predicates, and values are deliberately excluded.
Sourcepub fn validate(&self) -> Result<(), KnowledgeValidationError>
pub fn validate(&self) -> Result<(), KnowledgeValidationError>
Validate one record against the stable contract and all payload bounds.
Sourcepub fn to_canonical_json(&self) -> Result<String, KnowledgeValidationError>
pub fn to_canonical_json(&self) -> Result<String, KnowledgeValidationError>
Serialize a validated record with deterministic object-key ordering.
Sourcepub fn content_hash(&self) -> Result<String, KnowledgeValidationError>
pub fn content_hash(&self) -> Result<String, KnowledgeValidationError>
Hash the canonical record for integrity checks and stable comparisons.
Sourcepub fn assess(&self, context: &KnowledgeLookupContext) -> KnowledgeAssessment
pub fn assess(&self, context: &KnowledgeLookupContext) -> KnowledgeAssessment
Assess this record against current scope and fresh observation signals. A positive assessment never includes an executable target reference.
Sourcepub fn transition(
&mut self,
next: KnowledgeConfidence,
reason: String,
observed_at: String,
fresh_verification: bool,
) -> Result<(), KnowledgeValidationError>
pub fn transition( &mut self, next: KnowledgeConfidence, reason: String, observed_at: String, fresh_verification: bool, ) -> Result<(), KnowledgeValidationError>
Apply a lifecycle transition. Promotion to verified and recovery from
contradiction/quarantine require fresh verification evidence.
Trait Implementations§
Source§impl Clone for KnowledgeRecord
impl Clone for KnowledgeRecord
Source§fn clone(&self) -> KnowledgeRecord
fn clone(&self) -> KnowledgeRecord
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 KnowledgeRecord
impl Debug for KnowledgeRecord
Source§impl<'de> Deserialize<'de> for KnowledgeRecord
impl<'de> Deserialize<'de> for KnowledgeRecord
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>,
Source§impl PartialEq for KnowledgeRecord
impl PartialEq for KnowledgeRecord
Source§impl Serialize for KnowledgeRecord
impl Serialize for KnowledgeRecord
impl StructuralPartialEq for KnowledgeRecord
Auto Trait Implementations§
impl Freeze for KnowledgeRecord
impl RefUnwindSafe for KnowledgeRecord
impl Send for KnowledgeRecord
impl Sync for KnowledgeRecord
impl Unpin for KnowledgeRecord
impl UnsafeUnpin for KnowledgeRecord
impl UnwindSafe for KnowledgeRecord
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<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