@ttt-productions/q-core 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/migration-console/manifest.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE3E,eAAO,MAAM,wBAAwB,kFAAmF,CAAC;AACzH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,oCAAqC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,2DAA2D;AAC3D,eAAO,MAAM,+BAA+B,sDAMlC,CAAC;AACX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,gKAS7B,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,uBAAwB,SA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wBAAgB,2BAA2B,CAAC,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAIzE;AA4HD,eAAO,MAAM,0BAA0B,EAAE,SAAS,aAAa,EAmqB9D,CAAC;AAEF,4BAA4B;AAC5B,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,iBAAiB,EAAE,aAAa,CAE9E,CAAC;AAEF,+CAA+C;AAC/C,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,iBAAiB,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,EAAE,CAEhH"}
@@ -309,9 +309,9 @@ export const MIGRATION_CUTOVER_MANIFEST = [
309
309
  }),
310
310
  verifyStep(A.verifyPublicUsers, {
311
311
  title: 'Verify the public identities',
312
- summary: 'Each document holds its own uid, ghost flag, and lowercase name.',
312
+ summary: 'Each document holds its own uid, ghost flag, and lowercase name, and shows the featured badges its profile holds.',
313
313
  owningStep: 'q-core',
314
- dependsOn: [A.migratePublicUsers],
314
+ dependsOn: [A.migratePublicUsers, A.copyUserProfiles],
315
315
  }),
316
316
  copyStep(A.copyAwardDefinitions, {
317
317
  title: 'Copy the award catalog',
@@ -352,36 +352,37 @@ export const MIGRATION_CUTOVER_MANIFEST = [
352
352
  }),
353
353
  copyStep(A.copyTeamMemberships, {
354
354
  title: 'Copy the memberships',
355
- summary: 'Each membership under its compound id, `member` becoming `player`.',
355
+ summary: 'Each membership under its compound id, `member` becoming `player`; one whose team was not copied into its league is left behind and reported.',
356
356
  owningStep: 'q-core',
357
+ dependsOn: [A.copyLeagueTeams],
357
358
  }),
358
359
  verifyStep(A.verifyTeamMemberships, {
359
360
  title: 'Verify the memberships',
360
- summary: 'Every V1 membership copied; a team with two captains and a ghost on two memberships are reported.',
361
+ summary: 'Every V1 membership copied, or absent because its team is gone; a team with two captains and a ghost on two memberships are reported.',
361
362
  owningStep: 'q-core',
362
363
  dependsOn: [A.copyTeamMemberships],
363
364
  }),
364
365
  copyStep(A.copyTeamInvitations, {
365
366
  title: 'Copy the invitations',
366
- summary: 'Each invitation by id; a pending one whose invitee is already on the team is written approved.',
367
+ summary: 'Each invitation by id; a pending one whose invitee is already on the team is written approved, and a pending one whose team was not copied into its league is left behind and reported.',
367
368
  owningStep: 'high-risk-callables',
368
- dependsOn: [A.copyTeamMemberships],
369
+ dependsOn: [A.copyLeagueTeams, A.copyTeamMemberships],
369
370
  }),
370
371
  verifyStep(A.verifyTeamInvitations, {
371
372
  title: 'Verify the invitations',
372
- summary: 'Every V1 invitation copied as the transform makes it.',
373
+ summary: 'Every V1 invitation copied as the transform makes it, or absent because its team is gone.',
373
374
  owningStep: 'high-risk-callables',
374
375
  dependsOn: [A.copyTeamInvitations],
375
376
  }),
376
377
  copyStep(A.copyTeamJoinRequests, {
377
378
  title: 'Copy the join requests',
378
- summary: 'Each request by id; a pending one whose requester is already on the team is written approved.',
379
+ summary: 'Each request by id; a pending one whose requester is already on the team is written approved, and a pending one whose team was not copied into its league is left behind and reported.',
379
380
  owningStep: 'high-risk-callables',
380
- dependsOn: [A.copyTeamMemberships],
381
+ dependsOn: [A.copyLeagueTeams, A.copyTeamMemberships],
381
382
  }),
382
383
  verifyStep(A.verifyTeamJoinRequests, {
383
384
  title: 'Verify the join requests',
384
- summary: 'Every V1 request copied as the transform makes it.',
385
+ summary: 'Every V1 request copied as the transform makes it, or absent because its team is gone.',
385
386
  owningStep: 'high-risk-callables',
386
387
  dependsOn: [A.copyTeamJoinRequests],
387
388
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/migration-console/manifest.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,8FAA8F;AAC9F,mGAAmG;AACnG,mCAAmC;AACnC,EAAE;AACF,sBAAsB;AACtB,+FAA+F;AAC/F,mGAAmG;AACnG,6FAA6F;AAC7F,gGAAgG;AAChG,6EAA6E;AAC7E,kGAAkG;AAClG,yFAAyF;AACzF,k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,CAAC;AACtH,CAAC","sourcesContent":["// The 2.0 cutover manifest: every step of the coordinated migration, in the order the operator runs\n// them, with what each step needs first. The console's callables enforce it — an action whose\n// dependencies are not satisfied refuses to run — and its screen renders it, so both read this one\n// declaration (ARCH-101, ENG-002).\n//\n// Four kinds of step:\n// executable a console action with its own admin callable: admin-asserted, audited,\n// idempotent, resumable by its operation id, and re-runnable after a partial\n// failure. A write action offers a dry run; a verification only reads.\n// productControl a product callable the operator runs from its own screen (the Fix stats\n// actions and the stats check). The console never runs\n// a second copy of it; it records the run, checking the run's own evidence.\n// operatorCheckpoint external work the app cannot do safely — an export, a credential\n// revocation, a manual re-upload. Recorded with the operator's evidence; it\n// never claims the console performed it.\n// cutoverMarker the console's own record that the product now owns every destination.\n//\n// `dependsOn` is enforced: each id must be satisfied — an executable action's last real run reached\n// its end (a verification's also passed), and a recorded step recorded — before the step runs.\n// `orderedAfter` is display order only: a sequence that is ordering, not a gate.\n\nimport { MIGRATION_ACTION_IDS as A } from './action-ids.js';\nimport type { MigrationActionId } from './action-ids.js';\nimport type { RegisteredCollectionPath } from '../doc-schemas/registry.js';\n\nexport const MIGRATION_STEP_KIND_KEYS = ['executable', 'productControl', 'operatorCheckpoint', 'cutoverMarker'] as const;\nexport type MigrationStepKind = (typeof MIGRATION_STEP_KIND_KEYS)[number];\n\n/** What an executable action's pages return: documents written, or records compared. */\nexport const MIGRATION_RESULT_KIND_KEYS = ['write', 'verification'] as const;\nexport type MigrationResultKind = (typeof MIGRATION_RESULT_KIND_KEYS)[number];\n\n/** Where a product control's completion is proven from. */\nexport const MIGRATION_CONTROL_EVIDENCE_KEYS = [\n // The control's `statsOperations` document: a real run, complete, over the whole scope, that\n // left no game out.\n 'statsOperation',\n // The validation's report: complete, over everything, with no finding.\n 'statsValidationReport',\n] as const;\nexport type MigrationControlEvidence = (typeof MIGRATION_CONTROL_EVIDENCE_KEYS)[number];\n\n/** The step folder under the migration plan that owns a step's correctness. */\nexport const MIGRATION_OWNING_STEP_KEYS = [\n 'auth',\n 'q-core',\n 'stat-data-model',\n 'high-risk-callables',\n 'uploads-and-media',\n 'query-and-invalidation',\n 'secret-management',\n 'migration-console',\n] as const;\nexport type MigrationOwningStep = (typeof MIGRATION_OWNING_STEP_KEYS)[number];\n\ninterface MigrationStepBase {\n readonly id: MigrationActionId;\n readonly title: string;\n /** What the step changes or proves, in a sentence or two the operator reads before running it. */\n readonly summary: string;\n readonly owningStep: MigrationOwningStep;\n readonly dependsOn: readonly MigrationActionId[];\n readonly orderedAfter: readonly MigrationActionId[];\n}\n\nexport interface ExecutableMigrationStep extends MigrationStepBase {\n readonly kind: 'executable';\n /** The callable that runs one page of it. */\n readonly callable: string;\n readonly resultKind: MigrationResultKind;\n /** Whether it removes V1 data or revokes access — run only once its gates have passed. */\n readonly destructive: boolean;\n /** False for an action that is one bounded call, never paged. */\n readonly paged: boolean;\n /** The page size the console proposes; each core refuses a page larger than it can commit. */\n readonly defaultPageSize: number;\n /** A verification that informs the rehearsal and gates nothing. */\n readonly informational: boolean;\n /** Why replaying a page, or the whole action, cannot duplicate an effect. */\n readonly idempotency: string;\n /** The deterministic order it pages in, and what its resume key names. */\n readonly resumeKey: string;\n /** The safe response after a partial run. */\n readonly recovery: string;\n}\n\nexport interface ProductControlMigrationStep extends MigrationStepBase {\n readonly kind: 'productControl';\n /** The product callable the operator runs. */\n readonly callable: string;\n /** Where in the product the operator runs it, and with what scope. */\n readonly instructions: string;\n readonly evidence: MigrationControlEvidence;\n /** The documents it rebuilds, as `COLLECTION_SCHEMAS` templates: a destination no copy writes. */\n readonly destinations: readonly RegisteredCollectionPath[];\n}\n\nexport interface OperatorCheckpointMigrationStep extends MigrationStepBase {\n readonly kind: 'operatorCheckpoint';\n readonly instructions: string;\n /** What the operator records as proof before the next step unlocks. */\n readonly evidence: string;\n /** The point past which the external action cannot be undone, or null when none exists. */\n readonly noReturnBoundary: string | null;\n}\n\nexport interface CutoverMarkerMigrationStep extends MigrationStepBase {\n readonly kind: 'cutoverMarker';\n readonly callable: string;\n readonly noReturnBoundary: string;\n}\n\nexport type MigrationStep =\n | ExecutableMigrationStep\n | ProductControlMigrationStep\n | OperatorCheckpointMigrationStep\n | CutoverMarkerMigrationStep;\n\n/** The callable that records a product control's run, checking its evidence. */\nexport const RECORD_MIGRATION_CONTROL_RUN_CALLABLE = 'adminRecordMigrationControlRun';\n/** The callable that records an operator checkpoint with its evidence. */\nexport const RECORD_MIGRATION_CHECKPOINT_CALLABLE = 'adminRecordMigrationCheckpoint';\n/** The callable that records the cutover. */\nexport const RECORD_MIGRATION_CUTOVER_CALLABLE = 'adminRecordMigrationCutover';\n/** The callable that reads the console: the cutover marker, the lock, and every step's state. */\nexport const GET_MIGRATION_CONSOLE_CALLABLE = 'adminGetMigrationConsole';\n\n/** The console's callable name for an executable action: `admin` + its verb and its object. */\nexport function migrationActionCallableName(id: MigrationActionId): string {\n const [verb = '', object = ''] = id.split('.');\n const capitalize = (word: string) => word.charAt(0).toUpperCase() + word.slice(1);\n return `admin${capitalize(verb)}${capitalize(object)}`;\n}\n\nconst COPY_IDEMPOTENCY = 'Deterministic destination ids written whole, so a re-run rewrites the same documents with the same content.';\nconst VERIFY_IDEMPOTENCY = 'Reads only; a re-run compares again.';\nconst DELETE_IDEMPOTENCY = 'Deletes by id; a document already gone is skipped, so a re-run removes only what is left.';\nconst BY_DOCUMENT_ID = 'Source documents in document-id order; the resume key is the last id consumed.';\nconst SINGLE_DOCUMENT = 'One source document; it is never paged.';\nconst COPY_RECOVERY = 'Fix the transform and run the copy again; it refuses a live destination.';\nconst VERIFY_RECOVERY = 'Repair what it reports, through its copy or its resolution, and verify again.';\nconst DELETE_RECOVERY = 'Forward repair only: the retained V1 Firestore export holds what was deleted.';\n\ninterface ExecutableOptions {\n title: string;\n summary: string;\n owningStep: MigrationOwningStep;\n dependsOn?: readonly MigrationActionId[];\n orderedAfter?: readonly MigrationActionId[];\n resumeKey?: string;\n defaultPageSize?: number;\n}\n\nfunction copyStep(id: MigrationActionId, options: ExecutableOptions): ExecutableMigrationStep {\n return {\n kind: 'executable',\n id,\n callable: migrationActionCallableName(id),\n resultKind: 'write',\n destructive: false,\n paged: true,\n defaultPageSize: options.defaultPageSize ?? 100,\n informational: false,\n idempotency: COPY_IDEMPOTENCY,\n resumeKey: options.resumeKey ?? BY_DOCUMENT_ID,\n recovery: COPY_RECOVERY,\n title: options.title,\n summary: options.summary,\n owningStep: options.owningStep,\n dependsOn: options.dependsOn ?? [A.checkpointV1FirestoreExport],\n orderedAfter: options.orderedAfter ?? [],\n };\n}\n\nfunction verifyStep(id: MigrationActionId, options: ExecutableOptions & { informational?: boolean }): ExecutableMigrationStep {\n return {\n kind: 'executable',\n id,\n callable: migrationActionCallableName(id),\n resultKind: 'verification',\n destructive: false,\n paged: true,\n defaultPageSize: options.defaultPageSize ?? 100,\n informational: options.informational ?? false,\n idempotency: VERIFY_IDEMPOTENCY,\n resumeKey: options.resumeKey ?? BY_DOCUMENT_ID,\n recovery: VERIFY_RECOVERY,\n title: options.title,\n summary: options.summary,\n owningStep: options.owningStep,\n dependsOn: options.dependsOn ?? [],\n orderedAfter: options.orderedAfter ?? [],\n };\n}\n\nfunction deleteStep(id: MigrationActionId, options: ExecutableOptions): ExecutableMigrationStep {\n return {\n kind: 'executable',\n id,\n callable: migrationActionCallableName(id),\n resultKind: 'write',\n destructive: true,\n paged: true,\n defaultPageSize: options.defaultPageSize ?? 100,\n informational: false,\n idempotency: DELETE_IDEMPOTENCY,\n resumeKey: options.resumeKey ?? BY_DOCUMENT_ID,\n recovery: DELETE_RECOVERY,\n title: options.title,\n summary: options.summary,\n owningStep: options.owningStep,\n dependsOn: options.dependsOn ?? [],\n orderedAfter: options.orderedAfter ?? [],\n };\n}\n\n/** The copies whose verifications must pass before the rebuild reads the games they copied. */\nconst SOURCE_VERIFICATIONS_FOR_REBUILD = [\n A.verifySportLeagues,\n A.verifyLeagueTeams,\n A.verifyTeamMemberships,\n A.verifyGameRosterPlayers,\n A.verifySportGames,\n A.verifyGameStats,\n] as const satisfies readonly MigrationActionId[];\n\n/**\n * Every copy's verification. Each must pass before the cutover is recorded: a failed or skipped\n * record keeps the migration from being declared complete.\n */\nconst COPY_VERIFICATIONS = [\n A.verifyAdminList,\n A.verifyAppConfig,\n A.verifyLandingPageConfig,\n A.verifyStatsBeacon,\n A.verifyWaiverTemplates,\n A.verifyGameLocations,\n A.verifyUserProfiles,\n A.verifyHistoricalStats,\n A.verifyReservedDisplayNames,\n A.verifyPublicUsers,\n A.verifyAwardDefinitions,\n A.verifySportLeagues,\n A.verifyLeagueTeams,\n A.verifyTeamMemberships,\n A.verifyTeamInvitations,\n A.verifyTeamJoinRequests,\n A.verifyLeagueFreeAgents,\n A.verifySignedWaivers,\n A.verifyHardwareLoanContracts,\n A.verifySportGames,\n A.verifyGameStats,\n A.verifyGameRosterPlayers,\n A.verifyV1Pictures,\n] as const satisfies readonly MigrationActionId[];\n\nexport const MIGRATION_CUTOVER_MANIFEST: readonly MigrationStep[] = [\n // ── Before anything is read ────────────────────────────────────────────────────────────────────\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointV1FirestoreExport,\n title: 'Keep a managed export of the V1 database',\n summary: 'The managed Firestore export is the record of V1 and the only recovery after a delete.',\n owningStep: 'migration-console',\n dependsOn: [],\n orderedAfter: [],\n instructions:\n 'In production, with V1 stopped, take a managed Firestore export of the whole database to a Cloud Storage bucket and keep it. In a rehearsal, name the production export the dev copy was imported from.',\n evidence: 'The export operation name and the bucket path it wrote to.',\n noReturnBoundary: null,\n },\n\n // ── Global roles ───────────────────────────────────────────────────────────────────────────────\n copyStep(A.copyAdminList, {\n title: 'Copy the admin and referee rosters',\n summary: 'The `landing/admin` role maps become `_systemData/adminList`, the roster every role check reads.',\n owningStep: 'auth',\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyAdminList, {\n title: 'Verify the rosters',\n summary: 'Every V1 admin and referee is on the copied roster, and nobody else is.',\n owningStep: 'auth',\n dependsOn: [A.copyAdminList],\n resumeKey: SINGLE_DOCUMENT,\n }),\n\n // ── App configuration ──────────────────────────────────────────────────────────────────────────\n copyStep(A.copyAppConfig, {\n title: 'Copy the app configuration',\n summary: 'The version and the banner from `landing/base` become `_appConfig/app`, its switches at their open defaults.',\n owningStep: 'q-core',\n resumeKey: SINGLE_DOCUMENT,\n }),\n copyStep(A.copyLandingPageConfig, {\n title: 'Copy the landing page copy',\n summary: 'The hero title and the about text become `_appConfig/landingPage`; its picture arrives with the picture carry.',\n owningStep: 'q-core',\n resumeKey: SINGLE_DOCUMENT,\n }),\n copyStep(A.copyStatsBeacon, {\n title: 'Copy the stats beacon',\n summary: 'The last stats change V1 announced becomes `_appConfig/statsBeacon`, or nothing when V1 never fired one.',\n owningStep: 'query-and-invalidation',\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyAppConfig, {\n title: 'Verify the app configuration',\n summary: 'The version and the banner match V1 before the cutover, and the document satisfies its schema after it.',\n owningStep: 'q-core',\n dependsOn: [A.copyAppConfig],\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyLandingPageConfig, {\n title: 'Verify the landing page copy',\n summary: 'The landing copy matches V1 before the cutover, and satisfies its schema after it.',\n owningStep: 'q-core',\n dependsOn: [A.copyLandingPageConfig],\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyStatsBeacon, {\n title: 'Verify the stats beacon',\n summary: 'A beacon at least as recent as V1’s exists, or V1 never fired one.',\n owningStep: 'query-and-invalidation',\n dependsOn: [A.copyStatsBeacon],\n resumeKey: SINGLE_DOCUMENT,\n }),\n\n // ── Setup's catalogs ───────────────────────────────────────────────────────────────────────────\n copyStep(A.copyWaiverTemplates, {\n title: 'Copy the waiver templates',\n summary: 'Each template under its id, its wording as version 1.',\n owningStep: 'high-risk-callables',\n }),\n verifyStep(A.verifyWaiverTemplates, {\n title: 'Verify the waiver templates',\n summary: 'Every V1 template copied with its first version.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyWaiverTemplates],\n }),\n copyStep(A.copyGameLocations, {\n title: 'Copy the game locations',\n summary: 'Each venue on `landing/admin` becomes a `gameLocations` document under its id; its picture arrives with the picture carry.',\n owningStep: 'q-core',\n resumeKey: 'The venues in array order; the resume key is the last venue id.',\n }),\n verifyStep(A.verifyGameLocations, {\n title: 'Verify the game locations',\n summary: 'Every V1 venue copied and equal.',\n owningStep: 'q-core',\n dependsOn: [A.copyGameLocations],\n resumeKey: 'The venues in array order; the resume key is the last venue id.',\n }),\n\n // ── Accounts and identity ──────────────────────────────────────────────────────────────────────\n copyStep(A.copyUserProfiles, {\n title: 'Copy the profiles',\n summary: 'Each `users` document becomes its profile and its owner-only private document, every account active.',\n owningStep: 'auth',\n }),\n verifyStep(A.verifyUserProfiles, {\n title: 'Verify the profiles',\n summary: 'Every V1 profile copied with its private document.',\n owningStep: 'auth',\n dependsOn: [A.copyUserProfiles],\n }),\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointAbandonedRegistrationSweepEnabled,\n title: 'Enable the abandoned-registration sweep',\n summary:\n 'The scheduled sweep that deletes a sign-in account still holding no profile after its grace window does nothing until this is recorded, and stops again whenever the profile verification is run anew.',\n owningStep: 'auth',\n dependsOn: [A.verifyUserProfiles],\n orderedAfter: [],\n instructions:\n 'Once the profile verification has passed, confirm every account that should keep its sign-in holds a copied profile, then record this step to let the scheduled sweep delete the sign-in accounts that hold none past their grace window.',\n evidence: 'The passing profile verification this step follows, and the count of profiles it checked.',\n noReturnBoundary: 'The sweep’s first deletion of a sign-in account that holds no profile.',\n },\n copyStep(A.copyHistoricalStats, {\n title: 'Copy the historical baselines',\n summary: 'Each pre-Q-Sports career total becomes its sport’s `historicalStats` document.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyUserProfiles],\n }),\n verifyStep(A.verifyHistoricalStats, {\n title: 'Verify the historical baselines',\n summary: 'Every V1 baseline copied and equal; a database with none is declared empty.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyHistoricalStats],\n }),\n copyStep(A.deriveReservedDisplayNames, {\n title: 'Reserve the display names',\n summary: 'One reservation per copied profile; two names that collide are reported for an admin rename.',\n owningStep: 'auth',\n dependsOn: [A.copyUserProfiles],\n }),\n verifyStep(A.verifyReservedDisplayNames, {\n title: 'Verify the display-name reservations',\n summary: 'Every profile holds the reservation of its name.',\n owningStep: 'auth',\n dependsOn: [A.deriveReservedDisplayNames],\n }),\n copyStep(A.migratePublicUsers, {\n title: 'Migrate the public identities in place',\n summary: 'Each `publicUsers` document is rewritten where it sits: epoch timestamps, the recomputed lowercase name, the ghost flag.',\n owningStep: 'q-core',\n }),\n verifyStep(A.verifyPublicUsers, {\n title: 'Verify the public identities',\n summary: 'Each document holds its own uid, ghost flag, and lowercase name.',\n owningStep: 'q-core',\n dependsOn: [A.migratePublicUsers],\n }),\n copyStep(A.copyAwardDefinitions, {\n title: 'Copy the award catalog',\n summary: 'Each award on `landing/admin` becomes an `awardDefinitions` document with its holder count; its badge arrives with the picture carry.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copyUserProfiles],\n resumeKey: 'The awards in array order; the resume key is the last award id.',\n }),\n verifyStep(A.verifyAwardDefinitions, {\n title: 'Verify the award catalog',\n summary: 'Every award copied, every holder count equal to the profiles holding it, every grant, profile award pick, and shown badge naming an award that exists.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copyAwardDefinitions, A.migratePublicUsers],\n resumeKey: SINGLE_DOCUMENT,\n }),\n\n // ── Leagues and teams ──────────────────────────────────────────────────────────────────────────\n copyStep(A.copySportLeagues, {\n title: 'Copy the leagues',\n summary: 'Each league under its id — closed leagues included; its pictures arrive with the picture carry.',\n owningStep: 'q-core',\n }),\n verifyStep(A.verifySportLeagues, {\n title: 'Verify the leagues',\n summary: 'Every V1 league copied and equal, every waiver template it names existing.',\n owningStep: 'q-core',\n dependsOn: [A.copySportLeagues, A.copyWaiverTemplates],\n }),\n copyStep(A.copyLeagueTeams, {\n title: 'Copy the teams',\n summary: 'Each team under its id, its season lines in its sport’s shape.',\n owningStep: 'q-core',\n }),\n verifyStep(A.verifyLeagueTeams, {\n title: 'Verify the teams',\n summary: 'Every V1 team copied; the season lines are held to their schema, since the rebuild replaces them.',\n owningStep: 'q-core',\n dependsOn: [A.copyLeagueTeams],\n }),\n copyStep(A.copyTeamMemberships, {\n title: 'Copy the memberships',\n summary: 'Each membership under its compound id, `member` becoming `player`.',\n owningStep: 'q-core',\n }),\n verifyStep(A.verifyTeamMemberships, {\n title: 'Verify the memberships',\n summary: 'Every V1 membership copied; a team with two captains and a ghost on two memberships are reported.',\n owningStep: 'q-core',\n dependsOn: [A.copyTeamMemberships],\n }),\n copyStep(A.copyTeamInvitations, {\n title: 'Copy the invitations',\n summary: 'Each invitation by id; a pending one whose invitee is already on the team is written approved.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamMemberships],\n }),\n verifyStep(A.verifyTeamInvitations, {\n title: 'Verify the invitations',\n summary: 'Every V1 invitation copied as the transform makes it.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamInvitations],\n }),\n copyStep(A.copyTeamJoinRequests, {\n title: 'Copy the join requests',\n summary: 'Each request by id; a pending one whose requester is already on the team is written approved.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamMemberships],\n }),\n verifyStep(A.verifyTeamJoinRequests, {\n title: 'Verify the join requests',\n summary: 'Every V1 request copied as the transform makes it.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamJoinRequests],\n }),\n copyStep(A.copyLeagueFreeAgents, {\n title: 'Copy the free-agent signups',\n summary: 'Each signup under its built id; a signup whose player already joined a team in the league is left behind and reported.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamMemberships],\n }),\n verifyStep(A.verifyLeagueFreeAgents, {\n title: 'Verify the free-agent signups',\n summary: 'Every V1 signup copied, or absent because joining left it behind.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyLeagueFreeAgents],\n }),\n\n // ── Signed waivers and hardware contracts ──────────────────────────────────────────────────────\n copyStep(A.copySignedWaivers, {\n title: 'Copy the signed waivers',\n summary: 'Every signed waiver, a ghost’s included, under its id; its signature file stays where it is.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copyWaiverTemplates],\n }),\n verifyStep(A.verifySignedWaivers, {\n title: 'Verify the signed waivers',\n summary: 'Every V1 record copied and equal, each template it names existing.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copySignedWaivers],\n }),\n copyStep(A.copyHardwareLoanContracts, {\n title: 'Copy the hardware loan contracts',\n summary: 'Each contract from both V1 collections under its id; its signature file stays where it is.',\n owningStep: 'high-risk-callables',\n resumeKey: 'The V1 collections in turn, each by document id; the resume key is `{collection}/{id}`.',\n }),\n verifyStep(A.verifyHardwareLoanContracts, {\n title: 'Verify the hardware loan contracts',\n summary: 'Every V1 contract copied and equal.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyHardwareLoanContracts],\n resumeKey: 'The V1 collections in turn, each by document id; the resume key is `{collection}/{id}`.',\n }),\n verifyStep(A.verifySignatureFilesResolvable, {\n title: 'Verify the signature files resolve',\n summary: 'Each kept signature file is in this project’s bucket and exists. A rehearsal reports every file as another environment’s, which is expected.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifySignedWaivers, A.verifyHardwareLoanContracts],\n resumeKey: 'The signed waivers by id, then the contracts; the resume key is the record path.',\n }),\n\n // ── Games ──────────────────────────────────────────────────────────────────────────────────────\n copyStep(A.copyGameRosterPlayers, {\n title: 'Copy the game rosters',\n summary: 'One entry per team per person in each game, from each V1 roster document’s own team and user.',\n owningStep: 'high-risk-callables',\n resumeKey: 'The V1 games by document id; the resume key is the last game id.',\n defaultPageSize: 50,\n }),\n {\n kind: 'executable',\n id: A.resolveUnrosteredStatLine,\n callable: migrationActionCallableName(A.resolveUnrosteredStatLine),\n resultKind: 'write',\n destructive: false,\n paged: false,\n defaultPageSize: 1,\n informational: false,\n idempotency: 'A second resolution of the same line is acknowledged and writes nothing.',\n resumeKey: 'One game, one line; it is never paged.',\n recovery: 'Resolve the line again with the right team, then copy the game again.',\n title: 'Resolve a stat line no roster places',\n summary: 'For a line the game copy stops on, the admin names its team: the missing roster entry is written with its reason, and the game copied again.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyGameRosterPlayers],\n orderedAfter: [],\n },\n copyStep(A.copySportGames, {\n title: 'Copy the games',\n summary: 'Each V1 game with its stats: the event documents, the rollup, the participation lists by roster entry, and a completed game’s finalized record.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyGameRosterPlayers],\n orderedAfter: [A.resolveUnrosteredStatLine],\n resumeKey: 'The V1 games by document id; a game’s documents commit before its id becomes the resume key.',\n defaultPageSize: 20,\n }),\n verifyStep(A.verifySportGames, {\n title: 'Verify the game schedules',\n summary: 'Every V1 game’s schedule fields as the copy converts them.',\n owningStep: 'q-core',\n dependsOn: [A.copySportGames],\n }),\n verifyStep(A.verifyGameStats, {\n title: 'Verify the game stats',\n summary: 'Per game: the events replay to the rollup and to V1’s recorded lines, the finalized record matches, and every line and list names a roster entry.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copySportGames],\n defaultPageSize: 20,\n }),\n {\n kind: 'executable',\n id: A.reconcileOpenGameRosters,\n callable: migrationActionCallableName(A.reconcileOpenGameRosters),\n resultKind: 'write',\n destructive: false,\n paged: true,\n defaultPageSize: 20,\n informational: false,\n idempotency: 'Each open game is reconciled through the roster core against the copied memberships; a reconciled game changes nothing on a re-run.',\n resumeKey: 'The open games by document id; the resume key is the last game id.',\n recovery: 'Run it again: a game held by another operation is reported and reconciled on the next run.',\n title: 'Reconcile the open games’ rosters',\n summary: 'Each game open at the cutover: stale stat-free entries removed, missing members added.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyTeamMemberships, A.verifyGameStats],\n orderedAfter: [],\n },\n verifyStep(A.verifyGameRosterPlayers, {\n title: 'Verify the game rosters',\n summary: 'Every V1 roster entry copied; before the cutover, no open game keeps a stale entry.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyGameRosterPlayers, A.reconcileOpenGameRosters],\n resumeKey: 'The V1 games by document id; the resume key is the last game id.',\n }),\n\n // ── Pictures ───────────────────────────────────────────────────────────────────────────────────\n copyStep(A.carryV1Pictures, {\n title: 'Carry the V1 pictures onto the pipeline',\n summary: 'Each league, landing, venue, and award image is staged and accepted through the upload pipeline, which processes and publishes it. A rehearsal reports every source unavailable.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copySportLeagues, A.copyLandingPageConfig, A.copyGameLocations, A.copyAwardDefinitions],\n resumeKey: 'By owner kind, then owner id; the resume key is `{ownerKind}:{ownerId}`.',\n }),\n verifyStep(A.verifyV1Pictures, {\n title: 'Verify the carried pictures',\n summary: 'Every V1 reference attached with its three sizes, or reported for a reason no re-run changes; nothing still pending. A source in another bucket, or a page it could examine none of, fails it unless the run acknowledges unexamined sources, as a rehearsal does.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.carryV1Pictures],\n resumeKey: 'By owner kind, then owner id; the resume key is `{ownerKind}:{ownerId}`.',\n }),\n\n // ── The ghost names V1 left behind ─────────────────────────────────────────────────────────────\n {\n kind: 'executable',\n id: A.cleanupOrphanGhostPublicUsers,\n callable: migrationActionCallableName(A.cleanupOrphanGhostPublicUsers),\n resultKind: 'write',\n destructive: true,\n paged: true,\n defaultPageSize: 100,\n informational: false,\n idempotency: 'A ghost document is deleted only when nothing references it; a re-run finds nothing further.',\n resumeKey: BY_DOCUMENT_ID,\n recovery: DELETE_RECOVERY,\n title: 'Remove the ghost names nothing references',\n summary: 'Each ghost `publicUsers` document no membership, roster entry, or unvoided stat event names, reported by disposition first. No signed waiver is touched.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyPublicUsers, A.verifyTeamMemberships, A.verifyGameRosterPlayers, A.verifyGameStats],\n orderedAfter: [],\n },\n\n // ── The derived statistics ─────────────────────────────────────────────────────────────────────\n {\n kind: 'productControl',\n id: A.rebuildLeagueStats,\n title: 'Rebuild every league’s stats',\n summary: 'Every team’s season line and per-membership rows, closed leagues included, rebuilt from the copied games.',\n owningStep: 'stat-data-model',\n dependsOn: SOURCE_VERIFICATIONS_FOR_REBUILD,\n orderedAfter: [],\n callable: 'recalculateAllLeagueStats',\n destinations: ['leagueTeams/{teamId}'],\n instructions: 'Run “Rebuild every league” from Stats › Fix stats as a real run, not a dry run, and let it reach the end.',\n evidence: 'statsOperation',\n },\n {\n kind: 'productControl',\n id: A.rebuildLifetimeStats,\n title: 'Rebuild every user’s lifetime stats',\n summary: 'Every account’s lifetime lines rebuilt from the copied games and historical baselines.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildLeagueStats, A.verifyUserProfiles, A.verifyHistoricalStats],\n orderedAfter: [],\n callable: 'recalculateAllUserStats',\n destinations: ['userProfiles/{userId}'],\n instructions: 'Run “Rebuild every user” from Stats › Fix stats as a real run, and let it reach the end.',\n evidence: 'statsOperation',\n },\n {\n kind: 'productControl',\n id: A.rebuildSportHallOfFame,\n title: 'Rebuild the hall of fame',\n summary: 'The hall of fame of every sport that keeps one, rebuilt from the copied games and baselines.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildLifetimeStats],\n orderedAfter: [],\n callable: 'recalculateHallOfFame',\n destinations: ['sportHallOfFame/{sportKey}'],\n instructions: 'Run the hall-of-fame rebuild from Stats › Fix stats once for each sport that keeps a hall of fame, as real runs, and record every run.',\n evidence: 'statsOperation',\n },\n {\n kind: 'productControl',\n id: A.validateStats,\n title: 'Validate the stats',\n summary: 'Check stats over everything; it must report no finding.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildSportHallOfFame],\n orderedAfter: [],\n callable: 'runStatsValidation',\n destinations: ['statsValidationReports/{reportId}'],\n instructions: 'Run “Check stats” over everything from Stats › Fix stats and let it finish.',\n evidence: 'statsValidationReport',\n },\n verifyStep(A.verifyLeaguePlayerStats, {\n title: 'Compare the league player totals with V1',\n summary: 'Lists each player whose V1 league total differs from the sum of their rebuilt rows in that league. It informs the rehearsal and gates nothing.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildLeagueStats],\n informational: true,\n }),\n verifyStep(A.verifySportHallOfFame, {\n title: 'Verify the rebuilt hall of fame',\n summary: 'Every V1 hall of fame of a sport that keeps one has its rebuilt document, which satisfies its schema and holds an entry for every V1 player with a non-zero total.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildSportHallOfFame],\n }),\n\n // ── The cutover ────────────────────────────────────────────────────────────────────────────────\n {\n kind: 'cutoverMarker',\n id: A.recordCutoverLive,\n callable: RECORD_MIGRATION_CUTOVER_CALLABLE,\n title: 'Record the cutover',\n summary: 'From here on the product owns every destination: no copy runs again, and each verification holds what the product edits to its schema only.',\n owningStep: 'migration-console',\n dependsOn: [...COPY_VERIFICATIONS, A.validateStats],\n orderedAfter: [A.verifySportHallOfFame, A.verifySignatureFilesResolvable],\n noReturnBoundary: 'Recording the cutover. It is never undone: every copy refuses a live destination after it.',\n },\n\n // ── Cleanup: each delete gated on the verifications its core asserts ───────────────────────────\n deleteStep(A.deleteV1AdminRoles, {\n title: 'Remove the V1 role maps',\n summary: 'The `isAdmin` and `referees` fields on `landing/admin`; the document goes with its last carried row.',\n owningStep: 'auth',\n dependsOn: [A.verifyAdminList],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1LandingBase, {\n title: 'Delete `landing/base`',\n summary: 'The V1 configuration document, once its three documents and its picture are verified.',\n owningStep: 'q-core',\n dependsOn: [A.verifyAppConfig, A.verifyLandingPageConfig, A.verifyStatsBeacon, A.verifyV1Pictures],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1Waivers, {\n title: 'Delete the V1 waiver templates',\n summary: 'The `waivers` collection.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyWaiverTemplates],\n }),\n deleteStep(A.deleteV1GameLocations, {\n title: 'Remove the V1 venues',\n summary: 'The `locations` field on `landing/admin`; the document goes with its last carried row.',\n owningStep: 'q-core',\n dependsOn: [A.verifyGameLocations, A.verifyV1Pictures],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1AwardCatalog, {\n title: 'Remove the V1 award catalog',\n summary: 'The `awards` field on `landing/admin`; the document goes with its last carried row.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifyAwardDefinitions, A.verifyUserProfiles, A.verifyPublicUsers, A.verifyV1Pictures],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1Users, {\n title: 'Delete the V1 user documents',\n summary: 'Each `users` document with its historical baselines.',\n owningStep: 'auth',\n dependsOn: [A.verifyUserProfiles, A.verifyHistoricalStats, A.verifyReservedDisplayNames],\n }),\n deleteStep(A.deleteV1TeamInvites, {\n title: 'Delete the V1 invitations',\n summary: 'The `teamInvites` collection.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyTeamInvitations],\n }),\n deleteStep(A.deleteV1JoinRequests, {\n title: 'Delete the V1 join requests',\n summary: 'The `joinRequests` collection.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyTeamJoinRequests],\n }),\n deleteStep(A.deleteV1FreeAgentSignups, {\n title: 'Delete the V1 free-agent signups',\n summary: 'The `freeAgentSignups` collection, left-behind signups included.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyLeagueFreeAgents],\n }),\n deleteStep(A.deleteV1TeamMembers, {\n title: 'Delete the V1 memberships',\n summary: 'The `teamMembers` collection.',\n owningStep: 'q-core',\n dependsOn: [A.verifyTeamMemberships],\n }),\n deleteStep(A.deleteV1Teams, {\n title: 'Delete the V1 teams',\n summary: 'The `teams` collection; a team still holding a subcollection is reported and kept.',\n owningStep: 'q-core',\n dependsOn: [A.verifyLeagueTeams],\n }),\n {\n kind: 'executable',\n id: A.revokeV1SignatureDownloadTokens,\n callable: migrationActionCallableName(A.revokeV1SignatureDownloadTokens),\n resultKind: 'write',\n destructive: true,\n paged: true,\n defaultPageSize: 100,\n informational: false,\n idempotency: 'Removes a kept file’s download token; a file holding none is skipped. No file is moved or deleted.',\n resumeKey: 'The signed waivers by id, then the contracts; the resume key is the record path.',\n recovery: 'Run it again; a file whose token went is skipped.',\n title: 'Revoke the V1 signature download links',\n summary: 'Each kept signature file loses the download token V1’s stored links carry, so those links stop resolving.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifySignedWaivers, A.verifyHardwareLoanContracts, A.verifySignatureFilesResolvable],\n orderedAfter: [],\n },\n deleteStep(A.deleteV1WaiverSignatures, {\n title: 'Delete the V1 signed-waiver records',\n summary: 'The `waiverSignatures` records; the files stay, named by the copied records.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifySignedWaivers],\n }),\n deleteStep(A.deleteV1HardwareContracts, {\n title: 'Delete the V1 hardware contracts',\n summary: 'Both V1 contract collections; the signature files stay, named by the copied contracts.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyHardwareLoanContracts],\n resumeKey: 'The V1 collections in turn, each by document id; the resume key is `{collection}/{id}`.',\n }),\n deleteStep(A.deleteV1GameRosters, {\n title: 'Delete the V1 game rosters',\n summary: 'Each V1 game’s `roster` subcollection — never the game document.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyGameRosterPlayers, A.validateStats],\n resumeKey: 'The V1 games by document id; the resume key is the last game id.',\n defaultPageSize: 50,\n }),\n deleteStep(A.deleteV1LeagueGames, {\n title: 'Delete the V1 games',\n summary: 'The `leagueGames` documents; a game still holding its roster is reported and kept.',\n owningStep: 'stat-data-model',\n dependsOn: [A.verifySportGames, A.verifyGameStats, A.verifyGameRosterPlayers, A.validateStats, A.deleteV1GameRosters],\n }),\n deleteStep(A.deleteV1LeagueChats, {\n title: 'Delete the V1 league chats',\n summary: 'The parked chat documents under each V1 league and its team paths. Any other document found under a league is reported and kept.',\n owningStep: 'migration-console',\n dependsOn: [A.checkpointV1FirestoreExport],\n resumeKey: 'The V1 leagues by document id; the resume key is the last league id, or `{leagueId}/unfinished` while a league holds more chats than one page deletes.',\n defaultPageSize: 50,\n }),\n deleteStep(A.deleteV1Leagues, {\n title: 'Delete the V1 leagues',\n summary: 'The `leagues` collection; a league still holding a subcollection is reported and kept.',\n owningStep: 'q-core',\n dependsOn: [A.verifySportLeagues, A.verifyV1Pictures],\n orderedAfter: [A.verifyLeaguePlayerStats, A.deleteV1LeagueChats],\n }),\n deleteStep(A.deleteV1HallOfFame, {\n title: 'Delete the V1 hall of fame',\n summary: 'The `hallOfFame` collection, once every sport that keeps a hall of fame has its rebuilt document.',\n owningStep: 'stat-data-model',\n dependsOn: [A.verifySportHallOfFame],\n }),\n deleteStep(A.deleteV1ValidationReports, {\n title: 'Delete the V1 validation reports',\n summary: 'The `validationReports` collection. Nothing is copied: each report describes V1 aggregates at a past moment.',\n owningStep: 'stat-data-model',\n dependsOn: [A.checkpointV1FirestoreExport],\n orderedAfter: [A.validateStats],\n }),\n deleteStep(A.deleteV1AdminStats, {\n title: 'Delete the V1 dashboard counts',\n summary: 'The `adminStats` collection. Nothing is copied: the dashboard counts are counted live.',\n owningStep: 'q-core',\n dependsOn: [A.checkpointV1FirestoreExport],\n }),\n verifyStep(A.verifyV1CommerceDiscardable, {\n title: 'Check the V1 store holds no purchase',\n summary: 'Fails on an order that is not cancelled, a completed checkout, or a product holding inventory — any would be a real purchase, and goes to the owner.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.checkpointV1FirestoreExport],\n resumeKey: 'The six store collections in turn, each by document id.',\n }),\n deleteStep(A.deleteV1Commerce, {\n title: 'Delete the V1 store and payments',\n summary: 'The six store collections, nothing copied.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyV1CommerceDiscardable],\n resumeKey: 'The six store collections in turn, each by document id.',\n }),\n\n // ── After the cutover ──────────────────────────────────────────────────────────────────────────\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointUnattachedPicturesReuploaded,\n title: 'Re-upload the pictures the carry could not attach',\n summary: 'Any V1 image still unattached in production goes back on through its own control.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifyV1Pictures, A.recordCutoverLive],\n orderedAfter: [],\n instructions:\n 'For each source the picture verification reported, re-upload the image through its control — Reupload badge for an award, the picture managers for a league, the landing page, or a venue. In a rehearsal, record that this is production-only.',\n evidence: 'Each re-uploaded owner, or that the verification reported none.',\n noReturnBoundary: null,\n },\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointPaymentCredentialsRetired,\n title: 'Retire the payment-service credentials',\n summary: 'V2 binds no payment-service credential, so once it is live the three V1 binds are live credentials with no reader.',\n owningStep: 'secret-management',\n dependsOn: [A.recordCutoverLive],\n orderedAfter: [],\n instructions:\n 'Production only, once V2 is live there: revoke the payment service’s secret key and disable its webhook endpoint in its dashboard, then destroy the three secrets V1 binds for it — its secret key, its webhook secret, and APP_URL — in Secret Manager in both Firebase projects. In a rehearsal, record that this is production-only.',\n evidence: 'The payment dashboard showing the key revoked and the endpoint disabled, and `gcloud secrets list` in each project showing none of the three.',\n noReturnBoundary: 'The secret key revocation.',\n },\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointServiceAccountKeyRevoked,\n title: 'Revoke the obsolete production service-account key',\n summary: 'No script reads the local production key once the export script runs on the signed-in CLI credentials; revoking it makes every copy of it worthless.',\n owningStep: 'secret-management',\n dependsOn: [A.checkpointV1FirestoreExport],\n orderedAfter: [A.recordCutoverLive],\n instructions:\n 'Run the export script on Application Default Credentials against the production project named explicitly, then revoke the q-sports-prod service-account key in the Google Cloud console and delete serviceAccount.json from the machine. No replacement key is minted. In a rehearsal, record that this is production-only.',\n evidence: 'The export run on ADC, and the console showing the key revoked.',\n noReturnBoundary: 'The key revocation.',\n },\n];\n\n/** Every step by its id. */\nexport const MIGRATION_STEP_BY_ID: ReadonlyMap<MigrationActionId, MigrationStep> = new Map(\n MIGRATION_CUTOVER_MANIFEST.map((step) => [step.id, step]),\n);\n\n/** The steps of one kind, in cutover order. */\nexport function migrationStepsOfKind<K extends MigrationStepKind>(kind: K): Extract<MigrationStep, { kind: K }>[] {\n return MIGRATION_CUTOVER_MANIFEST.filter((step): step is Extract<MigrationStep, { kind: K }> => step.kind === kind);\n}\n"]}
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/migration-console/manifest.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,8FAA8F;AAC9F,mGAAmG;AACnG,mCAAmC;AACnC,EAAE;AACF,sBAAsB;AACtB,+FAA+F;AAC/F,mGAAmG;AACnG,6FAA6F;AAC7F,gGAAgG;AAChG,6EAA6E;AAC7E,kGAAkG;AAClG,yFAAyF;AACzF,kGAAkG;AAClG,+DAA+D;AAC/D,8FAA8F;AAC9F,EAAE;AACF,oGAAoG;AACpG,+FAA+F;AAC/F,iFAAiF;AAEjF,OAAO,EAAE,oBAAoB,IAAI,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAI5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,CAAU,CAAC;AAGzH,wFAAwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,cAAc,CAAU,CAAC;AAG7E,2DAA2D;AAC3D,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,6FAA6F;IAC7F,oBAAoB;IACpB,gBAAgB;IAChB,uEAAuE;IACvE,uBAAuB;CACf,CAAC;AAGX,+EAA+E;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM;IACN,QAAQ;IACR,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,mBAAmB;CACX,CAAC;AAkEX,gFAAgF;AAChF,MAAM,CAAC,MAAM,qCAAqC,GAAG,gCAAgC,CAAC;AACtF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oCAAoC,GAAG,gCAAgC,CAAC;AACrF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;AAC/E,iGAAiG;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AiB,CAAC;QACnC,YAAY,EACV,6TAA6T;QAC/T,QAAQ,EAAE,iEAAiE;QAC3E,gBAAgB,EAAE,qBAAqB;KACxC;CACF,CAAC;AAEF,4BAA4B;AAC5B,MAAM,CAAC,MAAM,oBAAoB,GAAkD,IAAI,GAAG,CACxF,0BAA0B,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAC1D,CAAC;AAEF,+CAA+C;AAC/C,MAAM,UAAU,oBAAoB,CAA8B,IAAO;IACvE,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAC,IAAI,EAA+C,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtH,CAAC","sourcesContent":["// The 2.0 cutover manifest: every step of the coordinated migration, in the order the operator runs\n// them, with what each step needs first. The console's callables enforce it — an action whose\n// dependencies are not satisfied refuses to run — and its screen renders it, so both read this one\n// declaration (ARCH-101, ENG-002).\n//\n// Four kinds of step:\n// executable a console action with its own admin callable: admin-asserted, audited,\n// idempotent, resumable by its operation id, and re-runnable after a partial\n// failure. A write action offers a dry run; a verification only reads.\n// productControl a product callable the operator runs from its own screen (the Fix stats\n// actions and the stats check). The console never runs\n// a second copy of it; it records the run, checking the run's own evidence.\n// operatorCheckpoint external work the app cannot do safely — an export, a credential\n// revocation, a manual re-upload. Recorded with the operator's evidence; it\n// never claims the console performed it.\n// cutoverMarker the console's own record that the product now owns every destination.\n//\n// `dependsOn` is enforced: each id must be satisfied — an executable action's last real run reached\n// its end (a verification's also passed), and a recorded step recorded — before the step runs.\n// `orderedAfter` is display order only: a sequence that is ordering, not a gate.\n\nimport { MIGRATION_ACTION_IDS as A } from './action-ids.js';\nimport type { MigrationActionId } from './action-ids.js';\nimport type { RegisteredCollectionPath } from '../doc-schemas/registry.js';\n\nexport const MIGRATION_STEP_KIND_KEYS = ['executable', 'productControl', 'operatorCheckpoint', 'cutoverMarker'] as const;\nexport type MigrationStepKind = (typeof MIGRATION_STEP_KIND_KEYS)[number];\n\n/** What an executable action's pages return: documents written, or records compared. */\nexport const MIGRATION_RESULT_KIND_KEYS = ['write', 'verification'] as const;\nexport type MigrationResultKind = (typeof MIGRATION_RESULT_KIND_KEYS)[number];\n\n/** Where a product control's completion is proven from. */\nexport const MIGRATION_CONTROL_EVIDENCE_KEYS = [\n // The control's `statsOperations` document: a real run, complete, over the whole scope, that\n // left no game out.\n 'statsOperation',\n // The validation's report: complete, over everything, with no finding.\n 'statsValidationReport',\n] as const;\nexport type MigrationControlEvidence = (typeof MIGRATION_CONTROL_EVIDENCE_KEYS)[number];\n\n/** The step folder under the migration plan that owns a step's correctness. */\nexport const MIGRATION_OWNING_STEP_KEYS = [\n 'auth',\n 'q-core',\n 'stat-data-model',\n 'high-risk-callables',\n 'uploads-and-media',\n 'query-and-invalidation',\n 'secret-management',\n 'migration-console',\n] as const;\nexport type MigrationOwningStep = (typeof MIGRATION_OWNING_STEP_KEYS)[number];\n\ninterface MigrationStepBase {\n readonly id: MigrationActionId;\n readonly title: string;\n /** What the step changes or proves, in a sentence or two the operator reads before running it. */\n readonly summary: string;\n readonly owningStep: MigrationOwningStep;\n readonly dependsOn: readonly MigrationActionId[];\n readonly orderedAfter: readonly MigrationActionId[];\n}\n\nexport interface ExecutableMigrationStep extends MigrationStepBase {\n readonly kind: 'executable';\n /** The callable that runs one page of it. */\n readonly callable: string;\n readonly resultKind: MigrationResultKind;\n /** Whether it removes V1 data or revokes access — run only once its gates have passed. */\n readonly destructive: boolean;\n /** False for an action that is one bounded call, never paged. */\n readonly paged: boolean;\n /** The page size the console proposes; each core refuses a page larger than it can commit. */\n readonly defaultPageSize: number;\n /** A verification that informs the rehearsal and gates nothing. */\n readonly informational: boolean;\n /** Why replaying a page, or the whole action, cannot duplicate an effect. */\n readonly idempotency: string;\n /** The deterministic order it pages in, and what its resume key names. */\n readonly resumeKey: string;\n /** The safe response after a partial run. */\n readonly recovery: string;\n}\n\nexport interface ProductControlMigrationStep extends MigrationStepBase {\n readonly kind: 'productControl';\n /** The product callable the operator runs. */\n readonly callable: string;\n /** Where in the product the operator runs it, and with what scope. */\n readonly instructions: string;\n readonly evidence: MigrationControlEvidence;\n /** The documents it rebuilds, as `COLLECTION_SCHEMAS` templates: a destination no copy writes. */\n readonly destinations: readonly RegisteredCollectionPath[];\n}\n\nexport interface OperatorCheckpointMigrationStep extends MigrationStepBase {\n readonly kind: 'operatorCheckpoint';\n readonly instructions: string;\n /** What the operator records as proof before the next step unlocks. */\n readonly evidence: string;\n /** The point past which the external action cannot be undone, or null when none exists. */\n readonly noReturnBoundary: string | null;\n}\n\nexport interface CutoverMarkerMigrationStep extends MigrationStepBase {\n readonly kind: 'cutoverMarker';\n readonly callable: string;\n readonly noReturnBoundary: string;\n}\n\nexport type MigrationStep =\n | ExecutableMigrationStep\n | ProductControlMigrationStep\n | OperatorCheckpointMigrationStep\n | CutoverMarkerMigrationStep;\n\n/** The callable that records a product control's run, checking its evidence. */\nexport const RECORD_MIGRATION_CONTROL_RUN_CALLABLE = 'adminRecordMigrationControlRun';\n/** The callable that records an operator checkpoint with its evidence. */\nexport const RECORD_MIGRATION_CHECKPOINT_CALLABLE = 'adminRecordMigrationCheckpoint';\n/** The callable that records the cutover. */\nexport const RECORD_MIGRATION_CUTOVER_CALLABLE = 'adminRecordMigrationCutover';\n/** The callable that reads the console: the cutover marker, the lock, and every step's state. */\nexport const GET_MIGRATION_CONSOLE_CALLABLE = 'adminGetMigrationConsole';\n\n/** The console's callable name for an executable action: `admin` + its verb and its object. */\nexport function migrationActionCallableName(id: MigrationActionId): string {\n const [verb = '', object = ''] = id.split('.');\n const capitalize = (word: string) => word.charAt(0).toUpperCase() + word.slice(1);\n return `admin${capitalize(verb)}${capitalize(object)}`;\n}\n\nconst COPY_IDEMPOTENCY = 'Deterministic destination ids written whole, so a re-run rewrites the same documents with the same content.';\nconst VERIFY_IDEMPOTENCY = 'Reads only; a re-run compares again.';\nconst DELETE_IDEMPOTENCY = 'Deletes by id; a document already gone is skipped, so a re-run removes only what is left.';\nconst BY_DOCUMENT_ID = 'Source documents in document-id order; the resume key is the last id consumed.';\nconst SINGLE_DOCUMENT = 'One source document; it is never paged.';\nconst COPY_RECOVERY = 'Fix the transform and run the copy again; it refuses a live destination.';\nconst VERIFY_RECOVERY = 'Repair what it reports, through its copy or its resolution, and verify again.';\nconst DELETE_RECOVERY = 'Forward repair only: the retained V1 Firestore export holds what was deleted.';\n\ninterface ExecutableOptions {\n title: string;\n summary: string;\n owningStep: MigrationOwningStep;\n dependsOn?: readonly MigrationActionId[];\n orderedAfter?: readonly MigrationActionId[];\n resumeKey?: string;\n defaultPageSize?: number;\n}\n\nfunction copyStep(id: MigrationActionId, options: ExecutableOptions): ExecutableMigrationStep {\n return {\n kind: 'executable',\n id,\n callable: migrationActionCallableName(id),\n resultKind: 'write',\n destructive: false,\n paged: true,\n defaultPageSize: options.defaultPageSize ?? 100,\n informational: false,\n idempotency: COPY_IDEMPOTENCY,\n resumeKey: options.resumeKey ?? BY_DOCUMENT_ID,\n recovery: COPY_RECOVERY,\n title: options.title,\n summary: options.summary,\n owningStep: options.owningStep,\n dependsOn: options.dependsOn ?? [A.checkpointV1FirestoreExport],\n orderedAfter: options.orderedAfter ?? [],\n };\n}\n\nfunction verifyStep(id: MigrationActionId, options: ExecutableOptions & { informational?: boolean }): ExecutableMigrationStep {\n return {\n kind: 'executable',\n id,\n callable: migrationActionCallableName(id),\n resultKind: 'verification',\n destructive: false,\n paged: true,\n defaultPageSize: options.defaultPageSize ?? 100,\n informational: options.informational ?? false,\n idempotency: VERIFY_IDEMPOTENCY,\n resumeKey: options.resumeKey ?? BY_DOCUMENT_ID,\n recovery: VERIFY_RECOVERY,\n title: options.title,\n summary: options.summary,\n owningStep: options.owningStep,\n dependsOn: options.dependsOn ?? [],\n orderedAfter: options.orderedAfter ?? [],\n };\n}\n\nfunction deleteStep(id: MigrationActionId, options: ExecutableOptions): ExecutableMigrationStep {\n return {\n kind: 'executable',\n id,\n callable: migrationActionCallableName(id),\n resultKind: 'write',\n destructive: true,\n paged: true,\n defaultPageSize: options.defaultPageSize ?? 100,\n informational: false,\n idempotency: DELETE_IDEMPOTENCY,\n resumeKey: options.resumeKey ?? BY_DOCUMENT_ID,\n recovery: DELETE_RECOVERY,\n title: options.title,\n summary: options.summary,\n owningStep: options.owningStep,\n dependsOn: options.dependsOn ?? [],\n orderedAfter: options.orderedAfter ?? [],\n };\n}\n\n/** The copies whose verifications must pass before the rebuild reads the games they copied. */\nconst SOURCE_VERIFICATIONS_FOR_REBUILD = [\n A.verifySportLeagues,\n A.verifyLeagueTeams,\n A.verifyTeamMemberships,\n A.verifyGameRosterPlayers,\n A.verifySportGames,\n A.verifyGameStats,\n] as const satisfies readonly MigrationActionId[];\n\n/**\n * Every copy's verification. Each must pass before the cutover is recorded: a failed or skipped\n * record keeps the migration from being declared complete.\n */\nconst COPY_VERIFICATIONS = [\n A.verifyAdminList,\n A.verifyAppConfig,\n A.verifyLandingPageConfig,\n A.verifyStatsBeacon,\n A.verifyWaiverTemplates,\n A.verifyGameLocations,\n A.verifyUserProfiles,\n A.verifyHistoricalStats,\n A.verifyReservedDisplayNames,\n A.verifyPublicUsers,\n A.verifyAwardDefinitions,\n A.verifySportLeagues,\n A.verifyLeagueTeams,\n A.verifyTeamMemberships,\n A.verifyTeamInvitations,\n A.verifyTeamJoinRequests,\n A.verifyLeagueFreeAgents,\n A.verifySignedWaivers,\n A.verifyHardwareLoanContracts,\n A.verifySportGames,\n A.verifyGameStats,\n A.verifyGameRosterPlayers,\n A.verifyV1Pictures,\n] as const satisfies readonly MigrationActionId[];\n\nexport const MIGRATION_CUTOVER_MANIFEST: readonly MigrationStep[] = [\n // ── Before anything is read ────────────────────────────────────────────────────────────────────\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointV1FirestoreExport,\n title: 'Keep a managed export of the V1 database',\n summary: 'The managed Firestore export is the record of V1 and the only recovery after a delete.',\n owningStep: 'migration-console',\n dependsOn: [],\n orderedAfter: [],\n instructions:\n 'In production, with V1 stopped, take a managed Firestore export of the whole database to a Cloud Storage bucket and keep it. In a rehearsal, name the production export the dev copy was imported from.',\n evidence: 'The export operation name and the bucket path it wrote to.',\n noReturnBoundary: null,\n },\n\n // ── Global roles ───────────────────────────────────────────────────────────────────────────────\n copyStep(A.copyAdminList, {\n title: 'Copy the admin and referee rosters',\n summary: 'The `landing/admin` role maps become `_systemData/adminList`, the roster every role check reads.',\n owningStep: 'auth',\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyAdminList, {\n title: 'Verify the rosters',\n summary: 'Every V1 admin and referee is on the copied roster, and nobody else is.',\n owningStep: 'auth',\n dependsOn: [A.copyAdminList],\n resumeKey: SINGLE_DOCUMENT,\n }),\n\n // ── App configuration ──────────────────────────────────────────────────────────────────────────\n copyStep(A.copyAppConfig, {\n title: 'Copy the app configuration',\n summary: 'The version and the banner from `landing/base` become `_appConfig/app`, its switches at their open defaults.',\n owningStep: 'q-core',\n resumeKey: SINGLE_DOCUMENT,\n }),\n copyStep(A.copyLandingPageConfig, {\n title: 'Copy the landing page copy',\n summary: 'The hero title and the about text become `_appConfig/landingPage`; its picture arrives with the picture carry.',\n owningStep: 'q-core',\n resumeKey: SINGLE_DOCUMENT,\n }),\n copyStep(A.copyStatsBeacon, {\n title: 'Copy the stats beacon',\n summary: 'The last stats change V1 announced becomes `_appConfig/statsBeacon`, or nothing when V1 never fired one.',\n owningStep: 'query-and-invalidation',\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyAppConfig, {\n title: 'Verify the app configuration',\n summary: 'The version and the banner match V1 before the cutover, and the document satisfies its schema after it.',\n owningStep: 'q-core',\n dependsOn: [A.copyAppConfig],\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyLandingPageConfig, {\n title: 'Verify the landing page copy',\n summary: 'The landing copy matches V1 before the cutover, and satisfies its schema after it.',\n owningStep: 'q-core',\n dependsOn: [A.copyLandingPageConfig],\n resumeKey: SINGLE_DOCUMENT,\n }),\n verifyStep(A.verifyStatsBeacon, {\n title: 'Verify the stats beacon',\n summary: 'A beacon at least as recent as V1’s exists, or V1 never fired one.',\n owningStep: 'query-and-invalidation',\n dependsOn: [A.copyStatsBeacon],\n resumeKey: SINGLE_DOCUMENT,\n }),\n\n // ── Setup's catalogs ───────────────────────────────────────────────────────────────────────────\n copyStep(A.copyWaiverTemplates, {\n title: 'Copy the waiver templates',\n summary: 'Each template under its id, its wording as version 1.',\n owningStep: 'high-risk-callables',\n }),\n verifyStep(A.verifyWaiverTemplates, {\n title: 'Verify the waiver templates',\n summary: 'Every V1 template copied with its first version.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyWaiverTemplates],\n }),\n copyStep(A.copyGameLocations, {\n title: 'Copy the game locations',\n summary: 'Each venue on `landing/admin` becomes a `gameLocations` document under its id; its picture arrives with the picture carry.',\n owningStep: 'q-core',\n resumeKey: 'The venues in array order; the resume key is the last venue id.',\n }),\n verifyStep(A.verifyGameLocations, {\n title: 'Verify the game locations',\n summary: 'Every V1 venue copied and equal.',\n owningStep: 'q-core',\n dependsOn: [A.copyGameLocations],\n resumeKey: 'The venues in array order; the resume key is the last venue id.',\n }),\n\n // ── Accounts and identity ──────────────────────────────────────────────────────────────────────\n copyStep(A.copyUserProfiles, {\n title: 'Copy the profiles',\n summary: 'Each `users` document becomes its profile and its owner-only private document, every account active.',\n owningStep: 'auth',\n }),\n verifyStep(A.verifyUserProfiles, {\n title: 'Verify the profiles',\n summary: 'Every V1 profile copied with its private document.',\n owningStep: 'auth',\n dependsOn: [A.copyUserProfiles],\n }),\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointAbandonedRegistrationSweepEnabled,\n title: 'Enable the abandoned-registration sweep',\n summary:\n 'The scheduled sweep that deletes a sign-in account still holding no profile after its grace window does nothing until this is recorded, and stops again whenever the profile verification is run anew.',\n owningStep: 'auth',\n dependsOn: [A.verifyUserProfiles],\n orderedAfter: [],\n instructions:\n 'Once the profile verification has passed, confirm every account that should keep its sign-in holds a copied profile, then record this step to let the scheduled sweep delete the sign-in accounts that hold none past their grace window.',\n evidence: 'The passing profile verification this step follows, and the count of profiles it checked.',\n noReturnBoundary: 'The sweep’s first deletion of a sign-in account that holds no profile.',\n },\n copyStep(A.copyHistoricalStats, {\n title: 'Copy the historical baselines',\n summary: 'Each pre-Q-Sports career total becomes its sport’s `historicalStats` document.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyUserProfiles],\n }),\n verifyStep(A.verifyHistoricalStats, {\n title: 'Verify the historical baselines',\n summary: 'Every V1 baseline copied and equal; a database with none is declared empty.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyHistoricalStats],\n }),\n copyStep(A.deriveReservedDisplayNames, {\n title: 'Reserve the display names',\n summary: 'One reservation per copied profile; two names that collide are reported for an admin rename.',\n owningStep: 'auth',\n dependsOn: [A.copyUserProfiles],\n }),\n verifyStep(A.verifyReservedDisplayNames, {\n title: 'Verify the display-name reservations',\n summary: 'Every profile holds the reservation of its name.',\n owningStep: 'auth',\n dependsOn: [A.deriveReservedDisplayNames],\n }),\n copyStep(A.migratePublicUsers, {\n title: 'Migrate the public identities in place',\n summary: 'Each `publicUsers` document is rewritten where it sits: epoch timestamps, the recomputed lowercase name, the ghost flag.',\n owningStep: 'q-core',\n }),\n verifyStep(A.verifyPublicUsers, {\n title: 'Verify the public identities',\n summary: 'Each document holds its own uid, ghost flag, and lowercase name, and shows the featured badges its profile holds.',\n owningStep: 'q-core',\n dependsOn: [A.migratePublicUsers, A.copyUserProfiles],\n }),\n copyStep(A.copyAwardDefinitions, {\n title: 'Copy the award catalog',\n summary: 'Each award on `landing/admin` becomes an `awardDefinitions` document with its holder count; its badge arrives with the picture carry.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copyUserProfiles],\n resumeKey: 'The awards in array order; the resume key is the last award id.',\n }),\n verifyStep(A.verifyAwardDefinitions, {\n title: 'Verify the award catalog',\n summary: 'Every award copied, every holder count equal to the profiles holding it, every grant, profile award pick, and shown badge naming an award that exists.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copyAwardDefinitions, A.migratePublicUsers],\n resumeKey: SINGLE_DOCUMENT,\n }),\n\n // ── Leagues and teams ──────────────────────────────────────────────────────────────────────────\n copyStep(A.copySportLeagues, {\n title: 'Copy the leagues',\n summary: 'Each league under its id — closed leagues included; its pictures arrive with the picture carry.',\n owningStep: 'q-core',\n }),\n verifyStep(A.verifySportLeagues, {\n title: 'Verify the leagues',\n summary: 'Every V1 league copied and equal, every waiver template it names existing.',\n owningStep: 'q-core',\n dependsOn: [A.copySportLeagues, A.copyWaiverTemplates],\n }),\n copyStep(A.copyLeagueTeams, {\n title: 'Copy the teams',\n summary: 'Each team under its id, its season lines in its sport’s shape.',\n owningStep: 'q-core',\n }),\n verifyStep(A.verifyLeagueTeams, {\n title: 'Verify the teams',\n summary: 'Every V1 team copied; the season lines are held to their schema, since the rebuild replaces them.',\n owningStep: 'q-core',\n dependsOn: [A.copyLeagueTeams],\n }),\n copyStep(A.copyTeamMemberships, {\n title: 'Copy the memberships',\n summary: 'Each membership under its compound id, `member` becoming `player`; one whose team was not copied into its league is left behind and reported.',\n owningStep: 'q-core',\n dependsOn: [A.copyLeagueTeams],\n }),\n verifyStep(A.verifyTeamMemberships, {\n title: 'Verify the memberships',\n summary: 'Every V1 membership copied, or absent because its team is gone; a team with two captains and a ghost on two memberships are reported.',\n owningStep: 'q-core',\n dependsOn: [A.copyTeamMemberships],\n }),\n copyStep(A.copyTeamInvitations, {\n title: 'Copy the invitations',\n summary: 'Each invitation by id; a pending one whose invitee is already on the team is written approved, and a pending one whose team was not copied into its league is left behind and reported.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyLeagueTeams, A.copyTeamMemberships],\n }),\n verifyStep(A.verifyTeamInvitations, {\n title: 'Verify the invitations',\n summary: 'Every V1 invitation copied as the transform makes it, or absent because its team is gone.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamInvitations],\n }),\n copyStep(A.copyTeamJoinRequests, {\n title: 'Copy the join requests',\n summary: 'Each request by id; a pending one whose requester is already on the team is written approved, and a pending one whose team was not copied into its league is left behind and reported.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyLeagueTeams, A.copyTeamMemberships],\n }),\n verifyStep(A.verifyTeamJoinRequests, {\n title: 'Verify the join requests',\n summary: 'Every V1 request copied as the transform makes it, or absent because its team is gone.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamJoinRequests],\n }),\n copyStep(A.copyLeagueFreeAgents, {\n title: 'Copy the free-agent signups',\n summary: 'Each signup under its built id; a signup whose player already joined a team in the league is left behind and reported.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyTeamMemberships],\n }),\n verifyStep(A.verifyLeagueFreeAgents, {\n title: 'Verify the free-agent signups',\n summary: 'Every V1 signup copied, or absent because joining left it behind.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyLeagueFreeAgents],\n }),\n\n // ── Signed waivers and hardware contracts ──────────────────────────────────────────────────────\n copyStep(A.copySignedWaivers, {\n title: 'Copy the signed waivers',\n summary: 'Every signed waiver, a ghost’s included, under its id; its signature file stays where it is.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copyWaiverTemplates],\n }),\n verifyStep(A.verifySignedWaivers, {\n title: 'Verify the signed waivers',\n summary: 'Every V1 record copied and equal, each template it names existing.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copySignedWaivers],\n }),\n copyStep(A.copyHardwareLoanContracts, {\n title: 'Copy the hardware loan contracts',\n summary: 'Each contract from both V1 collections under its id; its signature file stays where it is.',\n owningStep: 'high-risk-callables',\n resumeKey: 'The V1 collections in turn, each by document id; the resume key is `{collection}/{id}`.',\n }),\n verifyStep(A.verifyHardwareLoanContracts, {\n title: 'Verify the hardware loan contracts',\n summary: 'Every V1 contract copied and equal.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyHardwareLoanContracts],\n resumeKey: 'The V1 collections in turn, each by document id; the resume key is `{collection}/{id}`.',\n }),\n verifyStep(A.verifySignatureFilesResolvable, {\n title: 'Verify the signature files resolve',\n summary: 'Each kept signature file is in this project’s bucket and exists. A rehearsal reports every file as another environment’s, which is expected.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifySignedWaivers, A.verifyHardwareLoanContracts],\n resumeKey: 'The signed waivers by id, then the contracts; the resume key is the record path.',\n }),\n\n // ── Games ──────────────────────────────────────────────────────────────────────────────────────\n copyStep(A.copyGameRosterPlayers, {\n title: 'Copy the game rosters',\n summary: 'One entry per team per person in each game, from each V1 roster document’s own team and user.',\n owningStep: 'high-risk-callables',\n resumeKey: 'The V1 games by document id; the resume key is the last game id.',\n defaultPageSize: 50,\n }),\n {\n kind: 'executable',\n id: A.resolveUnrosteredStatLine,\n callable: migrationActionCallableName(A.resolveUnrosteredStatLine),\n resultKind: 'write',\n destructive: false,\n paged: false,\n defaultPageSize: 1,\n informational: false,\n idempotency: 'A second resolution of the same line is acknowledged and writes nothing.',\n resumeKey: 'One game, one line; it is never paged.',\n recovery: 'Resolve the line again with the right team, then copy the game again.',\n title: 'Resolve a stat line no roster places',\n summary: 'For a line the game copy stops on, the admin names its team: the missing roster entry is written with its reason, and the game copied again.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyGameRosterPlayers],\n orderedAfter: [],\n },\n copyStep(A.copySportGames, {\n title: 'Copy the games',\n summary: 'Each V1 game with its stats: the event documents, the rollup, the participation lists by roster entry, and a completed game’s finalized record.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copyGameRosterPlayers],\n orderedAfter: [A.resolveUnrosteredStatLine],\n resumeKey: 'The V1 games by document id; a game’s documents commit before its id becomes the resume key.',\n defaultPageSize: 20,\n }),\n verifyStep(A.verifySportGames, {\n title: 'Verify the game schedules',\n summary: 'Every V1 game’s schedule fields as the copy converts them.',\n owningStep: 'q-core',\n dependsOn: [A.copySportGames],\n }),\n verifyStep(A.verifyGameStats, {\n title: 'Verify the game stats',\n summary: 'Per game: the events replay to the rollup and to V1’s recorded lines, the finalized record matches, and every line and list names a roster entry.',\n owningStep: 'stat-data-model',\n dependsOn: [A.copySportGames],\n defaultPageSize: 20,\n }),\n {\n kind: 'executable',\n id: A.reconcileOpenGameRosters,\n callable: migrationActionCallableName(A.reconcileOpenGameRosters),\n resultKind: 'write',\n destructive: false,\n paged: true,\n defaultPageSize: 20,\n informational: false,\n idempotency: 'Each open game is reconciled through the roster core against the copied memberships; a reconciled game changes nothing on a re-run.',\n resumeKey: 'The open games by document id; the resume key is the last game id.',\n recovery: 'Run it again: a game held by another operation is reported and reconciled on the next run.',\n title: 'Reconcile the open games’ rosters',\n summary: 'Each game open at the cutover: stale stat-free entries removed, missing members added.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyTeamMemberships, A.verifyGameStats],\n orderedAfter: [],\n },\n verifyStep(A.verifyGameRosterPlayers, {\n title: 'Verify the game rosters',\n summary: 'Every V1 roster entry copied; before the cutover, no open game keeps a stale entry.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.copyGameRosterPlayers, A.reconcileOpenGameRosters],\n resumeKey: 'The V1 games by document id; the resume key is the last game id.',\n }),\n\n // ── Pictures ───────────────────────────────────────────────────────────────────────────────────\n copyStep(A.carryV1Pictures, {\n title: 'Carry the V1 pictures onto the pipeline',\n summary: 'Each league, landing, venue, and award image is staged and accepted through the upload pipeline, which processes and publishes it. A rehearsal reports every source unavailable.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.copySportLeagues, A.copyLandingPageConfig, A.copyGameLocations, A.copyAwardDefinitions],\n resumeKey: 'By owner kind, then owner id; the resume key is `{ownerKind}:{ownerId}`.',\n }),\n verifyStep(A.verifyV1Pictures, {\n title: 'Verify the carried pictures',\n summary: 'Every V1 reference attached with its three sizes, or reported for a reason no re-run changes; nothing still pending. A source in another bucket, or a page it could examine none of, fails it unless the run acknowledges unexamined sources, as a rehearsal does.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.carryV1Pictures],\n resumeKey: 'By owner kind, then owner id; the resume key is `{ownerKind}:{ownerId}`.',\n }),\n\n // ── The ghost names V1 left behind ─────────────────────────────────────────────────────────────\n {\n kind: 'executable',\n id: A.cleanupOrphanGhostPublicUsers,\n callable: migrationActionCallableName(A.cleanupOrphanGhostPublicUsers),\n resultKind: 'write',\n destructive: true,\n paged: true,\n defaultPageSize: 100,\n informational: false,\n idempotency: 'A ghost document is deleted only when nothing references it; a re-run finds nothing further.',\n resumeKey: BY_DOCUMENT_ID,\n recovery: DELETE_RECOVERY,\n title: 'Remove the ghost names nothing references',\n summary: 'Each ghost `publicUsers` document no membership, roster entry, or unvoided stat event names, reported by disposition first. No signed waiver is touched.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyPublicUsers, A.verifyTeamMemberships, A.verifyGameRosterPlayers, A.verifyGameStats],\n orderedAfter: [],\n },\n\n // ── The derived statistics ─────────────────────────────────────────────────────────────────────\n {\n kind: 'productControl',\n id: A.rebuildLeagueStats,\n title: 'Rebuild every league’s stats',\n summary: 'Every team’s season line and per-membership rows, closed leagues included, rebuilt from the copied games.',\n owningStep: 'stat-data-model',\n dependsOn: SOURCE_VERIFICATIONS_FOR_REBUILD,\n orderedAfter: [],\n callable: 'recalculateAllLeagueStats',\n destinations: ['leagueTeams/{teamId}'],\n instructions: 'Run “Rebuild every league” from Stats › Fix stats as a real run, not a dry run, and let it reach the end.',\n evidence: 'statsOperation',\n },\n {\n kind: 'productControl',\n id: A.rebuildLifetimeStats,\n title: 'Rebuild every user’s lifetime stats',\n summary: 'Every account’s lifetime lines rebuilt from the copied games and historical baselines.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildLeagueStats, A.verifyUserProfiles, A.verifyHistoricalStats],\n orderedAfter: [],\n callable: 'recalculateAllUserStats',\n destinations: ['userProfiles/{userId}'],\n instructions: 'Run “Rebuild every user” from Stats › Fix stats as a real run, and let it reach the end.',\n evidence: 'statsOperation',\n },\n {\n kind: 'productControl',\n id: A.rebuildSportHallOfFame,\n title: 'Rebuild the hall of fame',\n summary: 'The hall of fame of every sport that keeps one, rebuilt from the copied games and baselines.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildLifetimeStats],\n orderedAfter: [],\n callable: 'recalculateHallOfFame',\n destinations: ['sportHallOfFame/{sportKey}'],\n instructions: 'Run the hall-of-fame rebuild from Stats › Fix stats once for each sport that keeps a hall of fame, as real runs, and record every run.',\n evidence: 'statsOperation',\n },\n {\n kind: 'productControl',\n id: A.validateStats,\n title: 'Validate the stats',\n summary: 'Check stats over everything; it must report no finding.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildSportHallOfFame],\n orderedAfter: [],\n callable: 'runStatsValidation',\n destinations: ['statsValidationReports/{reportId}'],\n instructions: 'Run “Check stats” over everything from Stats › Fix stats and let it finish.',\n evidence: 'statsValidationReport',\n },\n verifyStep(A.verifyLeaguePlayerStats, {\n title: 'Compare the league player totals with V1',\n summary: 'Lists each player whose V1 league total differs from the sum of their rebuilt rows in that league. It informs the rehearsal and gates nothing.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildLeagueStats],\n informational: true,\n }),\n verifyStep(A.verifySportHallOfFame, {\n title: 'Verify the rebuilt hall of fame',\n summary: 'Every V1 hall of fame of a sport that keeps one has its rebuilt document, which satisfies its schema and holds an entry for every V1 player with a non-zero total.',\n owningStep: 'stat-data-model',\n dependsOn: [A.rebuildSportHallOfFame],\n }),\n\n // ── The cutover ────────────────────────────────────────────────────────────────────────────────\n {\n kind: 'cutoverMarker',\n id: A.recordCutoverLive,\n callable: RECORD_MIGRATION_CUTOVER_CALLABLE,\n title: 'Record the cutover',\n summary: 'From here on the product owns every destination: no copy runs again, and each verification holds what the product edits to its schema only.',\n owningStep: 'migration-console',\n dependsOn: [...COPY_VERIFICATIONS, A.validateStats],\n orderedAfter: [A.verifySportHallOfFame, A.verifySignatureFilesResolvable],\n noReturnBoundary: 'Recording the cutover. It is never undone: every copy refuses a live destination after it.',\n },\n\n // ── Cleanup: each delete gated on the verifications its core asserts ───────────────────────────\n deleteStep(A.deleteV1AdminRoles, {\n title: 'Remove the V1 role maps',\n summary: 'The `isAdmin` and `referees` fields on `landing/admin`; the document goes with its last carried row.',\n owningStep: 'auth',\n dependsOn: [A.verifyAdminList],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1LandingBase, {\n title: 'Delete `landing/base`',\n summary: 'The V1 configuration document, once its three documents and its picture are verified.',\n owningStep: 'q-core',\n dependsOn: [A.verifyAppConfig, A.verifyLandingPageConfig, A.verifyStatsBeacon, A.verifyV1Pictures],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1Waivers, {\n title: 'Delete the V1 waiver templates',\n summary: 'The `waivers` collection.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyWaiverTemplates],\n }),\n deleteStep(A.deleteV1GameLocations, {\n title: 'Remove the V1 venues',\n summary: 'The `locations` field on `landing/admin`; the document goes with its last carried row.',\n owningStep: 'q-core',\n dependsOn: [A.verifyGameLocations, A.verifyV1Pictures],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1AwardCatalog, {\n title: 'Remove the V1 award catalog',\n summary: 'The `awards` field on `landing/admin`; the document goes with its last carried row.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifyAwardDefinitions, A.verifyUserProfiles, A.verifyPublicUsers, A.verifyV1Pictures],\n resumeKey: SINGLE_DOCUMENT,\n }),\n deleteStep(A.deleteV1Users, {\n title: 'Delete the V1 user documents',\n summary: 'Each `users` document with its historical baselines.',\n owningStep: 'auth',\n dependsOn: [A.verifyUserProfiles, A.verifyHistoricalStats, A.verifyReservedDisplayNames],\n }),\n deleteStep(A.deleteV1TeamInvites, {\n title: 'Delete the V1 invitations',\n summary: 'The `teamInvites` collection.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyTeamInvitations],\n }),\n deleteStep(A.deleteV1JoinRequests, {\n title: 'Delete the V1 join requests',\n summary: 'The `joinRequests` collection.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyTeamJoinRequests],\n }),\n deleteStep(A.deleteV1FreeAgentSignups, {\n title: 'Delete the V1 free-agent signups',\n summary: 'The `freeAgentSignups` collection, left-behind signups included.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyLeagueFreeAgents],\n }),\n deleteStep(A.deleteV1TeamMembers, {\n title: 'Delete the V1 memberships',\n summary: 'The `teamMembers` collection.',\n owningStep: 'q-core',\n dependsOn: [A.verifyTeamMemberships],\n }),\n deleteStep(A.deleteV1Teams, {\n title: 'Delete the V1 teams',\n summary: 'The `teams` collection; a team still holding a subcollection is reported and kept.',\n owningStep: 'q-core',\n dependsOn: [A.verifyLeagueTeams],\n }),\n {\n kind: 'executable',\n id: A.revokeV1SignatureDownloadTokens,\n callable: migrationActionCallableName(A.revokeV1SignatureDownloadTokens),\n resultKind: 'write',\n destructive: true,\n paged: true,\n defaultPageSize: 100,\n informational: false,\n idempotency: 'Removes a kept file’s download token; a file holding none is skipped. No file is moved or deleted.',\n resumeKey: 'The signed waivers by id, then the contracts; the resume key is the record path.',\n recovery: 'Run it again; a file whose token went is skipped.',\n title: 'Revoke the V1 signature download links',\n summary: 'Each kept signature file loses the download token V1’s stored links carry, so those links stop resolving.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifySignedWaivers, A.verifyHardwareLoanContracts, A.verifySignatureFilesResolvable],\n orderedAfter: [],\n },\n deleteStep(A.deleteV1WaiverSignatures, {\n title: 'Delete the V1 signed-waiver records',\n summary: 'The `waiverSignatures` records; the files stay, named by the copied records.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifySignedWaivers],\n }),\n deleteStep(A.deleteV1HardwareContracts, {\n title: 'Delete the V1 hardware contracts',\n summary: 'Both V1 contract collections; the signature files stay, named by the copied contracts.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyHardwareLoanContracts],\n resumeKey: 'The V1 collections in turn, each by document id; the resume key is `{collection}/{id}`.',\n }),\n deleteStep(A.deleteV1GameRosters, {\n title: 'Delete the V1 game rosters',\n summary: 'Each V1 game’s `roster` subcollection — never the game document.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyGameRosterPlayers, A.validateStats],\n resumeKey: 'The V1 games by document id; the resume key is the last game id.',\n defaultPageSize: 50,\n }),\n deleteStep(A.deleteV1LeagueGames, {\n title: 'Delete the V1 games',\n summary: 'The `leagueGames` documents; a game still holding its roster is reported and kept.',\n owningStep: 'stat-data-model',\n dependsOn: [A.verifySportGames, A.verifyGameStats, A.verifyGameRosterPlayers, A.validateStats, A.deleteV1GameRosters],\n }),\n deleteStep(A.deleteV1LeagueChats, {\n title: 'Delete the V1 league chats',\n summary: 'The parked chat documents under each V1 league and its team paths. Any other document found under a league is reported and kept.',\n owningStep: 'migration-console',\n dependsOn: [A.checkpointV1FirestoreExport],\n resumeKey: 'The V1 leagues by document id; the resume key is the last league id, or `{leagueId}/unfinished` while a league holds more chats than one page deletes.',\n defaultPageSize: 50,\n }),\n deleteStep(A.deleteV1Leagues, {\n title: 'Delete the V1 leagues',\n summary: 'The `leagues` collection; a league still holding a subcollection is reported and kept.',\n owningStep: 'q-core',\n dependsOn: [A.verifySportLeagues, A.verifyV1Pictures],\n orderedAfter: [A.verifyLeaguePlayerStats, A.deleteV1LeagueChats],\n }),\n deleteStep(A.deleteV1HallOfFame, {\n title: 'Delete the V1 hall of fame',\n summary: 'The `hallOfFame` collection, once every sport that keeps a hall of fame has its rebuilt document.',\n owningStep: 'stat-data-model',\n dependsOn: [A.verifySportHallOfFame],\n }),\n deleteStep(A.deleteV1ValidationReports, {\n title: 'Delete the V1 validation reports',\n summary: 'The `validationReports` collection. Nothing is copied: each report describes V1 aggregates at a past moment.',\n owningStep: 'stat-data-model',\n dependsOn: [A.checkpointV1FirestoreExport],\n orderedAfter: [A.validateStats],\n }),\n deleteStep(A.deleteV1AdminStats, {\n title: 'Delete the V1 dashboard counts',\n summary: 'The `adminStats` collection. Nothing is copied: the dashboard counts are counted live.',\n owningStep: 'q-core',\n dependsOn: [A.checkpointV1FirestoreExport],\n }),\n verifyStep(A.verifyV1CommerceDiscardable, {\n title: 'Check the V1 store holds no purchase',\n summary: 'Fails on an order that is not cancelled, a completed checkout, or a product holding inventory — any would be a real purchase, and goes to the owner.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.checkpointV1FirestoreExport],\n resumeKey: 'The six store collections in turn, each by document id.',\n }),\n deleteStep(A.deleteV1Commerce, {\n title: 'Delete the V1 store and payments',\n summary: 'The six store collections, nothing copied.',\n owningStep: 'high-risk-callables',\n dependsOn: [A.verifyV1CommerceDiscardable],\n resumeKey: 'The six store collections in turn, each by document id.',\n }),\n\n // ── After the cutover ──────────────────────────────────────────────────────────────────────────\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointUnattachedPicturesReuploaded,\n title: 'Re-upload the pictures the carry could not attach',\n summary: 'Any V1 image still unattached in production goes back on through its own control.',\n owningStep: 'uploads-and-media',\n dependsOn: [A.verifyV1Pictures, A.recordCutoverLive],\n orderedAfter: [],\n instructions:\n 'For each source the picture verification reported, re-upload the image through its control — Reupload badge for an award, the picture managers for a league, the landing page, or a venue. In a rehearsal, record that this is production-only.',\n evidence: 'Each re-uploaded owner, or that the verification reported none.',\n noReturnBoundary: null,\n },\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointPaymentCredentialsRetired,\n title: 'Retire the payment-service credentials',\n summary: 'V2 binds no payment-service credential, so once it is live the three V1 binds are live credentials with no reader.',\n owningStep: 'secret-management',\n dependsOn: [A.recordCutoverLive],\n orderedAfter: [],\n instructions:\n 'Production only, once V2 is live there: revoke the payment service’s secret key and disable its webhook endpoint in its dashboard, then destroy the three secrets V1 binds for it — its secret key, its webhook secret, and APP_URL — in Secret Manager in both Firebase projects. In a rehearsal, record that this is production-only.',\n evidence: 'The payment dashboard showing the key revoked and the endpoint disabled, and `gcloud secrets list` in each project showing none of the three.',\n noReturnBoundary: 'The secret key revocation.',\n },\n {\n kind: 'operatorCheckpoint',\n id: A.checkpointServiceAccountKeyRevoked,\n title: 'Revoke the obsolete production service-account key',\n summary: 'No script reads the local production key once the export script runs on the signed-in CLI credentials; revoking it makes every copy of it worthless.',\n owningStep: 'secret-management',\n dependsOn: [A.checkpointV1FirestoreExport],\n orderedAfter: [A.recordCutoverLive],\n instructions:\n 'Run the export script on Application Default Credentials against the production project named explicitly, then revoke the q-sports-prod service-account key in the Google Cloud console and delete serviceAccount.json from the machine. No replacement key is minted. In a rehearsal, record that this is production-only.',\n evidence: 'The export run on ADC, and the console showing the key revoked.',\n noReturnBoundary: 'The key revocation.',\n },\n];\n\n/** Every step by its id. */\nexport const MIGRATION_STEP_BY_ID: ReadonlyMap<MigrationActionId, MigrationStep> = new Map(\n MIGRATION_CUTOVER_MANIFEST.map((step) => [step.id, step]),\n);\n\n/** The steps of one kind, in cutover order. */\nexport function migrationStepsOfKind<K extends MigrationStepKind>(kind: K): Extract<MigrationStep, { kind: K }>[] {\n return MIGRATION_CUTOVER_MANIFEST.filter((step): step is Extract<MigrationStep, { kind: K }> => step.kind === kind);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsCxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAwC,CAAC;AACjF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,OAAO,iCAAiC,CAAC,CAAC;AAG5F,eAAO,MAAM,uCAAuC;;;kBAEzC,CAAC;AACZ,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAExG,eAAO,MAAM,wCAAwC;;;;kBAAoC,CAAC;AAC1F,MAAM,MAAM,kCAAkC,GAAG,2BAA2B,CAAC;AAK7E,eAAO,MAAM,gCAAgC;;kBAA8C,CAAC;AAC5F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAK1F,eAAO,MAAM,iCAAiC;;;;kBAMnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -178,8 +178,9 @@ export const DeleteTeamGhostPlayerInputSchema = z
178
178
  .object({ teamId: teamIdSchema, ghostUserId: ghostUserIdSchema })
179
179
  .strict();
180
180
  // `complete` is false when the call ran out of time part-way: the ghost's games stay held and the
181
- // same call finishes the removal. `publicUserDeleted` is false when something else still names the
182
- // ghost, so its name stays until that reference goes.
181
+ // same call finishes the removal. `finishedGameEntriesRemoved` is the whole removal's count so far,
182
+ // never one call's share, so a later response replaces an earlier one. `publicUserDeleted` is false
183
+ // when something else still names the ghost, so its name stays until that reference goes.
183
184
  export const DeleteTeamGhostPlayerResultSchema = z
184
185
  .object({
185
186
  leagueId: leagueIdSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"teams.js","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,kGAAkG;AAClG,6EAA6E;AAE7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAA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,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;KACtD,MAAM,EAAE,CAAC;AAGZ,8FAA8F;AAC9F,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;KAC1D,MAAM,EAAE,CAAC;AAGZ,sFAAsF;AACtF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAChF,MAAM,EAAE,CAAC;AAGZ,mGAAmG;AACnG,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC;KACrD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;KAClE,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,wCAAwC,GAAG,iCAAiC,CAAC;AAG1F,kGAAkG;AAClG,oGAAoG;AACpG,sDAAsD;AACtD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAG5F,iGAAiG;AACjG,qGAAqG;AACrG,0BAA0B;AAC1B,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,kBAAkB,EAAE,WAAW;CAChC,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for teams and team membership. The acting user is always `request.auth.uid` —\n// never an input field (ARCH-106). The entry, never a field of the payload, decides the authority\n// (BACKEND-004); an admin entry's schema adds only what its authority needs.\n\nimport { z } from 'zod';\nimport {\n leagueJoinWarningActedOnSchema,\n leagueJoinWarningFindingSchema,\n} from '../utils/league-join-warning.js';\nimport { documentIdSegmentSchema, membershipRosterSyncStatusSchema } from '../doc-schemas/atoms.js';\nimport { buildGhostUserIdForRequest, isGhostUserId } from '../ids/minted-ids.js';\nimport { isDocumentIdSegment } from '../paths/utils.js';\nimport { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS } from '../types/stats.js';\nimport { MEMBER_ASSIGNABLE_TEAM_ROLES } from '../types/unions.js';\nimport {\n contactPhoneSchema,\n countSchema,\n displayNameSchema,\n gameIdSchema,\n leagueIdSchema,\n teamIconSchema,\n teamIdSchema,\n teamNameSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from './atoms.js';\n\n// ---------------------------------------------------------------------------------------------\n// Team creation — `createLeagueTeam` (the creator becomes captain) and `adminCreateLeagueTeam`\n// (an admin creates the team with a newly minted ghost captain). Both write the team's contact\n// phone; `teamType` is read only in a Competitive/Recreational league, which requires it.\n// ---------------------------------------------------------------------------------------------\n\nconst teamCreationFields = {\n leagueId: leagueIdSchema,\n name: teamNameSchema,\n icon: teamIconSchema,\n teamType: teamTypeSchema.optional(),\n contactPhone: contactPhoneSchema,\n};\n\nexport const CreateLeagueTeamInputSchema = z.object(teamCreationFields).strict();\nexport type CreateLeagueTeamInput = z.infer<typeof CreateLeagueTeamInputSchema>;\n\nexport const AdminCreateLeagueTeamInputSchema = z\n .object({ ...teamCreationFields, captainDisplayName: displayNameSchema })\n .strict();\nexport type AdminCreateLeagueTeamInput = z.infer<typeof AdminCreateLeagueTeamInputSchema>;\n\nexport const CreateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type CreateLeagueTeamResult = z.infer<typeof CreateLeagueTeamResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Ghost add — one core behind two doors. The team page door (`createTeamGhostPlayer` /\n// `adminCreateTeamGhostPlayer`) needs authority over the team; the game page door\n// (`createGameGhostPlayer` / `adminCreateGameGhostPlayer`) needs scoring authority over the game\n// and adds to one of its two teams. The ghost id is derived by the server from the add's\n// `requestId`, which the client mints once when the add starts and re-sends on every retry, so a\n// retry after an unknown outcome is recognised as the same add (`buildGhostUserIdForRequest`).\n// ---------------------------------------------------------------------------------------------\n\n// One document-id segment (ARCH-106), short enough that the ghost id derived from it is one too.\nexport const ghostCreateRequestIdSchema = documentIdSegmentSchema.refine(\n (requestId) => isDocumentIdSegment(buildGhostUserIdForRequest(requestId)),\n 'Not a ghost add request id.',\n);\n\nexport const CreateTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, displayName: displayNameSchema, requestId: ghostCreateRequestIdSchema })\n .strict();\nexport type CreateTeamGhostPlayerInput = z.infer<typeof CreateTeamGhostPlayerInputSchema>;\n\nexport const CreateGameGhostPlayerInputSchema = z\n .object({\n gameId: gameIdSchema,\n teamId: teamIdSchema,\n displayName: displayNameSchema,\n requestId: ghostCreateRequestIdSchema,\n })\n .strict();\nexport type CreateGameGhostPlayerInput = z.infer<typeof CreateGameGhostPlayerInputSchema>;\n\n// `rosterSyncStatus` is where the new membership's roster work stood when the call returned: the\n// membership is committed either way, and `pending` finishes in the background.\nexport const CreateGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type CreateGhostPlayerResult = z.infer<typeof CreateGhostPlayerResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// The join warning — `getLeagueJoinWarning` (the person, or a captain or co-captain of the target\n// team) and `adminGetLeagueJoinWarning` (an admin, about anyone).\n// ---------------------------------------------------------------------------------------------\n\n// `targetTeamId` is the team the door acts for; a free-agent signup and a team being created have\n// none. `actedOn` is the item the door answers, which the warning leaves out.\nexport const GetLeagueJoinWarningInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n targetTeamId: teamIdSchema.optional(),\n actedOn: leagueJoinWarningActedOnSchema.optional(),\n })\n .strict();\nexport type GetLeagueJoinWarningInput = z.infer<typeof GetLeagueJoinWarningInputSchema>;\n\nexport const GetLeagueJoinWarningResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n findings: z.array(leagueJoinWarningFindingSchema),\n })\n .strict();\nexport type GetLeagueJoinWarningResult = z.infer<typeof GetLeagueJoinWarningResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Roster reconciliation recovery — an admin puts a team's failed roster obligations back to work.\n// ---------------------------------------------------------------------------------------------\n\nexport const AdminRetryLeagueTeamRosterSyncInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminRetryLeagueTeamRosterSyncInput = z.infer<typeof AdminRetryLeagueTeamRosterSyncInputSchema>;\n\nexport const AdminRetryLeagueTeamRosterSyncResultSchema = z\n .object({\n teamId: teamIdSchema,\n // Failed obligations put back to pending.\n retried: countSchema,\n // Of those and any already pending, how many the call itself finished.\n reconciled: countSchema,\n // Failed obligations left as they are because they fail their schema, by document id; a\n // damaged document's id is reported as stored, so it is not held to the membership id format.\n damagedTeamMembershipIds: z.array(z.string().min(1)),\n })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncResult = z.infer<typeof AdminRetryLeagueTeamRosterSyncResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Linking a ghost to a real account — `linkGhostPlayerToUser` in a league that is not closed, and\n// `adminLinkClosedLeagueGhostPlayer` in a closed one. Both are admin-only and act on one team. A link\n// takes no reason: the admin chooses the account and confirms, and the link's audit event records\n// who linked which ghost to whom and what moved (BACKEND-212). The ghost and the account are\n// ids the core checks itself, so a ghost id named as the account, or a real id named as the ghost,\n// is refused with a failure record rather than at the parse. Every name the link records is read\n// server-side, never sent.\n// ---------------------------------------------------------------------------------------------\n\nexport const LinkGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n })\n .strict();\nexport type LinkGhostPlayerInput = z.infer<typeof LinkGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the link stays under way, and the same\n// call by the same account continues it. `membershipOutcome` is present once it is complete.\n// `publicUserDeleted` is false when something else still names the ghost.\nexport const LinkGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n complete: z.boolean(),\n gamesMoved: countSchema,\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type LinkGhostPlayerResult = z.infer<typeof LinkGhostPlayerResultSchema>;\n\nexport const AdminLinkClosedLeagueGhostPlayerInputSchema = LinkGhostPlayerInputSchema;\nexport type AdminLinkClosedLeagueGhostPlayerInput = LinkGhostPlayerInput;\nexport const AdminLinkClosedLeagueGhostPlayerResultSchema = LinkGhostPlayerResultSchema;\nexport type AdminLinkClosedLeagueGhostPlayerResult = LinkGhostPlayerResult;\n\n// ---------------------------------------------------------------------------------------------\n// Managing a team's members. A role change and a removal each have a member entry — the team's\n// captain or a co-captain, read from their membership — and an admin entry; changing the captain,\n// renaming the team, changing its type, setting its contact phone, and deleting it are admin-only.\n// Every target is named by id and read server-side; nothing here names who is acting (ARCH-106).\n// ---------------------------------------------------------------------------------------------\n\n/** A ghost id, refused for any other id, so a removal input cannot name a real account. */\nexport const ghostUserIdSchema = userIdSchema.refine(isGhostUserId, 'Not a ghost player.');\n\n// `updateTeamMembershipRole` (the captain) / `adminUpdateTeamMembershipRole`: promote a player to\n// co-captain, or demote a co-captain to player.\nexport const UpdateTeamMembershipRoleInputSchema = z\n .object({ teamId: teamIdSchema, userId: userIdSchema, role: z.enum(MEMBER_ASSIGNABLE_TEAM_ROLES) })\n .strict();\nexport type UpdateTeamMembershipRoleInput = z.infer<typeof UpdateTeamMembershipRoleInputSchema>;\n\n// `changed` is false when the member already held the role: nothing was written or recorded.\nexport const UpdateTeamMembershipRoleResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateTeamMembershipRoleResult = z.infer<typeof UpdateTeamMembershipRoleResultSchema>;\n\n// `deleteTeamMembership` (the captain or a co-captain) / `adminDeleteTeamMembership`: remove a real\n// player from the team. A ghost is removed through its own action, below.\nexport const DeleteTeamMembershipInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema.refine((userId) => !isGhostUserId(userId), 'A ghost player is removed as a ghost player.'),\n })\n .strict();\nexport type DeleteTeamMembershipInput = z.infer<typeof DeleteTeamMembershipInputSchema>;\n\n// `deleted` is false when the person held no membership on the team: nothing was written. The\n// membership is gone either way; `rosterSyncStatus` is where its roster work stood on return.\nexport const DeleteTeamMembershipResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n deleted: z.boolean(),\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type DeleteTeamMembershipResult = z.infer<typeof DeleteTeamMembershipResultSchema>;\n\n// `deleteTeamGhostPlayer` (the captain or a co-captain) / `adminDeleteTeamGhostPlayer`: remove a ghost\n// that has never played, completely. A never-played ghost holds no stat, so its removal is not a\n// repair and takes no reason; its audit event still records who removed what (BACKEND-212).\nexport const DeleteTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, ghostUserId: ghostUserIdSchema })\n .strict();\nexport type DeleteTeamGhostPlayerInput = z.infer<typeof DeleteTeamGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the ghost's games stay held and the\n// same call finishes the removal. `publicUserDeleted` is false when something else still names the\n// ghost, so its name stays until that reference goes.\nexport const DeleteTeamGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n complete: z.boolean(),\n finishedGameEntriesRemoved: countSchema,\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type DeleteTeamGhostPlayerResult = z.infer<typeof DeleteTeamGhostPlayerResultSchema>;\n\n// `adminUpdateLeagueTeamCaptain`: make a member of the team its captain. Every other captain the team\n// holds becomes a player.\nexport const AdminUpdateLeagueTeamCaptainInputSchema = z\n .object({ teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainInput = z.infer<typeof AdminUpdateLeagueTeamCaptainInputSchema>;\n\nexport const AdminUpdateLeagueTeamCaptainResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n captainUserId: userIdSchema,\n demotedUserIds: z.array(userIdSchema),\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainResult = z.infer<typeof AdminUpdateLeagueTeamCaptainResultSchema>;\n\n// `adminUpdateLeagueTeamName`: rename a team. The name lives on the team alone; nothing copies it.\nexport const AdminUpdateLeagueTeamNameInputSchema = z\n .object({ teamId: teamIdSchema, name: teamNameSchema })\n .strict();\nexport type AdminUpdateLeagueTeamNameInput = z.infer<typeof AdminUpdateLeagueTeamNameInputSchema>;\n\n// `adminUpdateLeagueTeamType`: change a team's type in a league that sorts its teams by type.\nexport const AdminUpdateLeagueTeamTypeInputSchema = z\n .object({ teamId: teamIdSchema, teamType: teamTypeSchema })\n .strict();\nexport type AdminUpdateLeagueTeamTypeInput = z.infer<typeof AdminUpdateLeagueTeamTypeInputSchema>;\n\n// The answer to either edit: `changed` is false when the team already held the value.\nexport const AdminUpdateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, changed: z.boolean() })\n .strict();\nexport type AdminUpdateLeagueTeamResult = z.infer<typeof AdminUpdateLeagueTeamResultSchema>;\n\n// `adminUpdateLeagueTeamContact`: set the team's contact phone on its admin-only contact document.\nexport const AdminUpdateLeagueTeamContactInputSchema = z\n .object({ teamId: teamIdSchema, contactPhone: contactPhoneSchema })\n .strict();\nexport type AdminUpdateLeagueTeamContactInput = z.infer<typeof AdminUpdateLeagueTeamContactInputSchema>;\n\nexport const AdminUpdateLeagueTeamContactResultSchema = AdminUpdateLeagueTeamResultSchema;\nexport type AdminUpdateLeagueTeamContactResult = AdminUpdateLeagueTeamResult;\n\n// `adminDeleteLeagueTeam`: delete a team that has never played, with everything that is only its.\n// A never-played team holds no stat, so its deletion is not a repair and takes no reason; its audit\n// event still records who deleted what (BACKEND-212).\nexport const AdminDeleteLeagueTeamInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminDeleteLeagueTeamInput = z.infer<typeof AdminDeleteLeagueTeamInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: what is left stays, the team still\n// stands, and the same call finishes the deletion. `remainingGameCount` is the team's games still to\n// delete when it stopped.\nexport const AdminDeleteLeagueTeamResultSchema = z\n .object({\n teamId: teamIdSchema,\n complete: z.boolean(),\n remainingGameCount: countSchema,\n })\n .strict();\nexport type AdminDeleteLeagueTeamResult = z.infer<typeof AdminDeleteLeagueTeamResultSchema>;\n"]}
1
+ {"version":3,"file":"teams.js","sourceRoot":"","sources":["../../src/schemas/teams.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,kGAAkG;AAClG,6EAA6E;AAE7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,W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C;AAGZ,sFAAsF;AACtF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;KAChF,MAAM,EAAE,CAAC;AAGZ,mGAAmG;AACnG,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC;KACrD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;KAClE,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,wCAAwC,GAAG,iCAAiC,CAAC;AAG1F,kGAAkG;AAClG,oGAAoG;AACpG,sDAAsD;AACtD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAG5F,iGAAiG;AACjG,qGAAqG;AACrG,0BAA0B;AAC1B,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,kBAAkB,EAAE,WAAW;CAChC,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Callable contracts for teams and team membership. The acting user is always `request.auth.uid` —\n// never an input field (ARCH-106). The entry, never a field of the payload, decides the authority\n// (BACKEND-004); an admin entry's schema adds only what its authority needs.\n\nimport { z } from 'zod';\nimport {\n leagueJoinWarningActedOnSchema,\n leagueJoinWarningFindingSchema,\n} from '../utils/league-join-warning.js';\nimport { documentIdSegmentSchema, membershipRosterSyncStatusSchema } from '../doc-schemas/atoms.js';\nimport { buildGhostUserIdForRequest, isGhostUserId } from '../ids/minted-ids.js';\nimport { isDocumentIdSegment } from '../paths/utils.js';\nimport { GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS } from '../types/stats.js';\nimport { MEMBER_ASSIGNABLE_TEAM_ROLES } from '../types/unions.js';\nimport {\n contactPhoneSchema,\n countSchema,\n displayNameSchema,\n gameIdSchema,\n leagueIdSchema,\n teamIconSchema,\n teamIdSchema,\n teamNameSchema,\n teamRoleSchema,\n teamTypeSchema,\n userIdSchema,\n} from './atoms.js';\n\n// ---------------------------------------------------------------------------------------------\n// Team creation — `createLeagueTeam` (the creator becomes captain) and `adminCreateLeagueTeam`\n// (an admin creates the team with a newly minted ghost captain). Both write the team's contact\n// phone; `teamType` is read only in a Competitive/Recreational league, which requires it.\n// ---------------------------------------------------------------------------------------------\n\nconst teamCreationFields = {\n leagueId: leagueIdSchema,\n name: teamNameSchema,\n icon: teamIconSchema,\n teamType: teamTypeSchema.optional(),\n contactPhone: contactPhoneSchema,\n};\n\nexport const CreateLeagueTeamInputSchema = z.object(teamCreationFields).strict();\nexport type CreateLeagueTeamInput = z.infer<typeof CreateLeagueTeamInputSchema>;\n\nexport const AdminCreateLeagueTeamInputSchema = z\n .object({ ...teamCreationFields, captainDisplayName: displayNameSchema })\n .strict();\nexport type AdminCreateLeagueTeamInput = z.infer<typeof AdminCreateLeagueTeamInputSchema>;\n\nexport const CreateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type CreateLeagueTeamResult = z.infer<typeof CreateLeagueTeamResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Ghost add — one core behind two doors. The team page door (`createTeamGhostPlayer` /\n// `adminCreateTeamGhostPlayer`) needs authority over the team; the game page door\n// (`createGameGhostPlayer` / `adminCreateGameGhostPlayer`) needs scoring authority over the game\n// and adds to one of its two teams. The ghost id is derived by the server from the add's\n// `requestId`, which the client mints once when the add starts and re-sends on every retry, so a\n// retry after an unknown outcome is recognised as the same add (`buildGhostUserIdForRequest`).\n// ---------------------------------------------------------------------------------------------\n\n// One document-id segment (ARCH-106), short enough that the ghost id derived from it is one too.\nexport const ghostCreateRequestIdSchema = documentIdSegmentSchema.refine(\n (requestId) => isDocumentIdSegment(buildGhostUserIdForRequest(requestId)),\n 'Not a ghost add request id.',\n);\n\nexport const CreateTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, displayName: displayNameSchema, requestId: ghostCreateRequestIdSchema })\n .strict();\nexport type CreateTeamGhostPlayerInput = z.infer<typeof CreateTeamGhostPlayerInputSchema>;\n\nexport const CreateGameGhostPlayerInputSchema = z\n .object({\n gameId: gameIdSchema,\n teamId: teamIdSchema,\n displayName: displayNameSchema,\n requestId: ghostCreateRequestIdSchema,\n })\n .strict();\nexport type CreateGameGhostPlayerInput = z.infer<typeof CreateGameGhostPlayerInputSchema>;\n\n// `rosterSyncStatus` is where the new membership's roster work stood when the call returned: the\n// membership is committed either way, and `pending` finishes in the background.\nexport const CreateGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type CreateGhostPlayerResult = z.infer<typeof CreateGhostPlayerResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// The join warning — `getLeagueJoinWarning` (the person, or a captain or co-captain of the target\n// team) and `adminGetLeagueJoinWarning` (an admin, about anyone).\n// ---------------------------------------------------------------------------------------------\n\n// `targetTeamId` is the team the door acts for; a free-agent signup and a team being created have\n// none. `actedOn` is the item the door answers, which the warning leaves out.\nexport const GetLeagueJoinWarningInputSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n targetTeamId: teamIdSchema.optional(),\n actedOn: leagueJoinWarningActedOnSchema.optional(),\n })\n .strict();\nexport type GetLeagueJoinWarningInput = z.infer<typeof GetLeagueJoinWarningInputSchema>;\n\nexport const GetLeagueJoinWarningResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n findings: z.array(leagueJoinWarningFindingSchema),\n })\n .strict();\nexport type GetLeagueJoinWarningResult = z.infer<typeof GetLeagueJoinWarningResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Roster reconciliation recovery — an admin puts a team's failed roster obligations back to work.\n// ---------------------------------------------------------------------------------------------\n\nexport const AdminRetryLeagueTeamRosterSyncInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminRetryLeagueTeamRosterSyncInput = z.infer<typeof AdminRetryLeagueTeamRosterSyncInputSchema>;\n\nexport const AdminRetryLeagueTeamRosterSyncResultSchema = z\n .object({\n teamId: teamIdSchema,\n // Failed obligations put back to pending.\n retried: countSchema,\n // Of those and any already pending, how many the call itself finished.\n reconciled: countSchema,\n // Failed obligations left as they are because they fail their schema, by document id; a\n // damaged document's id is reported as stored, so it is not held to the membership id format.\n damagedTeamMembershipIds: z.array(z.string().min(1)),\n })\n .strict();\nexport type AdminRetryLeagueTeamRosterSyncResult = z.infer<typeof AdminRetryLeagueTeamRosterSyncResultSchema>;\n\n// ---------------------------------------------------------------------------------------------\n// Linking a ghost to a real account — `linkGhostPlayerToUser` in a league that is not closed, and\n// `adminLinkClosedLeagueGhostPlayer` in a closed one. Both are admin-only and act on one team. A link\n// takes no reason: the admin chooses the account and confirms, and the link's audit event records\n// who linked which ghost to whom and what moved (BACKEND-212). The ghost and the account are\n// ids the core checks itself, so a ghost id named as the account, or a real id named as the ghost,\n// is refused with a failure record rather than at the parse. Every name the link records is read\n// server-side, never sent.\n// ---------------------------------------------------------------------------------------------\n\nexport const LinkGhostPlayerInputSchema = z\n .object({\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n })\n .strict();\nexport type LinkGhostPlayerInput = z.infer<typeof LinkGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the link stays under way, and the same\n// call by the same account continues it. `membershipOutcome` is present once it is complete.\n// `publicUserDeleted` is false when something else still names the ghost.\nexport const LinkGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n userId: userIdSchema,\n complete: z.boolean(),\n gamesMoved: countSchema,\n membershipOutcome: z.enum(GHOST_LINK_MEMBERSHIP_OUTCOME_KEYS).optional(),\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type LinkGhostPlayerResult = z.infer<typeof LinkGhostPlayerResultSchema>;\n\nexport const AdminLinkClosedLeagueGhostPlayerInputSchema = LinkGhostPlayerInputSchema;\nexport type AdminLinkClosedLeagueGhostPlayerInput = LinkGhostPlayerInput;\nexport const AdminLinkClosedLeagueGhostPlayerResultSchema = LinkGhostPlayerResultSchema;\nexport type AdminLinkClosedLeagueGhostPlayerResult = LinkGhostPlayerResult;\n\n// ---------------------------------------------------------------------------------------------\n// Managing a team's members. A role change and a removal each have a member entry — the team's\n// captain or a co-captain, read from their membership — and an admin entry; changing the captain,\n// renaming the team, changing its type, setting its contact phone, and deleting it are admin-only.\n// Every target is named by id and read server-side; nothing here names who is acting (ARCH-106).\n// ---------------------------------------------------------------------------------------------\n\n/** A ghost id, refused for any other id, so a removal input cannot name a real account. */\nexport const ghostUserIdSchema = userIdSchema.refine(isGhostUserId, 'Not a ghost player.');\n\n// `updateTeamMembershipRole` (the captain) / `adminUpdateTeamMembershipRole`: promote a player to\n// co-captain, or demote a co-captain to player.\nexport const UpdateTeamMembershipRoleInputSchema = z\n .object({ teamId: teamIdSchema, userId: userIdSchema, role: z.enum(MEMBER_ASSIGNABLE_TEAM_ROLES) })\n .strict();\nexport type UpdateTeamMembershipRoleInput = z.infer<typeof UpdateTeamMembershipRoleInputSchema>;\n\n// `changed` is false when the member already held the role: nothing was written or recorded.\nexport const UpdateTeamMembershipRoleResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n role: teamRoleSchema,\n changed: z.boolean(),\n })\n .strict();\nexport type UpdateTeamMembershipRoleResult = z.infer<typeof UpdateTeamMembershipRoleResultSchema>;\n\n// `deleteTeamMembership` (the captain or a co-captain) / `adminDeleteTeamMembership`: remove a real\n// player from the team. A ghost is removed through its own action, below.\nexport const DeleteTeamMembershipInputSchema = z\n .object({\n teamId: teamIdSchema,\n userId: userIdSchema.refine((userId) => !isGhostUserId(userId), 'A ghost player is removed as a ghost player.'),\n })\n .strict();\nexport type DeleteTeamMembershipInput = z.infer<typeof DeleteTeamMembershipInputSchema>;\n\n// `deleted` is false when the person held no membership on the team: nothing was written. The\n// membership is gone either way; `rosterSyncStatus` is where its roster work stood on return.\nexport const DeleteTeamMembershipResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n userId: userIdSchema,\n deleted: z.boolean(),\n rosterSyncStatus: membershipRosterSyncStatusSchema,\n })\n .strict();\nexport type DeleteTeamMembershipResult = z.infer<typeof DeleteTeamMembershipResultSchema>;\n\n// `deleteTeamGhostPlayer` (the captain or a co-captain) / `adminDeleteTeamGhostPlayer`: remove a ghost\n// that has never played, completely. A never-played ghost holds no stat, so its removal is not a\n// repair and takes no reason; its audit event still records who removed what (BACKEND-212).\nexport const DeleteTeamGhostPlayerInputSchema = z\n .object({ teamId: teamIdSchema, ghostUserId: ghostUserIdSchema })\n .strict();\nexport type DeleteTeamGhostPlayerInput = z.infer<typeof DeleteTeamGhostPlayerInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: the ghost's games stay held and the\n// same call finishes the removal. `finishedGameEntriesRemoved` is the whole removal's count so far,\n// never one call's share, so a later response replaces an earlier one. `publicUserDeleted` is false\n// when something else still names the ghost, so its name stays until that reference goes.\nexport const DeleteTeamGhostPlayerResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n ghostUserId: userIdSchema,\n complete: z.boolean(),\n finishedGameEntriesRemoved: countSchema,\n publicUserDeleted: z.boolean(),\n })\n .strict();\nexport type DeleteTeamGhostPlayerResult = z.infer<typeof DeleteTeamGhostPlayerResultSchema>;\n\n// `adminUpdateLeagueTeamCaptain`: make a member of the team its captain. Every other captain the team\n// holds becomes a player.\nexport const AdminUpdateLeagueTeamCaptainInputSchema = z\n .object({ teamId: teamIdSchema, captainUserId: userIdSchema })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainInput = z.infer<typeof AdminUpdateLeagueTeamCaptainInputSchema>;\n\nexport const AdminUpdateLeagueTeamCaptainResultSchema = z\n .object({\n leagueId: leagueIdSchema,\n teamId: teamIdSchema,\n captainUserId: userIdSchema,\n demotedUserIds: z.array(userIdSchema),\n changed: z.boolean(),\n })\n .strict();\nexport type AdminUpdateLeagueTeamCaptainResult = z.infer<typeof AdminUpdateLeagueTeamCaptainResultSchema>;\n\n// `adminUpdateLeagueTeamName`: rename a team. The name lives on the team alone; nothing copies it.\nexport const AdminUpdateLeagueTeamNameInputSchema = z\n .object({ teamId: teamIdSchema, name: teamNameSchema })\n .strict();\nexport type AdminUpdateLeagueTeamNameInput = z.infer<typeof AdminUpdateLeagueTeamNameInputSchema>;\n\n// `adminUpdateLeagueTeamType`: change a team's type in a league that sorts its teams by type.\nexport const AdminUpdateLeagueTeamTypeInputSchema = z\n .object({ teamId: teamIdSchema, teamType: teamTypeSchema })\n .strict();\nexport type AdminUpdateLeagueTeamTypeInput = z.infer<typeof AdminUpdateLeagueTeamTypeInputSchema>;\n\n// The answer to either edit: `changed` is false when the team already held the value.\nexport const AdminUpdateLeagueTeamResultSchema = z\n .object({ leagueId: leagueIdSchema, teamId: teamIdSchema, changed: z.boolean() })\n .strict();\nexport type AdminUpdateLeagueTeamResult = z.infer<typeof AdminUpdateLeagueTeamResultSchema>;\n\n// `adminUpdateLeagueTeamContact`: set the team's contact phone on its admin-only contact document.\nexport const AdminUpdateLeagueTeamContactInputSchema = z\n .object({ teamId: teamIdSchema, contactPhone: contactPhoneSchema })\n .strict();\nexport type AdminUpdateLeagueTeamContactInput = z.infer<typeof AdminUpdateLeagueTeamContactInputSchema>;\n\nexport const AdminUpdateLeagueTeamContactResultSchema = AdminUpdateLeagueTeamResultSchema;\nexport type AdminUpdateLeagueTeamContactResult = AdminUpdateLeagueTeamResult;\n\n// `adminDeleteLeagueTeam`: delete a team that has never played, with everything that is only its.\n// A never-played team holds no stat, so its deletion is not a repair and takes no reason; its audit\n// event still records who deleted what (BACKEND-212).\nexport const AdminDeleteLeagueTeamInputSchema = z.object({ teamId: teamIdSchema }).strict();\nexport type AdminDeleteLeagueTeamInput = z.infer<typeof AdminDeleteLeagueTeamInputSchema>;\n\n// `complete` is false when the call ran out of time part-way: what is left stays, the team still\n// stands, and the same call finishes the deletion. `remainingGameCount` is the team's games still to\n// delete when it stopped.\nexport const AdminDeleteLeagueTeamResultSchema = z\n .object({\n teamId: teamIdSchema,\n complete: z.boolean(),\n remainingGameCount: countSchema,\n })\n .strict();\nexport type AdminDeleteLeagueTeamResult = z.infer<typeof AdminDeleteLeagueTeamResultSchema>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/q-core",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Core types, Firestore path constants, zod schemas, and shared constants for Q-Sports",
5
5
  "repository": {
6
6
  "type": "git",