Skip to content

Migrate record-duplicate family onto a lifecycle driver#52

Merged
HynLcc merged 1 commit into
mainfrom
migrate-runner-lifecycle-20260619-121901
Jun 19, 2026
Merged

Migrate record-duplicate family onto a lifecycle driver#52
HynLcc merged 1 commit into
mainfrom
migrate-runner-lifecycle-20260619-121901

Conversation

@HynLcc

@HynLcc HynLcc commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

Move selection-duplicate + record-duplicate-single onto a shared framework/runners/record-duplicate-lifecycle.ts driver. Both runners hand-wrote the same skeleton: prepare(seed) → seedReady → one measured duplicate op → verify → build result (catch + success) → finally restore-back cleanup (delete the rows the duplicate created so a reusable seed keeps its row count, else drop the table). That protocol now lives in the driver once; each runner declares only what varies (fixtureVersion, the measured op + its trace strategy, verify, buildResult, which ids to delete in cleanup) via RecordDuplicateSpec.

buildResult stays inside each runner file, so artifact semantics (phase names/order, metric keys, threshold metric/max/unit, details.operation, routing, verifiedSamples) are byte-identical. Net −220 lines.

Migrated

Runner kind Case
selection-duplicate record-duplicate/grid-block-duplicate-1k
record-duplicate-single record-duplicate/single-record-sequential-100

Tracker updated: 12 / 35 runner kinds · 14 / 55 cases.

Proof

  • G1 (local v1+v2, both cases): baseline A == baseline B, and baseline A == candidate for all four artifacts. A deliberate phases[0].name / details.operation / threshold-metric perturbation fails the diff.
  • pnpm check: green.
  • GitHub CI (run 27806964660, teable_ee_ref=develop): all 4 case×engine pass. Routing routeMatched=true / engineMatched=true / feature=duplicateRecord; final-state verified (finalCount.scanned == expectedFinalRowCount: 11000 / 1100); traces clean (selection 1/1/0, single 100/100/0, no failed/skipped).

diff-artifacts.mjs mask

Masks only fields that differ between two runs of unchanged code (confirmed by baseline A vs B): the generated record-id lists (createdRecordIds, duplicatedRecordIds, sourceRecordId, duplicatedRecordId) and details.request.path / projection (embedded table/field ids). operation + method + projectionSize keep the endpoint semantics visible. No semantic field masked (negative test proves drift is still caught).

Protected surface

Untouched: no cases/**, registry.ts, framework/types.ts config interfaces, or framework/artifacts.ts changes.

🤖 Generated with Claude Code

Move selection-duplicate + record-duplicate-single onto a shared
record-duplicate-lifecycle.ts driver. Both runners hand-wrote the same
skeleton: prepare(seed) -> seedReady -> one measured duplicate op -> verify
-> build result (catch + success) -> finally restore-back cleanup (delete the
rows the duplicate created so a reusable seed keeps its row count, else drop
the table). That protocol now lives in the driver once; each runner declares
only what varies (fixtureVersion, the measured op + its trace strategy, verify,
buildResult, which ids to delete in cleanup) via RecordDuplicateSpec.

Behavior is unchanged: buildResult stays in each runner file, so artifact
semantics (phase names/order, metric keys, threshold metric/max/unit,
details.operation, routing, verifiedSamples) are byte-identical.

G1 proof (local v1+v2, both cases): baseline A == baseline B, baseline A ==
candidate for all four artifacts; a deliberate phases[0].name / details.operation
/ threshold-metric perturbation fails the diff.

scripts/diff-artifacts.mjs: mask the generated record-id lists
(createdRecordIds, duplicatedRecordIds, sourceRecordId, duplicatedRecordId) and
details.request.path/projection. These differ between two runs of unchanged
code (each run seeds a fresh table); operation + method + projectionSize keep
the endpoint semantics visible.

Protected surface untouched: no cases/**, registry.ts, framework/types.ts
config interfaces, or framework/artifacts.ts changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@HynLcc HynLcc merged commit ef7b13b into main Jun 19, 2026
6 checks passed
@HynLcc HynLcc deleted the migrate-runner-lifecycle-20260619-121901 branch June 19, 2026 05:48
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