-
Notifications
You must be signed in to change notification settings - Fork 0
Document v0.1 scope and integration stubs #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jmcte
wants to merge
1
commit into
main
Choose a base branch
from
codex/issue-85-scope-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to MailPlus Intelligence are documented here. | ||
|
|
||
| The format follows Keep a Changelog, and this project uses the versioning | ||
| policy in [docs/versioning.md](docs/versioning.md). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| - Prepare public-release polish, release workflow, and repo metadata before the | ||
| v0.1.0 visibility/tagging gate. | ||
|
|
||
| ## [0.1.0] - 2026-05-23 | ||
|
|
||
| ### Added | ||
|
|
||
| - Canonical-store boundary and privacy/redaction rules for keeping MailPlus as | ||
| the raw-message archive. | ||
| - Metadata fixture corpus, SQLite schema bootstrap, and index/search helpers. | ||
| - Deterministic thread reconstruction with confidence evidence. | ||
| - Classification lanes, noise suppression policy, and fixture coverage. | ||
| - Deterministic semantic extraction, LLM cassette playback, and optional live | ||
| LLM extraction surface. | ||
| - Selected-message text cache policy, promotion queue, dry-run exporters, and | ||
| scheduler locks. | ||
| - CLI commands for search, thread inspection, queue review, dry-run export, | ||
| sync status, and doctor checks. | ||
| - Live adapter and raw-fetch interface stubs for future credential-gated Phase | ||
| 2 integration. | ||
|
|
||
| ### Changed | ||
|
|
||
| - Public docs now call out fixture-mode support separately from live MailPlus | ||
| and production export work. | ||
|
|
||
| ### Security | ||
|
|
||
| - Added fixture/privacy boundaries and fast validation gates sized for a public | ||
| repo before live MailPlus credential handling exists. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Live Export Integration | ||
|
|
||
| Production export to wiki pages, `memory/`, or reminders is v0.2 territory. | ||
| v0.1 only writes dry-run artifacts so reviewers can inspect candidate output | ||
| before anything durable changes. | ||
|
|
||
| ## Required Guarantees | ||
|
|
||
| A live exporter must honor: | ||
|
|
||
| - provenance: every durable write keeps source thread, message IDs, locators, | ||
| evidence references, confidence, and review status | ||
| - idempotency: rerunning the same approved candidate does not create duplicate | ||
| wiki, memory, or reminder entries | ||
| - rollback: every write records enough target metadata to undo or supersede it | ||
| - review boundary: only `approved` or `corrected` candidates may leave the | ||
| dry-run surface | ||
| - privacy boundary: raw message bodies and attachment payloads are never | ||
| exported into durable memory surfaces | ||
|
|
||
| See [promotion review workflow](../promotion-review-workflow.md) for the | ||
| human-review states that gate live writes. | ||
|
|
||
| ## Target-Specific Notes | ||
|
|
||
| Wiki and `memory/` exporters should prefer stable page or note identifiers over | ||
| title matching. Reminder exporters should store the source artifact ID in the | ||
| target metadata when the target system allows it. | ||
|
|
||
| ## Operator Flow | ||
|
|
||
| 1. Run extraction and review candidates in the promotion queue. | ||
| 2. Approve or correct only the artifacts that should become durable memory. | ||
| 3. Run the exporter in dry-run mode and inspect the manifest. | ||
| 4. Run the live exporter with an explicit target and rollback path. | ||
|
|
||
| Live export PRs are welcome once they include dry-run parity tests, rollback | ||
| evidence, and target-specific idempotency tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # Live MailPlus Adapter Integration | ||
|
|
||
| The live adapter is v0.2 territory. v0.1 ships the stable boundary and fixture | ||
| mode, but `_fetch_messages()` intentionally returns an empty batch until a real | ||
| MailPlus or IMAP client is wired in. | ||
|
|
||
| ## Expected Configuration | ||
|
|
||
| `src/mailplus_intelligence/live_adapter.py` reads these environment variables: | ||
|
|
||
| | Variable | Required | Purpose | | ||
| | --- | --- | --- | | ||
| | `MAILPLUS_HOST` | yes | MailPlus API or IMAP host | | ||
| | `MAILPLUS_USER` | yes | Mailbox identity | | ||
| | `MAILPLUS_TOKEN` | yes | OAuth token or app password | | ||
| | `MAILPLUS_MAILBOX` | no | Mailbox/folder root, default `INBOX` | | ||
| | `MAILPLUS_PAGE_SIZE` | no | Batch size, default `50` | | ||
|
|
||
| Missing required values raise `LiveAdapterNotConfigured`; fixture-mode tests | ||
| should continue to treat that as a gated state, not a failure. | ||
|
|
||
| ## SyncBatch Shape | ||
|
|
||
| Live ingestion must return the same `SyncBatch` shape as fixture ingestion: | ||
|
|
||
| - `source_name`: stable source identifier such as `mailplus:<user>` | ||
| - `cursor`: previous cursor supplied by the scheduler or checkpoint | ||
| - `next_cursor`: cursor for the next incremental sync | ||
| - `messages`: list of metadata-only message dictionaries | ||
|
|
||
| Each message should include source account/mailbox/folder, stable UID, message | ||
| ID, references/in-reply-to headers when present, sender/recipients, subject, | ||
| sent date, labels/flags, locator fields, and attachment metadata. It must not | ||
| include raw message bodies. | ||
|
|
||
| ## Worked IMAP Stub | ||
|
|
||
| ```python | ||
| from mailplus_intelligence.live_adapter import LiveAdapterConfig | ||
| from mailplus_intelligence.sync import SyncBatch | ||
|
|
||
|
|
||
| def fetch_imap_metadata(config: LiveAdapterConfig, cursor: str = "") -> SyncBatch: | ||
| messages = [ | ||
| { | ||
| "fixture_id": "imap:123", | ||
| "message_id": "<message@example.test>", | ||
| "subject": "Example subject", | ||
| "from": "sender@example.test", | ||
| "to": ["operator@example.test"], | ||
| "date": "2026-05-23T12:00:00Z", | ||
| "mailbox": config.user, | ||
| "folder": config.mailbox, | ||
| "locator": { | ||
| "export_id": "imap-demo", | ||
| "uid": "123", | ||
| "account": config.user, | ||
| }, | ||
| "attachments": [], | ||
| } | ||
| ] | ||
| return SyncBatch( | ||
| source_name=f"mailplus:{config.user}", | ||
| cursor=cursor, | ||
| next_cursor="123", | ||
| messages=messages, | ||
| ) | ||
| ``` | ||
|
|
||
| PRs are welcome for a real adapter once they preserve the metadata-only | ||
| boundary, fail closed on credential or locator drift, and include fixture-mode | ||
| tests that do not require live credentials. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Versioning | ||
|
|
||
| MailPlus Intelligence uses semantic versioning after public release. | ||
|
|
||
| ## 0.x Policy | ||
|
|
||
| While the project is in `0.x`, breaking changes can ship in minor releases | ||
| when they are documented in `CHANGELOG.md`. Patch releases should remain | ||
| backward compatible unless a security fix requires otherwise. | ||
|
|
||
| ## Source Of Truth | ||
|
|
||
| The package version is declared in `pyproject.toml` and exposed at runtime as | ||
| `mailplus_intelligence.__version__` through `importlib.metadata`. Do not copy | ||
| the version into README examples or docs unless the surrounding text is release | ||
| history. | ||
|
|
||
| ## Release Notes | ||
|
|
||
| Every release should update `CHANGELOG.md` with operator-facing changes, known | ||
| stubs, and any compatibility notes. Commit-level detail belongs in the GitHub | ||
| history, not the changelog. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The worked IMAP stub currently constructs
SyncBatchwithnext_cursor, butSyncBatchonly definessource_name,cursor, andmessagesinsrc/mailplus_intelligence/sync.py(SyncBatchdataclass). Anyone implementing Phase 2 by following this guide will hitTypeError: __init__() got an unexpected keyword argument 'next_cursor'at runtime, so the integration instructions are not executable as written.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codex please address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
docs/integration/live-mailplus-adapter.mdby removing the invalidnext_cursorfield from the documentedSyncBatchshape and clarifying thatcursoris the value checkpointed after the batch.SyncBatchwith valid fields only, settingcursor="123"and convertingmessagesto a tuple so the example is executable against the current dataclass contract.SyncBatchdataclass only acceptssource_name,cursor, andmessages, which is whynext_cursorwas invalid.Testing
git diff -- docs/integration/live-mailplus-adapter.mdnl -ba docs/integration/live-mailplus-adapter.md | sed -n '22,75p'git config core.hooksPath .githooks; git add docs/integration/live-mailplus-adapter.md; git commit -m "docs: fix SyncBatch example in live adapter guide"View task →