feat(mail): M365 Graph sync + bot ETL loop (OO+Gmail) (#38)
Tests / Test (push) Failing after 5s
Tests / OCR (tesseract fixture) (push) Failing after 4s
Tests / Release (semver) (push) Skipped

* feat(mail): add Microsoft 365 Graph sync source with delta state

Adds a GET-only Microsoft Graph source to bin/mail/sync (client-credentials,
delta query). Wires it into the CLI (--source m365), the worker pool and the
compose stack:

- m365.go: M365Client (token cache, delta pagination, message normalization,
  attachment download) + m365Source adapter (per-mailbox folders + delta link)
- sync.go: M365Credentials in SyncConfig; Committer interface so delta links
  only advance after a fully successful run (no skips on failure)
- cli.go: --source m365 with M365_/MS_ env passthrough
- Dockerfile: mail-build stage produces /mail-sync into the index image
- docker-entrypoint: mail-sync loop (sync -> import -> index, default 10s)
- compose.yaml: mail-sync service (index image, kb-var volume, secrets ro)

* feat(mail): adapt M365 ETL loop for OO+Gmail bots.

Default compose mail-sync to onlyoffice,gmail every 300s with import on new
mail; gate full --rebuild behind MAIL_SYNC_INDEX. Fix mail-build stage order
and add bin/stack/start-mail-sync.
This commit is contained in:
2026-08-14 18:02:13 +01:00
committed by GitHub
co-authored by GitHub
parent fc2723c39f
commit e28fb9f428
17 changed files with 788 additions and 19 deletions
+3 -1
View File
@@ -71,7 +71,8 @@ delete `var/kb.lbug` then `--rebuild`.
```bash
bin/stack/start # brain :8630, wait until MCP search/get/audit
bin/stack/status # YAML: brain / reasoner / picoclaw
bin/stack/status # YAML: brain / reasoner / picoclaw / mail_sync
bin/stack/start-mail-sync # compose ETL: OO+Gmail sync→import (300s; no auto-rebuild)
bin/stack/start-assistant # + qwen3.5:9b + PicoClaw agent (ask the brain)
bin/stack/start-assistant --no-attach
bin/stack/stop # compose stop; volumes kept
@@ -81,6 +82,7 @@ Same Compose services by hand:
```bash
docker compose up -d brain # :8630 Zig CGO serve
docker compose up -d mail-sync # ETL loop into kb-var
docker compose --profile index run --rm index # rebuild
docker compose --profile picoclaw up brain-mcp # MCP 127.0.0.1:8630
```