feat(sessions): soft interference detection via DAG dependency cones #166
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Context
Sub-issue of #125 (Context-Aware Part Subscription System).
Hard interference (same object, same context level) is enforced by the DB unique index from #163. This issue adds soft interference detection — warning when two users edit different objects whose dependency cones overlap.
How It Works
Sketch001. The server storesdependency_cone: [Sketch001, Pad003, Fillet005](the forward cone from the DAG).Sketch003. The server computes B's cone:[Sketch003, Pad003, Pocket002].Pad003appears in both cones → soft interference.interference: "soft"and details. The client can warn the user but still allows entry.Server-Side Cone Computation
When a client acquires a session without providing
dependency_cone, and the DAG module is enabled:object_idbynode_keydag.GetForwardCone(nodeID)(already implemented ininternal/db/dag.go)dependency_conein the sessionIf the DAG doesn't exist for this item, store empty cone and skip soft detection.
Changes to Acquire Handler
Extend
HandleAcquireEditSession(from #163):Soft Interference Detection Logic
Interference Resolved Events
When a session is released and it had soft interference with another session, notify the remaining session:
SSE event:
edit.interference_resolvedFallback Behavior
Files to Modify
internal/api/session_handlers.go— extend acquire with cone computation and soft detectionAcceptance Criteria
interference: "soft"responseinterference: "none"edit.interference_resolvedSSE event when conflicting session releasesDepends On
internal/db/dag.goGetForwardCone()already exists)Part Of
#125