Skip to content

fix: resolve a >= 3.10 python for the pre-push gate on macOS system python3.9 hosts - #21413

Merged
Git-on-my-level merged 25 commits into
BasedHardware:mainfrom
Git-on-my-level:agent/t_79cdaed0-preflight-python39
Oct 14, 2026
Merged

Git-on-my-level merged 25 commits into
BasedHardware:mainfrom
Git-on-my-level:agent/t_79cdaed0-preflight-python39

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Fix: resolve a >= 3.10 python for the pre-push gate on macOS system python3.9 hosts

Summary

The GLM fixer runs launched by the PR completion monitor repeatedly complete
their code work (green suite, commits ready) and then fail at git push:
the repo's pre-push preflight resolves its interpreter through
scripts/dev-harness/_resolve_python.sh, which falls back to bare python3
when a worktree has no backend/.venv. On macOS that PATH python3 is Xcode
CLT 3.9, and the check scripts crash at import (git_bash.py:11 uses PEP 604
unions at module scope), so every push from a fresh fixer worktree fails
regardless of the diff. The documented PYTHON= override does not reach the
children spawned through preflight_runner.py on every path.

What changed

  1. scripts/dev-harness/_resolve_python.sh
    • New floor probe dev_harness_python_floor_ok (3.10 floor: PEP 604
      unions and match statements at module scope exist across the check
      scripts, so 3.9-compat is not a route).
    • PATH fallback chain: python3.14 ... python3.10, then bare python3
      only when it passes the floor probe.
    • Absolute Homebrew-prefix probe (/opt/homebrew/opt/[email protected],
      /usr/local/...) after PATH, because fixer/cron contexts run the hook
      with stripped PATHs where no versioned name is reachable.
    • dev_harness_python_floor_advisory names the fix (make lane-bootstrap /
      brew install / PYTHON=).
  2. .github/scripts/preflight_runner.py
    • Refuses to spawn children under a below-floor interpreter (exit 2) and
      prints the same actionable guidance instead of letting a TypeError stand
      in for the diagnosis.
  3. scripts/pr-preflight
    • Same early floor check for standalone runs.
  4. .github/scripts/run_checks.py
    • command_for_host now honors python_executable on POSIX too, and
      execute_checks passes its own interpreter, so the ~200 manifest
      python3 entries run under the harness-selected interpreter instead of
      PATH python3.
  5. scripts/dev-harness/dev_harness/mobile_session.py +
    scripts/dev-harness/dev_harness/device_runner.py
    • Device discovery in device doctor is bounded (25s) and a tooling
      timeout is classified (exit 124 + remedy) instead of escaping
      subprocess.TimeoutExpired as a raw traceback. Diagnosis names a pending
      Xcode first launch (sudo xcodebuild -runFirstLaunch && sudo xcodebuild -license accept), which is exactly how this failure
      presents on macOS after an Xcode update.

Verification

  • Reproduced the original crash: /usr/bin/python3 -c 'import git_bash'
    fails with the TypeError on this host; imports cleanly under 3.14.
  • Resolver tests (scripts/dev-harness/tests/test_python_resolver.py):
    deterministic PATH-stub cases for every fallback branch (below-floor
    python3 skipped, versioned fallback chosen, newest-first order, bare
    python3 kept when it qualifies, stripped-PATH prefix probe).
  • Runner floor-gate tests (.github/scripts/test_preflight_runner.py):
    below-floor runner exits 2 without spawning children; modern interpreter
    proceeds.
  • Live acceptance on this host (macOS, Xcode CLT 3.9 on PATH): resolver now
    returns /opt/homebrew/opt/[email protected]/bin/python3.14 under a stripped
    /usr/bin:/bin PATH, and a full bounded pre-push run passes all lanes.

Product invariants affected

  • INV-MEM-4

Failure class (fixes)

Failure-Class: none

View guided diff

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T17:36:13.588159Z 0441940 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 7f424928a8

ℹ️ 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 scripts/dev-harness/_resolve_python.sh Resolved
…ython3.9 hosts

macOS ships Xcode CLT python3 3.9 where the dev harness's bare-python3
fallback cannot import the check scripts (git_bash.py uses PEP 604 unions
at module scope), so every push crashed at preflight regardless of the
diff. Probe PATH candidates (python3.14..python3.10) before bare python3
and keep bare python3 only when it meets the 3.10 floor; when a
below-floor interpreter is still selected, preflight_runner and
scripts/pr-preflight name the fix (make lane-bootstrap, brew python, or
PYTHON=) instead of letting a TypeError stand in for it.
Fixer/cron contexts run the hook with /usr/bin:/bin PATHs where no
versioned interpreter name is reachable, so probe the standard Homebrew
prefixes (still floor-probed, still overridden by PYTHON=) before
admitting bare python3. Resolver tests now assert floor-qualified or
documented-fallback outcomes host-adaptively instead of pinning one
host's python layout.
…gnosis

A pending Xcode first launch (re-armed by Xcode updates; completing it
needs admin rights) makes every xcrun devicectl/simctl call spawn a
hanging `xcodebuild -runFirstLaunch` child, so device discovery blocked
past the test budget and TimeoutExpired escaped the classified-result
seam as a raw traceback. Bound doctor discovery to 25s, convert inner
timeouts into exit 124 + the sudo completion remedy, and let injected
runners' timeouts surface as DeviceRunnerError instead of escaping.
run_checks substitutes its own interpreter (the one pre-push-singleflight
floor-probed) for the manifest's python3 alias on POSIX too, so hosts
whose PATH python3 is Xcode CLT 3.9 execute the ~200 manifest checks
under >= 3.10 instead of crashing at import.
Ubuntu CI has /usr/bin/python3.12 on the same stripped PATH, which the
resolver legally picks as a versioned name; only assert the absolute
Homebrew prefix on hosts that actually have it.
@Git-on-my-level
Git-on-my-level force-pushed the agent/t_79cdaed0-preflight-python39 branch from 7f42492 to feb5849 Compare October 13, 2026 16:09
… xcrun timeouts

Address Codex review feedback on the resolver and device runner:

- _resolve_python.sh: among floor-qualified fallback candidates (PATH and
  absolute install prefixes), prefer one that can also import the cheap-gate
  deps (yaml + python-dotenv). The resolver is shared by mobile-session.sh,
  dev-up.sh and the cheap pre-push gates, so a version-newer interpreter
  without those packages must not shadow an import-capable one. With no
  import-capable candidate, keep the documented floor-only outcome so the
  gate reports the missing module instead of a version crash. Also drop the
  unused DEV_HARNESS_MIN_PYTHON_* constants (shellcheck SC2034).
- mobile_session.py: the Xcode first-launch diagnosis now runs only when the
  timed-out command is xcrun. Android/adb timeouts keep a tooling-generic
  diagnosis instead of being misreported as an Xcode first-launch remedy.
- tests: probe-aware resolver stubs (floor vs import probe), regression tests
  for both behaviors; adb-timeout and xcrun-timeout device-runner tests.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor pass 0fbdc8f6 — addressed all three Codex review threads.

  • P1 (resolver test assertion): already fixed at the previous head (feb5849, _assert_floor_qualified_or_documented_fallback now accepts a floor-probed relative python3.X name from a stripped Linux PATH); replied with the pointer and resolved.
  • P2 (probe fallback imports before selecting a newer Python): both fallback loops (PATH names and absolute install prefixes) now require the same import dotenv, yaml probe as the venv branch before accepting a floor-qualified candidate; a floor-only candidate is kept as a last resort so the gate reports the missing module instead of crashing. Regression tests stub the floor and import probes independently.
  • P2 (limit the Xcode diagnosis to xcrun timeouts): the xcodebuild -checkFirstLaunchStatus probe and Xcode remedy text now run only when the timed-out command is xcrun; adb/Android timeouts keep a tooling-generic diagnosis. Tests cover both sides.
  • Also dropped the unused DEV_HARNESS_MIN_PYTHON_* constants (shellcheck SC2034).

Commit c03efaf. Local: full dev-harness unit lane green (560 tests), bash -n + shellcheck clean, repo preflight passed with the PR body (the pre-push hook's empty-body path is a fork-worktree PR-discovery artifact, equivalent gate run recorded above). All CI checks green on the new head; threads resolved; no new bot findings on re-scan.

@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: c03efaf732

ℹ️ 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 on lines +375 to +377
real_prefix = Path("/opt/homebrew/opt/[email protected]/bin/python3.14")
if real_prefix.is_file():
assert resolved == str(real_prefix)

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 Accept the import-capable Homebrew fallback

On a macOS host where /opt/homebrew/opt/[email protected]/bin/python3.14 exists but lacks dotenv/PyYAML while another probed interpreter (for example [email protected]) has them, the resolver deliberately returns the import-capable interpreter at scripts/dev-harness/_resolve_python.sh:113-116, but this test requires 3.14 solely because its file exists. The changed scripts/dev-harness/** paths select the dev-harness-unit-tests manifest lane, so that host's pre-push fails despite a correct resolution; validate resolved with the host-adaptive helper instead of pinning this path.

AGENTS.md reference: scripts/dev-harness/AGENTS.md:L8-L9

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in eb13a44: the stripped-PATH prefix test no longer asserts [email protected] merely because the file exists. It now accepts any floor-qualified outcome (via _assert_floor_qualified_or_documented_fallback) and additionally fails only when the resolver picks an import-incapable newer prefix while an import-capable candidate exists — which is the regression this thread describes and exactly the local-host scenario (/opt/homebrew/opt/[email protected] without dotenv/PyYAML); on this host the test now passes with the resolver returning the import-capable pick, and on hosts where 3.14 has the deps the pick is 3.14 anyway. The dev-harness-unit-tests lane is green with the new assertion (562 passed).

Comment on lines +1112 to +1116
first_launch = "pending" if probe.returncode != 0 else "complete"
except (OSError, subprocess.TimeoutExpired):
first_launch = "unknown"
diagnosis = (
f"{tool} timed out after {timeout:g}s; Xcode first launch is {first_launch}. "

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 Keep a remedy for completed Xcode first launch

When xcrun devicectl times out while xcodebuild -checkFirstLaunchStatus returns 0, this path sets the state to complete but still replaces the generic timeout diagnosis with an If pending first-launch remedy. In that scenario device doctor gives no applicable next step for the actual tooling/device hang, although scripts/dev-harness/PHYSICAL_DEVICES.md:60-61 promises the exact smallest step; retain the generic diagnosis when first launch is complete (and likely when its status is unknown).

AGENTS.md reference: scripts/dev-harness/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in eb13a44: when xcodebuild -checkFirstLaunchStatus returns 0 (first launch complete), the xcrun-timeout diagnosis now keeps the generic tooling-hang guidance — retry, and if it persists restart the Xcode tooling daemons or the host — with no runFirstLaunch remedy (covered by test_default_device_runner_xcrun_timeout_keeps_generic_diagnosis_when_first_launch_complete). When the probe is pending or cannot be answered, the diagnosis explicitly names the admin commands as an operator action; device_doctor (next thread) classifies that as operator-action-needed.

Comment on lines +1117 to +1119
"If pending, complete it once with admin rights: "
"`sudo xcodebuild -runFirstLaunch && sudo xcodebuild -license accept` "
"(or open Xcode.app and finish the prompt)."

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 Mark admin-only Xcode setup as operator action

When the probe reports first launch pending, this new diagnosis explicitly requires admin rights, but IosTooling converts the returned 124 into DeviceRunnerError and device_runner.device_doctor() unconditionally records every such error as agent-remediable with an install-Xcode remedy. The mobile-session contract at scripts/dev-harness/MOBILE_SESSIONS.md:72-80 assigns privileged install/license work to operator-action-needed, so JSON consumers and agents are told they can remediate an action that actually needs the operator; propagate a distinct classification for this pending state.

AGENTS.md reference: scripts/dev-harness/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in eb13a44: the pending-first-launch diagnosis carries a shared marker ("Xcode first launch is pending", device_runner.XCODE_FIRST_LAUNCH_PENDING_MARKER) and device_doctor now classifies that DeviceRunnerError as operator-action-needed with the exact admin remedy (sudo xcodebuild -runFirstLaunch && sudo xcodebuild -license accept, then rerun the doctor), per the MOBILE_SESSIONS.md "Doctor" contract; all other devicectl failures keep the agent-remediable install-Xcode path (covered by test_pending_xcode_first_launch_is_operator_action_not_agent_remediable).

…rst-launch remedy, operator-action classification

- test_python_resolver: the stripped-PATH prefix test no longer requires
  python3.14 merely because its file exists; it accepts any floor-qualified
  outcome and fails only when an import-incapable newer prefix shadows an
  import-capable pick (the resolver's actual contract).
- mobile_session: an xcrun timeout with first launch already complete keeps a
  generic tooling-hang diagnosis (retry/daemon guidance) instead of telling
  the operator to redo a finished first launch; a pending or unprobed first
  launch names the admin commands explicitly as an operator action.
- device_runner: device_doctor classifies a pending Xcode first launch
  (shared marker) as operator-action-needed per MOBILE_SESSIONS.md, not
  agent-remediable; other devicectl failures keep the agent-remediable path.

@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: eb13a44180

ℹ️ 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".

…l, share the marker constant, pin the doctor wiring end-to-end

- test_python_resolver: the stripped-PATH prefix test accepts every
  documented resolver outcome unconditionally; the import-preference
  contract stays pinned by the stubbed-probe test, so no assertion can
  reject a correct resolver on host-specific interpreter states.
- mobile_session: the pending-first-launch diagnosis reuses
  device_runner.XCODE_FIRST_LAUNCH_PENDING_MARKER (lazy import, matching
  the module's existing device_runner seam) instead of a duplicated
  literal, and the probe-unknown branch names the smallest diagnostic
  step (run the check manually) before any privileged remediation.
- test_device_runner: new end-to-end test drives the actual
  _default_device_runner xcrun-timeout diagnosis through device_doctor
  and asserts the operator-action-needed classification, pinning the
  runner-to-doctor marker coupling.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Independent review (OpenAI-model reviewer; code authored by GLM agents)

The head commit went through a two-round independent review by gpt-5.5-pro (Oracle), which did not author any of this PR:

  • Round 1 (eb13a44): REQUEST_CHANGES — 3 × P2: (1) inverted, host-dependent assertion in the stripped-PATH prefix test; (2) duplicated literal marker between mobile_session.py and device_runner.py without shared constant/integration coverage; (3) probe-unknown branch offering privileged remediation without the immediate diagnostic step.
  • Round 2 (f487873): APPROVE — "All three P2 findings are adequately addressed by the delta, with no remaining blocking issue identified."

Fixes landed in f487873c28: unconditional host-adaptive test assertion (import-preference contract stays pinned by the stubbed-probe test), shared XCODE_FIRST_LAUNCH_PENDING_MARKER constant + end-to-end _default_device_runner → device_doctor test, and an explicit xcodebuild -checkFirstLaunchStatus diagnostic step in the unknown branch. Full dev-harness lane: 564 passed / 6 skipped / 20 xfailed; pushed through the real pre-push gate.

@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: f487873c28

ℹ️ 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".

- mobile_session: an adb timeout carries the shared ADB_TIMEOUT_MARKER and
  names the server/USB retry step; a completed-first-launch xcrun timeout
  carries XCODE_FIRST_LAUNCH_COMPLETE_MARKER.
- device_runner: the doctor keeps agent-remediable for both timeout cases
  but swaps the default install remedies for the timeout-specific step —
  adb server restart instead of reinstalling platform-tools, and Xcode
  tooling-daemon restart instead of installing Xcode when the first-launch
  probe just succeeded. Pending first launch keeps operator-action-needed.
- tests: two new end-to-end cases drive the real _default_device_runner
  timeouts through device_doctor and pin the JSON remedies.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Independent review — final update (head d190f49)

Codex raised two valid P2s on the f487873 doctor wiring (completed-first-launch still offered "install Xcode"; adb timeout still offered "install platform-tools"). Both fixed in d190f49 with shared markers (XCODE_FIRST_LAUNCH_COMPLETE_MARKER, ADB_TIMEOUT_MARKER) and timeout-specific remedies, pinned by two new end-to-end runner→doctor tests (lane: 566 passed / 6 skipped / 20 xfailed).

The independent gpt-5.5-pro reviewer (same reviewer that REQUEST_CHANGES'd eb13a44 → APPROVED f487873) re-reviewed the final delta: VERDICT: APPROVE — "Both Codex P2s are addressed with correctly classified, actionable timeout remedies, and the delta introduces no apparent regressions."

Review trail on this PR: GLM-authored code; every push reviewed by Codex (chatgpt-codex-connector) AND by gpt-5.5-pro; all threads answered with commit refs.

@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: d190f49d8c

ℹ️ 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 on lines +1129 to +1130
except (OSError, subprocess.TimeoutExpired):
first_launch = "unknown"

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 the Xcode timeout remedy when its status probe hangs

When xcrun discovery times out and the subsequent xcodebuild -checkFirstLaunchStatus probe also hits its 10-second timeout, this branch records unknown and emits neither shared marker, so device_doctor falls through to the fixed install Xcode remedy even though xcodebuild successfully started and the unresolved condition is a tooling/probe hang. The explicit probe-timeout path is fresh evidence beyond the completed-first-launch thread; carry an unknown/timeout marker through to the retry/restart remedy so JSON consumers still receive the exact applicable step.

AGENTS.md reference: scripts/dev-harness/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 5ec7e9f: the probe-timeout case now returns immediately with a dedicated shared marker (XCODE_FIRST_LAUNCH_PROBE_TIMEOUT_MARKER: "Xcode first-launch status probe timed out") and device_doctor routes it — together with the completed-first-launch marker — to the retry/restart remedy (killall -9 remoted / reboot), so a hung probe can never fall through to install Xcode. Only a missing xcodebuild binary (OSError) keeps the unknown/install path, which is where that advice is actually correct. Pinned end-to-end by test_real_xcrun_timeout_with_hung_probe_keeps_timeout_remedy (lane: 567 passed / 6 skipped / 20 xfailed).

…g Xcode (Codex P2)

When xcodebuild -checkFirstLaunchStatus itself times out, xcodebuild ran and
hung — so the doctor must not fall through to the install-Xcode remedy. The
probe timeout now returns immediately with a dedicated shared marker
(XCODE_FIRST_LAUNCH_PROBE_TIMEOUT_MARKER) and the doctor routes it to the same
retry/restart remedy as the completed-first-launch case; only a missing
xcodebuild binary (OSError) keeps the unknown/install path. Pinned end-to-end
by test_real_xcrun_timeout_with_hung_probe_keeps_timeout_remedy (lane: 567
passed / 6 skipped / 20 xfailed).
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Independent review follow-up: Codex's probe-hang P2 (hung xcodebuild -checkFirstLaunchStatus fell through to install-Xcode) is fixed in 5ec7e9f with a dedicated XCODE_FIRST_LAUNCH_PROBE_TIMEOUT_MARKER routed to the retry/restart remedy; only a missing xcodebuild binary keeps the install path. The independent gpt-5.5-pro reviewer re-reviewed this delta: VERDICT: APPROVE. Lane: 567 passed / 6 skipped / 20 xfailed.

@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: 5ec7e9fb43

ℹ️ 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 scripts/dev-harness/_resolve_python.sh Resolved
Comment thread .github/scripts/preflight_runner.py Resolved
Comment thread scripts/dev-harness/_resolve_python.sh Resolved
…rt pin (Codex P1+P2 x2)

- dev-init: backend/.venv is created whenever it does not exist, not only
  when the resolver returns the literal 'python3' — a floor-qualified
  versioned/Homebrew interpreter on a fresh checkout no longer routes the
  requirements install into the global interpreter. The install always runs
  through dev_harness_python afterwards.
- _resolve_python: canonical and legacy venv candidates must now satisfy the
  3.10 floor in addition to the import probe, so a 3.9-created venv with
  dotenv/yaml cannot shadow a qualified interpreter and crash the PEP 604
  check scripts at import time.
- preflight_runner: no code change needed — the module already uses postponed
  annotations and imports cleanly on real 3.9.6 (verified); a regression test
  now re-executes the module and pins that the floor gate stays reachable on
  bare 3.9.
- tests: stubbed-venv resolver case, behavior dev-init venv-creation case
  (fake python3 materializes a logging venv; asserts pip runs through it),
  runner import probe. Lane: 569 passed / 6 skipped / 20 xfailed.

@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: efae178d05

ℹ️ 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 scripts/dev-harness/dev-init.sh Outdated
echo "Created backend/.venv"
fi

PYTHON_BIN="$(dev_harness_python)"

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 Badge Install requirements into the newly created virtualenv

On a fresh checkout where the new venv does not already expose dotenv and yaml (the normal venv result), this re-resolution rejects backend/.venv/bin/python in _resolve_python.sh:34-37 and selects a global/versioned fallback, so the following pip install either fails against an externally managed Homebrew Python or pollutes the global interpreter. The fresh evidence beyond the earlier comment is that the just-created venv is necessarily rejected by the new import probe before line 34 has installed those imports; create it with the selected floor-qualified bootstrap and bind PYTHON_BIN directly to that venv for the initial install.

AGENTS.md reference: AGENTS.md:L34-L34

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 000a7c3: after creating the venv, dev-init binds the install directly to $PWD/backend/.venv/bin/python — no re-resolution, so the not-yet-importable fresh venv can no longer be rejected in favor of a global interpreter. The sys.prefix membership check still guards the binding: a repo venv python that resolves into a foreign interpreter is refused with the lane-bootstrap guidance. Refusal tests now exercise the real spoofing shape (repo venv python symlinked to a foreign / foreign-checkout interpreter) instead of a PYTHON override, and the create-path test proves pip runs through the fresh venv.

…tall outside backend/.venv

Oracle follow-up on the Codex P1: with only a 3.9 python3 plus a
floor-qualified python3.12 on PATH, dev-init created the venv from the 3.9
host interpreter, the resolver then rejected that venv, and the requirements
install fell back to the global interpreter. dev-init now bootstraps the venv
with dev_harness_python's own pick (floor-qualified when one exists) and
refuses — exit 1 with lane-bootstrap guidance — unless the final resolved
interpreter lives inside backend/.venv, so pip can never target a global or
foreign interpreter. Covered by two new behavioral tests (floor-qualified
bootstrap; refusal on PYTHON override).
…cal venv

Oracle follow-up: the substring guard (*backend/.venv/*) let a PYTHON override
pointing at another checkout's backend/.venv pass and install this repo's
requirements there. dev-init now resolves the interpreter's physical path and
requires it to equal $PWD/backend/.venv/bin/python. Covered by
test_dev_init_refuses_a_foreign_checkout_venv_override (lane: 572 passed /
6 skipped / 20 xfailed).
…ntainment)

Oracle follow-up: pwd without -P and an unresolved interpreter symlink let a
repo-local backend/.venv/bin/python symlink redirect installs to a foreign
interpreter. The guard now resolves the checkout path (-P) and the interpreter
symlink, then requires containment within this repo's backend/.venv realpath
(lane: 572 passed / 6 skipped / 20 xfailed).
Oracle follow-up (round 2): even with pwd -P and symlink resolution, a
repo-local backend/.venv/bin/python symlink can point at a foreign
interpreter, and file-containment cannot work because a real venv python is
itself a symlink to the base interpreter. dev-init now asks the resolved
interpreter for sys.prefix and requires it to equal this repo's
backend/.venv realpath (both physical): a foreign interpreter reports its own
prefix, a real venv python — however symlinked — reports the venv. Fixture and
bootstrap stubs report their venv prefix so the tests exercise the real
contract (lane: 572 passed / 6 skipped / 20 xfailed).
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Independent review follow-up (Codex P1 on dev-init + Oracle hardening rounds): the venv is now bootstrapped with the resolver's floor-qualified pick, and dev-init refuses (exit 1 + make lane-bootstrap guidance) unless the resolved interpreter's sys.prefix equals this repo's backend/.venv realpath — the membership check survives both foreign-checkout overrides and symlinked venv pythons. Oracle verdict on the final delta: VERDICT: APPROVE. Lane: 572 passed / 6 skipped / 20 xfailed.

Re-running the resolver after venv creation rejected the fresh venv — it
cannot import dotenv/yaml before this install — and fell back to a global
interpreter on every fresh checkout. dev-init now binds the install directly
to $PWD/backend/.venv/bin/python right after creating it; the sys.prefix
membership check still refuses a venv python that resolves into a foreign
interpreter. Refusal tests now spoof via a symlinked repo venv python (the
exact shape the check defends) (lane: 572 passed / 6 skipped / 20 xfailed).
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Independent review follow-up: Codex's fresh-venv P1 (post-creation re-resolution rejected the not-yet-importable venv and fell back to a global interpreter) is fixed in 000a7c3 — the install binds directly to backend/.venv/bin/python with the sys.prefix membership guard intact. Independent gpt-5.5-pro re-review of the delta: VERDICT: APPROVE. Lane: 572 passed / 6 skipped / 20 xfailed.

@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: 000a7c3d56

ℹ️ 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 scripts/dev-harness/dev-init.sh Outdated
echo "Created backend/.venv (with $BOOTSTRAP_PY)"
fi

PYTHON_BIN="$PWD/backend/.venv/bin/python"

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 Badge Select the executable for the detected venv layout

On native Windows, both an existing and a newly created venv use backend/.venv/Scripts/python.exe, a layout that line 25 and the shared resolver explicitly accept. This assignment nevertheless always selects the nonexistent POSIX bin/python, so the prefix probe fails and every make dev-init run exits before installing dependencies or hooks; select the executable for whichever layout was detected above.

AGENTS.md reference: AGENTS.md:L34-L34

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 5c1991b: dev-init selects the executable for the layout that exists — $PWD/backend/.venv/bin/python or Scripts/python.exe — instead of hard-coding the POSIX path, and exits with guidance if the venv exists but has no interpreter.

Comment thread scripts/dev-harness/dev-init.sh Resolved
…the bootstrap interpreter (Codex P1+P2)

- dev-init picks backend/.venv/bin/python or Scripts/python.exe by existence
  (native Windows layout) instead of hard-coding the POSIX path, which made
  every make dev-init exit before install on Windows.
- the bootstrap interpreter is floor-checked (dev_harness_python_floor_ok +
  the documented advisory) before creating the venv, so a bare-3.9-only host
  stops with guidance instead of provisioning a venv every resolver call
  rejects. Lane: 572 passed / 6 skipped / 20 xfailed.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Independent review follow-up: Codex's Windows-layout P1 (hard-coded POSIX venv path) and bare-3.9-bootstrap P2 are fixed in 5c1991b — the venv executable is selected by detected layout and the bootstrap interpreter is floor-checked with the documented advisory before creation. Independent gpt-5.5-pro re-review: VERDICT: APPROVE. Lane: 572 passed / 6 skipped / 20 xfailed.

@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: 5c1991bd1f

ℹ️ 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 scripts/dev-harness/dev-init.sh Resolved
Comment thread scripts/dev-harness/dev-init.sh Resolved
…(Codex P1 x2)

- dev_harness_backend_pinned_python discovers the repo-pinned 3.11 runtime
  (PATH python3.11, then uv-managed — the lane-backend toolchain) so dev-init
  provisions the interpreter the backend pylock (>=3.11,<3.12) and
  mobile_doctor require, falling back to the floor pick with an explicit
  advisory only when no 3.11 is discoverable.
- dev-init now tracks whether backend/.venv pre-existed and refuses to run
  the requirements install when the resolver rejects that venv (below the
  3.10 floor or missing cheap-gate imports) — previously the executable-only
  condition skipped every check and the install ran under 3.9 while the
  resolver ignored the same venv.
… fallback (Oracle review)

- A pre-existing floor-OK venv missing cheap-gate packages is the recoverable
  shape of an interrupted first run: dev-init now completes the install
  instead of refusing it (refusing would deadlock the recovery path). Only a
  below-the-floor venv is refused.
- dev_harness_backend_pinned_python now enforces the full pinned range
  (>=3.11,<3.12), not just the 3.10 floor, and converts uv's native Windows
  path via cygpath before the executability probe (Git Bash).
- When no 3.11 is discoverable, dev-init attempts 'uv python install 3.11'
  (the lane-backend precedent) before falling back to the floor pick with the
  explicit pylock advisory.

@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: 8dad2b88fc

ℹ️ 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 scripts/dev-harness/dev-init.sh Outdated
Comment on lines +38 to +40
BOOTSTRAP_PY="$(dev_harness_python)"
echo "dev-init: no pinned Python 3.11 discoverable; bootstrapping with the floor pick $BOOTSTRAP_PY" >&2
echo "dev-init: the backend pylock is >=3.11,<3.12 — run 'make lane-backend' to upgrade this venv to 3.11." >&2

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 Badge Require 3.11 before bootstrapping the backend venv

When no Python 3.11 is discoverable but python3.12/python3.14 is on PATH, this fallback still creates backend/.venv with that interpreter. The newly retained BOOTSTRAP_PY="$(dev_harness_python)" branch is fresh evidence beyond the earlier 3.11 review: every backend/pylock*.toml declares >=3.11,<3.12, and mobile_doctor._check_backend_venv rejects any non-3.11 venv, so dev-init either fails during requirements installation or reports success with an environment the documented mobile doctor immediately blocks; stop with the 3.11 setup remedy instead of provisioning it.

AGENTS.md reference: scripts/dev-harness/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

…venv guard to 3.11 (Oracle review round 2)

- dev-init no longer falls back to the 3.10 floor pick when no 3.11 can be
  discovered or provisioned: the backend requirements install serves the
  backend (pylock >=3.11,<3.12), so without 3.11 it exits 1 with install
  guidance instead of silently creating a backend-incompatible venv.
- The pre-existing-venv guard now enforces the strict >=3.11,<3.12 pin via
  the shared dev_harness_venv_python_is_pinned_311 predicate: 3.11 (complete
  or interrupted) proceeds; 3.9/3.10 and 3.12+ are refused.
- Tests: refusal-without-311, uv-provisioned 3.11, below-floor venv refusal
  updated to the pin contract; the floor-fallback bootstrap test is retired
  (the fallback it pinned is gone by design).

@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: 2a26ff3a88

ℹ️ 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 scripts/dev-harness/_resolve_python.sh Resolved
Comment thread scripts/dev-harness/dev-init.sh Resolved
Comment thread scripts/dev-harness/dev-init.sh Resolved
@Git-on-my-level

Copy link
Copy Markdown
Member Author

CI note on head 2a26ff3: Mobile App Checks failed with exactly 2 Dart test failures in app/test/unit/sync_poll_storm_test.dart (Transcribe Later 404 auto-reupload + shared 18/min budget) — a surface this PR never touches (the PR diff is scripts/dev-harness bash + their tests only; 928 upstream commits touch app/ since the merge-base). main's own current run (38582830611) shows the same lane red right now via Android Emulator Acceptance. Treating it as the known flaky lane; re-running the failed jobs.

… pin recovery hints (Codex round 4)

- dev_harness_backend_pinned_python accepts an explicit PYTHON= override that
  passes the pin, before the fixed-name and uv probes (Codex P1).
- The sys.prefix membership check cygpath-normalizes a native Windows prefix
  before the physical-path comparison (Codex P1).
- Every recovery hint now names the pinned runtime (python3.11 -m venv or
  make lane-bootstrap) instead of the ambient python3 alias, which on a
  3.9/3.12+ host would recreate a venv the strict check refuses (Codex P2).

@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: c5b35cab53

ℹ️ 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 scripts/dev-harness/_resolve_python.sh Resolved
Comment thread scripts/dev-harness/dev-init.sh Resolved
…ry hint (Codex round 5)

- dev_harness_backend_pinned_python probes the absolute Homebrew 3.11
  prefixes (keg-only 'brew install [email protected]' — the remedy the resolver
  advertises) before requiring uv; the list lives in an overridable
  dev_harness_backend_pinned_prefixes function (Codex P1).
- The sys.prefix membership refusal now tells the user to remove and recreate
  backend/.venv pinned with 3.11 (or lane-bootstrap) instead of the
  ineffective 'install Python >= 3.10 and re-run' non-remedy (Codex P2).

@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: f8bf8b513f

ℹ️ 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 scripts/dev-harness/dev-init.sh Resolved
Comment thread scripts/dev-harness/_resolve_python.sh Resolved
…Codex round 6)

- The not-pinned-venv recovery hint now says 'rm -rf backend/.venv && dev-init'
  — dev-init re-runs the full pinned discovery (PATH name, keg-only Homebrew
  prefixes, uv) so it completes on every host shape the resolver supports;
  lane-bootstrap stays as the uv alternative (Codex P2).
- Fallback/absence fixtures neutralize the host's real keg-only Homebrew 3.11
  (empty dev_harness_backend_pinned_prefixes in the fixture resolver copy and
  in the resolver-function harness) so local preflight exercises the intended
  paths on every host (Codex P2).

@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: 04419408e2

ℹ️ 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 scripts/dev-harness/dev-init.sh Resolved
…d-override fixture (Codex round 7)

- The not-pinned-venv recovery hint now names 'make dev-init' — the actual
  target — instead of a bare 'dev-init' command that does not exist (Codex P2).
- test_backend_pinned_python_rejects_below_pin_python_override neutralizes the
  host's keg-only Homebrew prefixes too: after the override is rejected, a real
  host prefix must not legitimately answer (Codex P2).
@Git-on-my-level
Git-on-my-level merged commit e8e1f25 into BasedHardware:main Oct 14, 2026
36 checks passed
PINYOPATTANAWASANPORN added a commit to PINYOPATTANAWASANPORN/omi that referenced this pull request Oct 18, 2026
… and README (BasedHardware#22079)

Align AppSetup.mdx and app/README.md with scripts/dev-harness/dev-init.sh
behavior since BasedHardware#21413, which automatically resolves or provisions
Python 3.11 via python3.11, Homebrew [email protected], or uv.

Closes BasedHardware#22079
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