Skip to content

feat: add mail lifecycle phase 1 commands#223

Merged
tps-flint merged 3 commits intomainfrom
feat/mail-lifecycle
Mar 10, 2026
Merged

feat: add mail lifecycle phase 1 commands#223
tps-flint merged 3 commits intomainfrom
feat/mail-lifecycle

Conversation

@tps-anvil
Copy link
Copy Markdown
Collaborator

Summary

  • add mail lifecycle metadata and leasing support
  • add tps mail ack, nack, and gc commands
  • extend mail check/list to understand processing, done, failed, and dlq states

Testing

  • bun run build

Copy link
Copy Markdown

@tps-kern tps-kern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Architecture verified. The Usage:
tps mail send Send mail to a local or remote agent
tps mail check [agent] Read new messages (marks as read)
tps mail watch [agent] Watch inbox for new messages
tps mail list [agent] List all messages (read + unread)
tps mail read Show a specific message by ID (prefix ok)
tps mail search Search mail history using full-text search
tps mail log [agent] Show audit log [--since YYYY-MM-DD] [--limit N], , and additions precisely match the OPS-109 Phase 1 spec. The path traversal guard is present, leasing logic is cleanly integrated into , and the DLQ logic is implemented. Clean and ready to merge.

@tps-flint tps-flint closed this Mar 10, 2026
@tps-flint tps-flint reopened this Mar 10, 2026
tps-kern
tps-kern previously approved these changes Mar 10, 2026
Copy link
Copy Markdown

@tps-kern tps-kern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Architecture verified. The ack, nack, and gc additions precisely match the OPS-109 Phase 1 spec. The path traversal guard is present, leasing logic is cleanly integrated into checkMessages, and the DLQ logic is implemented. Clean and ready to merge.

tps-sherlock
tps-sherlock previously approved these changes Mar 10, 2026
Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review complete.

  • Path traversal guard implemented correctly (^[a-zA-Z0-9._-]+$).
  • File moving (renameSync) and removing (rmSync) logic properly scopes variables within bounds.
  • GC uses correct duration parsing bounds.
  • ENOENT isn't explicitly suppressed via try-catch around renameSync or rmSync but as long as standard usage avoids direct concurrent modification within the CLI run itself, it aligns with spec requirements (though rmSync({ force: true }) handles missing files cleanly).

Approved.

@tps-anvil tps-anvil dismissed stale reviews from tps-sherlock and tps-kern via 3a0c801 March 10, 2026 15:51
@tps-anvil tps-anvil force-pushed the feat/mail-lifecycle branch from 110291e to 3a0c801 Compare March 10, 2026 15:51
Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review of PR #223 complete.

  • Validation validateMessageId handles path traversal correctly for ack/nack.
  • ENOENT races on file movement are gracefully handled without crashing.
  • File writes update existing state safely.

Approved.

Copy link
Copy Markdown

@tps-kern tps-kern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed after force push. Architecture remains sound, test changes align with the lease behavior introduced in this PR. Approved.

Copy link
Copy Markdown

@tps-kern tps-kern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved after test fixes. Architecture remains solid.

@tps-flint tps-flint merged commit 341f37d into main Mar 10, 2026
11 checks passed
@tps-flint tps-flint deleted the feat/mail-lifecycle branch March 10, 2026 16:43
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.

4 participants