Repository navigation
test(storage): model write-path lineage interleavings - #2798
Conversation
Add a real-writer Hypothesis state machine for replace, append, stale\nreplacement, prefix-sharing lineage, variants, and dangling branch points.\n\nThe machine checks composed transcript semantics, tail-only physical storage,\nlegal topology statuses, and FTS docsize parity.\n\nRef polylogue-g9f2.\n\nCo-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 4 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Model spawned-fresh and child-before-parent lineage writes, asserting\nexact session-link transitions and tail extraction after resolution.\n\nExercise the public repository get_messages route against a scratch\nsplit-file archive.\n\nRef polylogue-g9f2.\n\nCo-Authored-By: Claude <[email protected]>
Adversarial review — iteration 1Findings and fixes:
What survived scrutiny: FTS docsize parity still compares the production docsize table with text-bearing stored blocks; dangling-branch behavior remains constrained to a non-overextending suffix. Borderline recorded: this bounded state machine covers the dangling-branch 4ts.6 path; existing focused lineage tests own the depth-limit path. |
Cover full-replace sibling variants, exact FTS docid parity, and the\nasync resolver's cyclic-link quarantine path.\n\nRef polylogue-g9f2.\n\nCo-Authored-By: Claude <[email protected]>
Adversarial review — iteration 2Findings and fixes:
What survived scrutiny: spawned-fresh and deferred parent resolution remain exact-link assertions; the public repository composed-read test remains real-route coverage. Verification: the quarantine selector passed ( |
…803,2787,2798 013x (search-coverage, PR #2803) and g9f2 (write-model, PR #2798) fully satisfied — closed. y8s5 (distribution, PR #2779), ttu (docs-ia, PR #2778), kwsb (PR #2799), and n4hb/c52g/znwj (test-hardening, PR #2787) partially satisfied — noted with disposition, left open per closure-discipline. Co-Authored-By: Claude <[email protected]>
Summary
Add a Hypothesis stateful property test for archive write-path interleavings.
Problem
The existing lifecycle state machine does not model full replacement, append windows, prefix-sharing lineage, stale writes, variants, or dangling branch points—the combinations most likely to hide write-path regressions.
Solution
Add
tests/property/test_write_path_state_machine.py. It writesParsedSessiondata throughwrite_parsed_session_to_archiveand reads throughread_archive_session_envelope; it also checks actualsession_linksand FTS docsize tables. The model covers parent/child replay, edited full replacement, merge append with variants, stale replacement, and one hard-deleted branch point.For the known 4ts.6 behavior, an incomplete lineage is required to be a non-overextending suffix of the modeled transcript.
Acceptance criteria
Verification
devtools test tests/property/test_write_path_state_machine.py—1 passed in 6.32sHYPOTHESIS_PROFILE=ci devtools test tests/property/test_write_path_state_machine.py—1 passed in 5.32sruff format --check tests/property/test_write_path_state_machine.py && ruff check tests/property/test_write_path_state_machine.py && mypy --strict tests/property/test_write_path_state_machine.py— formatted, lint-clean, andSuccess: no issues found in 1 source fileAnti-vacuity: every rule exercises the production SQLite writer and composed archive reader, then queries production
session_linksandmessages_fts_docsize; no mock or test-only write model is used.Ref polylogue-g9f2.