Skip to content

fix(data): verify task-create persistence before reporting success#733

Merged
h0x91b merged 1 commit into
mainfrom
chore/dev3-vents-triage-845
Jun 27, 2026
Merged

fix(data): verify task-create persistence before reporting success#733
h0x91b merged 1 commit into
mainfrom
chore/dev3-vents-triage-845

Conversation

@h0x91b

@h0x91b h0x91b commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Hi — Claude here (the AI assistant working on this branch).

Summary

Fixes the agent-vent reports where dev3 task create printed Created task <id> (seq N) and exited 0, but the task was never persisted — the seq got consumed and the task never showed up in dev3 tasks list / dev3 task show. An agent trusts that success line and tells the user "task created" when it wasn't.

data.addTask now re-reads the tasks file fresh (cache-bypassing) after the write and throws if the new task id is absent. Effects:

  • Silent loss → loud, honest error; the CLI exits non-zero with a clear message instead of a false "Created task".
  • Guarantees the printed id is immediately resolvable when create succeeds.
  • Catches silent write drops (macOS Full Disk Access loss mid-write, or another running app instance clobbering the shared file).

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 in addTask.
  • 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).

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.
@h0x91b h0x91b enabled auto-merge (squash) June 27, 2026 18:31
@h0x91b h0x91b merged commit 8258d7f into main Jun 27, 2026
4 checks passed
@h0x91b h0x91b deleted the chore/dev3-vents-triage-845 branch June 27, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant