Skip to content

feat: Outlook mail read + safe message-rule authoring - #2

Merged
neilgfoster merged 1 commit into
mainfrom
feat/msgraph-mail-rules-implement
Jun 19, 2026
Merged

feat: Outlook mail read + safe message-rule authoring#2
neilgfoster merged 1 commit into
mainfrom
feat/msgraph-mail-rules-implement

Conversation

@neilgfoster

Copy link
Copy Markdown
Owner

Implements feature 001-msgraph-mail-rules end to end, replacing the template reference pattern with the real msgraph surface. Completes all 36 SDD tasks.

What's here

  • 7 agent-friendly skills under plugin/skills/: auth-login, mail-list, mail-get, rule-list, rule-verify, rule-create, rule-remove. Each has an onboarding-quality description (what + when-to-use), accurate annotations, steering errors, and points at the runtime describe catalog as the schema source of truth.
  • tests/test_client.py — 20 offline unit tests as unittest.TestCase classes (run under both python3 -m unittest discover -s tests and pytest/CI). They mock the single _http seam and the XDG state paths, covering: the describe/TOOLS catalog, token cache 0600 + scope ratchet, mail-read shaping, the read-only catch-set + verification marker (only GETs), and the rule-create gates (scope and prior verify), plus rule-remove's single DELETE.
  • Template residue removed: plugin/src/example/, plugin/skills/example-subject-verb/, and the inert plugin/hooks/hooks.json.
  • README updated: verbs table, Azure app-registration prerequisite, and MSGRAPH_CLIENT_ID/MSGRAPH_TENANT_ID env vars.

Safety model (structural, not behavioural)

  • Read-only by default (Mail.Read + MailboxSettings.Read); write capability exists only after a separate MailboxSettings.ReadWrite consent.
  • rule-create refuses unless the same criteria were verified read-only first (the verification marker gate).
  • Rule actions are move-to-folder only — never delete; rule-remove is the reversibility primitive.

Constraints upheld

The shippable payload under plugin/ stays stdlib-only (a ZeroDependencyTest and a quickstart.md grep guard against msal/azure/requests). ruff/pytest are dev tooling only and never ship. No token/secret is tracked in the repo.

Validation (local CI parity, all green)

  • ruff check . — passed
  • ruff format --check . — passed
  • pytest -q — 23 passed

The live-auth acceptance demo still requires the one-time human Azure app registration.

🤖 Generated with Claude Code

Replace the template reference pattern with the real msgraph surface
(feature 001-msgraph-mail-rules), completing all 36 SDD tasks.

- Add 7 agent-friendly skills (auth-login, mail-list, mail-get,
  rule-list, rule-verify, rule-create, rule-remove); each points at the
  runtime `describe` catalog as the schema source of truth.
- Add tests/test_client.py: 20 offline unit tests (unittest.TestCase, so
  they run under both `unittest discover` and pytest) mocking the single
  `_http` seam and the XDG state paths — covers the describe catalog,
  token cache 0600 + scope ratchet, mail-read shaping, the read-only
  catch-set + verification marker, and the rule-create scope/verify gates.
- Remove template residue: src/example/, skills/example-subject-verb/,
  and the inert hooks/hooks.json.
- Update README to the shipped verbs, the Azure app-registration
  prerequisite, and MSGRAPH_CLIENT_ID/MSGRAPH_TENANT_ID env vars.

The shippable payload under plugin/ stays stdlib-only; ruff/pytest are
dev tooling only and never ship. Local CI parity green: ruff check,
ruff format --check, pytest (23 passed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@neilgfoster
neilgfoster merged commit c2814d9 into main Jun 19, 2026
1 check passed
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.

1 participant