Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions docs/agents/mail-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,6 @@ the point: it is the tier that costs us nothing. See the `external` bullets belo

## Always true

- **Gmail keeps both directions inside hiring threads.** Incoming search excludes SENT and
DRAFT mail; thread expansion retains sent replies and discards drafts. Gmail's SENT label
identifies aliases; the connected primary address is a fallback. `emails.direction` is
`incoming` or `outgoing`, with To/Cc headers and thread ids exposed to inbox readers.
Sent messages start read and never enter employer classification, stage advancement,
employer-reply events, interview evidence or silence calculations. Hosted and external
messages retain their existing incoming defaults; this adds no sending transport.
Application mail views also show unlinked sent replies when their Gmail conversation
has one unambiguous linked incoming job, including links classified after sync. Explicit
attachments win; this display inference writes no link or employer activity. Recall
candidates and suggestion writes remain incoming-only, including after alias repair.
- **Sent discovery has its own cursor.** `gmail_connections.sent_sync_cursor` starts at zero:
the first successful pass expands stored Gmail threads to recover their sent history.
Later passes list SENT message/thread identifiers since the prior successful run (with a
60-second overlap), fetching content only for known hiring threads. This catches replies
to old conversations without a new incoming anchor. The cursor records run-start time;
a transient message or thread failure preserves both cursors, and idempotent inserts
make retries safe. Permanently missing provider messages/threads are skipped. Reimports
refresh direction and recipient metadata; an old alias reply newly recognized as SENT
loses its employer classification, pending work and employer-reply event. Existing
application stages are not automatically rolled back: that would overwrite later user
decisions. Apply migration 0267 before deploying the readers.
- **The fetch is scoped to hiring-SHAPED mail, not to ATS senders, and the inbox filters at
DISPLAY.** `gmailsync.BuildQueryFor` admits mail from a curated ATS domain OR carrying one
of the recognised application/interview phrasings, minus anything the connected address
Expand Down
Loading
Loading