Skip to content

Migrate conditional-lookup onto a new field-add lifecycle driver#59

Merged
HynLcc merged 1 commit into
mainfrom
migrate-conditional-lookup-lifecycle
Jun 19, 2026
Merged

Migrate conditional-lookup onto a new field-add lifecycle driver#59
HynLcc merged 1 commit into
mainfrom
migrate-conditional-lookup-lifecycle

Conversation

@HynLcc

@HynLcc HynLcc commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

Migrates the conditional-lookup runner kind (lookup/conditional-10k) onto a brand-new shared driver, field-add-lifecycle.ts.

conditional-lookup fits neither existing driver:

  • No single prepare phase — its create/seed measurements ride the fixture with cache-variant names (seedBuild/createTables/seedRestore), like field-convert-lifecycle but unlike record-mutation-lifecycle.
  • Two primary phases (createLookupField + fullLookupScanReady) feeding a computed conditionalLookupReadyMs threshold — unlike field-convert-lifecycle's single metric-named phase.
  • Restore-or-delete cleanup (drop the added lookup field) — unlike field-convert's keep-or-delete (in-place, non-invertible).

So this introduces the sibling family driver for runners whose measured op adds a field over a seeded table, waits for the new column to backfill, then restores the seed by deleting that field. field-duplicate and field-create ride it next (rounds 2–3), generalizing it as the family migrates.

The driver owns the repeated protocol (the seedReady phase, diagnostic-error wrapping, cleanup invocation). conditional-lookup declares only what varies: the dual-table seed fixture, the seed assertion, the trace-wrapped field-add + full-scan readiness bundle, the result assembly (reusing buildConditionalLookupCaseResult unchanged), and the restore-or-delete cleanup. The exported seed helpers field-duplicate reuses are untouched.

diff-artifacts.mjs masks

  • conditional-lookup's generated ids/names (source/host table ids, sourceFields/hostFields ids, host record ids, table names) — proven volatile by an unmodified-main baseline A vs B (the case was never diff-validated before).
  • details.seed.seedHash/seedHashShort — the same content-addressed seed-cache key every other migrated runner already masks under a cache object. It digests the seed code files, so it moves on a pure refactor while staying identical run-to-run; conditional-lookup just placed it directly under details.seed.

Validation (local, lookup/conditional-10k, v1+v2)

  • Baseline A vs B clean after the noise masks.
  • pnpm check green.
  • G1 baseline vs candidate clean for both engines (only the documented seedHash key masked).
  • Negative tests: phase / verifiedSamples.expected / threshold metric / recordCount / seedNamePrefix drift all still caught; only the seedHash key is ignored.
  • Trace ref count unchanged (23 both engines).
  • Semantics: both engines pass, 6 phases match baseline, conditionalLookupReadyMs = createLookupField + fullScan, full 10k scan verified, no routing assertion (correct for a computed-lookup case).
  • New driver — no other members to regress this round.

Tracker: 20/35 runner kinds, 24/55 cases.

🤖 Generated with Claude Code

conditional-lookup fits neither existing driver: it has no single "prepare"
phase (its create/seed measurements ride the fixture with cache-variant names),
its primary is two phases (createLookupField + fullLookupScanReady) feeding a
computed conditionalLookupReadyMs threshold, and its cleanup is restore-or-delete
(drop the added lookup field) rather than field-convert's keep-or-delete. So this
introduces field-add-lifecycle.ts — the sibling for runners whose measured op
ADDS a field over a seeded table, waits for the new column to backfill, and
restores the seed by deleting that field. field-duplicate and field-create join
it next.

The driver owns the repeated protocol (seedReady phase, diagnostic wrapping,
cleanup invocation). conditional-lookup declares only what varies: the dual-table
seed fixture, the seed assertion, the trace-wrapped field-add + full-scan
readiness bundle, the result assembly (reusing buildConditionalLookupCaseResult
unchanged), and the restore-or-delete cleanup. The exported seed helpers
field-duplicate reuses are untouched.

diff-artifacts.mjs: add masks for conditional-lookup's generated ids/names
(table ids, seedFields ids, host record ids, table names) — proven volatile by an
unmodified-main baseline A vs B — and for details.seed.seedHash/seedHashShort,
the same content-addressed seed-cache key every other migrated runner already
masks under a `cache` object (it digests the seed code, so it moves on a pure
refactor while staying identical run-to-run).

Validation (local, lookup/conditional-10k, v1+v2): baseline A vs B clean after
the noise masks; pnpm check green; G1 baseline vs candidate clean for both
engines; negative tests confirm phase/expected/threshold/recordCount/seedNamePrefix
drift is still caught and only the seedHash key is ignored; trace ref count
unchanged (23). No other driver members to regress (new driver).

Tracker: 20/35 runner kinds, 24/55 cases.

Co-Authored-By: Claude <noreply@anthropic.com>
@HynLcc HynLcc merged commit 1c2fdb8 into main Jun 19, 2026
6 checks passed
@HynLcc HynLcc deleted the migrate-conditional-lookup-lifecycle branch June 19, 2026 16:12
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