huginn-sources: every run takes the lock (chat-off included) #68

Merged
eureka merged 2 commits from gamecult-chat/ingest-lock-always into main 2026-11-17 02:02:26 +00:00
Owner

Closes follow-up gamecult-chat:follow_up:chat-ingest-lock-less-chat-off-run.

A run with no chat flags took no lock yet retires chat and refreshes the forge, writing cursors whole, so it could overwrite a tombstone from a concurrent chat-purge. Now --lock-file is required for every run (and for chat-purge, as before); lock_file is a plain PathBuf and lock_if is deleted, so the lock-less path no longer exists.

Breaking for callers: any unit or script that runs huginn-sources without --lock-file now exits 2. No unit lives in this repo; the deployed unit must pass the same --lock-file as the purge command (the cut's handoff list covers unit lines).

Tests: flag-parse tests updated (chat-off with lock parses; chat-off without lock is refused); a_held_lock_exits_3_through_execute_for_both_modes now also asserts a chat-off run returns Stop::Locked. Mutation (take the lock only when chat is configured) makes that test fail. cargo test -p huginn-daemon --lib --bin huginn-sources: 297 lib + 6 bin passed. Docs: docs/chat-retrieval-map.md status paragraph.

Not covered: the Synapse /messages dir=f semantics live readback (separate item in the follow-up).

🤖 Generated with Claude Code

Closes follow-up `gamecult-chat:follow_up:chat-ingest-lock-less-chat-off-run`. A run with no chat flags took no lock yet retires chat and refreshes the forge, writing cursors whole, so it could overwrite a tombstone from a concurrent `chat-purge`. Now `--lock-file` is required for every run (and for `chat-purge`, as before); `lock_file` is a plain `PathBuf` and `lock_if` is deleted, so the lock-less path no longer exists. **Breaking for callers:** any unit or script that runs `huginn-sources` without `--lock-file` now exits 2. No unit lives in this repo; the deployed unit must pass the same `--lock-file` as the purge command (the cut's handoff list covers unit lines). Tests: flag-parse tests updated (chat-off with lock parses; chat-off without lock is refused); `a_held_lock_exits_3_through_execute_for_both_modes` now also asserts a chat-off run returns `Stop::Locked`. Mutation (take the lock only when chat is configured) makes that test fail. `cargo test -p huginn-daemon --lib --bin huginn-sources`: 297 lib + 6 bin passed. Docs: `docs/chat-retrieval-map.md` status paragraph. Not covered: the Synapse `/messages` dir=f semantics live readback (separate item in the follow-up). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
--lock-file is now required for all runs, not only chat runs; the held-lock test covers a chat-off run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
eureka merged commit a424c1c4d5 into main 2026-11-17 02:02:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Huginn!68
No description provided.