Skip to content

Add the desktop app: the web shell in its own window, attached through hide connect - #149

Merged
yansfil merged 17 commits into
mainfrom
prd/electron-basic-port
Sep 26, 2026
Merged

yansfil merged 17 commits into
mainfrom
prd/electron-basic-port

Conversation

@yansfil

@yansfil yansfil commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Related: PRD agents/prd/electron-basic-port/prd.md · main(#150 web design system reset, #151 sidebar agent status, #152 Project Overview)을 머지해 그 web shell 위에서 동작 (PRD D-09)

Summary

  • 브라우저 탭의 web shell은 ⌘T/⌘W 같은 단축키를 Chrome에 빼앗기고 다른 탭 사이에 섞입니다.
  • desktop/에 Electron 호스트를 추가했습니다: hide connect로 살아 있는 hided에 붙거나 띄우고, 그 web shell을 전용 창에 띄웁니다.
  • 레지스트리의 Electron 열을 Swift 단축키로 채웠고, 앱 메뉴도 같은 열에서 만들어 창 리스너와 같은 run으로 보냅니다.
  • hided CLI에 hide connect(JSON)와 hide status --json을 추가했고, 데몬은 자기 프로세스 그룹을 가집니다.
  • 서명·공증·배포 없이 로컬 .app 패키징(pnpm --dir desktop package)과 dev 실행만 제공합니다.

The desktop app attached to an isolated hided, on the reset design system

⌘/ in the desktop app lists the Electron column, with no 'moved for Chrome' notes

The host's own screen when hided cannot be reached, styled through the generated tokens

Review

  • 머지 전 필수 수동 확인: 패키징한 앱에서 실제 키로 ⌘T, ⌘W, ⌃Tab, ⌘C/⌘V를 한 번씩 눌러 동작이 정확히 한 번인지 봐 주세요.
  • 판단해 주세요: 한 번 누름이 두 번 실행되면 대안은 Electron에서 메뉴 소유 단축키를 리스너가 답하지 않게 하는 것입니다(CodeMirror의 Mod-d/f//와 충돌 비용 있음).
  • 판단해 주세요: 새 탭/새 워크스페이스 힌트 문구 4곳과 Settings 안내 한 줄이 호스트 단축키를 읽게 바뀌었습니다(브라우저 출력은 이전과 같음).
  • 판단해 주세요: Electron에서는 브라우저 단축키 재지정(browser_shortcut_bindings)을 적용하지 않습니다. Electron 재지정은 후속입니다.
  • 조심해서 볼 파일: hided/src/cli.rs - failure path: hided가 옆에 없는 hide는 이제 자신을 다시 띄우지 않고 start_failed로 거절합니다(심볼릭 링크 CLI에서 자기 증식 체인이 나던 버그).
  • 조심해서 볼 파일: desktop/src/main/host.ts - failure path: 발견 상태 기계, 데몬 소실 후 재부착, 토큰이 로그에 남지 않는 경계.
  • 조심해서 볼 파일: .github/workflows/pr.yml - desktop lane 추가와 web lane 안의 Electron e2e는 GitHub에서 처음 돕니다.

Evidence

  • 확인한 것: _electron smoke 5개, 격리된 hided + pinned Herdr: 부착과 터미널 pane, Playwright ⌘T와 메인 프로세스 메뉴 클릭이 각각 create_tab 정확히 1회, ⌥T 무반응.
  • 확인한 것: 같은 smoke에서 renderer에 Node API 없음(hideHost는 kind, onCommand뿐), 외부 링크·이동은 기본 브라우저로, 창은 데몬 origin 유지.
  • 확인한 것: 두 번째 실행은 종료하고 기존 창을 부름, 마지막 창을 닫아도 앱 유지 후 activate로 복귀, 종료 후 같은 데몬 pid에 재부착, 창 크기·위치 복원.
  • 확인한 것: CLI 없음 화면과 Retry 후 부착, hide stop 후 web shell의 끊김 표시, 새 데몬으로 창이 따라감.
  • 확인한 것: 패키징한 unsigned hide.app 한 인스턴스(PID로 식별)를 격리 상태로 띄워 창 캡처, 종료·재실행 때 같은 데몬 pid(33068) 재사용. 이 네이티브 확인은 main 머지 전 head에서 했습니다.
  • 확인한 것: main 머지(Sidebar agent status: waiting-on-children parent, badge child list, quiet rows #151, Project Overview becomes a stage board in the web shell #152 포함) 후 head에서 web 단위 321개와 web e2e 60개 전체, desktop 단위 23개(토큰이 로그에 남지 않음 포함)와 _electron smoke 5개, cargo test/lint, swift test.
  • 확인한 것: 머지 후 상태 페이지는 생성된 토큰만 씁니다. 렌더된 배경·글자·버튼 색이 tokens.css의 .dark 값과 같음을 Electron에서 계산된 스타일로 확인했습니다.
  • 확인하지 못한 것: 실제 키 입력. 이 Mac에 손쉬운 사용/이벤트 합성 권한이 없어 비활성 앱에 보낸 CGEvent가 버려졌습니다. 메뉴 가속키 이중 실행과 터미널의 ⌘C/⌘V는 미확인입니다.
  • 확인하지 못한 것: Dock 클릭과 ⌘Q를 실제로 누르지는 않았습니다(activate 이벤트와 기본 quit 역할로 대신).
  • CI: 첫 실행에서 lifetime 테스트가 러너의 작은 화면 때문에 실패했고, 창 크기를 작업 영역 안에 맞추고 실제 배치된 bounds를 기대하도록 고쳤습니다.
Verification record

… itself

hide connect runs the same discovery hide open runs (reuse the daemon the
state file names, else start one and wait for it) and prints one JSON line
instead of opening a browser; status --json is the attach-only probe. The
daemon now leads its own process group so an interrupt to the job that ran
the CLI never reaches it.
A hide CLI reached through a symlink resolved current_exe to the link's
directory, found no hided there, and fell back to running itself: each
attempt started one more CLI, each starting the next. The executable is
canonicalized, and a CLI with no hided beside it now refuses with
start_failed.
…host

The Electron column is the Swift chord set, so the chords the browser moved
to the ⌥ family return to ⌘ in the desktop app. The window listener, the ⌘/
sheet and the Settings tooltip read the running host's column; the browser
column and its overrides are unchanged. App-menu commands arrive through
window.hideHost into the same run path as a chord, and a ⌃Tab cycle
commits on releasing ⌃.
…h hide connect

desktop/ is an Electron host. It finds the hide CLI (HIDE_CLI_PATH, this
worktree's build, PATH), runs hide connect to reuse or start the one
daemon, and loads the shell it serves. While it looks, and when it cannot,
the window shows its own status screen with the reason and Retry. A
daemon that dies leaves the shell's disconnected state on screen and the
host re-attaches when hide status --json names the next one.

The app menu is built from the registry's Electron column; window bounds
persist in userData; one instance per profile; closing the last window
keeps the app; quitting never stops hided. The renderer is sandboxed with
a preload that exposes only the host kind and the menu channel, and
navigation outside the daemon origin goes to the default browser.
The Main screen, sidebar, tab bar and empty workspace hints wrote the
browser's ⌥ chords as literals; in the desktop app they now read ⇧⌘N and
⌘T from the registry.
…y order as unverified

The smoke now closes the only window, sees the app stay with no window,
and brings one back through activate on the same daemon. The architecture
note no longer states that a native chord cannot run twice: that rests on
Electron's key order and no native keystroke has checked it.
Electron's loadURL rejection quotes the URL it tried, and the daemon URL
carries the token; a failed load now logs only the error code. A CLI call
queued behind the one quit killed no longer starts, a stream error after a
child started is not reported as a spawn failure, and the package states
Electron's Node floor.
The CI runner's display is smaller than the fixed 1000x700 at (120,140), so
macOS moved the window before its bounds were stored and the restored
bounds differed from the ones the test set.
The shortcut column and host entry are re-applied onto the redesigned
MainScreen, TabBar, WorkspaceScreen, sidebar, ShortcutSheet and Settings.
The status page takes the generated tokens under the web shell's names:
the build unwraps tokens.css's @theme blocks into :root for a plain page,
reads the window background from the dark theme, and the Retry button
mirrors the secondary Button.
…152) under the desktop host

The shortcut table keeps the filled Electron column and takes main's
Project home row, which now opens the front checkout's Project Overview.
@yansfil
yansfil merged commit 9c7c726 into main Sep 26, 2026
7 checks passed
@yansfil
yansfil deleted the prd/electron-basic-port branch September 26, 2026 00:01
yansfil added a commit that referenced this pull request Sep 26, 2026
… Swift app once (#160)

Related: #149 (데스크톱 앱) 후속 · 사용자 결정 2026-09-26 08:31 KST, 데스크톱 앱이 운영자의
Swift 단축키 설정을 따라야 하느냐는 질문에 "ㅇㅇㅇ 그대로 설정하게 해야지~"

## Summary

- 운영자는 Swift 앱에서 pane 단축키를 바꿔 씁니다(예: 확대 ⇧⌘↩). 데스크톱 앱은 이 설정을 무시해서 ⇧⌘↩가 아무
일도 하지 않았습니다.
- 데스크톱 앱의 pane 단축키가 core의 macOS 세트 `ui_state.shortcut_bindings`를 따릅니다.
Swift 앱과 같은 세트, 같은 형식(`command+shift+return`), 같은 규칙입니다.
- 키 리스너, ⌘/ 시트, 힌트, 네이티브 메뉴 가속키가 모두 이 세트를 읽고, 세트가 바뀌면 메뉴를 다시 만듭니다.
Settings > Shortcuts는 데스크톱 앱에서 이 세트를 편집합니다.
- hided가 Swift 앱의 `state.json`에서 `shortcut_bindings`만 한 번 가져옵니다. core의
세트가 비어 있을 때만 가져오고, 가져왔다고 기록해 이후 "기본값 복원"이 다시 덮이지 않습니다.
- 브라우저는 그대로 `browser_shortcut_bindings`와 Chrome 규칙을 씁니다. ⌃Tab·⌥Tab 순환이
데스크톱 앱에서 손을 뗄 때 한 번만 커밋되는지도 e2e로 확인했습니다.

![The desktop app's Settings > Shortcuts after the Swift import (⇧⌘↩
zoom) and one rebind in Settings
(⌥⌘R)](https://github.com/yansfil/pr-assets/blob/main/hide/electron-shortcut-bindings/e07a7f8/desktop-shortcut-settings.png?raw=true)

## Review

- **판단해 주세요**: 가져오기의 주인을 hided/core로 정했습니다. S10에서 Swift 셸이 지워져도 남는 쪽이고,
Swift 앱은 이 옵션을 넘기지 않습니다.
- **판단해 주세요**: 가져오기는 한 방향, 한 번입니다. 이후 Swift 앱에서 바꾼 값은 넘어오지 않고, 데스크톱 앱에서
바꾼 값도 Swift 파일에 쓰지 않습니다.
- **판단해 주세요**: 데스크톱 앱의 거절 규칙은 Swift 앱과 같습니다(⌘ 필수, 인쇄 가능한 키 하나나 Return,
⌘Q·⌘H·⌘M·⌘S·⌘W·⌘,·⌘1-9 불가). Chrome이 가져가는 ⌘⇧W 같은 키는 데스크톱 앱에서는 쓸 수 있습니다.
- **조심해서 볼 파일**: `herdr-core/src/runtime.rs` - runtime mutex: 가져오기는
`Runtime::new`에서 mutex로 감싸기 전에 한 번 읽고 동기 저장합니다(8 MiB 읽기 상한).
- **조심해서 볼 파일**: `herdr-core/src/runtime/events.rs` - failure path:
`ui_state_update`가 macOS 세트에도 16개·64자 상한을 적용합니다. Swift 셸도 같은 이벤트로 이 세트를
보냅니다.
- **조심해서 볼 파일**: `desktop/src/main/host.ts`,
`desktop/src/preload/index.ts` - bridge: 렌더러→메인 채널 `reportBindings`가 새로
생겼습니다. 이 창의 daemon origin 페이지에서 온 짧은 문자열 맵만 받습니다.
- **조심해서 볼 파일**: `web/src/keyboard.ts` - high-frequency path: store 알림마다
참조 비교로 끝나고, 세트 내용이 바뀔 때만 직렬화하고 전송합니다.

## Evidence

- **확인한 것**: `_electron` smoke 7개(기존 5 + 새 2), 격리된 HOME·hided·Herdr: 가짜
Swift `state.json`(toggle_zoom = ⇧⌘↩)이 넘어와 메뉴 가속키가
`Shift+Command+Return`이 됩니다.
- **확인한 것**: 같은 smoke에서 ⇧⌘↩가 `toggle_zoom`을 정확히 1회 보내 pane이 확대되고, 이전 기본값
⌥⌘↩는 아무것도 보내지 않으며, ⌘/ 시트가 ⇧⌘↩를 보여 줍니다.
- **확인한 것**: Settings에서 Split right를 ⌥⌘R로 바꾸면 `shortcut_bindings`에
`command+option+r`로 저장되고, `browser_shortcut_bindings`는 비어 있는 그대로이며, 메뉴가
`Alt+Command+R`로 다시 만들어집니다.
- **확인한 것**: ⌃를 누른 채 Tab 두 번 → 놓을 때 두 칸 뒤 탭으로 `focus_tab` 정확히 1회, ⌃⇧Tab은
뒤로 한 칸. ⌥Tab·⌥⇧Tab도 프로젝트 사이에서 `focus_checkout` 정확히 1회.
- **확인한 것**: core 가져오기 테스트 5개(한 번만, 복원 유지, 편집한 세트 보존, 파일 없음 후 재시도, 읽을 수
없는 파일 진단)와 persistence 테스트, cargo test/lint 전체, swift 549개.
- **확인한 것**: web 단위 326개(Swift 텍스트 형식, 운영자 세트, Swift 거절 규칙, 호스트별 세트 분리)와
web e2e 60개 전체, desktop 단위 25개(메뉴가 보고된 세트를 보여 줌, 잘못된 보고 거절).
- **확인하지 못한 것**: 실제 키 입력. Playwright 입력은 NSMenu에 닿지 않고 이 Mac에는 손쉬운 사용
권한이 없어, 가속키 이중 실행 여부는 #149와 같이 미확인입니다.
- **확인하지 못한 것**: 순환 smoke가 개발 중 한 번 ⌃⇧Tab 단계에서 실패했습니다(Shift가 빠진 듯 한 칸
앞으로 선택됨). 이후 단독 6회, 파일 전체 2회, 최종 1회 통과했고 원인은 모릅니다.
- **확인하지 못한 것**: 운영자의 실제 `state.json`으로는 돌리지 않았습니다. 같은 내용을 격리된 HOME에 써서
확인했습니다.

<details><summary>Verification record</summary>

- Base 9c7c726 (main, #149) → head 958af62, 브랜치
electron-shortcut-bindings. 958af62는 테스트 fixture의 `/Users/...` 경로를
`/tmp/project`로 바꾼 것뿐입니다(repository invariants의 workstation identity
검사). 이 변경을 덮는 sasu 실행은 없습니다(PRD 없음, 사용자 결정이 근거).
- Suites on the final tree: `scripts/verify-cargo.sh test` 0,
`scripts/verify-cargo.sh lint` 0, `scripts/verify-swift.sh test` 0
(549), web typecheck/lint/unit 0 (326), web e2e 0 (60), desktop
typecheck/lint/unit 0 (25), desktop e2e 0 (7).
- Reviews (native subagents, 03255c6):
- Fidelity: Fix now 없음. Follow-up: Swift의 ⌥1-9 예약은 옮기지 않았으나 ⌘ 필수 규칙이 이미
거절함; 읽을 수 없는 Swift 파일은 매 실행 다시 읽고 진단함(의도); 상한 상수 중복.
- Code: Fix now 없음. mutex 밖 I/O, 호스트 간 덮어쓰기, bridge 발신자 검증, 알림당 비용 확인.
Follow-up: 상한 상수 중복(e07a7f8에서 서로를 가리키는 주석 추가), 기존 브라우저 세트가 데스크톱 편집에서
살아남는지 채운 세트로 보는 e2e, `ui_state_update`에서 `shortcut_bindings`를 빼면 세트가
지워지는 기존 계약(다른 필드와 같은 패턴).
- beb408b에서 Shortcuts 탭 부제의 "this browser host" 문구를 호스트 중립으로 바꿨습니다(스크린샷
확인 중 발견).
- Follow-up improvements: 실제 키 입력 자동화(손쉬운 사용 권한이 있는 QA 호스트), ⌃⇧Tab 단발 실패
원인, 위 리뷰 Follow-up.

</details>
yansfil added a commit that referenced this pull request Sep 26, 2026
…PATH (#166)

Related: #149 (the desktop host)

## Summary

Finder나 Dock에서 연 패키지 hide.app은 launchd의
PATH(`/usr/bin:/bin:/usr/sbin:/sbin`)로 시작합니다.
운영자 머신에서 5초 로그인 셸 조회가 실제 zsh rc(웜 2.4초, 콜드는 더 김)에 타임아웃됐고, 창이 "hide CLI
not found"에 머물렀습니다.
이제 CLI 탐색 순서는 `HIDE_CLI_PATH` -> (비패키지) 워크트리 빌드 -> PATH -> 마지막으로 붙은 CLI
-> 로그인 셸 PATH(패키지만, 10초) -> `~/.local/bin`, `/opt/homebrew/bin`,
`/usr/local/bin`입니다.
붙은 CLI는 프로필의 `cli-path.json`에 기억되어, 두 번째 실행부터는 느린 로그인 셸을 부르지 않습니다.
실패 화면은 그대로이고, 시도한 경로는 모두 한 번씩 로그에 남습니다.

## Review

- **판단해 주세요**: 기억한 경로를 PATH 뒤, 로그인 셸 앞에 둔 순서. 로그인 셸이 운영자 의도의 권위지만 비싸서,
기억한 경로가 그 캐시 역할을 합니다
- **판단해 주세요**: 로그인 셸 타임아웃 10초(VS Code
`shellEnvironmentResolutionTimeout` 기본값). 실패는 캐시하지 않아 Retry가 다시 묻습니다
- **조심해서 볼 파일**: `desktop/src/main/cli.ts` - `resolveCli`가 async가 됐고 로그인
셸은 앞 단계가 모두 빗나갈 때만 호출됩니다
- **조심해서 볼 파일**: `desktop/src/main/host.ts` - failure path: 로그인 셸 조회 중
quit/Retry, `hide connect` 성공 뒤에만 기억을 씁니다
- **조심해서 볼 파일**: `desktop/src/main/env.ts` - `HOME`을 레지스트리에 추가. Electron
`app.getPath("home")`은 `HOME`을 무시해 격리 QA가 운영자 CLI를 찾았습니다
- **조심해서 볼 파일**: `desktop/e2e/fixture.ts` - 이미 떠 있는 데몬에 다시 붙는 relaunch는
`relaunch()`로 메인 프로세스에서 창을 읽습니다(아래 Evidence)
- 로그인 셸은 shell-env처럼 `/usr/bin/env DISABLE_AUTO_UPDATE=true
ZSH_TMUX_AUTOSTART*=...`로 감싸 Oh My Zsh 업데이트 프롬프트와 tmux 자동 시작을 막습니다
- 설치 디렉터리 목록은 Swift 앱 `RuntimeEnvironment.swift`의 fallback과 같습니다.
`jsonFile.ts`는 `windowState.ts`의 원자적 쓰기를 뽑아낸 것입니다

## Evidence

- **확인한 것**: `pnpm --dir desktop typecheck`, `lint`, `test`(30개, 새 순서
테스트 6개와 기억 파일 파싱, 실제 `/bin/sh` 로그인 조회 포함) 통과
- **확인한 것**: `pnpm --dir desktop e2e` 8/8, 새 `discovery` 테스트: PATH를
launchd 값으로, `HIDE_CLI_PATH` 없이, 워크트리 밖으로 복사한 앱에서 `~/.local/bin`으로 붙고
`cli-path.json`을 쓴 뒤 재실행은 `remembered`로 붙음
- **확인한 것**: 패키지 앱(`pnpm --dir desktop package`)을 `env -i`로 launchd 같은
환경, 비공개 HOME/state/profile/socket으로 세 번 실행
- 3초 걸리는 가짜 로그인 셸 -> `login`으로 붙고 기억 (`cli.login_path` elapsed 3243ms)
- 멈추는 셸 + 기억 있음 -> 셸을 부르지 않고 `remembered`로 0.1초 안에 붙음
- 멈추는 셸 + 기억 없음 -> 10004ms에 타임아웃, `~/.local/bin`에서 `well-known`으로 붙음. 사건
시나리오 그대로
- 각 실행 뒤 비공개 데몬을 `hide stop`, 남은 프로세스 없음. 운영자 hided와 상태 디렉터리는 건드리지 않음
- `python3 -m unittest discover -s scripts/tests`(39),
`check-no-workstation-identity.sh`, `check-no-attribution.py` 통과
- **확인한 것**: #164 병합 뒤 CI의 `discovery` 실패는 relaunch 경합이었습니다. 로컬 반복에서 기존
`lifetime`도 같은 모양으로 실패했습니다
- 재실행이 수십 ms 만에 붙으면 Playwright가 status 페이지 -> 데몬 origin 렌더러 교체를 놓칩니다.
page가 `file://`에 머물거나 window 이벤트가 안 옵니다
- 탐침 스펙으로 확인: 놓친 경우에도 창은 데몬 URL, 로딩 끝, 보임, 셸 DOM 있음. 제품 문제가 아니라 테스트 관측
문제입니다
- 그래서 두 relaunch는 메인 프로세스로 창을 읽고, cleanup의 `rmSync`는 ENOTEMPTY를
재시도합니다(main에서도 16회 중 1회 재현)
- 고친 뒤 `lifetime`/`discovery` 반복 30회 통과(운영자 화면 때문에 중간에 멈춤). e2e 창은 여전히
화면에 뜨며, 숨김 실행은 이 PR에 넣지 않았습니다
- **확인하지 못한 것**: Finder/Dock에서 실제로 연 실행(launchd가 준 환경 그대로)과 운영자의 실제 zsh
rc. 위 검증은 `env -i`와 가짜 셸로 흉내낸 것입니다
- **확인하지 못한 것**: Playwright는 앱을 비패키지로 띄우므로 e2e는 로그인 셸 단계를 지나지 않습니다. 그
자리는 단위 테스트와 위 패키지 수동 실행이 덮습니다
- **확인하지 못한 것**: Rust, Swift, web 레인은 이 diff가 건드리지 않아 로컬에서 돌리지 않았습니다.
CI가 돌립니다
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 9, 2026
A test's own sshd chose its port by binding port 0 and letting it go, and
reported itself ready when any listener answered on that port. Another test's
sshd took the port first, the test's sshd exited with "Address already in
use", and the daemon signed in to the other server and stopped at
host_key_changed (with-hide/hide-private#210). A server is now ready only when
its own log says it listens, and one that lost the bind is started again on
another port.

The device pane asker asked the node for a credential as soon as its program
started, before the holder wrote the pane's record as running, and was
refused once with no retry (with-hide#503). The test now releases the asker after the
node's proof of the pane, and a failed wait shows the asker's screen.

The node's caller cap probe wrote its request to a connection the node had
already answered and ended (with-hide#149), and the setup renderer's receipt wait gave
up after 64 frames of a busy daemon (with-hide#294); one now only listens, the other
waits by time.

The remote hook's miss and the relay's non-binary frame (with-hide#173, with-hide#457) now say
which stage ran out and which message arrived. The remote mailbox lane can be
repeated by hand on a branch (repeat input).
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 9, 2026
Closes with-hide/hide-private#210
Closes with-hide/hide-private#503
Closes with-hide/hide-private#149
Closes with-hide/hide-private#294
Related: with-hide/hide-private#718 with-hide#719 (제품 쪽 후속), with-hide#173 (hook 시간 초과는 원인
미확정, 진단만 추가), with-hide#457 (relay, 진단만 추가), with-hide#339 with-hide#398 (WSL, 이슈에 원인과 남은 일을 적음)

## Summary

기기 연결 테스트가 가끔 실패하던 원인 넷을 고쳤습니다. 제품 코드는 바뀌지 않고 테스트 보조 코드와 CI 입구만 바뀝니다.

- with-hide#210: 테스트용 sshd가 고른 포트를 다른 테스트의 sshd가 먼저 잡아도 "준비됨"으로 통과해서, 데몬이 남의 서버에
붙고 `host_key_changed`로 끝났습니다. 이제 자기 sshd가 "listening"을 로그에 쓸 때까지 기다리고,
포트를 잃었으면 다른 포트로 다시 시작합니다.
- with-hide#503: 질문하는 프로그램이 holder가 pane 기록을 `running`으로 쓰기 전에 물어서 한 번 거절당했습니다.
테스트가 노드의 증명을 확인한 뒤에 풀어 주게 순서를 고정했습니다.
- with-hide#149: 거절 순서 문제는 `133b05fe9`가 이미 고쳤고, 남은 BrokenPipe는 상한 확인용 연결이 이미 닫힌
연결에 요청을 쓰던 테스트 경쟁이라 듣기만 하게 바꿨습니다.
- with-hide#294: 설정용 renderer가 프레임 64개에서 포기하던 것을 시간 상한으로 바꿨습니다. 이슈 본문의 첫 증상인
doorbell 시간 초과는 with-hide#173 댓글대로 10월 28일 뒤 재발이 없어, frame 상한을 고친 이 PR로 닫습니다.
- remote mailbox 레인을 브랜치에서 손으로 N번 반복할 수 있습니다: `gh workflow run
remote-mailbox.yml --ref <branch> -f repeat=10`.

## Review

- **판단해 주세요**: 반복 실행을 새 workflow가 아니라 `remote-mailbox.yml`의
`workflow_dispatch` + `repeat` 입력으로 둔 것. `test_vt_cache.py`가 vt-cache 사용
workflow 목록을 고정해서 새 파일은 정책 검사에 걸립니다.
- **조심해서 볼 파일**: `hided/tests/it/support/sshd.rs` - 준비 판정을 연결 성공에서 자기
로그의 "Server listening ... port N."으로 바꾼 곳(macOS sshd로 문구 확인).
재시작(`online(false)` 뒤 `online(true)`)은 로그가 이어 쓰이므로 spawn 뒤에 쓰인 부분만 읽고,
같은 포트를 잃으면 이유를 말하며 실패합니다. `system_ssh`에 이 경로를 확인하는 시험을 더했습니다.
- **조심해서 볼 파일**: `hided/tests/it/device_own_engine.rs` - asker가 파일이 생길
때까지 기다리는 셸 반복. 상태를 기다리는 것이고 시간을 기다리지 않습니다.
- **질문**: #173의 11월 7일 실패는 hook이 제품 예산(`INTAKE_BUDGET` 1.65초) 안에 답을 못 받은
것입니다. 부하 때문에 예산을 못 지키는 경우를 테스트가 어떻게 다룰지(병렬도를 줄일지) 정하지 못해 이번엔 진단만 넣었습니다.

- **후속 이슈**: #149의 남은 틈(노드가 연결을 닫은 뒤에 자리를 돌려주는 것)은 제품 쪽이라 #718에, #503의
제품 쪽 경쟁(holder 기록이 Running이 되기 전의 첫 `hide` 호출 거절)은 #719에 적었습니다. 테스트 쪽
원인은 이 PR이 고쳤습니다.
- 반복 실행은 `--retries 0`으로 돌아, 한 번의 실패가 job의 실패입니다.

## Evidence

- **확인한 것**: `cargo check`와 `clippy -D warnings`(hided, hide-relay 테스트)가
통과합니다. 포트 충돌 메시지(`Bind to port N on 127.0.0.1 failed: Address already in
use`)와 listening 문구는 이 Mac의 sshd에서 직접 확인했습니다.
- **확인한 것**: with-hide#210 원인은 실패한 CI 실행(42085737360)의 보관된 sshd 로그에 `Address
already in use`와 데몬의 `host_key_changed`가 함께 있는 것으로 확인했습니다.
- **확인하지 못한 것**: #503의 원인은 코드 읽기로 좁힌 것입니다(`hide-holder/src/holder.rs`의
spawn 뒤 `running` 기록 사이). 실패한 CI에는 asker 화면이 없었고, 이번 변경이 다음 실패 때 그 화면을
남깁니다.
- **확인한 것**: remote mailbox 레인(Linux)을 이 브랜치에서 `repeat=10`으로 돌려 10회 모두
통과했고(33개 x 10, 재시도 0번, `FLAKY` 줄 없음)
https://github.com/with-hide/hide/actions/runs/42386421651 에서 볼 수 있습니다.
- **확인한 것**: 재시작 경로를 고친 head 6817f7c09에서 `--retries 0`으로 다시 `repeat=10`을
돌려 10회 모두 통과했습니다(33개 x 10, `no flaky test`)
https://github.com/with-hide/hide/actions/runs/42429757957
- **확인하지 못한 것**: 고치기 전 실패율은 이슈별로 며칠에 한두 번이라 10회 통과가 재발 없음을 증명하지는 않습니다. 이
Mac에서는 레인을 돌리지 않았습니다.
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