// engine/execution-plan/mobile-dist/expo-steps.ts — SPEC-013
// Distribution steps for Expo (EAS) release specs.
function buildEasBuildStep(order) {
    return {
        order,
        title: 'EAS Build — production profile',
        description: 'Build production artifacts via EAS Build:\n' +
            '`eas build --platform all --profile production`\n' +
            'Ensure `eas.json` production profile is configured for `app-store` (iOS) and `app-bundle` (Android).',
        files: ['eas.json', 'app.json', 'app.config.ts'],
        dependsOn: [],
        verification: 'EAS Build dashboard shows both builds as "Finished". Download and inspect artifacts.',
        estimatedMinutes: 20,
        canRollback: false,
    };
}
function buildEasSubmitStep(order) {
    return {
        order,
        title: 'EAS Submit — upload to stores',
        description: 'Submit builds to both stores via EAS Submit:\n' +
            '`eas submit --platform ios` → TestFlight\n' +
            '`eas submit --platform android` → Google Play internal track\n' +
            'Store credentials must be configured in EAS project settings.',
        files: ['eas.json'],
        dependsOn: [],
        verification: 'iOS build visible in TestFlight. Android build visible in Play Console internal track.',
        estimatedMinutes: 15,
        canRollback: false,
    };
}
function buildExpoSmokeTestStep(order) {
    return {
        order,
        title: 'Smoke test on real devices',
        description: 'Install and test critical flows:\n' +
            '- iOS: install from TestFlight on physical iPhone/iPad\n' +
            '- Android: install via Play Console opt-in link on Android device\n' +
            'Verify: app launch, auth, primary feature, OTA update check.',
        files: [],
        dependsOn: [],
        verification: 'App launches without crash on both platforms. Core flows complete. OTA channel responsive.',
        estimatedMinutes: 45,
        canRollback: false,
    };
}
function buildExpoStoreSubmitStep(order) {
    return {
        order,
        title: 'Submit for store review (production)',
        description: 'Promote to production review:\n' +
            '- iOS: in App Store Connect, submit TestFlight build for review\n' +
            '- Android: promote internal track → production in Play Console\n' +
            'Complete metadata: screenshots, privacy manifest, content rating, changelog.',
        files: ['fastlane/metadata/', 'PrivacyInfo.xcprivacy'],
        dependsOn: [],
        verification: 'App Store Connect shows "In Review". Play Console production track update pending.',
        estimatedMinutes: 30,
        canRollback: false,
    };
}
function buildEasOtaUpdateStep(order) {
    return {
        order,
        title: 'EAS Update — OTA update channel',
        description: 'Push JS bundle and assets update for non-native changes:\n' +
            '`eas update --branch production --message "Release vX.Y.Z"`\n' +
            'Verify update is delivered to existing installs without requiring a full store release.',
        files: ['eas.json'],
        dependsOn: [],
        verification: 'EAS Update shows update published. Existing installs receive update on next launch.',
        estimatedMinutes: 10,
        canRollback: true,
    };
}
function buildExpoPhasedRolloutStep(order) {
    return {
        order,
        title: 'Phased rollout',
        description: '- iOS: App Store Connect → Phased Release (7-day automatic rollout)\n' +
            '- Android: Play Console → set rollout to 1% → 10% → 100% over 7 days\n' +
            'Monitor: crash-free sessions, ANR rate, OTA delivery success rate.',
        files: [],
        dependsOn: [],
        verification: 'Phased release active. Crash-free rate > 99.5%. OTA update adoption > 80% within 48h.',
        estimatedMinutes: 15,
        canRollback: true,
    };
}
function buildExpoMonitorStep(order) {
    return {
        order,
        title: 'Post-release monitoring',
        description: 'Monitor 24h post-release:\n' +
            '- EAS insights: crash-free sessions\n' +
            '- Sentry/Crashlytics: error rate\n' +
            '- Android Vitals: ANR < 0.47%, crash < 1.09%\n' +
            'Rollback: halt phased release in stores; revert OTA via `eas update --branch rollback`.',
        files: [],
        dependsOn: [],
        verification: 'No P0 errors. OTA delivered to > 70% of users. Store vitals within acceptable limits.',
        estimatedMinutes: 60,
        canRollback: true,
    };
}
export function generateExpoDistributionPhase(startOrder) {
    let order = startOrder;
    return [
        buildEasBuildStep(order++),
        buildEasSubmitStep(order++),
        buildExpoSmokeTestStep(order++),
        buildExpoStoreSubmitStep(order++),
        buildEasOtaUpdateStep(order++),
        buildExpoPhasedRolloutStep(order++),
        buildExpoMonitorStep(order),
    ];
}
//# sourceMappingURL=expo-steps.js.map