You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 29765dc
Browse filesBrowse the repository at this point in the historyBrowse files
fix: serialize history deletion with settlement and validate the locked record
Address PR #1726 review findings with minimal changes scoped to the new
settlement writer.
Deletion versus settlement (#1726 finding 1)
- src/utils/fileLock.ts exports acquireFileLock and withFileLock. They use
the exact advisory lock protocol that safeWriteJson uses, so one
implementation owns the per-file lock. safeWriteJson acquires through
acquireFileLock and keeps its write, backup, and release behavior.
- TaskHistoryStore.delete and deleteMany unlink each history_item.json
inside withFileLock. Cache eviction and write-through semantics stay
identical to base. Lock ordering stays store lock first, then one
per-file lock, matching the write path, so no path nests the file lock.
- The real-filesystem race test pauses settlement inside its locked disk
read, starts deletion from a second store, verifies the deletion stays
blocked, releases settlement, and verifies the file stays deleted
without resurrection.
Locked-record validation (#1726 finding 3)
- The settlement merge callback now validates the disk record with the
canonical historyItemSchema and requires parsed.data.id === taskId.
- Malformed or mismatched records evict the stale cache entry and fail
settlement closed without rewriting the record. Missing-record eviction
and error behavior stay unchanged.
Gemini partial assertions (#1726 finding 2)
- The request-unique tool-call ID test now asserts exactly one partial
with name new_task and no arguments and exactly one partial with
serialized empty arguments and no name, then keeps the shared-ID and
cross-request uniqueness assertions.
The pre-commit hook was skipped because the full-workspace eslint in this
environment was killed for memory (exit 137). Targeted eslint
--prune-suppressions --max-warnings=0 passed on every edited file with no
suppression count increase, and CI runs the full lint.
Validation: focused Vitest suites pass, tsc --noEmit passes, all seven
bounded lifecycle model checkers pass, and full pnpm test passes (13
tasks, 488 files, 9021 tests).
Copy file name to clipboardExpand all lines: docs/architecture/task-lifecycle-model.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ CI fails if either exact causal witness or violation class changes, a witness di
83
83
84
84
The known-unsafe witnesses currently compare exact shortest action sequences. This is intentionally simple and reviewable, but brittle to harmless action renames or serialization refactors. A causal partial-order comparator would reduce that brittleness but would add a second trace-equivalence protocol to maintain. Until that complexity is justified, update an exact witness only after confirming the terminal violation class and required causal ordering are unchanged.
85
85
86
-
`TaskHistoryStore.realConcurrency.spec.ts` complements the abstract interleavings with real-filesystem checks through the real `proper-lockfile` and filesystem rename path, including stale-settlement compare-and-clear. Restart recovery is covered by `Task.persistence.spec.ts`: it treats an interrupted task's pending `create_subtask` action as rejected, settles that exact action before replay, and a failed recovery write stops replay rather than creating another child. Broader VS Code E2E remains reserved for other restart and extension-host behavior.
86
+
`TaskHistoryStore.realConcurrency.spec.ts` complements the abstract interleavings with real-filesystem checks through the real `proper-lockfile` and filesystem rename path, including stale-settlement compare-and-clear. History-file deletion serializes on the same per-file advisory lock as `safeWriteJson`, and the real-filesystem suite covers a deletion that targets the settlement read-to-commit window plus schema and task-ID validation of the locked disk record before settlement (#1726). Restart recovery is covered by `Task.persistence.spec.ts`: it treats an interrupted task's pending `create_subtask` action as rejected, settles that exact action before replay, and a failed recovery write stops replay rather than creating another child. Broader VS Code E2E remains reserved for other restart and extension-host behavior.
0 commit comments