Skip to content

Factor the repeated 'bump seeded Claude provider tier' migration into _lib.js #4161

Description

@atomantic

scripts/migrations/206-claude-default-opus-5.js is the fourth hand-copy of the same shape: 032-claude-default-opus-4-7.js058-claude-default-opus-4-8.js153-claude-default-sonnet-5.js206-claude-default-opus-5.js. diff scripts/migrations/153-claude-default-sonnet-5.js scripts/migrations/206-claude-default-opus-5.js (confirmed) is identical apart from the data and comment prose — the tier-pointer-swap helper and the entire up() body are byte-for-byte the same shape, just parameterized differently (which tier, which old/new model ids).

scripts/migrations/_lib.js is the documented home for exactly this kind of shared migration skeleton — it already exports makePromptReplaceMigration (~line 457) and makeSplitMigration (~line 158), with _testHelpers.js#runPromptMigrationTests supplying shared test cases for the prompt-replace family.

Fix shape

Add makeSeededProviderTierMigration({ targets, tierLabel }) to scripts/migrations/_lib.js, plus a matching shared test runner (mirroring runPromptMigrationTests), so the next model-tier bump is a ~25-line data table (old id(s), new id, tier pointer keys, Bedrock id mapping) instead of ~370 re-cloned lines.

Do NOT retro-edit 032/058/153/206. Migrations are append-only and frozen — a shipped migration must keep working against the shape it was written for. This factoring pays off starting with the migration after 206, not retroactively.

Surfaced by two independent /simplify reviewers on the opus-5 PR; skipped there to keep that PR scoped to the actual model bump.

Migrated from PLAN.md by /do:replan --issues.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

code-qualityProposed from a module-hygiene audit

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions