Repository navigation
feat: make snapshot runtime first-party and add replay-safe splitting - #81
Conversation
codeasier
left a comment
There was a problem hiding this comment.
Code review of the split engine and snapshot runtime migration. Test suite verified: 559 passed, 1 xfailed at the PR head; the migration is behavior-preserving and the split/replay logic is well-tested. Three findings below, with severity and reproduction paths.
codeasier
left a comment
There was a problem hiding this comment.
Reviewed the first-party snapshot runtime migration and replay-safe split. No blocking issues found; tests/lint pass. Two minor nits below on the new hooker.py.
codeasier
left a comment
There was a problem hiding this comment.
Review summary - 2 inline findings (1 medium, 1 low):
-
hooker.py:95-111- state mutated before write (medium): If the file write raises, the hooker is left withprev_segmentsdeleted andevents_buffercleared, causing a maskingAttributeErroron the next dump and silent event loss. See inline comment for the suggested fix. -
entities.py:261- off-by-one (low, pre-existing):<=should be<. Not reachable via the new CLI path but a trivial one-word fix.
Additional observation (not blocking): split_service.py:196-221 - the _stage_identity / _verify_stage_identity pair has a narrow theoretical symlink-substitution race between lstat() and os.open(O_DIRECTORY) on POSIX. Already mitigated by mkdtemp in the user's own output dir + fd retention; a documenting comment about the assumption would be reasonable but no code change needed.
What looks correct: SplitError.__reduce__ (pickle-safe), mcp<2 pin, append+reverse trace ordering, staging-fd inode-reuse fix, provenance CI guard, and trace-id round-trip all verified with test coverage.
ca34de8 to
69e26a6
Compare
Description
pt_snap_cli.vendor.memsnapdumpto the first-partypt_snap_cli.snapshotnamespace.pt-snap splitsupport with per-device slicing, deterministic output names, same-filesystem staging, validation, and conflict-safe atomic publication.Related Issue
Related to #74. This PR establishes the first-party runtime and verified baseline that issue #74 should rebase onto.
Testing
Verified against rewritten PR head
32fb646c6bcf8959a5882e89a6965d13bec37513: 565 passed, 1 expected xfail; Ruff, Black, BasedPyright, provenance, Python 3.10-3.13, and wheel smoke passed. Import correctness and wall-clock gates passed. The 628k Max RSS measurements remained variable across controlled reruns and require separate performance review; internal benchmark handoff artifacts are intentionally excluded from this PR.Checklist
Snapshot Runtime Provenance
Snapshot provenance decision: updated
Snapshot provenance no-update reason: not applicable
Additional Notes
87ea207372e0985790e1a28dab499dccf3c3b9a4.src/pt_snap_cli/snapshot/PROVENANCE.md; relicensing is recorded indocs/legal/memsnapdump-mit-relicensing.md.benchmarks/baseline_import.py.d285ef3.