feat: add incremental mailbox threading with stable identity handoff - #20
feat: add incremental mailbox threading with stable identity handoff#20seonghobae wants to merge 97 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
Buyer-visible product gap
ThreadWeave's standards-grounded batch threader otherwise requires a complete rebuild after every arrival, expunge, metadata correction, or delayed ancestor. This PR adds an atomic incremental state boundary for mail servers, migration products, archive viewers, and naruon-style control planes without replacing the canonical batch engine.
Change
IncrementalThreadIndex,IndexedMessage,MailboxChangeSet, deterministic projections/deltas, and explicit merge/split transitions.VersionConflictError; hosts still own distributed write serialization.thread_messagesimplementation.Container/Messagestructural copies fromrootswhile retaining caller payloads by reference.THREAD, andUID THREADbehavior.str.encodeon a complete JSON chunk or allocating a second full bytes copy.ARCHITECTURE.md,CLAUDE.md, user/research documentation, CHANGELOG entries, and a weekly/manual isolated mailbox benchmark workflow.Exact-head verification
Exact head:
46e3c5d43c249e3b39197940cd5cbdffb1f7d7a2All GitHub-hosted gates on that exact head completed successfully:
cion Python 3.10, 3.11, 3.12, and 3.13;pip check;The exact-head Python 3.13 run reports:
The autonomous and release trust boundary separately reports:
src/threadweave/incremental.pyreports 713 statements and 300 branches at 100% coverage. Every published GitHub code-quality review thread is resolved.The exact-head wheel and sdist were independently hashed and the wheel was installed outside the source tree. Extended smoke verification covered incremental
THREAD/UID THREAD, snapshot round-trip, optimistic continuation, identity handoff, and fail-closed record preflight:The bounded-state change followed explicit red/green proof:
group_by_subject/sort_by_sent_datecombinations matched complete batch reconstruction at every transition;A current-head CodeRabbit review is requested separately. No independent approval is inferred from a skipped, rate-limited, or status-only response.
Mailbox-scale evidence
A 100,000-message default-mode mailbox with one metadata replacement produced the following isolated transaction evidence on the verified product code:
The scheduled/manual workflow separately compares incremental bridge updates with canonical full rebuilds, requires identical ordered projection digests, reports wall time and peak RSS, and retains JSON evidence for 90 days. The release-order contract requires the mailbox-scale benchmark to be rerun after issue #17 closes and the branch is updated to released
main.These results support bounded small-delta work and canonical parity. They are not a claim of lower initial-build memory, lower full-view materialization cost, or constant-time sent-date ordering.
Standards and references — APA 7th
Bray, T. (Ed.). (2017). The JavaScript Object Notation (JSON) data interchange format (RFC 8259). RFC Editor. https://doi.org/10.17487/RFC8259
Gondwana, B. (2018). IMAP extension for object identifiers (RFC 8474). RFC Editor. https://doi.org/10.17487/RFC8474
Jenkins, N., & Newman, C. (2019). The JSON Meta Application Protocol (JMAP) for mail (RFC 8621). RFC Editor. https://doi.org/10.17487/RFC8621
Melnikov, A., & Cridland, D. (2014). IMAP extensions: Quick flag changes resynchronization (CONDSTORE) and quick mailbox resynchronization (QRESYNC) (RFC 7162). RFC Editor. https://doi.org/10.17487/RFC7162
Melnikov, A., & Leiba, B. (Eds.). (2021). Internet Message Access Protocol (IMAP)—Version 4rev2 (RFC 9051). RFC Editor. https://doi.org/10.17487/RFC9051
The existing RFC 5256 batch implementation remains the structural correctness oracle.
Compatibility and release freeze
0.2.0.0.2.0Trusted Publishing blocker. This PR must stay draft and must not merge until the verified 0.2.0 release closes Release operations: configure the PyPI Trusted Publisher for 0.2.0 #17.main, rerun every exact-head gate and the mailbox-scale benchmark, obtain current-head independent review, and merge only if no blocking finding remains.Closes #19 only after those post-release conditions are satisfied.