[INSTAB-01] Instability safeguards: automated rollback, feature flags, and change volume limits
Labels: devops, security, p1-critical, effort-medium
Assignee: 🤖 Copilot
Phase: Phase 4 — Quality Flywheel
DORA 2025 Source: “AI adoption is now linked to higher software delivery throughput AND increases instability” finding; “Control systems must speed up” guidance
Effort: Medium (1–3 days)
Prerequisites: DEVOPS-01 (CI), SEC-03 (Firestore rules), OBS-01 (Sentry)
The Critical 2025 DORA Finding This Addresses
“AI adoption is linked to higher software delivery throughput. However, the ongoing challenge remains of ensuring software works as intended before it’s delivered to users. AI increases instability… Without robust control systems — strong automated testing, mature version control practices, and fast feedback loops — an increase in change volume leads to instability.”
The Faros AI telemetry data (independent of DORA, 2025) quantified this precisely: AI consistently increases PR size by 154%. Larger PRs = more surface area for bugs = higher change failure rate. The control system must be proportionally stronger.
This issue installs three safeguards:
- Automated OTA rollback capability — when a deploy causes a Sentry spike, revert is one command
- Change volume monitoring — alerts when PRs are abnormally large (already partially in PROCESS-01, this extends it)
- Feature flag infrastructure — allows new features to be deployed but toggled off if they cause instability
Acceptance Criteria
1. OTA Rollback Runbook and Automation
2. PR Size Alert Enhancement (extend PROCESS-01)
3. Feature Flag Infrastructure
- Go to Firebase Console → Firestore →
config/featureFlags
- Set the problematic flag to
false
- OTA update not required — change takes effect on next app foreground
4. Fast Feedback Loop Verification
Files to Create / Change
src/config/featureFlags.ts (create)
src/hooks/useFeatureFlags.ts (create — reads from Firestore or defaults)
docs/RUNBOOKS.md — add Emergency Rollback and Remote Feature Disable
docs/METRICS.md — add CI pipeline time target
.github/workflows/ci-quality.yml — update PR size check to block (not warn) on > 600 lines
[INSTAB-01] Instability safeguards: automated rollback, feature flags, and change volume limits
Labels:
devops,security,p1-critical,effort-mediumAssignee: 🤖 Copilot
Phase: Phase 4 — Quality Flywheel
DORA 2025 Source: “AI adoption is now linked to higher software delivery throughput AND increases instability” finding; “Control systems must speed up” guidance
Effort: Medium (1–3 days)
Prerequisites: DEVOPS-01 (CI), SEC-03 (Firestore rules), OBS-01 (Sentry)
The Critical 2025 DORA Finding This Addresses
The Faros AI telemetry data (independent of DORA, 2025) quantified this precisely: AI consistently increases PR size by 154%. Larger PRs = more surface area for bugs = higher change failure rate. The control system must be proportionally stronger.
This issue installs three safeguards:
Acceptance Criteria
1. OTA Rollback Runbook and Automation
docs/RUNBOOKS.mdupdated with “Emergency OTA Rollback” procedure:Rollback command tested in staging environment and documented as working
OTA update channel strategy documented:
development,staging,production(aligns with DEVOPS-02)Sentry alert (from METRICS-02) triggers a GitHub issue automatically when change failure is detected
2. PR Size Alert Enhancement (extend PROCESS-01)
large-pr-approvedlarge-pr-approvedlabel added to GitHub labels — must be applied by a human reviewer, never by Copilot3. Feature Flag Infrastructure
A lightweight feature flag system implemented using
src/config/featureFlags.ts:enabled: booleanconfig/featureFlags(allows remote toggle without OTA)truein development, controlled in staging/productionNew features from Phase 3 onward are gated behind a feature flag initially
Flag schema:
docs/RUNBOOKS.mdupdated with “Disable a feature remotely” procedure:config/featureFlagsfalse4. Fast Feedback Loop Verification
docs/METRICS.mdFiles to Create / Change
src/config/featureFlags.ts(create)src/hooks/useFeatureFlags.ts(create — reads from Firestore or defaults)docs/RUNBOOKS.md— add Emergency Rollback and Remote Feature Disabledocs/METRICS.md— add CI pipeline time target.github/workflows/ci-quality.yml— update PR size check to block (not warn) on > 600 lines