#![allow(dead_code)]
use weavatrix_refactor_plan::{
Completeness, CompletenessProof, EvidenceScope, FileEdit, GraphRevision, PlannerIdentity,
Position, Provenance, RefactorOperation, RefactorPlan, ScopeKind, TextEdit, TextRange,
UncertainReference, UncertaintyCode,
};
pub fn text_edit() -> TextEdit {
TextEdit::replace(
TextRange::new(Position::new(1, 0), Position::new(1, 1)),
"a",
"b",
Provenance::EXACT_LSP,
)
}
pub fn file_edit(path: &str) -> FileEdit {
FileEdit::new(path, "0".repeat(64), vec![text_edit()])
}
pub fn minimal_plan() -> RefactorPlan {
RefactorPlan::new(
"rename_symbol",
vec![RefactorOperation::Modify(file_edit("src/a.rs"))],
)
}
pub fn strict_plan(completeness: &str) -> RefactorPlan {
let mut plan = minimal_plan();
plan.completeness = Some(Completeness::new(completeness));
plan.evidence.created_at = Some("2026-08-02T12:00:00Z".to_owned());
plan.evidence.graph_revision = GraphRevision::Value("revision-1".to_owned());
plan.evidence.completeness_proof = Some(CompletenessProof::new(
EvidenceScope::new(ScopeKind::new("REPOSITORY"), "workspace"),
PlannerIdentity::new("weavatrix-refactor", "0.1.0", "rust-analyzer"),
));
plan.evidence.uncertain_references = Some(Vec::new());
plan.evidence.not_modified = Some(Vec::new());
plan.evidence.warnings = Some(Vec::new());
plan.evidence.follow_up = Some("verify the planned change".to_owned());
if completeness == Completeness::PARTIAL {
plan.evidence
.uncertain_references
.as_mut()
.unwrap()
.push(UncertainReference {
path: Some("src/dynamic.rs".to_owned()),
kind: Some(UncertaintyCode::new("DYNAMIC_REFERENCE")),
..UncertainReference::default()
});
}
plan
}