spec(client): DAG push and edit session contract for silo-mod / Kindred Create #168
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).
The server-side edit session and checkpoint infrastructure (#161-#167) depends on the client (silo-mod FreeCAD extension and Kindred Create) implementing specific behaviors. This issue specifies the contract so client development can proceed in parallel.
What the Server Provides
1. Workstation Registration
On first launch, the client must register its workstation:
The
fingerprintmust be stable across restarts. Recommended: hash ofplatform.node() + uuid.getnode()or OS machine-id. Registration is idempotent — same fingerprint returns the existing workstation.Store the returned
workstation_idin the client config.2. SSE Connection with Workstation Identity
Connect to SSE with workstation_id:
This associates the connection with the workstation for targeted event delivery.
3. Edit Session Lifecycle
The client must map its internal editing context transitions to server session calls.
Context Detection
The client needs to detect when the user enters and exits these contexts:
sketchSketch001Sketch001partdesignBodyBodyassemblyAssemblyAssemblyAcquire Call
dependency_cone is optional but strongly recommended. The client should compute it from the local feature tree:
If the client cannot compute the cone, omit it — the server will try to compute it from the stored DAG.
Handle Acquire Response
interference: "none"— proceed normallyinterference: "soft"— warn the user but allow entry. Show which user and object conflicts.hard_interference) — block entry. Show who holds the lock and when they acquired it.The client must store the
session_idfor the release call.Release Call (via Checkpoint)
On upward context transition, push a checkpoint that atomically releases the session:
With the checkpoint file/diff and
session_idin the request.4. DAG Push
The client should push the feature DAG after any structural change:
When to push:
dagfield in checkpoint request)Node types to include:
sketch— Sketch objectsfeature— PartDesign features (Pad, Pocket, Fillet, etc.)body— Body containerspart— Part containersassembly— Assembly containersconstraint— Assembly constraintsEdge semantics:
depends_on— target depends on source (source is upstream)properties_hash: SHA-256 of the serialized feature properties. Used for change detection — if the hash changes, the node and its forward cone are marked dirty.
5. Checkpoint Content
The client pushes checkpoint content in one of two modes:
Diff Mode (preferred for XML parametric source)
Compute a unified diff of the XML parametric source against the base revision:
Upload as
storage_mode: "diff"withbase_revisionset.Full Mode (fallback)
Upload the complete file. Use when:
6. SSE Events to Handle
edit.session_acquirededit.session_releasededit.interference_resolvededit.handoff_requestededit.force_released7. Dependency Cone Computation
Pseudocode for computing the forward cone from the FreeCAD document:
Note: FreeCAD's
OutListgives upstream dependencies. We need to invert: find all objects whoseOutListincludes the current object. Alternatively, build a reverse adjacency map once and walk it.Acceptance Criteria (Client Side)
workstation_idquery paramRepos
silo-mod— FreeCAD Silo extension (Python)Depends On
Part Of
#125