Skip to content

Harden public client secret boundaries - #8717

Merged
Git-on-my-level merged 9 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/public-client-secret-boundary
Jul 1, 2026
Merged

Git-on-my-level merged 9 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/public-client-secret-boundary

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • introduce an allowlisted public-client env contract for Flutter/mobile release config and remove server secrets from app env generation
  • add policy, generator, source/CI guards, artifact scanners, hook/CI wiring, and docs/agent guidance so private secrets cannot be bundled into public clients
  • move Docker/GitHub deployment secrets out of image build args and into runtime secret injection

Verification

  • python3 scripts/check-public-client-secrets.py
  • python3 -m py_compile scripts/check-public-client-secrets.py scripts/scan-public-artifact-secrets.py
  • bash -n scripts/create-public-client-env.sh scripts/pre-commit scripts/pre-push
  • python3 -m black --line-length 120 --skip-string-normalization scripts/check-public-client-secrets.py scripts/scan-public-artifact-secrets.py
  • dart format --line-length 120 app/lib/env/prod_env.dart app/lib/env/dev_env.dart app/lib/env/env.dart app/test/providers/capture_provider_test.dart app/test/unit/env_test.dart app/test/unit/env_empty_staging_test.dart app/test/unit/env_staging_test.dart app/test/security/public_client_secret_boundary_test.dart
  • python3 scripts/scan-public-artifact-secrets.py --help
  • dummy artifact scanner negative tests for OPENAI_API_KEY and FOO_SECRET
  • go run github.com/rhysd/actionlint/cmd/[email protected] -shellcheck '' .github/workflows/lint.yml .github/workflows/gcp_apps_js.yml .github/workflows/gcp_frontend.yml .github/workflows/gcp_personas.yml
  • .github/scripts/run-pre-push.sh origin

Notes

  • app/test.sh test/security/public_client_secret_boundary_test.dart could not run locally because flutter is not installed/on PATH in this environment.
  • I pushed with --no-verify after .github/scripts/run-pre-push.sh origin passed; the normal push hook compared against stale fork/main (d7970556) instead of the real upstream base (2483bb2) and selected unrelated pre-existing backend async-blocker findings.

Review in cubic

@Git-on-my-level
Git-on-my-level force-pushed the codex/public-client-secret-boundary branch from 3b501da to dca3450 Compare July 1, 2026 00:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b501da7c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codemagic.yaml
PUBLIC_INTERCOM_APP_ID="$INTERCOM_APP_ID" \
PUBLIC_INTERCOM_IOS_API_KEY="$INTERCOM_IOS_API_KEY" \
PUBLIC_INTERCOM_ANDROID_API_KEY="$INTERCOM_ANDROID_API_KEY" \
../scripts/create-public-client-env.sh .client.env

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Android Intercom env generation

In the Android Codemagic workflows, this now only writes .client.env, but the Android Gradle build still reads app/.env to populate BuildConfig.INTERCOM_APP_ID and BuildConfig.INTERCOM_ANDROID_API_KEY (app/android/app/build.gradle:36 and :100-101). For internal/release Android builds those values become empty, so MyApp.kt skips Intercom SDK initialization; either keep emitting the legacy public .env entries for Gradle or update Gradle to read .client.env/PUBLIC_*.

Useful? React with 👍 / 👎.

Comment thread app/lib/env/dev_env.dart
// Every field in this file is compiled into public client binaries.
// Do not add provider API keys, OAuth client secrets, service accounts,
// private keys, admin tokens, signing credentials, or backend-only secrets.
@Envied(allowOptionalFields: true, path: '.client.dev.env')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Generate the new dev env file during setup

The documented mobile setup still writes only .dev.env with the old names (app/setup.sh:142-144, with similar legacy setup scripts), but DevEnv now reads .client.dev.env. A fresh dev setup therefore generates null/default dev config, causing API calls to build URLs from a null Env.apiBaseUrl or crash where it is force-unwrapped; update the setup scripts to create .client.dev.env with the PUBLIC_* keys before switching this path.

Useful? React with 👍 / 👎.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

18 issues found and verified against the latest diff

Confidence score: 2/5

  • The highest risk is in scripts/pre-commit, where check-public-client-secrets.py failures do not block commits, and scripts/pre-push can miss Dockerfile.* changes; together, secret-boundary checks can be bypassed and sensitive values may slip into public artifacts — make both hooks fail closed and include Dockerfile variant patterns before merging.
  • codemagic.yaml now writes .client.env while Android build inputs in app/android/app/build.gradle and dev setup paths in app/lib/env/dev_env.dart / app/setup.sh still expect older .env/.dev.env conventions, which can leave required Intercom values unset and break dev or release builds — align file names and key mappings across scripts, Gradle, and Envied sources.
  • In codemagic.yaml, the AAB scanner path uses ** without enabling globstar, so release pipelines can fail before publish even when the build itself succeeds — enable globstar or expand artifact paths explicitly in the scanner step.
  • scripts/scan-public-artifact-secrets.py and scripts/check-public-client-secrets.py still have enforcement gaps (DMGs treated as scanned without extraction, denied provider domains not enforced in app scans, and regex misses common quoted/path .env writes), and app/test/security/public_client_secret_boundary_test.dart can pass on missing metadata; merging as-is leaves real policy blind spots — tighten these checks and fix the test assertion so regressions are caught.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/env/dev_env.dart">

<violation number="1" location="app/lib/env/dev_env.dart:10">
P1: The Envied source path changed to `.client.dev.env`, but the developer setup scripts (e.g. `app/setup.sh`) still generate `.dev.env` with the old key names. A fresh dev setup will not produce `.client.dev.env`, so all Envied fields resolve to null defaults—`Env.apiBaseUrl` will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create `.client.dev.env` with the `PUBLIC_*` keys.</violation>
</file>

<file name="codemagic.yaml">

<violation number="1" location="codemagic.yaml:95">
P1: The Android Gradle build reads `app/.env` to populate `BuildConfig.INTERCOM_APP_ID` and `BuildConfig.INTERCOM_ANDROID_API_KEY` (see `app/android/app/build.gradle`). This script now writes only to `.client.env`, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy `.env` with the public Intercom entries for Gradle, or update `build.gradle` to read from `.client.env`/`PUBLIC_*` keys.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/pre-commit Resolved
Comment thread codemagic.yaml Resolved
Comment thread codemagic.yaml
PUBLIC_INTERCOM_APP_ID="$INTERCOM_APP_ID" \
PUBLIC_INTERCOM_IOS_API_KEY="$INTERCOM_IOS_API_KEY" \
PUBLIC_INTERCOM_ANDROID_API_KEY="$INTERCOM_ANDROID_API_KEY" \
../scripts/create-public-client-env.sh .client.env

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The Android Gradle build reads app/.env to populate BuildConfig.INTERCOM_APP_ID and BuildConfig.INTERCOM_ANDROID_API_KEY (see app/android/app/build.gradle). This script now writes only to .client.env, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy .env with the public Intercom entries for Gradle, or update build.gradle to read from .client.env/PUBLIC_* keys.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At codemagic.yaml, line 95:

<comment>The Android Gradle build reads `app/.env` to populate `BuildConfig.INTERCOM_APP_ID` and `BuildConfig.INTERCOM_ANDROID_API_KEY` (see `app/android/app/build.gradle`). This script now writes only to `.client.env`, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy `.env` with the public Intercom entries for Gradle, or update `build.gradle` to read from `.client.env`/`PUBLIC_*` keys.</comment>

<file context>
@@ -80,20 +80,19 @@ workflows:
+          PUBLIC_INTERCOM_APP_ID="$INTERCOM_APP_ID" \
+          PUBLIC_INTERCOM_IOS_API_KEY="$INTERCOM_IOS_API_KEY" \
+          PUBLIC_INTERCOM_ANDROID_API_KEY="$INTERCOM_ANDROID_API_KEY" \
+          ../scripts/create-public-client-env.sh .client.env
 
       - name: Set up Google Service Info
</file context>

Comment thread app/lib/env/dev_env.dart
// Every field in this file is compiled into public client binaries.
// Do not add provider API keys, OAuth client secrets, service accounts,
// private keys, admin tokens, signing credentials, or backend-only secrets.
@Envied(allowOptionalFields: true, path: '.client.dev.env')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The Envied source path changed to .client.dev.env, but the developer setup scripts (e.g. app/setup.sh) still generate .dev.env with the old key names. A fresh dev setup will not produce .client.dev.env, so all Envied fields resolve to null defaults—Env.apiBaseUrl will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create .client.dev.env with the PUBLIC_* keys.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/env/dev_env.dart, line 10:

<comment>The Envied source path changed to `.client.dev.env`, but the developer setup scripts (e.g. `app/setup.sh`) still generate `.dev.env` with the old key names. A fresh dev setup will not produce `.client.dev.env`, so all Envied fields resolve to null defaults—`Env.apiBaseUrl` will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create `.client.dev.env` with the `PUBLIC_*` keys.</comment>

<file context>
@@ -4,55 +4,50 @@ import 'env.dart';
+// Every field in this file is compiled into public client binaries.
+// Do not add provider API keys, OAuth client secrets, service accounts,
+// private keys, admin tokens, signing credentials, or backend-only secrets.
+@Envied(allowOptionalFields: true, path: '.client.dev.env')
 final class DevEnv implements EnvFields {
   DevEnv();
</file context>

Comment thread scripts/scan-public-artifact-secrets.py Resolved
Comment thread scripts/check-public-client-secrets.py Resolved
Comment thread scripts/check-public-client-secrets.py Resolved
Comment thread scripts/check-public-client-secrets.py Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12 issues found across 22 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/env/dev_env.dart">

<violation number="1" location="app/lib/env/dev_env.dart:10">
P1: The Envied source path changed to `.client.dev.env`, but the developer setup scripts (e.g. `app/setup.sh`) still generate `.dev.env` with the old key names. A fresh dev setup will not produce `.client.dev.env`, so all Envied fields resolve to null defaults—`Env.apiBaseUrl` will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create `.client.dev.env` with the `PUBLIC_*` keys.</violation>
</file>

<file name="codemagic.yaml">

<violation number="1" location="codemagic.yaml:95">
P1: The Android Gradle build reads `app/.env` to populate `BuildConfig.INTERCOM_APP_ID` and `BuildConfig.INTERCOM_ANDROID_API_KEY` (see `app/android/app/build.gradle`). This script now writes only to `.client.env`, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy `.env` with the public Intercom entries for Gradle, or update `build.gradle` to read from `.client.env`/`PUBLIC_*` keys.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/check-public-client-secrets.py Resolved
Comment thread app/initialsetup.bash Resolved
Comment thread app/config/client_env_policy.yaml Resolved
Comment thread app/config/client_env_policy.yaml Resolved
Comment thread codemagic.yaml Resolved
Comment thread .github/workflows/gcp_frontend.yml Resolved
Comment thread scripts/scan-public-artifact-secrets.py Resolved
Comment thread scripts/scan-public-artifact-secrets.py Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 issues found across 19 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/env/dev_env.dart">

<violation number="1" location="app/lib/env/dev_env.dart:10">
P1: The Envied source path changed to `.client.dev.env`, but the developer setup scripts (e.g. `app/setup.sh`) still generate `.dev.env` with the old key names. A fresh dev setup will not produce `.client.dev.env`, so all Envied fields resolve to null defaults—`Env.apiBaseUrl` will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create `.client.dev.env` with the `PUBLIC_*` keys.</violation>
</file>

<file name="codemagic.yaml">

<violation number="1" location="codemagic.yaml:95">
P1: The Android Gradle build reads `app/.env` to populate `BuildConfig.INTERCOM_APP_ID` and `BuildConfig.INTERCOM_ANDROID_API_KEY` (see `app/android/app/build.gradle`). This script now writes only to `.client.env`, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy `.env` with the public Intercom entries for Gradle, or update `build.gradle` to read from `.client.env`/`PUBLIC_*` keys.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread scripts/check-public-client-secrets.py Resolved
Comment thread app/setup/scripts/setup.ps1 Resolved
Comment thread app/initialsetup.bash Resolved
Comment thread codemagic.yaml Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/env/dev_env.dart">

<violation number="1" location="app/lib/env/dev_env.dart:10">
P1: The Envied source path changed to `.client.dev.env`, but the developer setup scripts (e.g. `app/setup.sh`) still generate `.dev.env` with the old key names. A fresh dev setup will not produce `.client.dev.env`, so all Envied fields resolve to null defaults—`Env.apiBaseUrl` will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create `.client.dev.env` with the `PUBLIC_*` keys.</violation>
</file>

<file name="codemagic.yaml">

<violation number="1" location="codemagic.yaml:95">
P1: The Android Gradle build reads `app/.env` to populate `BuildConfig.INTERCOM_APP_ID` and `BuildConfig.INTERCOM_ANDROID_API_KEY` (see `app/android/app/build.gradle`). This script now writes only to `.client.env`, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy `.env` with the public Intercom entries for Gradle, or update `build.gradle` to read from `.client.env`/`PUBLIC_*` keys.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 8 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/env/dev_env.dart">

<violation number="1" location="app/lib/env/dev_env.dart:10">
P1: The Envied source path changed to `.client.dev.env`, but the developer setup scripts (e.g. `app/setup.sh`) still generate `.dev.env` with the old key names. A fresh dev setup will not produce `.client.dev.env`, so all Envied fields resolve to null defaults—`Env.apiBaseUrl` will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create `.client.dev.env` with the `PUBLIC_*` keys.</violation>
</file>

<file name="codemagic.yaml">

<violation number="1" location="codemagic.yaml:95">
P1: The Android Gradle build reads `app/.env` to populate `BuildConfig.INTERCOM_APP_ID` and `BuildConfig.INTERCOM_ANDROID_API_KEY` (see `app/android/app/build.gradle`). This script now writes only to `.client.env`, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy `.env` with the public Intercom entries for Gradle, or update `build.gradle` to read from `.client.env`/`PUBLIC_*` keys.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread app/lib/models/stt_provider.dart Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/env/dev_env.dart">

<violation number="1" location="app/lib/env/dev_env.dart:10">
P1: The Envied source path changed to `.client.dev.env`, but the developer setup scripts (e.g. `app/setup.sh`) still generate `.dev.env` with the old key names. A fresh dev setup will not produce `.client.dev.env`, so all Envied fields resolve to null defaults—`Env.apiBaseUrl` will be null at runtime, breaking API requests or crashing on force-unwrap. Update the setup scripts to create `.client.dev.env` with the `PUBLIC_*` keys.</violation>
</file>

<file name="codemagic.yaml">

<violation number="1" location="codemagic.yaml:95">
P1: The Android Gradle build reads `app/.env` to populate `BuildConfig.INTERCOM_APP_ID` and `BuildConfig.INTERCOM_ANDROID_API_KEY` (see `app/android/app/build.gradle`). This script now writes only to `.client.env`, so the Gradle-consumed values will be empty at build time—Intercom SDK initialization will be silently skipped on Android release builds. Either emit a legacy `.env` with the public Intercom entries for Gradle, or update `build.gradle` to read from `.client.env`/`PUBLIC_*` keys.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@Git-on-my-level
Git-on-my-level merged commit 3553959 into BasedHardware:main Jul 1, 2026
3 checks passed
Git-on-my-level added a commit that referenced this pull request Jul 1, 2026
## Summary

Closes #8726.

This audits the post-#8717 public release secret boundary and fills the
remaining public-safe scanner gaps:

- adds release workflow/log hygiene checks for dangerous public env
writes and `set -x` blocks that touch server-only env refs
- broadens public Dockerfile secret-baking coverage across `web/**`,
`plugins/**`, `mcp/**`, and `desktop/**`
- allowlists existing public web build args used by admin/app public
images
- adds a docs audit page with what #8717 covered, what this PR adds, and
what remains private-maintainer evidence
- adds fake-sentinel scanner tests, including zipped build-log leakage
detection

## Secret-safety note

No production credentials were read, printed, stored, or committed.
Tests use fake sentinel values only. No release, deploy, provider, or
artifact publication actions were run.

## Validation

- `python3 scripts/test-public-secret-scanners.py` -> OK, 4 tests
- `python3 scripts/check-public-client-secrets.py` -> passed
- `git diff --check`
- `python3 -m py_compile scripts/check-public-client-secrets.py
scripts/scan-public-artifact-secrets.py
scripts/test-public-secret-scanners.py`
- `black --check --line-length 120 --skip-string-normalization
scripts/check-public-client-secrets.py
scripts/test-public-secret-scanners.py`
- pre-push hook on push to `origin/codex/8726-release-secret-hygiene` ->
passed, including OpenAPI up-to-date check


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/8730?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
mdmohsin7 added a commit that referenced this pull request Jul 1, 2026
## Why

The latest TestFlight builds (**1.0.542+969 / +970**) shipped broken.
Root causes, both from the public-client secret-boundary hardening
(#8716, #8717, #8733, #8741):

1. **Null API base URL → crash on launch.** Those PRs renamed every app
env var to a `PUBLIC_` prefix and moved Envied's source from `.env` →
`.client.env`. The Codemagic dashboard still defines the **old** names,
so the `PUBLIC_*` exports resolved empty, `create-public-client-env.sh`
skipped them, and Envied baked `null` into prod. `Env.apiBaseUrl!` then
force-unwrapped to a crash.
2. **`flutter build ipa` failure.** The post-build artifact scanner
flagged Firebase/SDK constant strings (`ERROR_INVALID_CREDENTIAL`,
`PROJECT_TOKEN`, …) inside the compiled `BatteryWidget.appex` Mach-O
binary as "server-only tokens" — false positives.

## What this does

- **Restores `codemagic.yaml` + `app/lib/env/**` to the last-good
(1.0.533) state** — byte-identical, verified 0-diff. The prod build
again reads the old var names that are still in the Codemagic dashboard.
- **Reverts the coupled secret-scanner apparatus as one unit** (it's
cross-wired through `lint.yml`, the git hooks, and the backend registry,
so half-reverting would fail CI): scanner scripts,
`client_env_policy.yaml`, the boundary test, the backend secret-consumer
registry, and the `lint.yml`/`pre-commit`/`pre-push` enforcement.
- Also restores `openai.dart`, the STT provider/polling code, app setup
scripts, and env tests to baseline.

## What is deliberately preserved (independent web hardening)

Not reverted — these removed baked secrets from the **web** images and
are unrelated to the mobile break:
- `.github/workflows/gcp_apps_js.yml`, `gcp_frontend.yml`,
`gcp_personas.yml` (baked-secret removal from Docker build args +
env-choice/SHA tagging)
- `web/frontend/**`, `web/personas-open-source/**`, `plugins/apps-js/**`

## Verification

- `codemagic.yaml` + `app/lib/env` diff vs the pre-hardening baseline:
**0 lines**; no `PUBLIC_API_BASE_URL` left in `codemagic.yaml`.
- No dangling references to any deleted script anywhere in the tree.
- `dart analyze` on the reverted app code: no errors.
- `flutter test` (env + capture_provider): **75/75 pass**.

## Note

This returns the mobile client to its long-standing pre-1.0.542 secret
posture (OpenAI/Google client secrets baked into the binary again). That
is the status quo that shipped in 1.0.533 and every prior release — not
a new exposure — but the underlying hardening should be re-attempted
later by adding the `PUBLIC_*` vars to Codemagic first, then re-landing,
rather than renaming under a live dashboard.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/8772?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
pull Bot pushed a commit to Mu-L/omi that referenced this pull request Jul 1, 2026
Builds 1.0.542+969/970 shipped broken: the secret-boundary PRs (BasedHardware#8716, BasedHardware#8717,
BasedHardware#8733, BasedHardware#8741) renamed every app env var to a PUBLIC_ prefix and moved Envied's
source to .client.env, but the Codemagic dashboard still defines the old names.
The PUBLIC_* exports resolved empty, create-public-client-env.sh skipped them,
and Envied baked null into prod — so Env.apiBaseUrl! force-unwrapped to a crash
on launch. The post-build artifact scanner also false-positived on Firebase/SDK
constant strings (ERROR_INVALID_CREDENTIAL, PROJECT_TOKEN) inside the compiled
BatteryWidget.appex, failing 'flutter build ipa'.

Restores codemagic.yaml and app/lib/env to the last-good (1.0.533) state so the
prod build works with the existing dashboard vars, and reverts the coupled
secret-scanner apparatus (scanner scripts, client_env_policy, boundary test,
backend secret-consumer registry, and the lint.yml/pre-commit/pre-push
enforcement) as one unit.

Preserves the independent web hardening: the gcp_apps_js/frontend/personas
workflows keep their baked-secret removal + env-choice/SHA-tagging, and
web/frontend, web/personas-open-source, and plugins/apps-js are untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant