SIGN IN SIGN UP

fix(acp): make the UNC pushd detour survive the paths it accepts

Three defects in the batch-launcher detour, all of which fire on exactly
the setup it was written for — a Windows session on a UNC workspace:

- `\\?\UNC\...` was detected as a UNC workspace but emitted verbatim, and
  cmd.exe resolves no extended-length path at all. `pushd` would fail and
  `&&` would take the whole agent launch down with it. It is now folded
  back to the plain `\\server\share\...` spelling.
- A trailing separator on the cwd was doubled into `\\` by
  `append_windows_batch_arg`. That is right for an argument a batch file
  re-parses and wrong for a cmd built-in, which never unescapes its own
  command line, so the pair reached `pushd` verbatim. Trimmed.
- A relative launcher was handed straight to cmd.exe, whose search order
  starts at the current directory — which `pushd` has just pointed at the
  workspace. Rust resolves a bare program name against PATH and never
  against the child's cwd, so this let an `agent.cmd` committed to a repo
  shadow the trusted one. The detour now requires an absolute launcher
  and anything else keeps the direct spawn.

The "is this launch taking the detour?" predicate was also evaluated in
two places that had to agree; it is now one `windows_pushd_cwd`, read by
both the command line and the `current_dir` call.
X
xintaofei committed
40828982f8cd35770f5e6b63e9198031cd3f7a15
Parent: 784a6a0