0211. Distinguish VC CAS conflicts
- Status: Accepted
- Date: 2026-11-09
- Plan: M16.6
- Review: Teaching diagnostics
Context
Ref creation collisions and stale updates currently share a misleading moved-branch message. Queue retries depend on the E1006 prefix; filesystem errors must not change.
Decision
Use a private Copy conflict enum in refs.rs to distinguish AlreadyExists from Moved. Classify an absent expectation with a present ref as AlreadyExists; all other expectation mismatches are Moved. Render both through one function, retaining E1006 and the exact moved message, but naming the existing branch for creation collisions. Fork's early absence check uses the same classifier under its existing branch lock. Keep filesystem errors in the existing String error channel without wrapping them.
Alternatives considered
- Separate string literals at each caller — duplicates classification and lets fork and CAS diagnostics drift.
- Wrap every filesystem error in the enum — adds conversions without clarifying conflict states or changing recovery; retaining Strings avoids unrelated churn.
Consequences
Creation collisions now suggest the right recovery while moved updates and queue retries retain their behavior. No store format, locking or publication order changes.