pub struct ProposedFact {
pub key: ContextKey,
pub id: ProposalId,
pub content: String,
pub provenance: String,
/* private fields */
}Expand description
An unvalidated suggestion from a non-authoritative source.
Proposed facts live in ContextKey::Proposals until a ValidationAgent
promotes them to Fact. The proposal tracks its origin for audit trail.
Fields§
§key: ContextKeyThe context key this proposal targets.
id: ProposalIdUnique identifier encoding origin and target.
content: StringThe proposed content.
provenance: StringProvenance information (e.g., model ID, prompt hash).
Implementations§
Source§impl ProposedFact
impl ProposedFact
Sourcepub fn new(
key: ContextKey,
id: impl Into<ProposalId>,
content: impl Into<String>,
provenance: impl Into<String>,
) -> ProposedFact
pub fn new( key: ContextKey, id: impl Into<ProposalId>, content: impl Into<String>, provenance: impl Into<String>, ) -> ProposedFact
Create a new draft proposal with explicit provenance.
Confidence defaults to 1.0. Override with with_confidence.
Sourcepub fn confidence(&self) -> f64
pub fn confidence(&self) -> f64
Returns the confidence value, always in [0.0, 1.0].
Sourcepub fn with_confidence(self, confidence: f64) -> ProposedFact
pub fn with_confidence(self, confidence: f64) -> ProposedFact
Set an explicit confidence baseline for this proposal.
Use this to establish a starting point, then accumulate criteria with
adjust_confidence. The value is clamped to
[0.0, 1.0]; non-finite values (NaN, infinity) are treated as 0.0.
For computed confidence (e.g. from a solver), pass the result directly.
Sourcepub fn adjust_confidence(self, delta: f64) -> ProposedFact
pub fn adjust_confidence(self, delta: f64) -> ProposedFact
Adjust confidence by a named step, clamped to [0.0, 1.0].
This is the recommended way to express confidence in suggestors and pack
solvers. Use the CONFIDENCE_STEP_* constants as the vocabulary:
use converge_pack::{CONFIDENCE_STEP_MAJOR, CONFIDENCE_STEP_MINOR, CONFIDENCE_STEP_TINY};
let proposal = ProposedFact::new(key, id, content, prov)
.with_confidence(0.5) // baseline
.adjust_confidence(CONFIDENCE_STEP_MAJOR) // primary criterion met
.adjust_confidence(CONFIDENCE_STEP_MINOR) // supporting criterion met
.adjust_confidence(CONFIDENCE_STEP_TINY); // tiebreaker bonusPrefer this over accumulating a local f64 and calling with_confidence
at the end — the clamping is automatic and the intent is explicit at each step.
Trait Implementations§
Source§impl Clone for ProposedFact
impl Clone for ProposedFact
Source§fn clone(&self) -> ProposedFact
fn clone(&self) -> ProposedFact
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more