Skip to content

feat: attachment indexing, cache, queue, exporters, CLI, and ops runbooks#77

Merged
jmcte merged 1 commit intomainfrom
claude/close-multiple-issues-9eFtJ
May 6, 2026
Merged

feat: attachment indexing, cache, queue, exporters, CLI, and ops runbooks#77
jmcte merged 1 commit intomainfrom
claude/close-multiple-issues-9eFtJ

Conversation

@jmcte
Copy link
Copy Markdown
Contributor

@jmcte jmcte commented May 6, 2026

$(cat <<'EOF'

Summary

Closes #35, #36, #37, #38, #69, #72, #73 — seven issues addressed in one PR.

What's implemented

Issue Deliverable
#73 Attachment metadata indexingfilename, content_type, size_bytes, content_id, inline_flag stored and queryable; migration 002; fixture extended with multi-attachment + inline-image test message
#69 Selected-text cache storetext_cache table with class filter (vip/project/admin/financial/travel/legal only), configurable TTL, eviction, and audit events; migration 003
#35 Promotion review queuepromotion_queue table; enqueue_candidate, decide (approve/reject/defer/correct/rollback_needed), get_queue, get_item; migration 003
#36 Dry-run exportersexport_approved_candidates() writes inspectable markdown/JSON artifacts with provenance + rollback notes; manifest; live mode blocked by guard
#72 Operator CLI (mpi)search, thread, queue list/inspect/approve/reject/defer/correct, export, doctor subcommands; --json output on all commands; registered as mpi entry point
#38 Evaluation/regression harnessscripts/evaluate.py runs classification, semantic contract, and noise-suppression checks against fixture corpus; exits non-zero on regression
#37 Operations runbooksdocs/ops-runbooks.md covers dry-run, incremental sync, backfill, checkpoint resume, live-MailPlus gate, extraction, queue review, export, rollback, audit log, and evaluation

New modules

  • src/mailplus_intelligence/index_writer.py — writes IndexRecords to SQLite; search_messages() with sender/keyword/folder/date/thread/attachment filters
  • src/mailplus_intelligence/cache.py — text cache with class gate, TTL, eviction
  • src/mailplus_intelligence/queue.py — promotion review queue CRUD
  • src/mailplus_intelligence/exporters.py — dry-run artifact generation
  • src/mailplus_intelligence/cli.py — operator CLI (mpi)
  • src/mailplus_intelligence/migrations/002_attachment_metadata.sql
  • src/mailplus_intelligence/migrations/003_cache_and_queue.sql
  • scripts/evaluate.py — offline evaluation harness
  • docs/ops-runbooks.md

Schema changes

  • apply_all_migrations() added to schema.py — version-aware, idempotent
  • Migration 002: content_id TEXT, inline_flag INTEGER on attachments; indexes on content_type and filename
  • Migration 003: text_cache table; promotion_queue table

Tests

90 tests pass (2 pre-existing failures are Python 3.11 vs ≥3.12 version check in test_doctor.py — unrelated to this PR).

New test files: test_attachment_metadata, test_cache, test_queue, test_exporters, test_index_writer, test_cli, test_evaluate.

Test plan

  • All existing tests pass (excluding pre-existing Python version check failures)
  • New tests cover: attachment schema, mapper attachment details, cache write/read/TTL/eviction/class-gate, queue enqueue/decide/list/get, dry-run export artifacts and manifest, index write + search filters, CLI subcommands, evaluation harness
  • Schema migrations are idempotent (version-checked before applying)
  • No raw mail body content stored anywhere

https://claude.ai/code/session_01REVqza82cZP43JoVMgu6jw
EOF
)


Generated by Claude Code

Closes #35 — promotion review queue with approve/reject/defer/correct/rollback
Closes #36 — dry-run exporters for memory, wiki, and reminder surfaces
Closes #37 — operations runbooks for sync and extraction job lifecycle
Closes #38 — fixture-based evaluation and regression harness
Closes #69 — selected-text cache store with TTL and class-filter enforcement
Closes #72 — operator CLI (mpi) with search/thread/queue/export/doctor subcommands
Closes #73 — attachment metadata indexing (filename, MIME type, size, content-id, inline flag)

New modules: cache.py, queue.py, exporters.py, index_writer.py, cli.py
New migrations: 002 (attachment metadata), 003 (text_cache + promotion_queue)
New scripts: scripts/evaluate.py
New docs: docs/ops-runbooks.md
New tests: test_attachment_metadata, test_cache, test_queue, test_exporters,
           test_index_writer, test_cli, test_evaluate

https://claude.ai/code/session_01REVqza82cZP43JoVMgu6jw
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50ef9f1672

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/evaluate.py
Comment thread scripts/evaluate.py
Comment thread src/mailplus_intelligence/exporters.py
@jmcte jmcte merged commit 85ff254 into main May 6, 2026
15 of 17 checks passed
@jmcte jmcte deleted the claude/close-multiple-issues-9eFtJ branch May 6, 2026 19:20
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.

M4: Build promotion review queue for extracted candidates

2 participants