Skip to content

Migrate selection-clear onto the record-mutation lifecycle driver#57

Merged
HynLcc merged 1 commit into
mainfrom
migrate-selection-clear-lifecycle
Jun 19, 2026
Merged

Migrate selection-clear onto the record-mutation lifecycle driver#57
HynLcc merged 1 commit into
mainfrom
migrate-selection-clear-lifecycle

Conversation

@HynLcc

@HynLcc HynLcc commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

Migrate the selection-clear runner kind (1 case:
selection-clear/flat-1k-20fields-cell-clear-stream) onto the existing
record-mutation-lifecycle.ts driver, reusing it rather than building a new
one. 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 no seedReady phase and a
separate verify phase. To fit without drifting the contract:

  • driver: assertSeedReady is now optional. The three existing members
    all define it, so their code path and artifacts are byte-identical (proven by
    regression diff). selection-clear omits it → driver emits no seedReady phase.
  • runner: runMeasuredOperation bundles the trace-wrapped, routing-asserted
    clear (primary metric clear1kMs) + 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 are
    unchanged.
  • seed mode stays bespoke: its artifact intentionally carries a seedReady
    phase (the inverse of execute), so routing both modes 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 needed.
  • G1 baseline vs candidate: 8/8 pass — selection-clear plus
    record-update / record-create / record-reorder regression (shared driver
    touched).
  • negative: perturbing phases[0].name, details.operation,
    fullScan.scannedRecords each fails the diff; a masked metric-value change
    still passes.
  • candidate artifacts: result=pass, routeMatched=true, actualXTeableV2
    matches engine, fullScan.scannedRecords == rowCount (1000), clear1kMs
    (1359ms v1 / 765ms v2) far below max 90000.

Protected surface

No changes to cases/**, registry.ts, framework/types.ts config interfaces,
framework/artifacts.ts, scripts/diff-artifacts.mjs, or ../teable-ee. Tracker
updated to 18/35 runner kinds · 22/55 cases.

🤖 Generated with Claude Code

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>
@HynLcc HynLcc merged commit 1d55c16 into main Jun 19, 2026
5 checks passed
@HynLcc HynLcc deleted the migrate-selection-clear-lifecycle branch June 19, 2026 14:37
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