pub struct WorktreePlan {
pub schema_version: String,
pub operation: String,
pub operations: Vec<RefactorOperation>,
pub completeness: Option<Completeness>,
pub evidence: PlanEvidence,
}Expand description
A bounded, versioned collection of logical refactor operations and evidence.
Fields§
§schema_version: String§operation: String§operations: Vec<RefactorOperation>One simultaneous transition set; array order is identity, not execution order.
completeness: Option<Completeness>§evidence: PlanEvidenceImplementations§
Source§impl RefactorPlan
impl RefactorPlan
pub fn new( operation: impl Into<String>, operations: Vec<RefactorOperation>, ) -> RefactorPlan
pub fn validate(&self) -> Result<ValidatedConsumerPlan<'_>, PlanError>
pub fn validate_with( &self, limits: RefactorPlanLimits, ) -> Result<ValidatedConsumerPlan<'_>, PlanError>
pub fn fingerprint(&self) -> Result<PlanFingerprint, PlanError>
Sourcepub fn from_text_edit_plan(plan: EditPlan) -> Result<RefactorPlan, PlanError>
pub fn from_text_edit_plan(plan: EditPlan) -> Result<RefactorPlan, PlanError>
Converts a legacy edit envelope without losing text edits or extensions.
§This requires a capturing decode
The edit envelope declares only schemaVersion, operation, files,
and completeness, so every annotation this crate understands —
createdAt, graphRevision, completenessProof,
uncertainReferences, notModified, warnings, followUp,
syntaxCheck — arrives as an undeclared member and lives in
crate::EditPlan::extensions.
A plan decoded through crate::weavatrix_edit::DeclaredEditPlan has
empty extension maps at every level. This conversion then returns Ok
with PlanEvidence::default(), reporting neither
an error nor a warning, the extension budget in
validate_with has nothing left to weigh, and the
fingerprint differs from the one the same wire
document yields after a capturing decode. Decode through
crate::EditPlan whenever the evidence matters.
Sourcepub fn try_into_text_edit_plan(self) -> Result<EditPlan, PlanError>
pub fn try_into_text_edit_plan(self) -> Result<EditPlan, PlanError>
Converts to a legacy edit envelope if every operation is a text modify.
Trait Implementations§
Source§impl Clone for RefactorPlan
impl Clone for RefactorPlan
Source§fn clone(&self) -> RefactorPlan
fn clone(&self) -> RefactorPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more