feat(eventcore-fs): read-time fsck + dangling-transaction handling #402
No reviewers
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/eventcore!402
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/393-fsck-dangling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements issue #393 / ADR-0046: the remaining git-robustness layers for the file store.
Problem
merge=unionkeeps agit mergeofevents/conflict-free for the additive case, but it can mask an illegal in-place edit of a JSONL file. And a partial or abortedgit mergecan leave a transaction whose parents did not arrive.Change
content_hashanchor over the event payload. On scan, a file whose payload no longer matches its anchor is rejected (excluded from the linearized history) and surfaced viastatus()as anIntegrityFailure— catching the illegal edit a union merge would otherwise mask. The field is serde-defaulted, so legacy v1 files still load (they skip the check).FORMAT_VERSIONis bumped to 2.parent_transaction_idsreference files not present (a partial/aborted git merge) is reported as aDanglingTransactionviastatus(). Linearization already tolerated missing parents; this makes the incomplete state observable — never a crash, never a silent drop.StoreStatus::is_clean()now accounts for forks, dangling transactions, and integrity failures.Acceptance (ADR-0046)
a_hand_edited_transaction_file_is_rejected_by_fsck).status()reports the dangling transaction, and reads do not panic (a_transaction_referencing_an_absent_parent_is_reported_as_dangling).Notes
sha2(0.10, matching the major already in the workspace lockfile) toeventcore-fs.git_robustness_test.rs(2 tests). Full crate suite 45 passed; workspace clippy/fmt clean (stable 1.96).main(PRs #391 and #392).Closes #393
The PR introduces a read-time fsck and dangling-transaction handling to improve the robustness of the file store against illegal edits and partial merges. The changes appear well-implemented and safe to merge, with comprehensive tests validating the new functionality.
Walkthrough
eventcore-fs/src/format.rs:
content_hashfor transaction integrity verification.load_transactionto perform read-time integrity checks.eventcore-fs/src/index.rs:
eventcore-fs/src/lib.rs:
status()to report integrity failures and dangling transactions.eventcore-fs/src/merge.rs:
DanglingTransactionandIntegrityFailure.StoreStatusto include new integrity checks.eventcore-fs/tests/git_robustness_test.rs:
LLM usage and cost
Estimated total USD: $0.044992 via https://api.openai.com and https://api.openai.com