Migrate record-duplicate family onto a lifecycle driver#52
Merged
Conversation
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>
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
Move
selection-duplicate+record-duplicate-singleonto a sharedframework/runners/record-duplicate-lifecycle.tsdriver. 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) viaRecordDuplicateSpec.buildResultstays 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
selection-duplicaterecord-duplicate/grid-block-duplicate-1krecord-duplicate-singlerecord-duplicate/single-record-sequential-100Tracker updated: 12 / 35 runner kinds · 14 / 55 cases.
Proof
phases[0].name/details.operation/ threshold-metric perturbation fails the diff.pnpm check: green.teable_ee_ref=develop): all 4 case×engine pass. RoutingrouteMatched=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) anddetails.request.path/projection(embedded table/field ids).operation+method+projectionSizekeep the endpoint semantics visible. No semantic field masked (negative test proves drift is still caught).Protected surface
Untouched: no
cases/**,registry.ts,framework/types.tsconfig interfaces, orframework/artifacts.tschanges.🤖 Generated with Claude Code