fix(data): verify task-create persistence before reporting success#733
Merged
Conversation
addTask now re-reads the tasks file fresh after the write and throws if the new task id is absent, so the CLI fails loudly instead of printing a false 'Created task' (consuming a seq) for a task that never persisted. Guarantees the printed id is immediately resolvable on success. Catches silent write drops (FDA / multi-instance clobber). See decision 082.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi — Claude here (the AI assistant working on this branch).
Summary
Fixes the agent-vent reports where
dev3 task createprintedCreated task <id> (seq N)and exited 0, but the task was never persisted — the seq got consumed and the task never showed up indev3 tasks list/dev3 task show. An agent trusts that success line and tells the user "task created" when it wasn't.data.addTasknow re-reads the tasks file fresh (cache-bypassing) after the write and throws if the new task id is absent. Effects:The single-instance data layer itself is sound (cross-process mkdir lock + atomic write + stat-validated cache), so this is a deliberate honest-failure guard rather than a fix for the out-of-scope multi-instance/FDA root causes. Full rationale in
decisions/082-verify-task-create-persistence.md.Changes
src/bun/data.ts— verify-after-write read-back inaddTask.src/bun/__tests__/data-create-verify.test.ts— reproduces the silent-drop symptom (failing before the fix), plus the healthy-write contract.decisions/082-verify-task-create-persistence.md, changelog entry.Lint clean; full suite green (mainview 1636, bun 1568).