Migrate field-create onto the field-add lifecycle driver#61
Merged
Conversation
Third and widest member of field-add-lifecycle (4 cases: 5 simple, 5 formula,
mixed-19, single-select-1k-options). field-create seeds an empty base-fields-only
table, adds N fields in one measured trace step with per-field engine routing,
optionally polls until the formula columns finish their computed backfill (a DB
aggregate over all rows), verifies the created fields and single-select options,
then restores the seed by deleting the added (non-base) fields.
Unlike the prior two members its prepare is a single measured phase
("prepareFieldCreate" in execute, a synthetic zero-duration "seedBuild"/
"seedRestore" in seed mode), so prepareFixture owns that measurement and parks
its name + duration on the (mutable, in-place) fixture; buildResult rebuilds the
prepare measurement from the live object after seedReady/backfill mutate it. The
driver itself is unchanged — a third runner, with the most divergent shape yet,
slots in with zero driver edits. Cleanup re-resolves the created fields by "not a
base field", the same invariant assertSeedReady already enforces.
diff-artifacts.mjs: mask field-create's generated field ids (createdFields[].id,
ready.computedFields[].id, ready.dependencyFields[].id, the flat details.fieldIds
list, and the compiled details.verifiedFields[].expression which embeds A/B/C
ids) plus details.ready.dbTableName — all proven volatile by an unmodified-main
baseline A vs B. Also mask details.prepare.seedHash / seedTableName, the same
content-addressed seed-cache key the cache.seedHash rule masks for other runners
(stable run-to-run, moves only on refactor; the seed config that also feeds it is
frozen because cases/** is untouched). Field names and computedFields[].expectedKind
keep the semantic identity visible.
Validation (local, all 4 cases, v1+v2): baseline A vs B clean after the noise
masks; pnpm check green; G1 baseline vs candidate clean for all 8 artifacts;
negative tests confirm phase / per-field routing / computed-backfill
checks.mismatches / ready.totalRows / createdFields[].name / single-select
verifiedOptions drift is caught while only seedHash and field-id keys are ignored;
per-field routing asserts v2 actualXTeableV2=true, feature createField; formula
backfill verified 10000/10000 with 0 nulls/0 mismatches; trace ref counts
unchanged (6/6/20/2). Shared driver untouched, so no sibling regression needed.
Tracker: 22/35 runner kinds, 29/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
Third and widest member of
field-add-lifecycle.ts— 4 cases: 5 simple fields, 5 formula fields, mixed-19, and single-select with 1k options.field-create seeds an empty (base-fields-only) table, adds N fields in one measured trace step with per-field engine routing, optionally polls until the formula columns finish their computed backfill (a DB aggregate over all rows), verifies the created fields and single-select options, then restores the seed by deleting the added (non-base) fields.
Unlike the prior two members its prepare is a single measured phase (
prepareFieldCreatein execute; a synthetic zero-durationseedBuild/seedRestorein seed mode), soprepareFixtureowns that measurement and parks its name+duration on the (mutable, in-place) fixture;buildResultrebuilds the prepare measurement from the live object afterseedReady/backfill mutate it. The driver is unchanged — a third runner, with the most divergent shape yet, slots in with zero driver edits. Cleanup re-resolves created fields by "not a base field", the same invariantassertSeedReadyalready enforces.diff-artifacts.mjs masks
All proven volatile by an unmodified-main baseline A vs B:
createdFields[].id,ready.computedFields[].id,ready.dependencyFields[].id, the flatdetails.fieldIdslist, and the compileddetails.verifiedFields[].expression(embeds A/B/C ids), plusdetails.ready.dbTableName.details.prepare.seedHash/seedTableName— the same content-addressed seed-cache key thecache.seedHashrule masks for other runners (stable run-to-run, moves only on refactor; the seed config that also feeds it is frozen because cases/** is untouched).Field names and
computedFields[].expectedKindkeep the semantic identity visible.Validation (local, all 4 cases, v1+v2)
pnpm checkgreen.routing.routeMatched/ computed-backfillchecks.mismatches/ready.totalRows/createdFields[].name/ single-selectverifiedOptions[].namedrift all caught; only the seedHash + field-id keys ignored (over-mask check:createdFields[].namestill caught).actualXTeableV2=true, featurecreateField; formula backfill verified 10000/10000, 0 nulls / 0 mismatches.Tracker: 22/35 runner kinds, 29/55 cases. This closes the field-add family campaign (conditional-lookup #59, field-duplicate #60, field-create here).
🤖 Generated with Claude Code