Skip to content

Check source and absent-target leases for flat-tree commits - #21

Merged
ctoth merged 3 commits into
masterfrom
fix/flat-tree-ref-leases-303
Oct 20, 2026
Merged

ctoth merged 3 commits into
masterfrom
fix/flat-tree-ref-leases-303

Conversation

@ctoth

@ctoth ctoth commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

A consumer planning a flat-tree merge could not require an absent target to remain absent, or require its source branches to retain their captured heads. Add named expected_heads checks to commit_flat_tree, where an explicit None means expected absence. Reuse the existing mutation guard, typed mismatch error and target CAS; reject stale expectations before building the commit. Existing expected_head callers use the same validation path.

Allow merge_base to consume full immutable commit IDs, taking precedence over same-named branches, so consumers can calculate the base from the exact parents used by their write plan.

Validation: 16 focused tests pass across memory and disk stores, covering moved/deleted sources, absent targets, normalization and target-CAS interleavings, conflicting expectations, exact successful trees/parents, and commit-ID resolution. The Propstore consumer regressions reproduce the motivating authoring races in propstore/propstore#303. This PR supplies the storage mechanics; Propstore chooses its source and target expectations.

@ctoth
ctoth marked this pull request as ready for review October 20, 2026 06:57
@ctoth
ctoth merged commit 6845641 into master Oct 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant