Document regex invariants & surface broken contact bindings #64
Loading…
Reference in a new issue
No description provided.
Delete branch "backend-reliability-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
.unwrap()calls indocx_ops.rs. Tracing each unwrap showed they're all safe by construction (guarded by surroundingif let Some(...),is_none()short-circuits, explicitlen()checks, or the regex match guaranteeing the substring exists). Converted each to.expect("<invariant>")so a future refactor breaking the assumption produces a useful panic message instead of a bareunwrap() on None. Also replaced onebest.is_none() || pos < best.unwrap().0withbest.is_none_or(|b| pos < b.0). Pure cleanup, no behavior change.resolve_contact_variablesused to silently drop bindings that pointed at deleted contacts: the role's variables stayed blank and the user had no signal. Changed the Tauri command to returnResult<Vec<String>, String>carrying one warning per broken binding, and added aresolveContactVariableshelper on the frontend that toasts each warning (8s warning toast). All five existing call sites now go through the helper.Test plan
make typecheckmake lintmake test— 93/93 passing