1'use strict';23// Work that remains on a new destination after the backend import, folded4// into `execution/completion-report.json.operatorActions` (projected to the post-execution5// handoff). Pre-import recovery lives in orchestration/user-actions/ and is not repeated here.6// The notification item is produced by setup and reused, never duplicated.7const fs = require('node:fs/promises');8const path = require('node:path');9const { readReceipt } = require
26const HEADLESS_READBACK_PROMPT = 'Requires Import Operator. In the original migration workspace, restore Wix CLI access to site {site}, then run `node skills/wix-replatform/scripts/wix-destination.js ensure --project-dir <migration project directory>` to repeat the published-URLs readback. Do not create a new site, and do not publish it without the cutover decision.';
27
28// A Headless site is created unpublished; publishing it is a cutover step. The item
29// stays until a readback records `published` or a website release is recorded.
44 resolutionEvidence: 'A `published` readback in orchestration/destination.json, or a released website/completion.json.',
45 };
46 if (publication.state === 'unpublished') {
47 return [{
48 ...base,
49 role: 'cutover-operator',
50 action: `Cutover Operator: Headless site ${site} is not published (verified unpublished at ${publication.checkedAt}) — customers have no public website yet. After the website and public-site checks pass, publish it from Business Manager (or \`npm run release\` in frontend/, which requires the Import Operator), then rerun the destination step to record a published readback. RePlatform never publishes it.`,
51 }];
52 }
53 // A receipt written before the Headless readback existed has no readback at all.
59 action: `Import Operator: the publication state of Headless site ${site} could not be read${reason} — an unresolved check, not "unpublished". Restore access and repeat the readback; then the Cutover Operator publishes the site at cutover if it is still unpublished.`,
60 }];
61}
62
63// The destination step installs the Developer Tools app (Secrets Manager) once when it verifies a new
64// Harmony or Studio site. A failed install does not fail the destination, so it is reported here. It is
65// independent of the website release: the owner needs the app whenever a stored secret is entered.
79 action: `Site owner: the Developer Tools app is not confirmed installed on the ${editor} site ${site} (${reason}${checked}), so the dashboard may have no Secrets Manager and site code may have no \`secrets\` object. Add "Developer Tools" from the dashboard's app list, then open the Secrets Manager page to confirm. This does not stop the migration, and the destination step does not retry it.`,
80 deadlineReason: 'before a credential must be stored on the site',
103 ? ' The site was created by Harmony generation: its generated pages, AI-generated text and images are placeholders until reviewed or replaced, even when the site looks finished; their existence never resolves this item.'
106 ? `verified unpublished at ${receipt.publication.checkedAt}`
107 : 'publication state not verified as unpublished — an unresolved check, not "unpublished"';
108 return [
109 ...developerTools,
110 {
111 code: 'editor_website_unfinished',
112 severity: 'high',
113 action: `Site owner/designer: the ${editor} website for site ${receipt.metaSiteId} is not built — customers cannot use the migrated website yet.${editorLink} Open the verified editor, complete the pages and required app surfaces for the imported data, then review/publish through the authorized cutover workflow. Resolve with bound website review/release evidence; backend import counts alone do not resolve this.${generated}`,
114 deadlineReason: 'before switching traffic',
115 entity: 'website',
116 affectedCount: 1,
117 },
118 {
119 code: 'editor_publication_outstanding',
120 severity: 'high',
121 action: `Cutover Operator/authorized publisher: site ${receipt.metaSiteId} has no public website until it is released (${publication}). Complete the website and public-site checks, then authorize and publish through the supported workflow. RePlatform never publishes it. Resolve with publication and public-site evidence.`,
122 deadlineReason: 'before switching traffic',
123 entity: 'website',
124 affectedCount: 1,
125 },
126 ];
127}
128
129// Setup installs apps on a Harmony site and cannot read the site's pages, so it records
130// setup/harmony-app-pages.json (`appPages: "not-read"`, the apps and their step ids) instead of claiming
131// the pages exist. That is an item for the site owner whether setup created the site or the operator
132// supplied it, so it does not depend on the destination receipt. The record is its own file because the
133// setup receipt is rewritten on every setup run. Nothing here proves the pages exist, and a released
134// website does not either, so only the site owner's confirmation can close it.
151 action: `Site owner/designer: setup installed these apps on the Wix Harmony site${site}: ${names(apps)}. It cannot read the site's pages, so the pages each app adds are unconfirmed — visitors may find them missing (a site whose app was installed another way, or before this run, may lack them).${editorLink} Open the editor and confirm each app's pages exist, and before any publication open them in the preview. Nothing in the pipeline clears this item: record the confirmation in the cutover checklist.`,
152 deadlineReason: 'before switching traffic',
153 entity: 'website',
154 affectedCount: apps.length,
155 actionId: 'harmony-app-pages:unconfirmed',
156 role: 'site-owner',
157 prerequisites: ['Setup passed for the listed install steps.'],
160 resolutionEvidence: "The site owner's confirmation that each app's pages exist, recorded in the cutover checklist. A released website does not prove it, and nothing in the pipeline clears this item.",
161 });
162 // An app the installer refused because another app already owns its page paths is not on the site at all.
163 if (deferred.length) {
164 actions.push({
165 code: 'harmony_app_install_deferred',
166 severity: 'high',
167 action: `Site owner/designer: setup could not install these apps on the Wix Harmony site${site}: ${names(deferred)}. Wix's editor installer refuses an app whose page paths another installed app already uses, so the app is missing and so are its pages and features.${editorLink} Add each app from the editor's app panel once Wix fixes the conflict, or decide to go without it, and record the decision in the cutover checklist. Nothing in the pipeline clears this item.`,
168 deadlineReason: 'before switching traffic',
169 entity: 'website',
170 affectedCount: deferred.length,
171 actionId: 'harmony-app-install:deferred',
172 role: 'site-owner',
173 prerequisites: ['Setup finished with the listed install steps deferred.'],
176 resolutionEvidence: "The site owner's record that each listed app was added, or consciously left out, in the cutover checklist. A released website does not prove it, and nothing in the pipeline clears this item.",
177 });
178 }
179 return actions;
180}
181
182// The site the project is set up against, from config/wix.env.