<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prikshit</title>
    <description>The latest articles on DEV Community by Prikshit (@prikshit).</description>
    <link>https://dev.to/prikshit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4248247%2F6f30bf1a-0f2c-4cd4-8862-e6b6506c6914.jpg</url>
      <title>DEV Community: Prikshit</title>
      <link>https://dev.to/prikshit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prikshit"/>
    <language>en</language>
    <item>
      <title>Claude Code Can Write the Feature. Can Your Team Maintain It?</title>
      <dc:creator>Prikshit</dc:creator>
      <pubDate>Mon, 16 Nov 2026 19:40:17 +0000</pubDate>
      <link>https://dev.to/prikshit/claude-code-can-write-the-feature-can-your-team-maintain-it-384k</link>
      <guid>https://dev.to/prikshit/claude-code-can-write-the-feature-can-your-team-maintain-it-384k</guid>
      <description>&lt;p&gt;&lt;em&gt;A practical way to judge AI-written code beyond a green build.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An AI coding agent can give you a working feature and a maintenance problem in the same commit. Both can pass the build.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine asking Claude Code to add bookmarks to an Android app. Users should be able to save an item, remove it, and find it again after closing the app.&lt;/p&gt;

&lt;p&gt;The agent produces a screen, a ViewModel, a repository, and some tests. The app opens, the save button works, and the tests turn green.&lt;/p&gt;

&lt;p&gt;Looks done.&lt;/p&gt;

&lt;p&gt;Then you notice the app already had a repository for that data. The agent has created another one, with slightly different rules.&lt;/p&gt;

&lt;p&gt;Or you close the app, reopen it, and discover that your bookmarks have vanished.&lt;/p&gt;

&lt;p&gt;These are imagined examples, but they expose the question I care about as a mobile engineer: can an AI agent add a feature without making the next feature harder to build?&lt;/p&gt;

&lt;p&gt;Generating code is only part of that job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftezd35ud6p83b1pltzr6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftezd35ud6p83b1pltzr6.png" alt="A hand places a teal puzzle-piece module into a dashed slot on a software blueprint. A magnifying glass highlights a module with gears, and other blocks show layers, a database, a cloud and a cube. A small sequence in the corner goes from a cube to stacked layers to a puzzle piece." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Give the agent a map before asking it to build
&lt;/h2&gt;

&lt;p&gt;A feature request describes what should change. It rarely explains everything that should stay consistent.&lt;/p&gt;

&lt;p&gt;“Add bookmarks” doesn’t tell the agent which existing component owns saved data. It doesn’t explain where business rules belong or how the team handles errors.&lt;/p&gt;

&lt;p&gt;Those details live in the codebase, team decisions, and sometimes one developer’s head.&lt;/p&gt;

&lt;p&gt;A new engineer would need time to learn them. An agent needs access to them too.&lt;/p&gt;

&lt;p&gt;Before making changes, I’d ask it to find the closest existing feature and explain how it works. Where is data stored? How does a change reach the screen? Which parts can be reused?&lt;/p&gt;

&lt;p&gt;That small step gives me something useful to review before a large diff appears.&lt;/p&gt;

&lt;p&gt;I’d also keep a short set of project rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check existing components before creating new ones.&lt;/li&gt;
&lt;li&gt;Keep business logic out of the UI.&lt;/li&gt;
&lt;li&gt;Follow the project’s current state and error-handling patterns.&lt;/li&gt;
&lt;li&gt;Explain any new dependency or change to module boundaries.&lt;/li&gt;
&lt;li&gt;Leave unrelated code alone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The aim isn’t to write a rule for every possible mistake. It’s to make the important decisions visible.&lt;/p&gt;

&lt;p&gt;A reusable Claude Code skill (a saved set of instructions the agent loads when needed) can package that process so it doesn’t have to be explained from scratch for each feature. But the value is in the questions it makes the agent answer, not the length of the instructions.&lt;/p&gt;

&lt;p&gt;A hundred lines of vague advice won’t beat five clear rules tied to the actual app.&lt;/p&gt;

&lt;p&gt;And written rules still need checks. An instruction to reuse existing code doesn’t prove that reuse happened.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv0we3jns2l9fcp43sxey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv0we3jns2l9fcp43sxey.png" alt="Three smartphones in a row. The left phone shows a bookmarks list of landscape photos beside a card with three green ticks. The middle phone is a dark screen circled by a teal restart arrow. The right phone shows an empty tray icon with a warning triangle." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Passing tests can protect the wrong behaviour
&lt;/h2&gt;

&lt;p&gt;Here’s the failure that worries me most.&lt;/p&gt;

&lt;p&gt;An agent decides to store bookmarks in an in-memory list instead of Room or DataStore. It then writes tests that add an item to that collection and check that the item appears.&lt;/p&gt;

&lt;p&gt;The tests pass because the collection works.&lt;/p&gt;

&lt;p&gt;But the user wanted bookmarks that survive an app restart. The tests never asked about that.&lt;/p&gt;

&lt;p&gt;The code and the tests agree. They’re both wrong about the requirement.&lt;/p&gt;

&lt;p&gt;This can happen without AI too. A developer gets attached to an implementation, then tests the choices they made instead of the outcome the user needs.&lt;/p&gt;

&lt;p&gt;The way out is to define important behaviour before writing the feature.&lt;/p&gt;

&lt;p&gt;For bookmarks, I’d start here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Save an item. Terminate the app. Launch it again. The saved item must still appear.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I’d check removal:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remove a saved item. Relaunch the app. The item must remain removed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These checks are plain enough for a product manager to understand. They also make it harder to mistake a working in-memory list for durable storage.&lt;/p&gt;

&lt;p&gt;Different tests answer different questions. A ViewModel test can check what state reaches the UI; it doesn’t, by itself, prove that the real database saves data correctly.&lt;/p&gt;

&lt;p&gt;The evidence has to match the claim.&lt;/p&gt;

&lt;p&gt;A separate reviewer may catch a missing scenario, whether that reviewer is a person or another agent. But adding agents doesn’t automatically solve the problem.&lt;/p&gt;

&lt;p&gt;If every reviewer starts with the same wrong assumption, they may all approve the same mistake.&lt;/p&gt;

&lt;p&gt;Give the reviewer the original requirement and ask what evidence is missing. Agreement alone isn’t evidence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhgsbsibuejw1c4baw23v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhgsbsibuejw1c4baw23v.png" alt="A stopwatch sits at the centre, surrounded by a code file, a document under a magnifying glass, interlocking puzzle pieces with a wrench, and a phone showing a bookmarks list with a green check." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure the work until it’s ready to merge
&lt;/h2&gt;

&lt;p&gt;A feature generated in five minutes sounds impressive. It sounds less impressive if someone spends two hours removing duplicate code and repairing the tests.&lt;/p&gt;

&lt;p&gt;Both periods belong on the clock.&lt;/p&gt;

&lt;p&gt;That’s why I want to compare two workflows using the same small Android feature.&lt;/p&gt;

&lt;p&gt;In one, the agent gets the repository and a normal feature request. In the other, it also gets project guidance, a reusable implementation process, and explicit review checkpoints.&lt;/p&gt;

&lt;p&gt;Both should start from the same commit, use the same model and requirements, and have the same time limit. I’d repeat the runs and keep the failures in the results.&lt;/p&gt;

&lt;p&gt;This is an experiment I want to run, not a benchmark I’ve completed.&lt;/p&gt;

&lt;p&gt;I’d judge each run by five things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Required behaviour:&lt;/strong&gt; Does the feature do what the user asked?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture:&lt;/strong&gt; Does it fit the app’s existing structure?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human corrections:&lt;/strong&gt; How much repair work remains?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total time:&lt;/strong&gt; How long until the feature is reviewed and verified?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; What did the model and tools cost to reach that point?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The structured approach might produce fewer mistakes. It might also add work without enough benefit.&lt;/p&gt;

&lt;p&gt;Either result is worth knowing.&lt;/p&gt;

&lt;p&gt;I’d be especially careful not to compare an unreviewed first draft with a fully checked implementation. They aren’t the same stage of work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F43cd7hmqswngie90irmw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F43cd7hmqswngie90irmw.png" alt="A phone showing a bookmarks list sits beside a checklist card. Saving and removing a bookmark have teal check marks, while persistence after a restart is marked with an empty amber circle. A plant, notebook and magnifying glass sit on the desk." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try this on your next small feature
&lt;/h2&gt;

&lt;p&gt;You don’t need a fleet of agents to start. Pick one contained change and write down three observable behaviours before handing it over.&lt;/p&gt;

&lt;p&gt;Then give the agent this instruction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before editing, inspect the closest existing feature. Explain what you will reuse, what you need to change, and how you will verify each requirement.&lt;/p&gt;

&lt;p&gt;After implementation, report which checks passed, which failed, and which behaviours remain unverified.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read the plan. Review the diff. Check whether the report supports the claim that the feature is done.&lt;/p&gt;

&lt;p&gt;“Unit tests passed; restart behaviour wasn’t checked on a device” is a useful report. It tells you exactly where confidence ends.&lt;/p&gt;

&lt;p&gt;“Everything works” hides that boundary.&lt;/p&gt;

&lt;p&gt;What’s the most convincing-looking mistake an AI coding agent has made in your project? Drop it in the comments, especially if the tests passed.&lt;/p&gt;

&lt;p&gt;I still want AI tools to help me ship faster. But I want to count the time spent understanding, checking, and repairing what they produce.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmy5rvvybc1uj4443miv6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmy5rvvybc1uj4443miv6.png" alt="Two developers across a table hand over a modular board of connected blocks, with a documented diagram in a notebook and a phone showing a bookmarks list standing nearby." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next developer inherits your code, not your demo.&lt;/p&gt;

</description>
      <category>android</category>
      <category>ai</category>
      <category>softwareengineering</category>
      <category>codereview</category>
    </item>
    <item>
      <title>Mobile Apps Can't Roll Back, So Agent-Written Code Needs a Release Gate</title>
      <dc:creator>Prikshit</dc:creator>
      <pubDate>Mon, 16 Nov 2026 17:38:08 +0000</pubDate>
      <link>https://dev.to/prikshit/mobile-apps-cant-roll-back-so-agent-written-code-needs-a-release-gate-4ole</link>
      <guid>https://dev.to/prikshit/mobile-apps-cant-roll-back-so-agent-written-code-needs-a-release-gate-4ole</guid>
      <description>&lt;p&gt;&lt;em&gt;Why staged rollouts are the release gate for agent-written Android and iOS code.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj0nhi6adm2bz35th0i2z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj0nhi6adm2bz35th0i2z.png" alt="Flat illustration of a closed checkpoint barrier on a conveyor path. A short queue of three blank smartphones waits on the near side, a large crowd of identical phones stands beyond the gate, and a small coral warning dot hovers above it." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Every build passes one checkpoint before it reaches everyone.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When you halt a staged rollout in Google Play, no new users get that version. Everyone who already installed it keeps it.&lt;/p&gt;

&lt;p&gt;That line from the Play Console docs is the part the agentic development diagrams skip. They usually draw the loop as intent, spec, plan, code and tests, review, and finally production signals that can trigger new tasks for the agent. Most add that humans stay in charge of critical releases. What they don't show is where that human decision goes when the release is a mobile binary, and for agent-written mobile code, that's where the risk sits. The practices aren't new. What changes is how much code reaches the release branch without anyone having typed it.&lt;/p&gt;

&lt;p&gt;On a web backend, a bad deploy gets reverted, and the loop carries on. On a phone, the build is already installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The store is your deployment step, and it has no undo
&lt;/h2&gt;

&lt;p&gt;Google Play's &lt;a href="https://support.google.com/googleplay/android-developer/answer/6346149" rel="noopener noreferrer"&gt;staged rollout guide&lt;/a&gt; says it plainly. Halting stops the version from reaching more people, and users who received it "will remain on that version." Play's own tip for a bad bundle is to create and roll out a new release with a fixed one. So the only way back is forward, through another build. Re-shipping the previous code under a higher version code is the rollback mobile teams actually have, and it still waits on review and on people installing the update.&lt;/p&gt;

&lt;p&gt;Apple's &lt;a href="https://developer.apple.com/help/app-store-connect/update-your-app/release-a-version-update-in-phases" rel="noopener noreferrer"&gt;phased release&lt;/a&gt; has the same shape with a fixed schedule. Users with automatic updates get it over 7 days, starting at 1% on day one and moving through 2%, 5%, 10%, 20% and 50% before 100% on day seven. You can pause for up to 30 days in total. The catch is in the same doc, which says anyone can download the update manually from the App Store at any time. That 1% only limits automatic updates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1c9a0m67sun1qvrv93x0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1c9a0m67sun1qvrv93x0.png" alt="Bar chart titled App Store phased release takes 7 days. Bars show the share of users with automatic updates who get the new version: day 1 1%, day 2 2%, day 3 5%, day 4 10%, day 5 20%, day 6 50%, day 7 100%. A dashed coral line at the top reads Manual App Store downloads are open to everyone from day 1. Subtitle notes pauses can total up to 30 days." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Apple's phased release schedule, charted from App Store Connect Help.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So when the agentic development loop says production signals feed back into the agent, on mobile that means real people already hit the crash. The signal is useful. It just arrives after the damage, and there's no button that pulls the build back off their phones.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the gate should actually measure
&lt;/h2&gt;

&lt;p&gt;The gate belongs between "review approved" and "100% of users." Its job is to compare the new build with the previous one while the rollout is still small, which is a different job from checking that the app is healthy in general.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Crash-free sessions and users per build.&lt;/strong&gt; Crashlytics calculates &lt;a href="https://firebase.google.com/docs/crashlytics/crash-free-metrics" rel="noopener noreferrer"&gt;crash-free users and crash-free sessions&lt;/a&gt; and lets you filter them by build. If you &lt;a href="https://firebase.google.com/docs/crashlytics/integrate-with-google-play" rel="noopener noreferrer"&gt;link Firebase with Google Play&lt;/a&gt;, you can also filter crash reports by Play track. These metrics only count fatal events, so they won't show an ANR spike.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New crash signatures.&lt;/strong&gt; Crashlytics can &lt;a href="https://firebase.google.com/docs/crashlytics/alerts" rel="noopener noreferrer"&gt;alert on new fatal issues&lt;/a&gt;, meaning crashes or ANRs it hasn't seen before, and on regressed issues you had marked closed. Regressed and trending alerts are on by default. New fatal, ANR and increasing-velocity alerts are not, so turn them on before you need them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-perceived ANR rate per version code.&lt;/strong&gt; The &lt;a href="https://developers.google.com/play/developer/reporting/reference/rest/v1beta1/vitals.anrrate/query" rel="noopener noreferrer"&gt;Play Developer Reporting API&lt;/a&gt; returns &lt;code&gt;userPerceivedAnrRate&lt;/code&gt; sliced by &lt;code&gt;versionCode&lt;/code&gt;, with hourly aggregation in UTC. The &lt;a href="https://developers.google.com/play/developer/reporting/reference/rest/v1beta1/vitals.crashrate" rel="noopener noreferrer"&gt;crash rate metric set&lt;/a&gt; works the same way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The user count behind each rate.&lt;/strong&gt; Both metric sets return &lt;code&gt;distinctUsers&lt;/code&gt;. At 1% rollout, a rate built on a few hundred users can swing wildly, so the gate should refuse to decide until there's enough data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fia09llku6vc0rfxss39f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fia09llku6vc0rfxss39f.png" alt="Flow diagram of a release gate for agent-written mobile code. Agent opens the PR, a human reviews, a small staged rollout starts, and the gate checks crash-free sessions, new fatal issues, ANR rate per version code and user count against the previous build. Bad signals halt automatically. Good signals expand only when a human decides. After a halt, no new users get the build and current users keep it." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The gate sits between a small staged rollout and everyone else.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Android vitals also publishes &lt;a href="https://developer.android.com/topic/performance/vitals" rel="noopener noreferrer"&gt;bad behavior thresholds&lt;/a&gt;. They're 1.09% for user-perceived crash rate and 0.47% for user-perceived ANR rate overall, with 8% for both on any single phone model, and Play judges them on a 28-day average. My opinion is that you shouldn't use these numbers as your gate. They decide store visibility, and by the time a 28-day average crosses 0.47%, the bad build has reached most of your users. Compare against your previous build instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  The halt button has an API
&lt;/h2&gt;

&lt;p&gt;Halting doesn't have to wait for someone to open Play Console. In the &lt;a href="https://developers.google.com/android-publisher/api-ref/rest/v3/edits.tracks" rel="noopener noreferrer"&gt;Play Developer API&lt;/a&gt;, a track release has a &lt;code&gt;status&lt;/code&gt; of &lt;code&gt;inProgress&lt;/code&gt;, &lt;code&gt;halted&lt;/code&gt; or &lt;code&gt;completed&lt;/code&gt;, plus a &lt;code&gt;userFraction&lt;/code&gt; for the staged percentage. The docs describe a halted release as one whose APKs "will no longer be served to users," while users who already have them are unaffected.&lt;/p&gt;

&lt;p&gt;Here's a halt check in Python. It reads the newest hour of vitals data for each version code and halts the release only when the new build looks worse than the previous one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timezone&lt;/span&gt;

&lt;span class="no"&gt;PACKAGE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"com.example.app"&lt;/span&gt;
&lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;PREV&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4210&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4200&lt;/span&gt;   &lt;span class="c1"&gt;# version codes being compared&lt;/span&gt;
&lt;span class="no"&gt;MIN_USERS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;         &lt;span class="c1"&gt;# tune from your own data&lt;/span&gt;
&lt;span class="no"&gt;MAX_RATIO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;          &lt;span class="c1"&gt;# tune from your own release history&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;to_utc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c1"&gt;# google.type.DateTime to datetime&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"year"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"month"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"day"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hours"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;tzinfo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;to_api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c1"&gt;# datetime to google.type.DateTime, hour aligned&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"year"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"month"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"day"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"hours"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hour&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"timeZone"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"UTC"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;latest_hour_anr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reporting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""{versionCode: (userPerceivedAnrRate, distinctUsers)} for the newest hour."""&lt;/span&gt;
    &lt;span class="n"&gt;metric_set&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"apps/{PACKAGE}/anrRateMetricSet"&lt;/span&gt;
    &lt;span class="n"&gt;info&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reporting&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;vitals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;anrrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metric_set&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;to_utc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"latestEndTime"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
               &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"freshnessInfo"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"freshnesses"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
               &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"aggregationPeriod"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"HOURLY"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reporting&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;vitals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;anrrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metric_set&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"timelineSpec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"aggregationPeriod"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"HOURLY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                             &lt;span class="s2"&gt;"startTime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;to_api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hours&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                             &lt;span class="s2"&gt;"endTime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;to_api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"dimensions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"versionCode"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"metrics"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"userPerceivedAnrRate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"distinctUsers"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;stats&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"rows"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"dimensions"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"int64Value"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"metric"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"decimalValue"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
             &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"metrics"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="s2"&gt;"decimalValue"&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"userPerceivedAnrRate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                       &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"distinctUsers"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_fatal_issue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# new_fatal_issue comes from your Crashlytics new fatal issue alert&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;new_fatal_issue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"halt"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;NEW&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="no"&gt;PREV&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;MIN_USERS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"wait"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;PREV&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;MAX_RATIO&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"halt"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"continue"&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;halt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;edit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;edits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;PACKAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"packageName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;PACKAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"editId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"track"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"production"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;track&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;edits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tracks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;halted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;release&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;track&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"releases"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;release&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"versionCodes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;release&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"inProgress"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;release&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"halted"&lt;/span&gt;   &lt;span class="c1"&gt;# userFraction stays as it was&lt;/span&gt;
            &lt;span class="n"&gt;halted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;halted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;edits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;PACKAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;editId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
    &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;edits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tracks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;track&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;edits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;PACKAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;editId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set &lt;code&gt;MAX_RATIO&lt;/code&gt; and &lt;code&gt;MIN_USERS&lt;/code&gt; from your own release history. The check reads a single hour because the API docs warn that adding up &lt;code&gt;distinctUsers&lt;/code&gt; across periods can count users more than once, and it edits the release already on the track instead of replacing the whole track. Also note that the &lt;a href="https://developers.google.com/android-publisher/edits" rel="noopener noreferrer"&gt;edits model&lt;/a&gt; discards an open edit if someone changes the app in Play Console at the same time, so keep one owner for rollout changes.&lt;/p&gt;

&lt;p&gt;The line I draw is the rollout percentage, and plenty of teams will disagree. A coding agent can open the release PR and even run this check. It shouldn't be the thing that raises &lt;code&gt;userFraction&lt;/code&gt;. A script that halts automatically is cheap insurance. A script that expands automatically puts the agent's judgment in front of every user at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap agent-written changes in remote flags
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A halt only protects people who haven't updated yet. For everyone who already has, you need a flag.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpyddnjw6wg212uzc9a8v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpyddnjw6wg212uzc9a8v.png" alt="Flat illustration of a physical toggle switch in the off position on the left, linked by a dotted line to a smartphone on the right whose screen is split into a lit teal panel and a dimmed grey panel marked with a small coral dot." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A remote flag can switch off a code path on phones that already updated.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Firebase Remote Config changes app behavior without a new release, but the &lt;a href="https://firebase.google.com/docs/remote-config/android/get-started" rel="noopener noreferrer"&gt;default minimum fetch interval is 12 hours&lt;/a&gt;. A kill switch that waits for a normal fetch can take hours to reach a phone. &lt;a href="https://firebase.google.com/docs/remote-config/real-time" rel="noopener noreferrer"&gt;Real-time Remote Config&lt;/a&gt; pushes new values to the app as soon as they're published, so it's the version worth using for this.&lt;/p&gt;

&lt;p&gt;This follows the listener pattern from the Firebase Android guide. The flag lives in Compose state, so a screen that's already open switches paths as soon as the new value is activated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;android&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;util&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Log&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;androidx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Composable&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;androidx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getValue&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;androidx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mutableStateOf&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;androidx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setValue&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Firebase&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remoteconfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ConfigUpdate&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remoteconfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ConfigUpdateListener&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remoteconfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FirebaseRemoteConfigException&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remoteconfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remoteConfig&lt;/span&gt;

&lt;span class="k"&gt;object&lt;/span&gt; &lt;span class="nc"&gt;Flags&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="no"&gt;CHECKOUT_V2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"checkout_v2_enabled"&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="n"&gt;remoteConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remoteConfig&lt;/span&gt;

    &lt;span class="c1"&gt;// Compose state, so screens that read it recompose when the flag flips.&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;checkoutV2&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="nf"&gt;mutableStateOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;

    &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// call once, for example from Application.onCreate()&lt;/span&gt;
        &lt;span class="c1"&gt;// The in-app default is OFF, so a device that never fetches keeps the old path.&lt;/span&gt;
        &lt;span class="n"&gt;remoteConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setDefaultsAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;CHECKOUT_V2&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;remoteConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetchAndActivate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;addOnCompleteListener&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;remoteConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addOnConfigUpdateListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;object&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ConfigUpdateListener&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onUpdate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;configUpdate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ConfigUpdate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;CHECKOUT_V2&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;configUpdate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;updatedKeys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;remoteConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;activate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;addOnCompleteListener&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;FirebaseRemoteConfigException&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nc"&gt;Log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;w&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Flags"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Config update error: ${error.code}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;checkoutV2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;remoteConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBoolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;CHECKOUT_V2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;@Composable&lt;/span&gt;
&lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nc"&gt;CheckoutEntry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Flags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;checkoutV2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;CheckoutV2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nc"&gt;CheckoutV1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default matters more than the listener. If the agent-written path is on by default, a device that never fetches config runs it anyway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://firebase.google.com/docs/remote-config/rollouts/get-started" rel="noopener noreferrer"&gt;Remote Config rollouts&lt;/a&gt; add a second, smaller staged release inside the binary. You choose the parameter and the share of devices that get the new value, and Firebase keeps an equal-sized control group so Crashlytics can compare the two. Because of that control group, the enabled percentage has to be 50% or less unless you change the setup. If the enabled group crashes more, you roll the flag back for everyone or for a segment, with no store review involved.&lt;/p&gt;

&lt;p&gt;Flags have hard limits, though. They only cover code you wrapped. A crash in &lt;code&gt;Application.onCreate()&lt;/code&gt; before config is read can't be switched off remotely. Neither can a Room migration that already ran, a new permission in the manifest, or a class R8 stripped at build time. When an agent touches that kind of code, the flag gives you nothing and the staged rollout is the only gate left.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the fix has to be a new build
&lt;/h2&gt;

&lt;p&gt;Then you ship forward and push people onto the fix. Play's &lt;a href="https://developer.android.com/guide/playcore/in-app-updates" rel="noopener noreferrer"&gt;in-app updates&lt;/a&gt; support an immediate flow, a full-screen flow the user has to accept before carrying on. The app reads &lt;code&gt;updatePriority()&lt;/code&gt;, which comes from the &lt;code&gt;inAppUpdatePriority&lt;/code&gt; value (0 to 5) set on the release. The &lt;a href="https://developer.android.com/guide/playcore/in-app-updates/kotlin-java" rel="noopener noreferrer"&gt;Kotlin guide&lt;/a&gt; notes that priority can only be set when you roll out a release and can't be changed later, so decide it before the fix goes out. For iOS, or for blocking builds that can't talk to your backend anymore, Firebase documents a &lt;a href="https://firebase.google.com/docs/remote-config/use-cases/minimum-version" rel="noopener noreferrer"&gt;minimum app version pattern&lt;/a&gt; with Remote Config.&lt;/p&gt;

&lt;h2&gt;
  
  
  A release gate for agent-written code
&lt;/h2&gt;

&lt;p&gt;Set it up in this order if you're starting from nothing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Turn on the Crashlytics alerts that are off by default, at least new fatal issues and increasing velocity.&lt;/li&gt;
&lt;li&gt;Put every agent-written feature behind a Remote Config flag that defaults to off in the app, and use the real-time listener.&lt;/li&gt;
&lt;li&gt;Start Play rollouts small and Apple releases in phased mode. Never send agent-written changes straight to 100%.&lt;/li&gt;
&lt;li&gt;Run a halt check per version code against the previous build, with a minimum user count before it decides.&lt;/li&gt;
&lt;li&gt;Let automation halt. Keep expanding the rollout as a human decision.&lt;/li&gt;
&lt;li&gt;Decide the in-app update priority of a fix before you roll it out.&lt;/li&gt;
&lt;li&gt;Give the code no flag can reach the slowest rollout. That means startup code, database migrations, manifest changes and R8 keep rules.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your pipeline already halts automatically, what metric triggers it, and has it ever fired on a false alarm?&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources and further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://support.google.com/googleplay/android-developer/answer/6346149" rel="noopener noreferrer"&gt;Release app updates with staged rollouts&lt;/a&gt; (Play Console Help)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.apple.com/help/app-store-connect/update-your-app/release-a-version-update-in-phases" rel="noopener noreferrer"&gt;Release a version update in phases&lt;/a&gt; (App Store Connect Help)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.android.com/topic/performance/vitals" rel="noopener noreferrer"&gt;Android vitals overview and bad behavior thresholds&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/play/developer/reporting/reference/rest/v1beta1/vitals.anrrate/query" rel="noopener noreferrer"&gt;Play Developer Reporting API, vitals.anrrate.query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/play/developer/reporting/reference/rest/v1beta1/vitals.crashrate" rel="noopener noreferrer"&gt;Play Developer Reporting API, crash rate metric set&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.google.com/android-publisher/api-ref/rest/v3/edits.tracks" rel="noopener noreferrer"&gt;Play Developer API, edits.tracks&lt;/a&gt; and &lt;a href="https://developers.google.com/android-publisher/edits" rel="noopener noreferrer"&gt;Edits&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://firebase.google.com/docs/crashlytics/crash-free-metrics" rel="noopener noreferrer"&gt;Understand crash-free metrics&lt;/a&gt; (Crashlytics)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com/docs/crashlytics/alerts" rel="noopener noreferrer"&gt;Crashlytics alerts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com/docs/crashlytics/integrate-with-google-play" rel="noopener noreferrer"&gt;Link Crashlytics with Google Play&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://firebase.google.com/docs/remote-config/android/get-started" rel="noopener noreferrer"&gt;Get started with Remote Config on Android&lt;/a&gt; and &lt;a href="https://firebase.google.com/docs/remote-config/real-time" rel="noopener noreferrer"&gt;Real-time Remote Config&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com/docs/remote-config/rollouts/get-started" rel="noopener noreferrer"&gt;Get started with Remote Config rollouts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com/docs/remote-config/use-cases/minimum-version" rel="noopener noreferrer"&gt;Enforce a minimum app version with Remote Config&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.android.com/guide/playcore/in-app-updates" rel="noopener noreferrer"&gt;In-app updates&lt;/a&gt; and &lt;a href="https://developer.android.com/guide/playcore/in-app-updates/kotlin-java" rel="noopener noreferrer"&gt;Support in-app updates (Kotlin or Java)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>android</category>
      <category>ios</category>
      <category>ai</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
