Skip to main content

Module inbox

Module inbox 

Source
Expand description

Maildir-based inbox messaging system.

Each team member gets a Maildir at .batty/inboxes/<member>/ with new/, cur/, tmp/ subdirectories. Messages are JSON blobs stored atomically via the maildir crate.

  • new/ — undelivered messages (daemon picks these up)
  • cur/ — delivered messages (moved here after tmux injection)
  • tmp/ — atomic write staging (managed by maildir crate)

Structs§

DigestEntry
A single entry in the digested inbox view.
InboxMessage
A message stored in a member’s inbox.
InboxPurgeSummary

Enums§

MessageCategory
Category of an inbox message, used for priority sorting and collapsing.
MessageType
Type of inbox message.

Functions§

all_messages
List all messages (both pending and delivered) for a member.
classify_message
Classify a message body into a category.
delete_message
Delete a message from a member’s inbox (from either new/ or cur/).
deliver_to_inbox
Deliver a message to a member’s inbox.
demote_stale_escalations
Demote digest entries whose referenced tasks are already done, archived, or otherwise cleared on the board. Escalations for cleared tasks are re-categorised as MessageCategory::Status so they no longer occupy the top of the inbox digest (#612).
digest_messages
Digest a list of inbox messages: collapse nudges per sender, status updates per task (keep latest), and priority-sort the result.
expire_stale_pending_messages
Expire pending messages older than the provided age by marking them delivered.
extract_task_ids_from_body
Extract #NN task references from a message body. Used by demote_stale_escalations (#612) to determine whether an escalation body is still actionable against the current board state.
find_recent_duplicate
Return the most recent duplicate message seen within the provided window.
inboxes_root
Resolve the inboxes root directory: .batty/inboxes/.
init_inbox
Initialize a member’s inbox (create new/, cur/, tmp/ dirs).
mark_delivered
Mark a message as delivered (move from new/ to cur/).
message_signature
Produce a stable signature for duplicate detection.
pending_message_count
Count undelivered messages in new/ for a member.
pending_messages
List all pending (undelivered) messages in a member’s inbox.
purge_delivered_messages
Purge delivered messages from a member inbox.
purge_delivered_messages_for_all
Purge delivered messages from every member inbox under .batty/inboxes/.
read_recent_messages
Read recent messages for a member across both pending and delivered states.