Repository navigation
Finish interrupted chat deletions on every server - #764
Conversation
Tombstone replay lived in createCliRemoteChats, so aiden serve --no-remote neither completed a committed deletion nor closed that chat to new turns. The daemon now closes tombstoned chats at construction and recovery runs at serve startup. A failure closes only those chats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A save read its file after consent without comparing it to what was reviewed, and new-task consent stayed valid until expiry because only the retired producer removed its receipt. No caller in src produces consent today, so this hardens the guard that remains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The in-memory spent list covers one scheduler. Separate offline commands build their own, so a receipt left on disk could be replayed through a new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
This PR can reopen and remotely serve a chat whose committed deletion tombstone is malformed or unreadable.
Reviewed changes I reviewed the daemon-wide relocation of interrupted chat deletion recovery, its Remote startup interaction, and the new behavioral coverage and documentation.
- Daemon-wide recovery —
createDaemonChatsnow captures tombstones, gates affected chat IDs, and owns repeatable roll-forward cleanup for every server mode. - Startup behavior —
serveOwnedattempts recovery for all servers, while Remote retries it and still rejects startup when a valid tombstone cannot be completed. - Coverage and docs — CLI tests cover no-Remote recovery and retry after a cleanup fault, and the README and serve state-machine worksheet document the new behavior.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
A malformed record was logged and treated as no pending deletions, so a chat whose deletion had committed could reopen. Remote used to reject this state. Every chat now stays closed and no server starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
A structurally malformed deletion record can still let a no-Remote server start with chat admission open.
Reviewed changes I reviewed the fail-closed tombstone fix and the base synchronization added since the prior Pullfrog review.
- Fail-closed tombstone reads — Retained unreadable and non-array record failures, closed all turn admission in that state, and rejected startup before ingress.
- Regression coverage and docs — Added a malformed-JSON startup test and documented the all-chat closure and startup refusal behavior.
- Base synchronization — Merged the latest
feature/sm-serve-framingchanges while preserving this PR's six-file recovery scope.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
The receipt survived until the command returned, so a process that died after publishing left it for a new scheduler to replay. It is now removed just before the first write publishes. Adds coverage of the follow-on phase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes I reviewed the tombstone-validation fix and base synchronization added since the prior Pullfrog review.
- Tombstone entry validation — Required every persisted deletion-record entry to be a string before installing per-chat gates, so structurally invalid records now close all admission and block startup.
- Regression coverage — Expanded the fail-closed behavioral test to cover malformed JSON, non-array JSON, and arrays containing non-ID values.
- Base synchronization — Merged the latest
feature/sm-serve-framingchanges while preserving the effective six-file recovery scope.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏
Forced removal hid a receipt deleted just after the last check, so the write still published. A missing receipt now stops it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onsent Give schedule consent one phase and bind it to the review
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes I reviewed the schedule-consent merge added since the prior Pullfrog review.
- Hardened one-shot consent — Modeled approval state as
first_write,follow_on, or terminalclosed, consumed the durable receipt before first publication, and preserved revocation at the publication boundary. - Bound saves to reviewed input — Compared the live schedule JSON with the approved proposal before resolving and persisting the task.
- Expanded behavioral coverage and records — Added eight focused cases for substitution, reuse, expiry, cancellation, authority changes, receipt races, crash replay, and follow-on checks, and documented the C15 state machine and remaining inventory dispositions.
- Verified the final head —
npm run buildandnode --test tests/schedule-consent.test.mjspassed locally, with all 8 focused tests passing.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

Moves tombstone recovery from
createCliRemoteChatstorecoverChatDeletions, so every server runs it.daemon-chat-deletions.jsonformat, step order, tombstone removed last. Remote still fails startup if a deletion is stuck.Defect fixed:
aiden serve --no-remoteneither finished a committed deletion nor closed the chat to new turns.packages/cli/README.mdis updated.Shared contracts: no persistence, wire-format, protocol revision, telemetry, network or runtime-flag change. Nothing outside
packages/cli,docs/state-machinesand.memorychanged, so the iOS and Android suites were not run.Worksheet:
docs/state-machines/serve-daemon.md.🤖 Generated with Claude Code