Skip to content

feat: commit preconditions judged on the manifest a commit lands on - #8801

Open
wkalt wants to merge 1 commit into
lance-format:ticket/ent-1961/predecessor-conditioned-publicationfrom
wkalt:ticket/ent-1961/commit-preconditions
Open

wkalt wants to merge 1 commit into
lance-format:ticket/ent-1961/predecessor-conditioned-publicationfrom
wkalt:ticket/ent-1961/commit-preconditions

Conversation

@wkalt

@wkalt wkalt commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

CommitBuilder::with_precondition takes a CommitPrecondition, judged on
the latest manifest on every attempt; publication is then conditioned on
that manifest still being the predecessor through
CommitHandler::commit_after. The handle's version must also still carry
the identity it was loaded with, so a candidate is never built from a
deleted incarnation. Refusal is PrerequisiteFailed; handlers that cannot
decide it atomically, detached commits, dataset creation and URI
destinations (which resolve to whatever occupies the URI now) refuse the
option outright.

RequiredSchemaMetadata is the first precondition, with
with_required_schema_metadata(key, value) as shorthand. The session
manifest, transaction and index-metadata caches key on identity too, since
a recreated dataset reuses version numbers.

@wkalt
wkalt force-pushed the ticket/ent-1961/commit-preconditions branch from a202bc2 to 9ecb5b6 Compare August 26, 2026 18:36
@github-actions github-actions Bot added the enhancement New feature or request label Aug 26, 2026
@wkalt
wkalt marked this pull request as ready for review August 26, 2026 18:38
@wkalt
wkalt changed the base branch from main to ticket/ent-1961/predecessor-conditioned-publication August 26, 2026 18:39
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026
@wkalt
wkalt force-pushed the ticket/ent-1961/predecessor-conditioned-publication branch from 2d6f91f to 673de02 Compare August 26, 2026 19:06
@wkalt
wkalt force-pushed the ticket/ent-1961/commit-preconditions branch 2 times, most recently from 9ecb5b6 to 07a65b8 Compare August 26, 2026 19:12
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026
@wkalt
wkalt force-pushed the ticket/ent-1961/predecessor-conditioned-publication branch from 673de02 to 2fdd8f3 Compare August 26, 2026 19:35
@wkalt
wkalt force-pushed the ticket/ent-1961/commit-preconditions branch from 07a65b8 to 8e0cf3e Compare August 26, 2026 19:41
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026
`CommitBuilder::with_precondition` takes a `CommitPrecondition`, judged on
the latest manifest on every attempt; publication is then conditioned on
that manifest still being the predecessor through
`CommitHandler::commit_after`. The handle's version must also still carry
the identity it was loaded with, so a candidate is never built from a
deleted incarnation. Refusal is `PrerequisiteFailed`; handlers that cannot
decide it atomically, detached commits, dataset creation and URI
destinations (which resolve to whatever occupies the URI now) refuse the
option outright.

`RequiredSchemaMetadata` is the first precondition, with
`with_required_schema_metadata(key, value)` as shorthand. The session
manifest, transaction and index-metadata caches key on identity too, since
a recreated dataset reuses version numbers.

Co-Authored-By: Claude Fable 5 <[email protected]>
@wkalt
wkalt force-pushed the ticket/ent-1961/commit-preconditions branch from 8e0cf3e to 375e58f Compare August 26, 2026 20:17
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 26, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Gate recommendation: request changes.

The current PR patch is unchanged by this rebase, and both prior code findings remain fixed.

The dependency sequence is still incomplete: this commit consumes predecessor-publication APIs supplied only by the open base PR #8800. Land #8800 into main first, then rebase or retarget this PR onto that landed commit so this change cannot be accepted without its atomic publication contract.

@lance-gatekeeper lance-gatekeeper Bot added K-changes Latest Gatekeeper recommendation requests changes. and removed K-changes Latest Gatekeeper recommendation requests changes. labels Aug 26, 2026
@github-actions github-actions Bot added the Stale label Nov 26, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An opt-in commit handler can satisfy the documented put_if_predecessor contract and report a successful write that never becomes the latest version. On 375e58f3, judge_preconditions reads the latest manifest, while target_version comes from dataset.manifest.version + 1. The reservation checks the identity of a retained version record and the availability of the target. After version cleanup, both checks can hold even though the branch has moved on.

Please derive the candidate version from the manifest whose preconditions passed and require the handler to confirm atomically at publication that this manifest is still the branch head. A handler that cannot guarantee this should refuse the operation. Please cover strict overwrite from an old handle and append overlapping cleanup through CommitBuilder, checking that a reported success is visible when reopening the latest version.

This finding comes from the commit path and the handler contract. #8800 has landed at e7fecb960, so this PR can now target main.

@github-actions github-actions Bot removed the Stale label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change enhancement New feature or request K-changes Latest Gatekeeper recommendation requests changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants