Fix cloud workspace sidebar directory and git provenance

Merged
AU
2mo ago
+307-23

Cloud workspace sidebar rows could inherit the Mac launch directory, branch, and pull-request metadata because cmux-tui bindings and projections were outside the existing remote-directory provenance boundary. This change keeps Cloud rows tied to trusted machine state.

The fix:

  • Treat cloudVMBinding and non-local cloudProjectedResource panels as remote directory provenance.
  • Reject local cwd fallback and local git/gh probing for Cloud panels, including passive reports and restore paths.
  • Feed cmux-tui terminal cwd values from accepted Cloud snapshots through the trusted remote-directory path; clear stale remote directory state when a terminal has no cwd or a non-terminal projection replaces it.
  • Keep Cloud branch and PR rows empty until trusted remote metadata exists.
  • Preserve the invariant across new bindings, projection reconciliation, and session restore, while retaining existing local and SSH behavior.
  • Keep projection membership indexed so provenance checks do not rescan the catalog for every sidebar row.

Fixes #12347.

Validation

  • Regression commit 4742ba78b6 adds the failing Cloud provenance coverage; edc46c4997 implements the fix.
  • Passed python3 scripts/swift_file_length_budget.py.
  • Passed ./scripts/lint-pbxproj-test-wiring.sh.
  • Passed python3 scripts/check-workspace-package-groups.py --check and python3 scripts/check-package-resolved-policy.py.
  • Tagged fleet build was attempted with CMUX_DEV_BACKEND_MODE=off through reload-cloud.sh. The build reached Swift compilation but was blocked by three pre-existing origin/main errors in CmuxTuiSurfaceProvider+Environment.swift (waitForScreen missing and an obsolete fallbackTabID argument); no error was reported in this issue's changed files.
  • No live app was launched or user workspace disturbed.