Skip to content

Commit c5fc113

Browse files
committed
fix(spec): name the per-entry conversion modules in build-schemas' D2 remedies (#29987)
After the split, a new D2 conversion is a module under src/conversions/entries/<toMajor>/ plus its import and array line in src/conversions/registry.ts. The three remedy texts in build-schemas.ts said to add it in registry.ts. They now name both, and the deletion-proofs and retired-keys check-mode tests pin the entries/ path (both fail on the old text). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg1QFj9ukYzafVoAqg
1 parent a8c5d94 commit c5fc113

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎packages/spec/scripts/build-schemas-check-mode.deletion-proofs.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ describe('build-schemas.ts — a deleted manifest key must prove itself (#4725)'
280280
// …and the two other routes a reader might actually need are named.
281281
expect(output).toContain('RENAMED_DEFS');
282282
expect(output).toContain('src/conversions/registry.ts');
283+
expect(output).toContain('src/conversions/entries/<toMajor>/');
283284
// Anchored on the merge base, which is the half a hand-edit cannot reach.
284285
expect(output).toContain(`merge base ${head.slice(0, 12)}`);
285286
},

‎packages/spec/scripts/build-schemas-check-mode.retired-keys.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ describe('build-schemas.ts — check (b) matches the exact retired key, not its
246246
expect(remedy).not.toContain('copy these lines');
247247
// The D2 conversion is still asked for — the table did not replace it.
248248
expect(remedy).toContain('src/conversions/registry.ts');
249+
expect(remedy).toContain('src/conversions/entries/');
249250
},
250251
);
251252

‎packages/spec/scripts/build-schemas.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,10 @@ if (surfaceDoc) {
12281228
` so the edit is lost. Nothing is inferred here: a leaf name matched against unrelated\n` +
12291229
` conversion surfaces is what let tombstones register themselves by coincidence\n` +
12301230
` (#4659).\n\n` +
1231-
` 2. Add a D2 conversion in src/conversions/registry.ts naming the surface (and a D3\n` +
1232-
` chain step referencing it) so \`os migrate meta\` rewrites their source.`,
1231+
` 2. Add a D2 conversion naming the surface, as one module under\n` +
1232+
` src/conversions/entries/<toMajor>/ plus its import and array line in\n` +
1233+
` src/conversions/registry.ts (and a D3 chain step referencing it) so\n` +
1234+
` \`os migrate meta\` rewrites their source.`,
12331235
);
12341236
process.exit(1);
12351237
}
@@ -2798,8 +2800,10 @@ function checkManifestRemovals(git: GitRun, baseRev: string | null): void {
27982800
`\n — then run \`${MIGRATION_REGISTRY_COMMAND}\`. ⛔ Never type an\n` +
27992801
` entry into the generated table by hand: the registry is generated whole and\n` +
28002802
` never committed, so the edit is lost.\n\n` +
2801-
` 2. Add a D2 conversion in src/conversions/registry.ts naming the surface (and a D3\n` +
2802-
` chain step referencing it) plus a \`major\` changeset, so the removal reaches\n` +
2803+
` 2. Add a D2 conversion naming the surface, as one module under\n` +
2804+
` src/conversions/entries/<toMajor>/ plus its import and array line in\n` +
2805+
` src/conversions/registry.ts (and a D3 chain step referencing it), plus a\n` +
2806+
` \`major\` changeset, so the removal reaches\n` +
28032807
` spec-changes.json, the upgrade guide and \`os migrate meta\` — the table is the\n` +
28042808
` proof it was declared, the conversion is the prescription a consumer follows.\n\n` +
28052809
` If the schema was not meant to disappear at all, this is not the fix: an added\n` +
@@ -3009,7 +3013,8 @@ let gitResolvedAnchor: { rev: string; keys: string[] } | null = null;
30093013
` (#5898) — as one entry file under ${entryDirOf('retired-key')}, named for\n` +
30103014
` that major per ${MIGRATION_ENTRIES_README}, then\n` +
30113015
` \`${MIGRATION_REGISTRY_COMMAND}\`; the table is generated, ⛔ never typed. The\n` +
3012-
` D2 conversion (src/conversions/registry.ts) naming the surface stays\n` +
3016+
` D2 conversion naming the surface (a module under src/conversions/entries/,\n` +
3017+
` imported and listed in src/conversions/registry.ts) stays\n` +
30133018
` required — it is the prescription consumers follow — but it is no longer\n` +
30143019
` what dates the clock; or\n` +
30153020
` 2. its def is not reachable from the metadata-type roots — this gate computes\n` +

0 commit comments

Comments
 (0)