Migrate selection-clear onto the record-mutation lifecycle driver#57
Merged
Conversation
selection-clear matches the record-mutation family shape (single seeded table -> one measured bulk mutation -> verify -> restore-or-delete), so it now rides record-mutation-lifecycle instead of hand-rolling the protocol. The only divergence from the existing members is presentation: the legacy execute artifact is [prepare, clear, verify] with no seedReady phase, and verify is a separate phase rather than folded silently. To support this without drifting the contract: - record-mutation-lifecycle: assertSeedReady is now optional. The three existing members (record-update/create/reorder) all define it, so their code path and artifacts are byte-identical (proven by regression diff). selection-clear omits it -> the driver emits no seedReady phase. - selection-clear runMeasuredOperation bundles clear (primary, trace-wrapped, routing-asserted) + the post-op full-scan verify into one primary measurement; a one-line buildResult adapter splits it back so buildSelectionClearResult — and the [prepare, clear, verify] artifact — is unchanged. - Seed mode stays bespoke: its artifact intentionally carries a seedReady phase, the inverse of execute, so routing both through one spec would push that asymmetry into the driver. Verification (local, execute, v1+v2): - pnpm check green. - baseline A vs B: 8/8 pass, zero new diff masks. - G1 baseline vs candidate: 8/8 pass (selection-clear + record-update/create/ reorder regression). - negative: phases[0].name / details.operation / fullScan.scannedRecords perturbations fail; masked metric value still passes. - candidate artifacts: result=pass, routeMatched=true, actualXTeableV2 matches engine, fullScan.scannedRecords==rowCount, clear1kMs far below max. Tracker: 18/35 runner kinds, 22/55 cases. Co-Authored-By: Claude <noreply@anthropic.com>
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
Migrate the selection-clear runner kind (1 case:
selection-clear/flat-1k-20fields-cell-clear-stream) onto the existingrecord-mutation-lifecycle.tsdriver, reusing it rather than building a newone. It is the 4th member (after record-update / record-create / record-reorder).
selection-clear matches the family shape — single seeded table → one measured
bulk mutation (clear-stream) → post-op verify → restore-or-delete — but its
legacy artifact is
[prepare, clear, verify]with noseedReadyphase and aseparate
verifyphase. To fit without drifting the contract:assertSeedReadyis now optional. The three existing membersall define it, so their code path and artifacts are byte-identical (proven by
regression diff). selection-clear omits it → driver emits no
seedReadyphase.runMeasuredOperationbundles the trace-wrapped, routing-assertedclear(primary metricclear1kMs) + the post-op full-scanverifyinto oneprimary measurement; a one-line
buildResultadapter splits it back sobuildSelectionClearResultand the[prepare, clear, verify]artifact areunchanged.
seedReadyphase (the inverse of execute), so routing both modes through one spec would
push that asymmetry into the driver.
Verification (local, execute, v1+v2)
pnpm checkgreen.record-update / record-create / record-reorder regression (shared driver
touched).
phases[0].name,details.operation,fullScan.scannedRecordseach fails the diff; a masked metric-value changestill passes.
result=pass,routeMatched=true,actualXTeableV2matches engine,
fullScan.scannedRecords == rowCount (1000),clear1kMs(1359ms v1 / 765ms v2) far below
max90000.Protected surface
No changes to
cases/**,registry.ts,framework/types.tsconfig interfaces,framework/artifacts.ts,scripts/diff-artifacts.mjs, or../teable-ee. Trackerupdated to 18/35 runner kinds · 22/55 cases.
🤖 Generated with Claude Code