buildfix-edit
Edit engine for buildfix plans.
This crate applies planned operations, checks preconditions, enforces safety gates at apply time, and produces patch previews.
Key APIs
attach_preconditions(...): add SHA256 file preconditions (and optional git HEAD precondition)preview_patch(...): render unified diff without writing filesapply_plan(...): execute plan in dry-run or write mode and returnBuildfixApplycheck_policy_block(...): detect policy-block outcomes for exit-code mappingapply_op_to_content(...): pure operation-to-content transformexecute_plan_from_contents(...): apply ops using in-memory content maps
Supported op shapes
toml_settoml_removetoml_transform(rule-based transforms)text_replace_anchored
Built-in transform rules
ensure_workspace_resolver_v2set_package_rust_versionset_package_editionensure_path_dep_has_versionensure_workspace_dependency_versionuse_workspace_dependency
Policy and safety behavior
safeops run by default when--applyis setguardedops requireallow_guardedunsafeops requireallow_unsafe- Missing params and precondition mismatches block apply results
This is a support crate for the buildfix workspace and may evolve in lockstep with the workspace release train.