feat(cutover): --account-ids cohort filter for phased prepare#438
Merged
Conversation
The runbook's phased cutover (internal accounts first, then beta cohort) needed a way to prepare a subset — `prepare` discovered ALL unlocked accounts. Adds an optional accountIds cohort: when set, only those accounts are prepared (preflight, plan, and records all scope to the cohort); everything else is left untouched. When omitted, behavior is unchanged (whole population). - prepare.ts: optional accountIds param filters discoveries right after discovery; requested-but-not-found ids are surfaced as cohortNotFound so the operator catches typos / locked / missing accounts. - CLI: `--account-ids <comma,separated>` on the prepare command. Closes the last cutover code gap for runbook-faithful phased prod cutover. 3 tests (whole population, cohort subset, not-found reporting); 82 cutover tests green.
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.
Summary
The runbook calls for a phased cutover (internal accounts first, then the beta cohort), but
preparediscovered and prepared all unlocked accounts. Adds an optional cohort filter — the last code gap for runbook-faithful phased prod cutover.preparePrimaryCashWalletCutover({ accountIds })— when set, discoveries are filtered to the cohort right after discovery, so preflight, planning, and record upsert all scope to it; the rest of the population is untouched. Omitted → unchanged whole-population behavior.cohortNotFound(catches typos / locked / already-migrated accounts before the operator hits go).--account-ids <comma,separated>on thepreparecommand.Test plan
Pairs with the operator guide's phasing steps.
🤖 Generated with Claude Code