From 4d7fc57a5e2ff4a2e7542ff90d2cedbba7325e57 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Wed, 2 Dec 2026 00:07:06 +0000 Subject: [PATCH] Record safety and transfer review findings --- docs/roadmap/remediation.md | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 docs/roadmap/remediation.md diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md new file mode 100644 index 0000000..84bcb97 --- /dev/null +++ b/docs/roadmap/remediation.md @@ -0,0 +1,80 @@ +# Safety and Transfer Sprint Review + +Reviewed implementation: `75eddf8adcdd23e2dd7a95acc56eab9d36445655`. +Comparison baseline: `a92a117`. + +## Required Remediation + +### R1 — P3: Identify workspace-lock contention while the command waits + +Status: Open + +Plan: [Stage 2](implementation.md#stage-2-introduce-one-stable-workspace-lock), +item 3, and the command wiring in Stage 3. The approved behavior includes +identifying the waited-on lock through existing diagnostics. + +**Evidence.** `AcquireWorkspaceLockContext` in +[local.go](../../internal/artifacts/local.go), lines 202–224, retries contention +silently. The workspace path is included only when cancellation returns an error. +The callers in [runner.go](../../internal/app/runner.go), lines 67–69, +[clean_command.go](../../internal/app/clean_command.go), lines 88–94, +[restore_command.go](../../internal/app/restore_command.go), and managed +initialization likewise enter the wait without reporting it. Existing lock tests +verify exclusion and cancellation, but do not verify a diagnostic during the wait. +This is established from source; exclusion itself is implemented correctly. + +**Impact.** A mutating invocation can wait indefinitely with no indication that +it is queued behind another invocation or which workspace lock is responsible. +Workspace-wide serialization makes this relevant even when the two commands +target different sessions. Cancelling reveals the path too late to explain an +ongoing wait. + +**Required outcome.** Use the existing operator reporting mechanism to identify +workspace lock acquisition/waiting before the blocking wait completes. Keep the +shared coordination semantics and cancellation causes. One concise acquisition +or contention diagnostic is sufficient; no polling log stream, new command +option, fairness rule, or lock-holder inspection subsystem is needed. + +**Verification.** Hold a real workspace lock, start a contending command with +captured diagnostics, and verify the lock path is reported while the holder +still owns it. Then cancel the waiter and verify cancellation and absence of +managed-state mutation. Coordinate the observation with a barrier or reporter +signal rather than asserting exact message wording or elapsed time. + +## Stage-by-Stage Assessment + +| Stage | Review result | +| --- | --- | +| 1 | SDK upload tests consume and compare payload bytes; recovery instructions bound regeneration before publication. | +| 2 | Stable workspace lock, cancellation, independent roots, and persistent coordination identity implemented; R1 remains. | +| 3 | Runner layout, preflight, mutating restore, manual cleanup, and managed initialization use the shared gate; R1 affects their operator diagnostics. | +| 4 | Exclusive local creation and provider-conditioned remote creation enforce non-forced conflicts at the write boundary. | +| 5 | Subprocess shutdown joins waiter/output completion before returning ownership, with delayed-completion regressions. | +| 6 | Shared response-bound streaming enforces known sizes, preserves unknown-size operation, closes responses, and retains failure causes. | +| 7 | Audio materialization records the downloaded response identity; replacement, reuse, and rollback tests cover the intended behavior. | +| 8 | Restore, previous-input hydration, and immutable verification use bounded streams with consumer-level oversized-response tests. | +| 9 | Changed local copies use existing atomic streaming and installed-byte checksums. | +| 10 | Publication mapping uses confined source descriptors rather than retaining all open handles. | +| 11 | Sources are transferred and closed sequentially; same-handle use, late failure, and pointer-last selection remain protected. | +| 12 | Original audit reports remain unchanged and only the nine scoped catalog entries are closed; the stage-completion claim needs R1 follow-through. | + +No additional correctness defect or inadvertently strengthened requirement was +identified in this sprint's scope. Workspace serialization, delayed shutdown +completion, and late publication-source failure follow the operator's approved +choices. Session-restore redesign, multi-format discovery, and the remaining +catalog findings remain separate pending work. + +## Verification Performed + +Passed with Go 1.27.4: + +- `go test ./...`; +- `go test -race -count=1 ./...`; +- `go vet ./...`; +- `go build ./...`; +- uncached focused tests for storage, artifacts, audio, stages, subprocesses, and + documentation; and +- `git diff --check`. + +The finding concerns missing operator feedback, which the passing lock tests do +not assert. No production code was changed or live external services invoked.