AX notes · Incident

Our release gates were checking something other than the release: a plaintext AAB and one missing dart-define

A plaintext-signaling AAB passed one of our release gates, and another gate's ad SDK check compared a dependency list (classpath) the intended release never used. Both gates read inputs built next to the release, not the release.

By Stephen Testing and release 9 min read Last updated

When green does not mean tested 5/6

An Android app bundle (AAB) built from a development config, one our own deployment doc called "not for submission", got a PASS from a release gate. That was September 13, 2026, in our Flutter peer-to-peer chat app. The server address was localhost, and the signaling that sets up connections ran unencrypted. A month later, in AXFamily, a family schedule app, the gate's ad SDK check turned out to be comparing a dependency list from a different build than the one we meant to ship.

We built both gates with an AI coding agent, and both judged an input produced next to the release instead of the release itself. If you read a green gate as proof the release was checked, the first question is what that PASS actually read.

Contents (9)
  1. A plaintext-signaling AAB passed
  2. AXFamily's gate judged another ad SDK
  3. One command made the snapshot too
  4. The missing check was in the decision record
  5. Required values, not banned strings
  6. Checks that read a side file skip locally
  7. The fixed gate inputs have no tests
  8. One must-fail fixture per gate
  9. FAQ

A plaintext-signaling AAB passed

Before building, the chat app's release workflow checked its dart-define file (the key=value settings Flutter compiles into the app) with one line:

grep -Eq 'example\.invalid|CHANGE_ME' "$f"   # fail if found

The production config still had a placeholder host, so it was blocked. The development config points at localhost with TLS off, but contains neither string, so it passed. On September 13, CI built a 43 MB test AAB from exactly that config, signed with the upload key, and the bundle verification script said PASS.

The deployment doc written that day called the AAB "a pipeline test build, not for submission", and still summarized that there were no blockers left on the code side. Per the repository's own release rules, nothing outside the app config stops plaintext ws:// signaling, so the same workflow could have shipped a signed, submittable AAB with plaintext signaling.

The cross-check two days later opens with its reason: judging whether to ship from documents its own author wrote would be self-confirmation, not a cross-check. So it didn't rely on the deployment doc's claims, re-measured the repository, and concluded "not ready to ship yet" (held back by three operational decisions, with three defects found along the way).

That night, one commit put the same rule into both the workflow and the verification script: TLS must be on, and an empty host, localhost, or a private, loopback or link-local IP fails. A pipeline rehearsal has to turn on allow_insecure_signaling, a flag that defaults to false, and then passes with a warning. Six fixtures (inputs made on purpose to test the rule) were run by hand and the results written into the doc; a re-run of the same check appears further down.

The same commit fixed the signature check. The certificate tool keytool writes its errors to standard output, so the 'could not read signature' branch never ran and the script quit without a reason, skipping the checks after it. No bad build got through. The script now looks for the certificate owner line (Owner:). The crypto tests CI skipped that night are covered in Silently skipped tests keep CI green.

AXFamily's gate judged another ad SDK

AXFamily shows ads through the google_mobile_ads 9.1.0 plugin, which picks the Android ad SDK from the build's dart-defines. Its build.gradle decodes the Gradle property dart-defines (base64-encoded KEY=VALUE pairs joined by commas) and decides like this:

def useNextGenSdk = dartEnvironmentVariables.USE_NEXT_GEN_SDK ? dartEnvironmentVariables.USE_NEXT_GEN_SDK : false

With a value you get the Next-Gen SDK (ads-mobile-sdk); without one, the Legacy SDK (play-services-ads). flutter build hands dart-defines to Gradle through that property. Call Gradle on its own and the property isn't there, so you always get Legacy.

The gate added on October 9 had four steps: wipe the build folder, build a fresh AAB, have Gradle list the release dependencies, then judge. Step three passed no dart-defines. Whatever values built the AAB, the gate judged the Legacy list, and the committed reference list (the snapshot) it compared against came from the same command, so the comparison could only ever match.

The dart-define check was off the other way. The gate only accepted keys on its allow list, and USE_NEXT_GEN_SDK wasn't on it.

The build that survived 2,000 random-input events on a Galaxy S21 that day was Next-Gen. The only build this gate could pass was Legacy, which that test never touched, and the verified config would have been blocked for carrying an unknown key.

On October 10, a fix commit made step three pass the same values as the AAB build, as -Pdart-defines in the format flutter build uses, without printing the values. The dart-define check now accepts USE_NEXT_GEN_SDK only when it is exactly 'true'. The plugin's ternary follows the truthiness rules of Groovy, the language build.gradle is written in, where any non-empty string is true, so 'false' also gives you Next-Gen.

Regenerating the snapshot with the fixed command changed it as below, and the tests gained three cases that must fail: 'false', an empty string, and a missing key.

Snapshot lines that changedBeforeAfter
Lines211214 (5 removed, 8 added)
Ad SDKplay-services-ads, play-services-ads-apiads-mobile-sdk
Companions3 measurement and ad-services modules6 Cronet (Chrome's network stack) modules, kotlinx-coroutines-guava

One command made the snapshot too

On the AXFamily side the cause had three layers. The gate listed dependencies with a different command from the one that built the release, and since the plugin picks dependencies from dart-defines, that changed the result. The commit that added the gate shows no check that the two commands got the same inputs. The last layer is that the reference, the snapshot and the test fixture, came out of that same command. There's no record of a full gate run before the fix.

In the chat app, the development config already in the repository did go through the gate, but until the fix nobody treated it as an input that had to fail.

About six and a half hours before that fix, another commit gave the AXFamily gate a step that opens the AAB's dex files (the compiled app code) and libapp.so (where Flutter's compiled Dart code lives) directly to make sure no end-to-end test mode leaked in. The gate already had a way to read the release, and the SDK list was still judged from a Gradle report.

The missing check was in the decision record

AXFamily's October 5 decision record already had the condition: Next-Gen is opt-in, so CI pins USE_NEXT_GEN_SDK=true and checks that the release APK contains ads-mobile-sdk. The item's status is "recommendation, presumed accepted": one the operator did not object to. The backlog's acceptance criteria asked for the same dart-define. The October 9 gate had neither, and committed a Legacy list as its snapshot instead.

Both gates, both fixes, and the wrong deployment summary all came from commits co-authored by Claude. The cross-check doc, not a person, corrected the summary; on the record the human part ends at not objecting to the decision record's recommendation.

Required values, not banned strings

Had we only added localhost to the placeholder list, 192.168.0.10 and 172.20.1.5 from the fixtures would still pass with TLS on. Instead of listing addresses to block, the fix requires what a release must have (TLS on, a public host), and because the pipeline still needs rehearsals, the exception opens only through the default-false flag.

For AXFamily, the gate could have accepted any non-empty USE_NEXT_GEN_SDK. That matches the plugin, but a config reading 'false' would produce a Next-Gen build and the gate would say nothing. Only an exact 'true' passes.

Checks that read a side file skip locally

The chat app's new TLS check and the older dart-define record check don't open the AAB. They read dart_defines.txt, a record the workflow writes from the config and leaves next to the AAB. Run the script locally without that file and both checks print SKIP; if everything else passes, the result is PASS. Nor does the script confirm the AAB and the record belong together.

Below is the new TLS check alone, re-run on November 11 against seven fixtures. The first six match the September 15 results; the seventh has no record file. signal.example.com is a reserved placeholder domain.

Terminal output of check 6 on seven fixtures: public host and rehearsal flag give fail=0, localhost, private IPs and a missing TLS key give fail=1, and no record file gives SKIP with fail=0.
Without the record file, check 6 prints SKIP and the failure count stays at 0. BOS_SIGNALING_TLS and _HOST are the chat app's dart-define keys (source: check 6 from the chat app repository's September 15 fix, re-run 2026-11-11).

The AXFamily gate builds its own AAB, which made passing it the same inputs easy. The chat app workflow's host check only judges IP literals, so a name that looks public but resolves to a private IP is not caught.

The fixed gate inputs have no tests

The chat app's fixtures were run by hand, and only the results went into the doc. The September 15 fix touched just the workflow and the verification script, and no commit has changed either file since. In AXFamily, no test looks at whether the gate passes -Pdart-defines to Gradle.

Drop that argument and the SDK step now fails against the Next-Gen snapshot. But the usage comment of the snapshot script that the error points to also omits it, so regenerating the snapshot as that comment says would put the gate back where it started. The gate also still lacks the check the decision record asked for: ads-mobile-sdk inside the release (the record says APK).

One must-fail fixture per gate

So this is the order we now use to check the gate itself. The three-stage pre-upload check we use for a separate set of Android apps is in What to check before shipping an AI-built Android app.

  1. For each gate step, write down what it reads: the release itself (the AAB's manifest, dex, signature), the inputs that built the release, or an input built separately.
  2. If it's built separately, confirm it uses the same arguments as the command that built the release. In Flutter, pass the same values to Gradle with -Pdart-defines. The AXFamily gate does it like this from the android folder (locking and output capture left out), where $DEFINES is the JSON file given to --dart-define-from-file:
    DD="$(node -e 'const d=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"));process.stdout.write(Object.entries(d).map(([k,v])=>Buffer.from(k+"="+v).toString("base64")).join(","))' "$DEFINES")"
    ./gradlew --no-daemon -q :app:dependencies --configuration releaseRuntimeClasspath "-Pdart-defines=$DD"
  3. For a step that compares against a snapshot, check that the snapshot came from a command with the same arguments. At least once, confirm the SDK from the release side. The October 9 device test confirmed Next-Gen by finding the Next-Gen package on 111 lines of mapping.txt, the name map R8 leaves behind.
    grep -c 'com.google.android.libraries.ads.mobile.sdk' build/app/outputs/mapping/release/mapping.txt
    Don't use com.google.android.gms.ads to detect Legacy: Next-Gen ships compatibility classes under that name (37 lines in the same record). The line above restates that check; there's no record of it being run exactly as written.
  4. Require the values a release must have (TLS on, a switch exactly 'true') instead of listing banned strings. Open exceptions only through a flag that defaults to false and warns when on.
  5. Give every gate one fixture that must fail: the development config already in the repository, a dart-define file missing a switch, an unsigned AAB. Check that it fails and that the reason gets printed.
  6. Commit that fixture as a test. When you fix a gate, put the input it should have blocked into the same commit.
Bar chart: in mapping.txt of the AXFamily Next-Gen release build, the Next-Gen package name appears on 111 lines and compatibility classes under the gms.ads name shared with Legacy on 37.
A Next-Gen build still carries 37 gms.ads lines, so that name cannot tell you whether Legacy is in.

FAQ

Can flutter build --dart-define change Android dependencies?

It can, depending on the plugin. google_mobile_ads 9.1.0 reads USE_NEXT_GEN_SDK from the Gradle property dart-defines and attaches either the Next-Gen or the Legacy ad SDK, so a separate Gradle call needs the same values through -Pdart-defines to resolve the same dependencies.

Does USE_NEXT_GEN_SDK=false give you the Legacy SDK?

Not in 9.1.0. The plugin treats any non-empty string as true, so 'false' still means Next-Gen; to get Legacy you have to leave the key out.

As of 2026-11-11, rechecked against the git history of both app repositories, the cross-check doc, the ad SDK device-test notes, the decision record and the plugin source. Server addresses, signing key details and the app's package name are left out.

This note is written from values SugarMount measured itself; an AI coding agent was used to draft it.

All AX notes