Skip to content

Windows 경로 모델: 기계 사이의 경로를 한 가지 철자로 싣습니다 (hide_platform::path) - #332

Merged
yansfil merged 5 commits into
mainfrom
platform/path-model
Oct 3, 2026
Merged

yansfil merged 5 commits into
mainfrom
platform/path-model

Conversation

@yansfil

@yansfil yansfil commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Refs with-hide/hide-private#103

Summary

Windows에서 편집기가 모든 파일을 거절하고 파일 색인이 src\main.rs로 답하던 문제를, 경로를 기계 사이에 한 가지 철자로 싣는 모델로 고칩니다.
hide_platform::path가 그 경계입니다: 상대 경로는 RelPath(UTF-8, / 구분, 정규화, 루트 밖으로 못 나감), 절대 경로는 "wire 철자"입니다.
wire 철자는 macOS/Linux에서 지금의 네이티브 철자 그대로이고, Windows에서는 C:/repo, //server/share/x(/ 구분, \\?\ 제거, 드라이브 대문자)입니다.
경로를 소유한 기계만 변환합니다: 나갈 때 to_wire/relative, 들어올 때 from_wire/RelPath::to_native. 다른 기계는 이름 단위 도우미(wire_relative, wire_join, wire_name)만 씁니다.
그래서 Unix에서만 돌던 handshake의 Explorer 열기 단계와 파일 색인 테스트가 이제 Windows에서도 돕니다.

Review

  • 판단해 주세요: 핸드오프의 방향("절대 경로는 기기 고유의 불투명 값, 웹은 표시만")과 다르게 갑니다. 이유는 아래 두 줄입니다.
  • 웹 셸(explorer.ts, actions.ts, 터미널 링크)과 저장 상태(expanded_paths, 탭, workspace-views.json)가 이미 절대 경로를 /로 잇고 비교합니다.
  • 불투명 값으로 가면 그 전부를 기기 왕복으로 바꿔야 하고, 한 철자로 가면 Unix wire는 그대로이고 기존 / 로직이 Windows에서도 맞습니다.
  • 판단해 주세요: relative-path 크레이트 대신 작은 타입을 직접 썼습니다. RelativePathBuf는 .., 선행 /, \를 받아들이고, to_path가 이름을 그대로 붙여 Windows에서 a\.. 이름이 루트를 벗어납니다. 불변식 전체를 감싸개가 지켜야 해서 크레이트가 더해 주는 것이 String 하나뿐입니다(camino는 절대/네이티브 UTF-8 경로용이라 이 문제가 아닙니다).
  • wire에서 보이는 변화 (macOS/Linux): 바이트 동일합니다. 예외는 더 엄격해진 입력뿐입니다.
    • 상대 경로 a/, a//b, a/./b는 이제 거절됩니다. 웹은 목록 항목에서 경로를 만들기 때문에 이런 경로를 보내는 쪽은 찾지 못했습니다.
    • UTF-8이 아닌 이름은 색인에서 빠집니다. 예전에는 대체 문자로 보였습니다.
    • UTF-8이 아닌 호출자 cwd는 path_unavailable로 답합니다.
    • Unix에서 file:///C:/a는 이제 C:/a로 읽힙니다.
  • wire에서 보이는 변화 (Windows): 절대 경로는 C:/..., 상대 경로는 src/main.rs, file URL은 file:///C:/a입니다. Herdr가 보고한 경로는 wire.rs에서 바뀌고, Herdr에게는 Herdr의 철자로 되돌려 보냅니다.
  • 조심해서 볼 파일:
    • herdr-core/src/wire.rs: Herdr contract 경계라서 봐야 합니다. herdr_path/herdr_param이 이 기계의 철자만 바꾸고 다른 기기의 철자는 그대로 둡니다.
    • hide-platform/src/path.rs: relative는 철자가 대소문자로만 다를 때만 볼륨에 묻습니다(case_sensitive). 호출자는 files::local_relative 하나이고 worker에서 돕니다. runtime mutex 밖입니다.
    • hided/src/boundary.rs, browser_routes.rs: failure path라서 봐야 합니다. 루트 밖과 ..는 여전히 거절되고, 모든 읽기가 host의 relative_path(to_native)를 지납니다.
  • 원칙: 1(옛 / 가정 코드는 바꾸지 않고 지움), 2(한 철자, 변환 지점 둘), 4(PathError로 그 자리에서 거절), 6·7(크레이트를 먼저 검토, std Path와 기존 identity 재사용), 8(기기 간 경로 계약), 12(계약 테스트는 세 OS에서 같은 파일), 13(호출자 하나가 아니라 모든 송신 지점).

Evidence

  • 확인한 것:
    • macOS에서 scripts/verify-cargo.sh test 전체 통과(56 suites)와 lint 통과.
    • Windows 대상 cargo clippy --workspace --all-targets -D warnings 통과. 크로스 컴파일만 했고 실행하지 않았습니다.
    • hide-platform/tests/path.rs 6개 계약은 Linux/Windows os contract와 macOS desktop-e2e에서 돕니다. 같은 상대 철자, \\?\ 루트, ..·절대·다른 드라이브 거절, 볼륨별 대소문자를 봅니다.
    • Windows windows check가 handshake의 Explorer 열기 단계와 파일 색인 테스트를 이번에 처음 실행합니다.
    • 독립 리뷰의 Fix now 3건을 고쳤습니다.
      • 중첩 저장소 nested/가 Changes에서 사라지던 것: 회귀 테스트를 추가했고, 수정 없이 실패하는 것을 확인했습니다.
      • UTF-8이 아닌 이름 하나가 색인을 truncated로 표시하던 것.
      • worktree.create/worktree.list의 경로가 wire 철자를 거치지 않던 것.
  • 확인하지 못한 것:
    • Mac에서 본 Windows 기기의 경로는 아직 철자를 바꾸지 않습니다(ARCHITECTURE의 "Not spelled yet").
    • Windows 데스크톱 호스트가 페이지에 주는 답과 드라이브 루트 자체를 체크아웃으로 쓰는 경우도 확인하지 않았습니다.
    • Windows 볼륨에서 대소문자가 다른 cwd 매칭은 실기기로 확인하지 않았습니다.
    • 계약 스키마(contracts/hided-ws.schema.json)의 문구는 바꾸지 않았습니다. 필드 모양은 그대로입니다.
리뷰의 Follow-up 중 남긴 것
  • wire_relative/wire_join이 절대 경로가 아닌 루트를 스스로 거절하지 않습니다. 지금은 호출자 다섯 곳이 검사합니다.
  • UNC 서버·공유 이름의 대소문자를 접지 않습니다. 이름은 정확히 비교합니다.
  • git::changes가 scope를 두 번 파싱합니다.
  • Windows 기기를 원격 기기로 쓰는 경로(Mac에서 본 Windows 철자)는 기기 브리지 작업 이후에 실제로 확인할 수 있습니다.

A path below a root is a RelPath: UTF-8 names joined by `/`, no leading
`/`, no empty, `.` or `..` name. An absolute path keeps its root and
changes only its separators: `/repo` on macOS and Linux, `C:/repo` and
`//server/share` on Windows, without a `\\?\` prefix where the short
spelling means the same path. Only the machine that owns a path converts
it (to_wire and relative out, from_wire and RelPath::to_native in), and
to_native refuses a name the system cannot hold as written. Everything
else relates wire spellings by their names alone.

The contract tests run on all three systems: one relative spelling for a
file below a checkout, a `\\?\` root relating to its short spelling,
`..`, absolute input and another drive refused with a typed error, and
case following the root's volume.
hide_host::relative_path parses a RelPath and converts it to this
machine's names, so a Windows helper reads `src/main.rs` and refuses a
name it cannot hold. The file index answers `/`-joined rows on every
system, Git's changed files are scoped by names rather than by native
path rules, and an Explorer name Windows would read as something else
(a `\`, a device name, a trailing dot) is refused before it is made.
The core relates a checkout's paths by names alone (relative_under,
Explorer changes, reveal folders, History scope and diffs), so it judges
a device's paths the same whatever system the device runs and never
reads them by this machine's rules. Paths this machine produces become
the wire spelling where they are made: the catalog (with the short
canonical spelling instead of `\\?\` paths), what Herdr reports (in
wire.rs, which also hands Herdr its own spelling back), hided's boundary
answers, the file index, the CLI's caller path and file URLs
(`file:///C:/a` on Windows). On macOS and Linux each of these is the
spelling it always was.

The handshake tests send what a client sends, so the Explorer's open of
a file inside its checkout and the file index test run on Windows too.
… failures

Git marks an untracked folder it does not enter (a nested repository)
with a trailing `/`, which the relative spelling refuses, so the entry
fell out of Changes and a checkout whose only change was one read as
clean; the marker is dropped before the path is read, as it was before.
A name the wire cannot carry is left out of the file index without
calling the walk truncated, and the paths of `worktree.create` and
`worktree.list` are spelled like every other path Herdr reports.

A name this system cannot hold is now reported as that, not as a path
outside the checkout; `relative_path` is the host's own again and the
unused conversion to `io::Error` is gone.
@yansfil
yansfil merged commit 8b080a3 into main Oct 3, 2026
21 checks passed
@yansfil
yansfil deleted the platform/path-model branch October 3, 2026 10:46
yansfil added a commit that referenced this pull request Oct 3, 2026
Refs #293

## Summary

Windows는 지금까지 `HIDE_OPEN_COMMAND`(명시적 파일 열기 CLI)를 부팅 때 거절했습니다. Unix는 데몬이
죽어도 그 CLI의 프로세스 트리가 끝나도록 supervisor와 owner 소켓 쌍을 두는데, Windows에는 그 대응이
없었기 때문입니다.
이제 Windows에서는 그 CLI를 `OwnedChild`로만 실행합니다. job
object(`KILL_ON_JOB_CLOSE`)가 stop, 10초 timeout, Drop, 그리고 hided가 소멸자 없이
죽는 경우까지 트리 전체를 끝냅니다.
두 시스템이 `OwnedOpener` 하나와 handler의 실행 경로 하나를 같이 씁니다.
opener lifecycle 테스트는 테스트 바이너리 자신을 가짜 CLI로 씁니다(sh 또는 `.cmd` 두 줄 스크립트).
그래서 같은 테스트가 세 OS에서 돕니다. 이 테스트와 opener가 필요한 handshake 테스트를 `windows
check`가 실행합니다.
#332(경로 모델)와 #334(필수 `windows check`) 위로 rebase했습니다. opener는 이제 CLI에 경로를
wire 철자를 거쳐 넘깁니다. Windows에서 데몬이 canonicalize한 `\\?\C:\x`가 아니라 `C:\x`를
받습니다. `code.cmd` 같은 명령줄 프로그램은 `\\?\` 접두사를 읽지 못하기 때문입니다.

## Review

- **판단해 주세요**: Unix는 supervisor를 유지합니다(원칙 2를 따르지 못한 이유).
- 어떤 Unix도 소유자가 죽을 때 프로세스 그룹 전체를 끝내 주지 않습니다. Linux `PR_SET_PDEATHSIG`는
직계 자식 하나만, 그것도 스레드 기준으로 보고, macOS에는 아예 없습니다.
  - 그래서 한 모델로는 owner-death 보장을 지킬 수 없습니다.
- **판단해 주세요**: Windows에서 CLI가 직접 띄운 프로세스는 job 안에 남아 CLI가 끝날 때 같이 끝납니다.
  - 예: 편집기가 떠 있지 않을 때 `code.cmd`가 띄운 편집기도 같이 끝납니다.
  - 셸이나 이미 떠 있는 앱이 연 것은 job 밖이라 남습니다.
- Unix에서 `setsid`로 빠지는 경우와 다릅니다. job을 CLI 종료 때 끝낼지, timeout·종료·데몬 사망 때만
끝낼지 정해 주세요. 지금은 Unix의 "CLI가 끝나면 그룹을 끝낸다"에 맞췄습니다.
- **조심해서 볼 파일**:
- `hide-platform/src/process.rs`: 콘솔이 없는 소유자(분리된 데몬)일 때만 Windows
`OwnedChild`에 `CREATE_NO_WINDOW`를 더합니다. 그렇지 않으면 콘솔 프로그램(`.cmd` 포함)마다 보이는
창이 뜹니다. 콘솔이 있는 소유자는 예전처럼 자식과 콘솔을 나눕니다. 모든 자식에 더했더니 자식마다 conhost가 생겨
`measure_tree` 계약이 바뀌었고, os contract (windows)가 그것을 잡았습니다.
- `hided/src/env.rs`: Windows는 `.exe/.com/.bat/.cmd`만 받습니다. 그 밖의 파일은 부팅
때 거절합니다.
- `hided/src/spawn.rs`: failure path라서 봐야 합니다. kill이 실패하면 기다리지 않고, job의
마지막 handle이 닫힐 때 끝납니다.
- `hided/src/opener.rs`: `program_spelling`이 `to_wire` 뒤 `from_wire`로
프로그램에 줄 철자를 만듭니다. wire 철자가 없는 경로(UTF-8이 아닌 이름 등)는 받은 그대로 넘깁니다. 거절하지 않은
이유는 그 경로가 이미 boundary를 통과한 이 기계의 경로이기 때문입니다.
- **원칙**: 1(Windows 거절 분기, `cfg` 울타리, 낡은 문서를 지움), 2(한 타입, 한 실행 경로),
4(실행할 수 없는 CLI는 부팅 때 거절), 7(새 장치 없이 `OwnedChild` 재사용), 8(소유 모델을 플랫폼 계층에
둠), 12(lifecycle 테스트 하나를 세 OS가 공유하고, supervisor 고유 테스트만 Unix).

## Evidence

- **확인한 것**:
  - macOS에서 `verify-cargo.sh lint`와 `test` 전체 통과.
- `opener_lifecycle` 10개 통과(가짜 CLI와 자식이 stop, timeout, 종료 알림, 소유 프로세스
kill 뒤에 남지 않음).
- 새 테스트 `a_helper_is_handed_the_plain_spelling_of_a_canonical_path`:
`fs::canonicalize`한 경로로 열면 가짜 CLI가 `identity::canonical` 철자를 받습니다.
Windows에서는 `\\?\`가 빠진 것을 확인합니다.
- rebase 뒤 macOS `verify-cargo.sh lint`/`test` 전체(56 suites)와 Windows 대상
clippy를 다시 통과했습니다.
  - Windows 대상 `clippy --workspace --all-targets -D warnings` 통과.
  - 독립 리뷰의 Fix now 3건을 고쳤습니다: 콘솔 창, Windows에서 실행 불가 파일 허용, 낡은 문서 한 줄.
- **확인하지 못한 것**:
  - Windows 실행은 이 PR의 CI가 처음입니다.
  - 탐색기와 COM 핸드오프가 job 밖에서 앱을 띄우는 경우는 실기기로 보지 않았습니다.
- opener를 부르는 신뢰된 전송은 아직 없습니다(`open_external`은 브라우저 소켓에서 거절). 실제 제품 경로는
이 PR로 열리지 않습니다.
yansfil added a commit that referenced this pull request Oct 3, 2026
…335)

Refs #293

## Summary

원격 데몬을 위해 기기에서 도는 pane bootstrap 도우미(`hide-host-helper
workspace-bridge`)는 `UnixListener` 위에서 비차단 accept를 폴링했고, 그 기기의 `hide`는
Windows에서 브리지를 찾지 않았습니다(`Ok(None)`).
이제 브리지는 slice 5의 pane bootstrap과 같은 방식으로
`hide_platform::ipc::LocalListener`/`ListenerCloser` 위에 섭니다.
macOS/Linux에서는 Unix 소켓, Windows에서는 named pipe와 그 marker 파일입니다.
accept는 자기 스레드에서 막혀 기다리고, exec 채널의 입력이 끝나면 closer가 그것을 닫습니다.
클라이언트(`bootstrap_remote`)는 `LocalStream`으로 연결합니다.
그래서 Windows 기기도 원격 데몬의 브리지를 둘 수 있습니다. 원격 OS probe와 원격 kit 설치는 이 PR의 범위가
아닙니다.
#332(경로 모델), #334(필수 `windows check`), #333(Windows opener) 위로
rebase했습니다. 브리지의 줄이 기기의 경로를 wire 철자로 싣습니다.
  - 데몬의 첫 줄의 `bridge_dir`는 브리지가 `from_wire`로 읽습니다.
- 브리지가 답하는 endpoint(Windows에서는 marker 파일)와 reference는 `to_wire`로 씁니다.
기기의 `hide`는 reference를 `from_wire`로 읽습니다.
  - hided 자신의 pane bootstrap도 같은 reader를 지나므로 reference를 wire 철자로 답합니다.

## Review

- **판단해 주세요**: 리뷰가 찾은 Windows 보안 구멍을 `hide_platform::ipc`에서 한 번에 막았습니다.
- Windows pipe 이름은 전역이라, marker가 있는 비공개 폴더가 다른 계정이 그 이름의 pipe를 먼저 만드는 것을
막지 못합니다.
- 이제 Windows의 모든 `LocalStream::connect`가 연결한 pipe의 소유자가 이 계정인지 확인하고, 아니면
`PermissionDenied`로 거절합니다.
  - slice 5에서 들어온 hided 자신의 pane bootstrap도 같은 구멍이 있었고, 같이 막힙니다.
- **조심해서 볼 파일**:
- `hide-host/src/workspace_bridge.rs`: failure path라서 봐야 합니다. accept나
sweep이 스스로 멈추면 이제 `failed` 프레임을 쓰고 끝납니다. 예전에는 아무 말 없이 멈춰 route가 ready로
남았습니다. 데몬(`remote_bridge.rs`)은 그 이유를 기록하고 route를 끝냅니다.
- `hide-platform/src/ipc.rs`: 모든 Windows 클라이언트 연결(Herdr 클라이언트 포함)에 소유자
확인이 하나 늘었습니다. Herdr는 같은 계정으로 돌기 때문에 통과합니다.
- `hided/src/workspace_cli.rs`: Unix의 `is_socket` 확인이 "디렉터리·링크가 아님 + 이
계정 소유"로 바뀌었습니다. 살아 있는 listener인지는 connect가 판단합니다.
- **판단해 주세요**: 첫 줄의 `herdr_socket`은 wire 철자로 바꾸지 않았습니다. 기기의 Herdr가 보고한
값을 그 Herdr에게 되돌려 주는 것이라, #332의 `wire.rs`가 Herdr에게 Herdr의 철자로 보내는 것과 같은
규칙입니다. 데몬이 Mac에서 Windows 기기의 철자를 바꾸지 않는 것은 ARCHITECTURE의 "Not spelled
yet"에 그대로 남아 있습니다.
- **조심해서 볼 파일 (rebase 후)**: `hided/src/pane_auth.rs`: failure path라서 봐야
합니다. wire 철자가 없는 reference(UTF-8이 아닌 상태 경로)는 `reference_unavailable`로
거절하고, 전달하지 못한 reference처럼 회수합니다. macOS/Linux에서는 바이트 동일합니다.
- **판단해 주세요**: 첫 CI(run 37118299146)의 rust workspace를 실패시킨 잠금 테스트를
고쳤습니다(`hide-platform/tests/fs.rs`, `src/fs/lock.rs` 문서).
- 원인: Unix의 `flock`은 서술자가 아니라 열린 파일에 붙습니다. 같은 테스트 바이너리의 다른
테스트(`hold_in_another_process`, `mkfifo`)가 자식을 띄우면, 그 자식은 exec 전까지 잠금
서술자의 복사본을 쥡니다. 그 사이에 `drop(held)`가 일어나면 잠금은 자식이 exec할 때 풀립니다. 테스트는 drop
직후 `Duration::ZERO` 한 번만 시도했습니다.
- 확인: fork 뒤 exec 전에 멈추는 자식을 둔 작은 프로그램에서, drop 직후 재잠금이 실패하고 자식이 exec한
뒤에는 성공했습니다.
- 고침: drop 뒤 다시 잡는 세 곳만 최대 10초 기다립니다. 같은 파일의 다른 프로세스 잠금 테스트가 이미 쓰는
방식입니다. "drop하면 풀린다"와 "잡고 있는 동안 다른 잠금은 못 잡는다"는 그대로 단언합니다. 경로 공유는
없었습니다(테스트마다 자기 tempdir).
- **원칙**: 1(fd 수준 peer pid 도우미와 브리지 복사본을 지움), 2·7(새 장치 없이 slice 5의 패턴과
`ipc` 재사용), 4·10(브리지가 멈춘 이유를 채널 위로 올림), 13(pipe 소유자 확인을 호출자가 아니라
`ipc`에서).

## Evidence

- **확인한 것**:
  - macOS에서 `verify-cargo.sh lint`와 `test` 전체 통과(55 suites).
  - Windows 대상 `clippy --workspace --all-targets -D warnings` 통과.
- rebase 뒤 macOS `verify-cargo.sh lint`/`test` 전체와 Windows 대상 clippy를 다시
돌렸습니다.
- 새 테스트 `a_remote_bridge_answers_this_device_and_ends_with_its_channel`가
세 OS에서 실제 브리지와 클라이언트를 맞붙입니다.
- 브리지가 호출자의 pid를 보고, Herdr가 없는 소켓에서 `pane_unavailable`로 멈춥니다. pid를 못 봤다면
`caller_unavailable`가 먼저 나옵니다.
    - 채널이 끝나면 10초 안에 끝나고 endpoint가 사라집니다.
- 첫 줄을 wire 철자로 보내고, `ready`의 endpoint가 `from_wire`로 읽혀 그 폴더 아래에 있는지
봅니다. Windows에서는 네이티브 철자였다면 `from_wire`가 거절합니다.
    - `windows check`가 이 테스트와 브리지 단위 테스트를 돌립니다.
- 독립 리뷰의 Fix now 2건을 고쳤습니다(멈춘 브리지의 침묵, Windows pipe 선점). accept 큐 제한과
sweep 기아도 같이 고쳤습니다.
- **확인하지 못한 것**:
- 첫 CI의 web e2e linux 1/6 `checkout-owner.spec.ts:162` 실패는 원인을 확인하지 못해
재실행하지 않고 #288에 run id와 함께 남겼습니다. Herdr는 탭 둘(`w2:t1`, `w2:t2`)을 만들었는데
화면에는 하나만 올라왔습니다. 이 PR은 탭 생성과 projection 경로를 바꾸지 않습니다.
  - 다른 계정이 pipe를 선점하는 경우는 CI에서 재현할 수 없습니다. 같은 계정의 연결이 모두 통과하는 것만 확인됩니다.
- Windows를 실제 원격 기기로 붙이는 흐름은 아직 없습니다. OS probe(`uname`), POSIX 셸 명령, kit
설치가 Unix를 가정합니다(#293).
yansfil added a commit that referenced this pull request Oct 3, 2026
Related: #293, #332(경로 모델), #334(`windows check` 필수)

## Summary

데스크톱 호스트(`desktop/src/main/`)는 Windows에서 페이지에 native 철자(`C:\repo`)로 답하고
페이지의 경로를 native로 읽었습니다.
페이지는 #332의 wire 철자(`C:/repo`)로 경로를 잇고 비교하므로, Windows에서는 probe 답이 체크아웃
루트와 맞지 않았고 `\foo`도 절대 경로로 통과했습니다.
- `desktop/src/main/wirePath.ts`가 `hide_platform::path` 규칙을 TypeScript로
한 글자씩 옮긴 유일한 경계입니다. probe의 `real`과 폴더 피커 답은 `toPage`로 나가고,
reveal·open·probe 입력은 `fromPage`로 들어옵니다.
- Windows에서는 native `C:\x`, 드라이브 없는 `\x`, 드라이브 상대 `C:x`를 페이지 입력으로 받지
않습니다. 환경 변수의 경로도 드라이브가 있어야 하고, 드라이브 없는 PATH 항목은 Rust `find_program`처럼
건너뜁니다.
- Windows 설치 폴더는 각 설치 프로그램의 기본 폴더입니다: `~\.local\bin`(Claude Code),
Codex·Herdr의 `%LOCALAPPDATA%\Programs\...\bin`, Git for Windows(계정용·머신용
`Git\cmd`), `%APPDATA%\npm`, GitHub CLI, Node.js.
- PATH가 없는 자식은 `%SystemRoot%` 아래 기본 시스템 Path를 받습니다. 변수가 없는 폴더는 추측하지 않고
빼며, 시작할 때 `env.locations_missing`가 그 키를 남깁니다.
- 로그인 셸의 `/bin/zsh` 추측은 지웠습니다. 이제 `SHELL`, 없으면 계정 DB의 셸을 쓰고, 둘 다 없으면 그
단계를 건너뛰고 `no_shell`을 로그에 남깁니다. macOS에서 답은 그대로입니다(wire 철자 = native).

## Review

- **판단해 주세요**: Windows에서 `ComSpec`을 읽지 않습니다. 호스트는 Windows에서 셸을 시작하지
않습니다(로그인 셸 없음, `hide.exe` 직접 실행). 읽기만 하고 쓰지 않는 키는 env 레지스트리 규칙에 어긋납니다.
- **판단해 주세요**: 킷은 Windows에서도 `~\.local\bin`에 확장자 없는 `hide` 링크를 만들어, 검색이
찾지 못합니다. 킷이 `hide.exe`를 쓰게 하는 일은 킷 변경이라 이 PR에서 고치지 않았습니다.
- **조심해서 볼 파일**:
- `desktop/src/main/wirePath.ts`: 기기 사이 경로 계약입니다. Rust와 다르면 둘 중 하나가
버그입니다. 장치 이름은 ASCII만 대문자로 바꾸고 Unicode 공백을 잘라 내며, 그 경우를 양쪽 테스트에 넣었습니다.
- `desktop/src/main/host.ts`: failure path입니다. wire 철자가 없는 폴더를 고르면 이유와
함께 거절하고, 페이지 진단에 "folder picker failed"가 뜹니다.
- 적용한 원칙:
  - 1: `revealablePath`를 지웠습니다.
  - 2: 방향마다 변환 지점이 하나입니다.
  - 4: 추측 대신 거절하고 그 키를 이름으로 남깁니다.
  - 7: 새 규칙을 만들지 않고 Rust 규칙을 거울처럼 옮겼습니다.
  - 12: 기대값은 Rust 테스트와 설치 프로그램 소스에서 왔고, 심은 버그 5개가 모두 잡혔습니다.
  - 13: 드라이브 없는 경로를 페이지 입력, env, PATH, 기억된 CLI에서 같은 규칙으로 막습니다.

## Evidence

- **확인한 것**:
- macOS에서 `bash scripts/verify-web.sh` exit 0, desktop `src/main` 92
통과·3 건너뜀(Windows 전용).
- `cargo test -p hide-platform --lib path::` 7 통과(새 장치 이름 경우 포함), `cargo
fmt --check`, hide-platform clippy 통과.
  - Windows 규칙은 텍스트라 macOS에서도 검사합니다(`wirePath.test.ts`).
- 미리 예측하고 버그를 심었더니 모두 해당 테스트가 실패했습니다: 드라이브 대문자 누락, `fromPage` 변환 생략,
`C:` 루트 없이 허용, 옛 장치 이름 규칙, Windows 시뮬레이션에서 드라이브 없는 PATH 허용.
- 경로를 `path.win32`로 바꾸고 플랫폼을 흉내 내 순수 테스트만 돌렸습니다(파일을 쓰지 않음): resolver 9,
설치 폴더 1, env 2 통과.
- **확인하지 못한 것**:
  - 실제 Windows 실행은 이 PR의 `windows check`(desktop unit)가 처음입니다.
  - Windows 앱 UI는 패키지가 없어 확인하지 못했습니다(PR 4).
- macOS desktop e2e는 로컬에서 돌리지 않고 CI에 맡겼습니다. 디스크 사정과 macOS 동작 무변경이 이유입니다.
  - 설치 폴더는 공식 문서와 설치 스크립트 소스로 정했고, 실제 Windows에 설치해 보지는 않았습니다.
- 웹의 터미널 링크 탐지(`terminalLinks.ts`, `pathLookups`)는 아직 POSIX 전용이라,
Windows 터미널 링크는 웹 쪽 작업이 남았습니다.

Refs #293
yansfil added a commit that referenced this pull request Oct 30, 2026
…s and a Windows Node warm-up (#1863)

Closes with-hide/hide-private#331
Closes with-hide/hide-private#332
Closes with-hide/hide-private#333
Closes with-hide/hide-private#338
Closes with-hide/hide-private#329

## Summary

Six flaky tests in five crates came from three causes, and each is fixed
once for its class.
- Tests read through a product time budget they are not about: Memory
reads were cut at the hook's 100 ms and returned no cards, and the usage
store's 250 ms step cut a 40,000-row prune.
A Memory read now has no deadline of its own (the 100 ms stays in the
hook alone), and the usage store's tests hold its clock still.
- Fixture `git` read the account's settings, so a commit failed whenever
the commit-signing agent did not answer; the fixtures now read no global
or system git file.
- The Windows Node test warmed Node with `--version`, which skips most
of Node's start, so the guarded run still paid the slow first start; the
warm-up now runs the same script.

Per issue:

| Issue | Handling |
| --- | --- |
| #331 usage store prune | Cause fixed: store budgets measured on an
injected clock; store tests open it on a still one |
| #332 herdr-core memory tests | Cause fixed: `MemoryStore::retrieve`
has no deadline; memory_hook tests use `answer_until` with a still clock
|
| #338 hide-memory store tests | Same cause as #332, same fix; the store
and hook tests in its latest comments read through
`retrieve_with_expiry`, which no longer adds a wall clock of its own |
| #333 hide-host fixture commit | Cause fixed:
`GIT_CONFIG_GLOBAL=/dev/null`, `GIT_CONFIG_NOSYSTEM=1`; four other
fixtures with the same inheritance too |
| #329 hide-kit Windows Node | Cause fixed: the first start runs the
guarded script, not `--version` |
| #334 omp observed false | Stays open by the lead's decision: the
helper's 1.2 s send budget is in another process; the failure now prints
the time, the recorded cause and the stand-in's calls |

The Windows process end (with-hide/hide-private#327) was in this pull
request and moved to a pull request of its own; its commits here are
taken back out, so `hide-platform`, `hide-ai`'s omp test and its
documentation are as on main.

스크린샷 없음: no screen changes.

## Review

- **조심해서 볼 파일**:
- `hide-memory/src/store.rs`, `hide-memory/src/hook.rs` -
`RetrievalQuery.deadline` is removed. The product's only Memory reader
is the hook (`hook::context_for` and `herdr_core::memory_hook::answer`,
both through `hide_memory::hook::within_hook_budget`, which adds the 100
ms); every `retrieve` call left is in a test.
- `herdr-core/src/usage_ledger/store.rs` - `Store` carries `clock: fn()
-> Instant`; `open` passes `Instant::now`, so product timing is
unchanged.
- `hide-host/src/worktrees.rs` and four test fixtures - git runs with no
global or system configuration file.
- **질문**: #329's readying pays Node's first full start before the 30 s
guard; the test is about the environment the kit hands Node (it aborts
without `SystemRoot`), not its start time. If a cold first start is ever
the operator's own concern, that is a separate product issue.

## Evidence

- **확인한 것**:
- Local macOS at load 30 to 84: `hide-memory --lib` 205/205 four times
(the parallel run that failed in #338), `hide-host --lib` 154/154,
`herdr-core --lib` usage_ledger, memory_hook, project_memory,
memory_analysis and real_agent_trust 135/135, `hide-agent-hooks`
adapter_contract and codex_binary 6/6.
- Windows CI on 7af7724 and 6fe4f39: every Rust suite of `windows
check` passed, including the hide-kit Node test (#329).
- `clippy --all-targets -D warnings` clean for hide-memory, herdr-core,
hide-host, hide-kit, hide-agent-hooks, hide-ai on macOS.
- **확인하지 못한 것**:
  - Windows tests run only on PR CI; this Mac cannot run them.
  - #334 is not fixed; it fails less silently.
- `windows check` failures seen on this branch were outside its diff:
two web unit tests timing out at 5 s together (open
with-hide/hide-private#354, commented there) and a web unit suite that
could not rename a fixture program another worker built (filed as
with-hide/hide-private#371).
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