fix: resolve workspace publish conflicts

This commit is contained in:
2026-08-04 06:57:19 +02:00
parent b75b3af28e
commit 234b40e7cf
7 changed files with 218 additions and 20 deletions
+17 -3
View File
@@ -16,6 +16,17 @@
Conflict payloads now pass through the canonical draft sanitizer and reject unknown/secret
fields before rendering.
## Review round 1
- Replaced the pull/reload-only conflict recovery with an explicit choice of the local draft or
registry value for every changed field. A revised draft can be saved only after every field has
a choice; it is rebased to the conflict's `actual.commit` and `actual.blob` and is never
published automatically.
- Kept normal validation and the explicit publish confirmation as mandatory steps after saving a
resolution. Nothing silently discards the local draft or merges it into the registry.
- Added typed expected/actual conflict revisions, displayed the active registry `status.head`
commit, and whitelisted every canonical `diagnostics.*` leaf path structurally.
## TDD evidence
- Wrote the publish-dialog and manager import/export tests before the implementation and observed
@@ -24,14 +35,17 @@
before wiring the conflict parser through the canonical sanitizer.
- Added a regression test for a failed pull during conflict recovery and observed the original
unhandled rejection before adding the redacted in-dialog error state.
- Added review-round tests first for per-field local/registry selection, rebased draft saving
without a second publish, active-commit rendering, and every canonical diagnostics conflict
path; these initially failed against the pull/reload-only UI and narrow path parser.
## Verification
Run in `frontend/` after the final changes:
```text
npx vitest run src/shell/WorkspacePublishDialog.test.tsx src/api/workspaces.test.ts src/shell/WorkspaceManager.test.tsx
# 3 files passed, 15 tests passed
npx vitest run src/shell/WorkspacePublishDialog.test.tsx src/api/workspaces.test.ts src/shell/WorkspaceManager.test.tsx src/workspaces/drafts.test.ts
# 4 files passed, 47 tests passed
npx tsc -b
# exit 0
@@ -39,5 +53,5 @@ npx tsc -b
```text
npx vitest run
# 51 files passed, 370 tests passed
# 51 files passed, 392 tests passed
```