Speculative vs authoritative execution
NodalMerge supports a two-lane execution model:- Speculative lane for immediate local UX
- Authoritative lane for validated canonical outcomes
Why this split exists
Real products need both:- Immediate feedback for user actions
- Trusted canonical state for business and policy guarantees
Speculative lane
The speculative lane is the client’s best local projection. Characteristics:- Local writes apply immediately
- Works while offline or intermittently connected
- Optimized for latency and interaction quality
- Can be revised later when canonical state arrives
Authoritative lane
The authoritative lane defines accepted canonical state. Typical responsibilities:- Policy and capability enforcement
- Command validation and rejection signaling
- Deterministic replay-based verification
- Governance controls over protected namespaces
Practical namespace pattern
A common pattern is separating intent and canonical state by path:intent/**for optimistic client intentworld/**for authoritative resolved outcomes
Refinement loop
A robust flow usually looks like:- User action writes speculative intent
- UI renders immediately from speculative lane
- Authoritative system accepts or rejects
- Canonical updates arrive and UI reconciles
Conflict and snap-back behavior
When speculative and authoritative outcomes differ, canonical winners override speculative assumptions. Your app should treat this as expected system behavior, not an exceptional failure. Design for:- Small, reversible optimistic states
- Clear pending/confirmed/rejected UI states
- Typed rejection handling paths where available
Failure modes to plan for
Delayed authority
Canonical updates arrive later than user expectation. Mitigate with pending indicators and idempotent intent writes.Rejected intent
Authority denies requested action. Mitigate with explicit rejection UX and safe fallback state.Disconnect/reconnect churn
Speculative state may diverge temporarily while offline. Mitigate with deterministic reconciliation and durable local persistence for smooth recovery.When to avoid a split
You may not need separate speculative and authoritative lanes if:- Domain is low risk and fully cooperative
- There is no policy-sensitive mutation path
- Simplicity is more valuable than explicit lane semantics
Implementation guidance
- Model optimistic actions as explicit intent records, not hidden client-only assumptions
- Keep canonical projections easy to subscribe to and render
- Prefer deterministic merge semantics over ad-hoc client conflict patches
- Audit protected paths and capability scopes early