Public Health Emergency App Store Phased Rollout and Telemetry Script
Generates a Node.js release management script to automate staged app store rollouts and halt deployment on error budget breaches.
Use this template when releasing time-sensitive public health updates across Apple App Store and Google Play. It provides an automated orchestration script that increases rollout percentages while monitoring error thresholds.
Role: Lead Mobile Infrastructure Architect for Public Health Systems.
Context
- Health Agency Name: {{health_agency_name}}
- Release Version: {{release_version}}
- Maximum Acceptable Error Rate: {{error_budget_threshold}}
- Alerting Webhook URL: {{monitoring_webhook_endpoint}}
- Phased Rollout Schedule: {{phased_rollout_stages}}
- API Secret Reference: {{api_auth_token_secret}}
Task
Generate an automated Node.js rollout controller script that orchestrates staged releases across App Store Connect and Google Play Developer APIs for {{health_agency_name}}, continuously checking telemetry and triggering an automated release halt if crash metrics exceed {{error_budget_threshold}}.
Method
- Establish secure API clients for App Store Connect API and Google Play Publishing API using credentials referenced by {{api_auth_token_secret}}.
- Ingest the release target {{release_version}} and verify current publication status in both developer consoles.
- Parse the rollout intervals defined in {{phased_rollout_stages}} (e.g., 1%, 5%, 20%, 50%, 100%).
- Implement an active monitoring loop that queries crash rate and ANR metrics between deployment tiers.
- Compare observed telemetry against {{error_budget_threshold}} after each observation window.
- Script an emergency brake routine that immediately pauses the rollout and sets release status to HALTED upon budget breach.
- Dispatch real-time incident notifications to {{monitoring_webhook_endpoint}} detailing rollout progress or halt triggers.
- Log all API interactions with timestamps for formal agency audit records.
Constraints
- MUST produce a clean, modern Node.js script using async/await with robust error boundaries.
- MUST NOT allow rollouts to progress to the next stage if telemetry endpoints fail to respond.
- Halting mechanisms MUST execute on both platforms simultaneously if a failure condition is met.
- Rollout intervals must include configurable back-off and evaluation pauses.
Output format
- Prerequisites and Package Dependencies
- Complete Node.js Rollout Script (
rollout_manager.js) - Environment Configuration File Template (
.env.example) - Execution and Manual Override Runbook
Self-review
- Ensure the circuit breaker logic correctly references {{error_budget_threshold}}.
- Validate that {{phased_rollout_stages}} is parsed cleanly without assuming hardcoded stage counts.
- Verify that failure alerts format rich JSON payloads for {{monitoring_webhook_endpoint}}.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.