Skip to content

fix(ci): make Windows preflight path-safe - #10825

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-preflight-msys-paths
Jul 30, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-preflight-msys-paths

Conversation

@tianmind-studio

@tianmind-studio tianmind-studio commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Make the repository preflight executable from ordinary Windows PowerShell, including checkouts whose absolute path contains spaces and non-ASCII characters.

  • Resolve Bash from the active Git for Windows installation instead of invoking the System32 WSL launcher.
  • Make GNU Make, hooks, release guards, readiness checks, and dev-harness entrypoints share the same Bash/Python resolver.
  • Reuse the repository Windows virtualenv (Scripts/python.exe) while preserving interpreter-specific PYTHONPATH separators.
  • Normalize manifest bash and python3 commands at the runner boundary, and decode Git/check output as UTF-8 instead of the Windows ANSI code page.
  • Preserve Unicode Git paths and checkout roots through preflight selection, child environments, and single-flight fingerprints.
  • Make Windows cancellation/liveness handling read-only and race-safe with isolated process groups, CTRL_BREAK_EVENT, and Win32 wait state.
  • Run readiness behavior fixtures through Git Bash and the selected native Python.
  • Keep Ruby/iOS and POSIX permission contracts on Linux/macOS, where their semantics are faithful, while retaining Linux CI coverage.
  • Keep security-sensitive token mode checks fail-closed on Windows; only the unrelated candidate-provenance fixture mocks that boundary.
  • Remove fixed test-output paths and nested Make banner leakage that made checks order- or host-dependent.

Product invariants affected

none

How it was verified

  • After syncing origin/main and dropping overlap already merged through test(setup): make linked-worktree fixture Windows-safe #10838, fix(ci): parse SwiftLint baseline URIs independent of host #10842, and fix(dev-harness): keep qualification cleanup portable on Windows #10843, the PR diff is down from 40 files to 34 files.
  • The current PR head ff80da22a passed the official make preflight: 70 selected checks in 273.24s.
  • A larger pending Windows integration stack passed make preflight from J:\codex-omi-work\路径 空格\omi-main-20260729: 79 selected checks in 323.17s.
  • Dev-harness unit suite: 69 passed, 13 expected platform skips.
  • Preflight contract suite: 36 passed, 2 expected platform skips.
  • Manifest runner suite: 39 passed, 1 expected platform skip.
  • Readiness behavior: 5 passed.
  • Failure-class guard ratchet: 14 passed plus a real 90-day history scan.
  • Desktop backend candidate probe: 14 passed.
  • Desktop beta retry contract: 30 passed.
  • Setup contract passed baseline provisioning, dependency-sync rerun, and linked-worktree fallback.
  • Ruff, Bash syntax, and diff hygiene passed for touched modules.

The desktop changes are internal-only. Local verification used PRE_PUSH_SKIP_DESKTOP_CHANGELOG=1, the documented equivalent of the required no-changelog-needed label; please add that label rather than publishing a user-facing changelog entry.

Tests

Coverage includes Git for Windows discovery, MSYS/native path conversion, Windows virtualenv resolution, Unicode checkout paths, UTF-8 subprocess output, joined/rejected single-flight behavior, cancellation forwarding, readiness orchestration, platform-scoped contracts, release guards, firmware guard execution, SwiftLint shell contracts, and security-sensitive candidate fixtures.

Failure class (fixes)

Failure-Class: none

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for tightening this Windows-specific release guard coverage. I reviewed the diff and also ran the three focused test_run_checks.py cases locally; they pass on Linux with the Windows helper behavior covered through injected platform/runner fakes.

This looks like a reasonable CI-only fix: it avoids resolving the System32 WSL launcher as bash, uses the Git for Windows install to find bash.exe, converts MSYS paths back through that same shell with cygpath -w, and compares filesystem identity rather than raw path spelling. I did not see a supply-chain/security concern or a hidden workflow expansion in this patch.

Because this touches release/CI guard logic, I’m leaving this as a positive signal rather than a formal approval; a maintainer should still make the final call on the workflow/release-test behavior before merge.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior needs-maintainer-review Needs a human maintainer to sign off before merge labels Jul 29, 2026
@tianmind-studio
tianmind-studio force-pushed the codex/windows-preflight-msys-paths branch from 894f09f to dcbcef4 Compare July 29, 2026 09:06
@tianmind-studio tianmind-studio changed the title fix(ci): make release guard contract test Windows-safe fix(ci): make release guard checks Windows-safe Jul 29, 2026
@tianmind-studio tianmind-studio changed the title fix(ci): make release guard checks Windows-safe fix(ci): make Git Bash checks Windows-safe Jul 29, 2026
@tianmind-studio

Copy link
Copy Markdown
Contributor Author

The hermetic scope check was canceled during actions/checkout after a two-minute fetch; no repository step ran. I do not have permission to rerun the workflow, so this one needs a maintainer rerun.

@tianmind-studio

Copy link
Copy Markdown
Contributor Author

Fresh native-Windows integration on current origin/main (6d92466) is green. I stacked this head with #10715, #10838, #10841, #10842, #10843, #10844, and #10845, then ran the official make preflight: all 30 selected manifest checks passed in 223.41s. This includes the real Git Bash/Python launcher boundary, setup rerun contract, release guards, 67 dev-harness tests (11 platform skips), UTF-8 history/source scans, runtime-image closure, SwiftLint config, and desktop-backend candidate fixtures.

@tianmind-studio tianmind-studio changed the title fix(ci): make Git Bash checks Windows-safe fix(ci): make Windows preflight path-safe Jul 29, 2026
@tianmind-studio

tianmind-studio commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Maintainer action needed: please add the no-changelog-needed label. The new desktop path is an internal preflight checker, so a user-facing changelog fragment would be misleading. I ran the exact local equivalent (PRE_PUSH_SKIP_DESKTOP_CHANGELOG=1) in a real Chinese-plus-space checkout; all 31 selected checks passed.

@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.

Direction is right (path-safe preflight on Windows). Not merging: 1,422 lines across 40 files rewires the shared preflight runner, checks manifest and run_checks — past the scoped-diff bar for an auto-merge on CI machinery.

@tianmind-studio

tianmind-studio commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Latest head ff80da22a is code-green and current with main.

The only failing conclusions are PR Metadata Preflight and Hygiene, both the same expected desktop-changelog-entry gate. These desktop changes are internal preflight/release-check tooling, so a user-facing changelog fragment would be misleading. Maintainer action remains: add no-changelog-needed.

Git-on-my-level added a commit that referenced this pull request Jul 30, 2026
## What changed and why

Closes #8498. Closes #10488.

Windows Rewind now reacts to foreground-window changes and follows that
window across displays without keeping multiple capture streams alive.

- The existing WinEvent hook requests an immediate sample on a
foreground change.
- Screen sources are cached as an ID-to-display map instead of caching
only the primary source.
- The foreground window's physical Win32 rectangle is converted to
Electron DIP coordinates and matched to its display, with cursor and
primary fallbacks.
- The renderer replaces its single persistent 1 fps stream only when the
target display changes, preserving the current quality tier and capture
cadence.
- Each save includes its capture source ID. The main process revalidates
that source before ingestion and drops stale frames when focus moved
displays during stream setup or JPEG encoding.
- The stream replacement path retains the `ended`/`mute` recovery merged
in #10829, including initial-muted rejection and generation-fenced
late-event handling.

Capture-disabled, lock/idle, excluded-app, sensitive-title, size, and
duplicate-frame guards remain authoritative in the existing
`ingestRewindFrame` path.

## Product invariants affected

none

## How it was verified

- Synced with current `origin/main` (`df314540b`) at head `c92147266`.
- `npm run build` passed with the final code, including main/preload and
renderer typechecks, bytecode verification, extension bundling, and the
production renderer bundle.
- A detached Windows integration used #10825 solely as the path-safe
preflight runner; the committed 44-file composition passed all 70
selected checks in 188.34s. This PR's own diff remains 10 files.
- Targeted ESLint and Prettier passed for the two conflict-resolved
capture-host files.
- `git diff --check` passed.
- A native Windows Electron smoke probe previously exercised
`SetWinEventHook -> foregroundCaptureTrigger -> BrowserWindow IPC`; two
programmatic foreground-window changes produced `events=2`.
- The current Windows host exposes one physical display, so a real
dual-monitor switch was not hardware-tested here. Multi-display source
selection, per-monitor DPI conversion, stream replacement, stale-source
rejection, and muted/dead-track recovery are covered by tests.

## Tests

- `vitest run src/main/rewind/sourceId.test.ts
src/main/rewind/foregroundCaptureTrigger.test.ts
src/renderer/src/components/rewind/RewindCaptureHost.test.tsx` passed: 3
files, 29 tests.
- Coverage includes source-map caching and invalidation,
foreground/cursor/primary display selection, physical-to-DIP conversion,
source switching, late old-track events, stale-source rejection, burst
coalescing, muted/dead-track recovery, and disabled/unmounted capture.
- A full Windows Vitest run on the prior head reached one unrelated
`Apps.errorToast.test.tsx` timeout under full-suite load; that untouched
file passed 2/2 immediately on an isolated rerun. All Rewind tests
remained green.

## Failure class (fixes)

Failure-Class: none
@Git-on-my-level
Git-on-my-level force-pushed the codex/windows-preflight-msys-paths branch 7 times, most recently from fb176bf to 5a5795c Compare July 30, 2026 05:05
Failure-Class: none

Route pre-push and preflight shell contracts through Git Bash / native
tools on Windows so MSYS/Unicode paths don't break manifest runner,
release guards, SwiftLint, firmware checks, and dev-harness scripts.
Add _bash_command() and _native_path_from_bash() helpers with
Git-for-Windows discovery. Decode Git output as UTF-8. Skip POSIX-only
checks on Windows.
@Git-on-my-level
Git-on-my-level force-pushed the codex/windows-preflight-msys-paths branch from 5a5795c to 7627043 Compare July 30, 2026 05:09
@Git-on-my-level
Git-on-my-level merged commit 7dc9301 into BasedHardware:main Jul 30, 2026
27 of 29 checks passed
@Git-on-my-level

Copy link
Copy Markdown
Member

Resolved — Windows pre-push/preflight contracts now portable on MSYS (Git Bash routing, UTF-8 path decoding). CI green on all required gates.

Git-on-my-level added a commit that referenced this pull request Jul 30, 2026
#10825 removed explicit --check-id support while
windows-preflight-portability.yml still passes named checks, so any PR that
touches the checks manifest fails Native Windows portability before checks run.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Git-on-my-level added a commit that referenced this pull request Jul 30, 2026
macOS /bin/bash rejects ${var,,}, which aborted local pre-push after #10825
when sourcing the dev-harness python resolver.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Git-on-my-level added a commit that referenced this pull request Jul 30, 2026
#10825 dropped pre-push-worktree-fallback and preflight-runner-portability
from the checks manifest while windows-preflight-portability.yml still
selects them by --check-id.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Co-authored-by: Cursor <[email protected]>
Git-on-my-level added a commit that referenced this pull request Aug 1, 2026
macOS /bin/bash rejects ${var,,}, which aborted local pre-push after #10825
when sourcing the dev-harness python resolver.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Git-on-my-level added a commit that referenced this pull request Aug 4, 2026
## Summary

- Root cause of Windows auto-update breakage after v1.0.30: production
is missing `/v2/desktop/update-feed/windows` (merged in #10610) while
Windows clients fail closed without it.
- Gate `desktop_windows_release.yml` on a production probe of that route
**before** tagging, so a missing backend deploy cannot mint another
broken cohort.
- Register failure class `FC-ship-before-required-route` and document
the deploy-before-ship contract.
- Restore `--check-id` support in `run_checks.py` and the Windows
portability manifest checks that #10825 dropped while
`windows-preflight-portability.yml` still depends on them (fixes Native
Windows process and launcher contracts).
- Keep the Windows python-path detect bash-3.2-safe so macOS pre-push
can source the harness resolver.

Closes SCA-256

## Test plan

- [x] `python3 .github/scripts/test_probe_windows_update_feed.py` (8
passed)
- [x] `python3 .github/scripts/test_run_checks.py` (40 passed)
- [x] `python3 .github/scripts/run_checks.py --lane ci --base HEAD
--head HEAD --platform windows --check-id check-manifest-contract
--list`
- [ ] CI green on PR #10883

## Failure class

Failure-Class: new

## Product invariants

None matched by path globs for this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-maintainer-review Needs a human maintainer to sign off before merge workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants