Status
createDashboardAuthoringSession has no production callers on current main; it is referenced only by its implementation and unit tests. This is therefore latent correctness/design debt, not a presently reachable user-facing defect.
Keep the issue open, but it does not block current Dashboard work. It does block wiring this session into Workbench, AI, MCP, or any other production caller.
Problem
DashboardAuthoringSession.commit() currently builds a complete StoredWorkspaceV1 from session-local snapshots and calls WorkspaceRepository.commit() directly.
That bypasses the shared mutation contract introduced by #341/#344:
- enter the application workspace write queue;
- load the latest committed aggregate at dequeue time;
- apply a mutation to that latest aggregate;
- commit atomically;
- project the committed result.
Once this session gains a live caller, its current implementation can overwrite query, Dashboard, import, rename, or other workspace changes committed by another same-tab producer while the authoring session was open.
Required design
Do not inject a raw repository commit capability into the authoring session.
Inject an application-level mutation seam equivalent to:
mutateWorkspace(
transform: (latest: StoredWorkspaceV1 | null) =>
StoredWorkspaceV1 | null | Promise<StoredWorkspaceV1 | null>,
): Promise<WorkspaceCommitResult | null>;
At commit time, the session must rebase its intended Dashboard/query changes onto the dequeue-time latest workspace rather than replacing latest with the session's original workspace snapshot.
The implementation must define explicit conflict semantics for session-local edits when the latest workspace changed incompatibly. It must not silently discard either side.
Scope
Preferred: adapt and retain DashboardAuthoringSession because it remains a useful reusable boundary for future non-DOM callers.
Acceptable alternative: delete the unused module and tests, then recreate it against the shared mutation API when the first production caller is introduced.
This issue is separate from #343. #343 protects cross-tab writes with repository/storage-level optimistic concurrency. This issue ensures this future producer obeys the existing same-tab mutation pipeline.
Acceptance criteria
Related
Status
createDashboardAuthoringSessionhas no production callers on currentmain; it is referenced only by its implementation and unit tests. This is therefore latent correctness/design debt, not a presently reachable user-facing defect.Keep the issue open, but it does not block current Dashboard work. It does block wiring this session into Workbench, AI, MCP, or any other production caller.
Problem
DashboardAuthoringSession.commit()currently builds a completeStoredWorkspaceV1from session-local snapshots and callsWorkspaceRepository.commit()directly.That bypasses the shared mutation contract introduced by #341/#344:
Once this session gains a live caller, its current implementation can overwrite query, Dashboard, import, rename, or other workspace changes committed by another same-tab producer while the authoring session was open.
Required design
Do not inject a raw repository commit capability into the authoring session.
Inject an application-level mutation seam equivalent to:
At commit time, the session must rebase its intended Dashboard/query changes onto the dequeue-time
latestworkspace rather than replacinglatestwith the session's original workspace snapshot.The implementation must define explicit conflict semantics for session-local edits when the latest workspace changed incompatibly. It must not silently discard either side.
Scope
Preferred: adapt and retain
DashboardAuthoringSessionbecause it remains a useful reusable boundary for future non-DOM callers.Acceptable alternative: delete the unused module and tests, then recreate it against the shared mutation API when the first production caller is introduced.
This issue is separate from #343. #343 protects cross-tab writes with repository/storage-level optimistic concurrency. This issue ensures this future producer obeys the existing same-tab mutation pipeline.
Acceptance criteria
DashboardAuthoringSessionno longer receives or calls rawWorkspaceRepository.commit().Related