Repository navigation
feat(reconcile): protected records are never cut by never-rules (1.3c) - #117
Merged
Merged
Conversation
The write-path half of protect (1.3b wired only the read-path master override). A `protect` overlay was invisible to reconcile, so a `never` rule could still sever a protected record's cluster membership. Enforcement: `never_cut_fixpoint`/`choose_cut_edge` gain a `protected` set — an edge incident to a protected record is uncuttable, exactly like a `cut_protect`-probability edge. A never pair reachable only through protected records escalates instead of cutting one. `load_protected_keys` (sibling of `load_suppressed_keys`, kind='protect', missing-table- tolerant) threads the set in from `run_reconcile`. Surfacing: the escalation — previously discarded — is written as an open `never_unsatisfiable` review-queue item. That reason code already exists in the schema and the review UI already renders it, so there is no new table, enum, or UI. Chosen over the reserved `cut_edges` relational-cut table (its NOT-NULL match_probability/active/released lifecycle is for a different, unbuilt feature) and over a new entity_events type (enum change touches the model-registry golden). No synchronous 409 precheck: `protect` is a *staged* overlay drained at reconcile, not a cheap synchronous request like `unmerge_entity`, so a 409 there would be awkward. The contradiction instead surfaces at reconcile time via the review item — a more robust, source-agnostic catch. Determinism: the review write is gated on a protect overlay existing AND an escalation occurring, so the base path never touches `review_queue`. Empty protected set ⇒ never-cut is byte-identical to pre-1.3c. No golden fixture changed; base_10 + all golden e2e byte-identical. (High-confidence escalations possible pre-1.3c stay silent until a future rebaseline.) Tests: two er-reconcile unit tests (protected record escalates; off-path protection is a no-op; empty reproduces the prior cut) + a gated `protected_record_is_never_cut_and_escalates_through_ducklake` DuckLake e2e. golden parity + the existing assertions e2e unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The write-path half of record protection. PR #116 (1.3b) made a
protectoverlay win master election on the read path, but reconcile never looked at protect — so aneverrule could still sever a protected record's cluster membership. This closes that gap: a protected record is never cut.Design
never_cut_fixpoint/choose_cut_edgegain aprotectedset. An edge incident to a protected record is uncuttable, exactly like acut_protect-probability edge. Aneverpair reachable only through protected records escalates instead of severing a protected record.load_protected_keys(sibling ofload_suppressed_keys,kind='protect', missing-table-tolerant) threads the set in fromrun_reconcile.never_unsatisfiablereview-queue item. That reason code already exists in the schema and the review UI already renders it → no new table, enum, or UI.cut_edgestable (its NOT-NULLmatch_probability+active/releasedlifecycle are for a different, unbuilt relational-cut feature) and over a newentity_eventstype (enum change touches the model-registry golden).protectis a staged overlay drained at reconcile, not a cheap synchronous request likeunmerge_entity, so a 409 there would be awkward. The contradiction instead surfaces at reconcile time via the review item — a more robust, source-agnostic catch.Determinism (does not break anything)
The review write is gated on a protect overlay existing AND an escalation occurring, so the base path never touches
review_queue. An emptyprotectedset makes never-cut byte-identical to pre-1.3c. No golden fixture changed; base_10 + every*_matches_goldene2e are byte-identical. (High-confidence escalations that were possible pre-1.3c stay silent until a future rebaseline — noted in code.)Tests
er-reconcileunit tests: a protected record escalates instead of being cut; off-path protection is a no-op; an empty set reproduces the prior cut exactly.protected_record_is_never_cut_and_escalates_through_ducklake(verified locally against Postgres,DEDUPE_E2E_DUCKLAKE=1): protected middle record stays co-clustered + anever_unsatisfiablereview is written.assertions_enforce_clustering_through_ducklakee2e unchanged; full workspace clippy/fmt clean.🤖 Generated with Claude Code