Commit graph

6 commits

Author SHA1 Message Date
da4c9bb713 feat: add direction field to ping embed build/parse 2026-07-13 18:55:16 -07:00
a2a839d9de feat: add leads-found channel and direction_for_modality 2026-07-13 18:51:22 -07:00
75ee9f8117 fix: prevent Discord embed field 400s from empty/oversized values
C1: build_ping_embed set sender_id field value="" whenever sender_id was
None, which manual_share.py always passes -- Discord rejects empty embed
field values (min length 1), so every manual-share ping failed to send.
Fixed by using a zero-width space sentinel that round-trips back to ""
(raw_content) or None (sender_id) in parse_ping_embed. Added regression
tests asserting no field value is ever empty after build_ping_embed runs.

C2: raw_content over 1024 chars (Discord's embed field cap) caused
inbox.send() to raise before the UID was marked seen, so oversized emails
were retried forever and never ingested. Added a defensive hard truncation
in build_ping_embed itself, plus an explicit truncation in email_ingest.py
before the embed is built (lossy for very long emails, acceptable for MVP).
2026-07-13 15:01:23 -07:00
9971632cd1 fix(bot): fix raw_content round-trip and parsing consistency
- Remove 'or (empty)' fallback in build_ping_embed to preserve empty strings in raw_content
- Fix parse_ping_embed to use direct indexing for all required fields (modality, raw_content, captured_at)
- Remove unused timezone import
- Add test case for empty raw_content round-trip to catch future regressions

Fixes code review findings: empty raw_content was being converted to literal "(empty)" string,
breaking lossless round-trip requirement needed by Task 7's thread-open handler.
2026-07-13 13:56:53 -07:00
af547ab02c feat(bot): add inbox ping embed builder/parser 2026-07-13 13:53:00 -07:00
669bb3456a feat(bot): add modality map, config loader, and backend client
Implements core bot infrastructure:
- modality_map: channel name to modality string mapping (personal_text, voice, fb_messenger, nd_messenger)
- config: Config dataclass with env-driven configuration loading for Discord, backend, and email IMAP credentials
- backend_client: async HTTP client for posting items to backend /items endpoint

All modality_map tests passing (3/3)
2026-07-13 13:48:39 -07:00