feat(database): read bounded conversation patch replay - #322
Draft
sandersonstabo wants to merge 4 commits into
Draft
Conversation
Add Repository::read_conversation_patch_replay with transactional Current/Batch/ResnapshotRequired semantics, capped at 64 patches, contiguity and corruption checks, five-variant reconstruction with E2/E5 stamp mapping. Add focused in-memory tests covering ThreadNotFound/Current/Resnapshot, capping, round-trip of all five variants, mid-tail isolation, gaps, and malformed payload defense.
…onstraint fixtures (E5a-c1) Replace interpolated patch/item/lifecycle/phase/thread identifiers in CorruptData reasons with fixed strings; counters/timestamps remain. Use scoped PRAGMA ignore_check_constraints=ON for negative revision/ zero sequence/negative tail and oversized body fixtures, restoring OFF after each, keeping foreign_keys toggle only for FK violations. Add sentinel leak assertions for unknown kinds/phases/lifecycle/thread mismatch. Remove uncompiled-test commentary and prove execution via temporary registration: 12/12 conversation_patch_replay tests pass, clippy pedantic clean for lib and owned test. Co-authored-by: Muse Spark
…5a-c2)
Remove crate-wide #![allow(clippy::pedantic)] and dead START_KEY_BYTES
const, replace entities::{self} import shape, fix uninlined_format_args,
cast_possible_truncation, wildcard and manual_let_else diagnostics with
ordinary code. Add narrow function-scoped allows only for intrinsically
large fixtures (all_five_variants_round_trip, sentinel_enum) with
concrete reasons. Preserve 12 passing behaviors and sentinel hygiene.
sandersonstabo
force-pushed
the
agent/database-conversation-patch-replay-port-86287f9
branch
from
August 29, 2026 10:10
53c9c76 to
f945d8e
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Depends on #321.
Scope
Verification
Exclusions / remaining work
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Adds a bounded, transactionally consistent conversation patch replay reader to the database module. The reader returns typed Current, contiguous Batch (max 64), or ResnapshotRequired outcomes, reconstructs all five patch variants, and rejects gaps and malformed payloads.
Written for commit f945d8e. Summary will update on new commits.