Skip to content

fix(app): refuse remote APIs in hermetic tests; add a lane-bootstrap that skips the full backend lock - #14321

Merged
Git-on-my-level merged 3 commits into
mainfrom
task/msd-harness-v4-v7-bootstrap-hermeticity
Sep 17, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
task/msd-harness-v4-v7-bootstrap-hermeticity

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

  • V7: hermetic app/test.sh and mobile-session doctor fail closed when app/.dev.env names a non-empty non-loopback API_BASE_URL, or when flavor/profile is anything but dev + local_dev. They refuse; they do not rewrite the file. app/test.sh used to skip writing .dev.env once generated files existed, so a leftover https://api.omi.me/ (or mobile_beta/prod) survived silently.
  • V4: make lane-bootstrap is the one idempotent command that takes a fresh linked worktree to “cheap pre-push gates can run and bash app/test.sh can run”. It checks Flutter 3.44.5, shares PUB_CACHE, creates a Python 3.11 backend/.venv via uv (never system 3.14), and installs only python-dotenv + PyYAML — not uv pip sync pylock.macos.toml (llvmlite/scipy/av/pyarrow). An incomplete .venv directory is no longer treated as ready: the resolver and doctor probe import dotenv, yaml and point at make lane-bootstrap.
  • Designed against two failures from today: Spine A make setup stalling ~20 minutes on heavy wheels, and git push dying at check_desktop_flow_lint_if_needed with “desktop E2E flow metadata checks require Python 3 and PyYAML” because backend/.venv existed but was empty of extras. Always-on cheap gates are stdlib; desktop-flow-lint needs PyYAML; harness wrappers need python-dotenv.

Failure-Class: new

The new class is FC-hermetic-suite-points-at-remote-api.

Product invariants affected

  • INV-MEM-4

Test plan

  • bash scripts/dev-harness/run-tests.sh — 285 passed, 7 skipped
  • bash app/scripts/check_hermetic_test_env_test.sh — refuses remote/LAN/mobile_beta/prod/OMI_APP_TEST_USE_PROD_API_DEFAULT=1 without rewriting
  • make lane-bootstrap on this fresh worktree (warm caches): real 37.92s (user 36.08, sys 2.88); idempotent second run real 4.60s; remote .dev.env refused and file left unchanged
  • backend/.venv/bin/python -c 'import dotenv, yaml' after bootstrap (Python 3.11.15)
  • mobile-session doctor --platform android --platform ios after bootstrap: backend-venv ready; Android agent-remediable (ANDROID_HOME unset); iOS Xcode 27.0 + iOS 26.5 ready; 860.2GiB free
  • Coordinator: scripts/pr-preflight --pr-body-file .local/pr-body-v4-v7.md — 17 checks passed in 96.59s

Fresh-worktree-to-first-run

Warm-cache target was < 5 minutes. Measured on this host:

Step Command real
lane-bootstrap (fresh worktree, warm PUB_CACHE + UV_CACHE) make lane-bootstrap 37.92s
idempotent re-run make lane-bootstrap 4.60s
origin/main app/test.sh without this bootstrap (includes suite) bash app/test.sh 106.49s

make setup-backend / full pylock sync is still opt-in when the change touches backend code.


Part of the mobile self-driving program (Harness lane, packages V4 and V7). Implemented by Cursor cursor-grok-4.6-high. Coordinator verification on the head commit: bash scripts/dev-harness/run-tests.sh 285 passed / 7 skipped; app/scripts/check_hermetic_test_env.sh refuses a remote URL, a loopback-lookalike host (127.0.0.1.evil.example) and a userinfo trick ([email protected]), and accepts empty and loopback; make lane-bootstrap re-run in place completes in 3 s and leaves the tree clean. The 38 s fresh-worktree figure is the lane's own measurement and was not independently re-measured.

🤖 Generated with Claude Code

Review in cubic

Git-on-my-level and others added 3 commits September 17, 2026 07:34
app/test.sh skipped writing .dev.env when generated files already existed, so a leftover API_BASE_URL or mobile_beta/prod pairing could silently survive. Fail closed at the checker, test.sh, and doctor without rewriting the file.

Failure-Class: new
Co-authored-by: Cursor <[email protected]>
A linked worktree can run cheap pre-push gates and app/test.sh after one idempotent command: pinned Flutter, shared PUB_CACHE, Python 3.11 via uv, and yaml+dotenv only. An incomplete .venv directory is no longer treated as ready.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Manifest-contract stubs only accepted `import yaml`. The resolver now probes `import dotenv, yaml` so an empty .venv is not treated as ready, and those stubs were skipped.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
@Git-on-my-level
Git-on-my-level force-pushed the task/msd-harness-v4-v7-bootstrap-hermeticity branch from f9765b6 to 5adcd22 Compare September 17, 2026 11:37

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dev/test-harness hardening, not a user-facing bug fix -- treated as approve-only per 'unsure bug vs feature' rule. Flagged author elevated scrutiny -- diff reviewed, no .github/workflows touched, no abuse signals found.

@Git-on-my-level
Git-on-my-level merged commit 7f287f5 into main Sep 17, 2026
49 checks passed
@Git-on-my-level
Git-on-my-level deleted the task/msd-harness-v4-v7-bootstrap-hermeticity branch September 17, 2026 16:54
@Git-on-my-level
Git-on-my-level restored the task/msd-harness-v4-v7-bootstrap-hermeticity branch September 17, 2026 17:02
@Git-on-my-level
Git-on-my-level deleted the task/msd-harness-v4-v7-bootstrap-hermeticity branch September 17, 2026 17:02
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.

2 participants