Repository navigation
Add web History and readonly unified diff - #141
Merged
Merged
Conversation
…xplorer on the right
# Conflicts: # agents/prd/web-shell-pivot-s3/prd.md
Render checkout changes through the existing core reader and preview tabs. Scope nested-folder requests and rename diffs to their registered path, and cover the web flow with an isolated browser fixture.
yansfil
marked this pull request as ready for review
September 24, 2026 05:07
yansfil
added a commit
that referenced
this pull request
Sep 24, 2026
Related: `agents/prd/web-shell-pivot-s5/prd.md` (S5, after #141) ## Summary 웹 셸에서 Swift로 돌아가지 않고 Settings(General·Appearance·Agents·Devices·Shortcuts)와 진단을 보고, 프로젝트 pin·Workspace purpose·worktree 생성/삭제·원격 기기를 관리할 수 있게 했습니다. 사이드바 맨 아래 기기 전환기(native `HideDevicePicker` 형태)에서 연결된 SSH 기기를 고르면 그 host의 프로젝트·agent·보이는 탭·pane 배치와 실시간 터미널이 보이고, 입력과 split/close/zoom/focus/탭 명령은 그 host의 정확한 pane에만 갑니다. Swift만 하던 worktree 삭제 실행과 생성 후 agent 시작을 core 워커로 옮겨 두 셸이 같은 실행자를 쓰고, 클라이언트가 삭제 완료를 주장할 수 있던 `worktree_removal_finished` 이벤트를 없앴습니다. hided는 핸드셰이크 뒤 `daemon` 프레임을 보내고, Settings 관찰 플래그를 연결별 수요로 소유합니다. 스크린샷은 격리 fixture(가상 기기 Studio Mac)에서 찍었습니다. | 사이드바 아래 기기 전환기 | 원격 host의 탭·split pane과 실시간 출력 | | --- | --- | |  |  | | **연결 끊김: stale 배너·Retry, pane은 disconnected** | **기기 제거 뒤 로컬 탭 유지, 끊긴 기기로 split은 미전송** | |  |  | ## Review - **판단해 주세요**: 웹은 원격 탭을 따로 고르지 않고 host의 focus를 따라갑니다. core가 attach하는 탭이 그것뿐이라, 탭 전환도 `remote_control` `focus_tab`으로 host를 움직입니다. - **판단해 주세요**: 원격 선택 중 find·reopen·탭 재정렬·파일 팔레트·우측 패널 파일은 로컬에서 실행하지 않고 안내 문구로 거절합니다(원격 파일/worktree 관리는 범위 밖). - **판단해 주세요**: 연결이 끊기면 마지막 배치를 stale 배너·Retry와 함께 남기고 아무 명령도 보내지 않습니다. 배치를 지우는 편이 낫다면 알려 주세요. - **판단해 주세요**: Shortcuts는 Swift 8개 중 7개만 편집합니다. 8번째 Toggle Conversation은 PRD Non-goals가 뺀 대화 화면에 묶여 "macOS app only"로 표시되며, B9의 "8개" 문구와 다릅니다. - **판단해 주세요**: Settings accent 4색을 `AccentChoice` 토큰으로 승격했습니다(`design/tokens.json`, `HideTheme`, Pen 변수 4개). 값은 그대로입니다. - **조심해서 볼 파일**: `web/src/actions.ts` - failure path, 원격 명령이 로컬 id나 로컬 대상으로 fallback하지 않는지(`remoteHost`, `sendRemote`, `requestClose`). - **조심해서 볼 파일**: `herdr-core/src/runtime/terminal.rs` `return_keyboard_to_local_pane` - Herdr/core ownership, 로컬로 돌아올 때 키보드 pane을 원격 id에서 되돌림. - **조심해서 볼 파일**: `herdr-core/src/runtime/devices.rs` `rebuild_device_rows` - 기기 등록/제거가 catalog 전체 재구성으로 로컬 탭을 비우던 문제를 기기 행만 갱신으로 바꿈. - **조심해서 볼 파일**: `herdr-core/src/worktree_cleanup.rs` `remove_confirmed`, `worktree_control.rs` - 되돌릴 수 없는 삭제 직전 재검사, lock 밖 Git 실행(runtime mutex). - **조심해서 볼 파일**: `herdr-core/src/runtime/session.rs` task `agent_phase` - snapshot wire에 필드 2개 추가, Swift는 선택 필드로 디코드. - **조심해서 볼 파일**: `hided/src/server.rs` - `ai_settings.observing` 분리와 연결 종료 시 수요 해제. - **질문**: 생성 직후 새 pane 포커스를 웹이 `focus_pane`으로 명시합니다. core ingest가 pending focus를 직접 등록하는 편이 나을까요? ## Evidence - **확인한 것 (fixture 제어)**: 격리 HOME의 hided + 로컬/원격 Herdr 0.9.1 두 개 + loopback 전용 sshd(검증된 host key, 암호 없음)를 Herdr Browser pane(chromux CDP)에서 조작. - 원격 marker 입력은 원격 pane에만 기록, ⌘D split은 원격 2 pane·로컬 1 pane 유지, zoom·클릭 포커스·⌥⇧W close는 원격 `w1:p1`만 닫히고 로컬 `w1:p1`은 남음. - 새 탭·탭 전환·탭 닫기 원격 한정, 로컬 복귀 뒤 ⌘D는 로컬 split, `terminal.keyboard_returned_local` 진단이 원격 id에서 로컬 pane으로 복귀를 기록. - 연결 끊김 시 stale 배너·"disconnected" 캡션, split은 안내만 뜨고 미전송, Retry는 실제 새 시도, 재연결 뒤 입력 도달. - 선택 중 기기 제거 뒤 원격 Herdr·workspace·pane 생존(재등록 시 같은 pane 기록), 로컬 탭은 즉시 유지. - 원격 행 메뉴: pin·새 worktree는 이유와 함께 비활성, purpose는 Herdr 0.9.1 이상에서 허용. - **확인한 것 (실제 원격 host, 읽기 전용)**: 준비된 SSH alias로 실제 Mac을 격리 HOME에 등록(IdentityFile 경로만 참조, 키 복사 없음, host key는 기존 기록과 대조 고정). - 선택하지 않은 채 연결 성공, Test 7/7 통과, snapshot에서 Herdr 0.9.1·workspace 25·tab 31·agent 12·attach pane 0 확인 후 제거. 그 host의 pane·프로젝트·서버에는 입력·포커스·split·close를 하지 않았습니다. - 연결만으로는 `session.snapshot`·`agent.list`·`pane.updated` 구독만 쓰고 `remote_control`은 사용자 요청 경로에서만 시작됨을 코드로 대조. - **확인한 것 (자동)**: `verify-cargo.sh lint`, `verify-cargo.sh test` 1,098개 통과(실패 0), 신규 core 테스트 2개(로컬 복귀 키보드, 선택 기기 제거 뒤 로컬 탭 유지). - web typecheck·lint·vitest 165개(원격 라우팅 9개 포함)·build, 로컬 Playwright 32개(pinned Herdr 0.9.1), design contract, workstation identity 등 스크립트 게이트 통과. - **확인하지 못한 것**: 실제 원격 host의 pane 제어는 권한 밖이라 fixture로만 증명. Test의 `pty` 단계가 통과했는데, 준비 안내에는 그 키에 PTY 할당이 금지돼 있다고 되어 있어 대조가 필요합니다. - 스크린샷은 로그인된 브라우저가 없어 `user-attachments` 대신 PR 작성자 계정의 secret gist에 올렸습니다(저장소에는 커밋하지 않음). - **확인하지 못한 것**: 로컬 Swift 6.3.1은 이 PR이 건드리지 않은 `HerdrApp.swift:241`을 data race로 거부합니다(CI macos-15 `swift shell` 통과). - **확인하지 못한 것**: `acceptance_timeout_ends_cli_spawned_before_watcher` 간헐 실패(이번 실행은 통과), 설치 앱의 hook 설치 성공 경로(standalone hided는 helper 없음으로 거절). - **확인하지 못한 것**: 원격·로컬 pane 사이 구분선이 없음, plugin pane PATH에 node가 없어 `hide.browser` host가 조용히 종료됨(QA pane만 `--env PATH`로 우회). - **확인하지 못한 것**: 이미 push된 `70846bc` 커밋 본문에 agent 이름이 백틱 없이 있어 `check-no-attribution.py` 기본 범위가 실패합니다. force push 없이는 고칠 수 없어 그대로 둡니다. - **생성물**: `design/hide-ui.lib.pen`은 `gen-pen.mjs`가 accent 변수 4개를 추가한 diff입니다. <details><summary>B1-B24 범위 점검</summary> - 구현·증명: B1, B2, B3, B4, B5, B8, B10, B11, B12, B13, B14, B15, B16, B17, B18, B19, B20, B22 (실제 웹 QA 또는 core·e2e 테스트). - 구현·부분 증명: B9(7/8, 위 판단 항목), B21(설정 복원 확인, 진행중 mutation 비재실행은 core 테스트만), B23·B24(경계와 off-lock은 게이트·테스트, 프로세스 수 측정은 미실행). - 구현·미검증: B6 다음 소비 요청의 provider 적용, B7 설치 성공 경로. - 범위 안 누락: 없음. B18의 지난 Test 결과가 현재 상태로 읽히던 문제는 실행 시각 표시로 고침. - 명시적 제외: 원격 파일·worktree 관리, 원격 find/reopen/재정렬, Toggle Conversation. </details> ## Breaking change - `worktree_removal_finished` 이벤트 제거, `worktree_removal.phase`의 `ready`가 `removing`으로 바뀜. 같은 커밋의 Swift 셸만 소비자이며 저장 상태·설치 경로는 그대로입니다. **AI tooling**: 대부분 AI 도구로 작성. 격리 Herdr 두 개와 Browser pane에서 모든 원격 흐름을 직접 조작하고 두 Herdr의 pane 목록·레이아웃을 매 단계 대조. <details><summary>Verification record</summary> - base `efd4e13`, head `42c142e`; S5 continuation commits `cf10555`, `4e04744`, `5b080d1`, `42c142e`. - `scripts/verify-cargo.sh lint` 0, `scripts/verify-cargo.sh test` 0 (1,098 passed, 0 failed, 9 ignored). - web: `tsc --noEmit`, `eslint src e2e`, `vitest run` 165/165, `vite build`, Playwright 32/32 with Herdr 0.9.1. - scripts: `check-design-contract.mjs`, `design-controls.test.mjs`, `check-hide-design.mjs`, `check-no-workstation-identity.sh`, `check-capability-readers-off-lock.sh`, `check-harness-ignore-anchor.sh` 0; `check-no-attribution.py --range 70846bc..HEAD` 0. - Local Swift gates (`check-shortcut-contract.sh`, `check-right-panel-sections.sh`) fail at the pre-existing `HerdrApp.swift:241` under Swift 6.3.1; CI runs them on macos-15. </details>
yansfil
added a commit
that referenced
this pull request
Oct 29, 2026
…ir causes (#1833) Closes with-hide/hide-private#256 Closes with-hide/hide-private#244 Closes with-hide/hide-private#226 Closes with-hide/hide-private#267 Closes with-hide/hide-private#163 Closes with-hide/hide-private#266 Closes with-hide/hide-private#230 Closes with-hide/hide-private#264 Closes with-hide/hide-private#265 Closes with-hide/hide-private#212 Closes with-hide/hide-private#141 Closes with-hide/hide-private#282 Related: with-hide/hide-private#326 (제품 쪽 후속), #1811 ## Summary Windows에서 데스크톱 앱 시작·정리와 hided daemon 수명 테스트가 가끔 실패하던 것을 원인별로 고칩니다. 제한 시간과 재시도는 그대로입니다. 가장 잦던 실패(#256)는 job에서 처음 시작하는 Windows PowerShell과 새 `hided`의 cold 비용이 첫 테스트의 제한 시간 안에 들어간 것이었고, 테스트 전에 한 번 먼저 시작합니다. 정리 실패(#244 등)는 Playwright의 `app.close()`가 앱 프로세스가 끝나기 전에 돌아오는 것이었고, fixture가 그 프로세스의 종료까지 기다립니다. hided 테스트의 private Herdr는 pane shell까지 끝난 뒤에 폴더를 지웁니다. 나머지는 테스트가 잘못 기대하던 것(아직 없는 파일 읽기, delta 모양, 탭 선택 순서)을 계약대로 고쳤습니다. 제품 코드는 바뀌지 않습니다. 스크린샷 없음: 화면과 제품 코드를 건드리지 않음(e2e fixture와 테스트만). <details><summary>이슈별 원인과 처리</summary> - **#256** Add a project(Windows desktop job의 첫 테스트): Herdr는 cmd.exe pane에서 agent를 `powershell.exe -NoLogo -NoProfile -EncodedCommand`로 띄웁니다(Herdr v0.9.5 `interactive_shell_command`). desktop lane은 첫 테스트 전에 PowerShell을 한 번도 돌리지 않아, 첫 `agent start` 두 개가 46초(제한 30초) 걸렸고 이후 시작은 0.35초였습니다(run 40821395497). web lane은 globalSetup의 `endVctip`이 PowerShell을 먼저 돌려 이 실패가 없습니다. 10-23에는 같은 첫 테스트에서 job의 첫 `hided` 시작이 24초 걸려 "hided did not respond"가 됐습니다(run 39930517565, 평소 0.4-0.9초). -> 두 entry point가 같은 `prepareWindowsRun`으로 Herdr와 같은 형태의 PowerShell 시작과 `hided node --version`을 테스트 전에 한 번 하고 걸린 시간을 출력합니다. desktop에는 없던 `endVctip`도 함께 합니다. - **#244 #226 #267** "candidate exit unconfirmed": Windows에서 Playwright는 Electron을 cmd.exe 아래에서 띄우고(`shell: true`), `close()`는 앱의 디버그 파이프가 닫히면 context가 disposed되어 `TargetClosedError`를 삼키고 돌아옵니다(playwright-core 1.63). 기록된 프로세스(cmd.exe)는 그 뒤에 끝나고, cleanup은 바로 `exitCode`를 읽었습니다. -> fixture의 `close()`가 그 프로세스의 `exit`까지 10초 안에서 기다리고, 넘으면 pid를 말하며 실패합니다(home은 보존). - **#163** product analytics: `expect.poll`은 콜백이 던진 오류를 재시도하지 않습니다. daemon의 첫 저장 전에 `core-state.json`을 읽어 ENOENT로 즉시 실패했습니다. -> 없는 파일은 "아직 저장 안 됨"으로 읽고, 다른 오류는 그대로 던집니다. - **#266** handshake: semantic delta는 한 burst에서 바뀐 필드를 모두 싣습니다. 느린 runner에서는 시작 직후의 link backfill이 UI 변경과 같은 frame에 `navigator`를 실었습니다(실패 로그에 `backfill.done`). -> "navigator가 없다" 대신 "partial delta가 싣는 필드는 모두 그 reader가 가진 값과 다르고, 전체보다 적다"를 단언합니다. - **#230** hide-ai usage: usage child는 `fake-claude.cmd` -> `python`이고 그 step이 job의 첫 python 실행입니다(보통 0.9-3.7초, 나쁜 run 21-30초). -> TESTING.md Rust 규칙 8의 `stand_ins::ready_with_args`로 fake를 먼저 한 번 시작합니다(`FAKE_ENV` lock 안에서). - **#264 #265 #212** connect_stop: 이 step이 job의 첫 debug `hided` 시작입니다. 보통 0.8-1.2초, 나쁜 run은 세 테스트가 함께 10-18초, 그 재시도도 6-10초(첫 시작의 cold 비용이 끝나는 시점까지 기다린 것과 맞음). -> 같은 규칙으로 `hide connect` 전에 `hided node --version`을 한 번 시작합니다. - **#141** New tab: 새 탭은 선택되기 전에 먼저 그려집니다. 테스트는 탭 수가 늘고 선택이 draft가 아니면 선택된 탭을 읽었는데, 이전 탭 `w1:t1`도 그 조건을 만족해 이전 탭을 읽었습니다. -> 메뉴 단계가 이미 하듯 선택이 이전 탭을 떠날 때까지 기다립니다. - **#282** real_herdr: 마지막 실패는 fixture 폴더 삭제가 os error 32(다른 프로세스가 사용 중)였습니다. `PrivateHerdr::stop`은 server 프로세스만 기다렸고, Windows에서 pane shell(cwd가 fixture 안)이 server보다 오래 삽니다. -> server를 `OwnedChild`(Windows Job)로 시작하고, stop은 `capture_until`로 server와 그 트리 전체가 끝날 때까지 기다립니다(30초, 넘으면 트리를 끝내고 오류). </details> ## Review - **판단해 주세요**: 첫 시작을 미리 내는 세 곳(#256 #230 #264류)은 테스트가 재는 것과 무관한 cold 비용이라 TESTING.md 규칙 8을 따랐습니다. 다만 실제 PC의 첫 agent 시작·첫 hided 시작에서도 보일 수 있어 제품 쪽은 with-hide/hide-private#326으로 남겼습니다. - **판단해 주세요**: #266 단언은 원래 계약(UI 변경 delta는 바뀌지 않은 section을 싣지 않음)을 약하게 하지 않습니다. 예전에는 `navigator` 하나만 봤고, 이제는 실린 모든 필드가 바뀐 것인지와 전체보다 적은지를 봅니다. `navigator`는 실제로 바뀌었을 때만 실릴 수 있습니다. - **조심해서 볼 파일**: `hided/tests/it/support/private_herdr.rs` - 23곳이 쓰는 fixture의 stop이 이제 트리 종료까지 확인합니다(failure path: 남은 pane이 있으면 오류). - **조심해서 볼 파일**: `desktop/e2e/fixture.ts` - Playwright `ElectronApplication.close`를 감쌉니다(failure path: 끝나지 않는 프로세스는 10초 뒤 pid와 함께 실패, home 보존). - **조심해서 볼 파일**: `web/e2e/platform-fixture.ts` `prepareWindowsRun` - 두 e2e entry point의 Windows 준비 순서(PowerShell, hided, 마지막 compile 뒤 vctip). ## Evidence - **확인한 것 (원인)**: #256 실패 6건이 모두 job의 첫 테스트였고, 최근 30 run 중 1건 실패; artifact의 Herdr 로그로 첫 시작 46초/14.5초/이후 0.35초를 쟀습니다. - **확인한 것 (원인)**: #244의 반환 경로는 playwright-core 1.63 `ElectronApplication.close()`와 `launchProcess`(`shell: true`, `close` 이벤트) 소스로 확인했습니다. - **확인한 것**: `fixture-cleanup.unit.ts`의 새 두 테스트가 수정 전 코드(exit 대기 제거)에서 실패하고 수정 후 통과. desktop unit 28 files 295 passed. - **확인한 것**: desktop typecheck(e2e 포함), web/desktop lint, `verify-cargo.sh fmt-check` 통과. - **확인한 것 (CI 반복)**: 0c6740300에서 verify 40854250922를 두 번(attempt 1, 2) 돌려 둘 다 통과, 재시도 0, flaky 보고 없음. Windows desktop e2e 19/19 두 번(첫 테스트 포함), macOS desktop 58+61 두 번, Rust 6231/6231 두 번, Windows check와 Windows web e2e 통과. 미리 치른 첫 PowerShell 시작은 2.5-5.6 s, Windows usage 테스트 1회차는 첫 Python 시작이 20.7 s 걸렸지만 기한 밖에서 치러져 통과했습니다. - **확인한 것**: 2934e82b7의 #266 assertion은 Linux·Windows에서 결정적으로 실패했습니다(`rest`가 바뀌지 않은 delta는 `rest: null`을 보냄). 0c6740300이 그 frame을 건너뛰게 고쳤고, 위 두 번의 run에서 통과했습니다. - **확인하지 못한 것**: 이 Mac에서 Windows를 돌릴 수 없어 Windows 동작은 이 PR의 CI Windows job으로 확인합니다. 디스크 여유가 2-5 GB라 Rust 테스트(handshake, connect_stop, hide-ai)와 e2e는 로컬에서 빌드하지 못했고 CI로 확인합니다. <details><summary>Verification record</summary> - base: main d8da3e4 - head: 0c67403, verify 40854250922 attempt 1, 2 success - 범위에서 뺀 것(증거는 각 이슈 코멘트에): #214 #169 #254 #255 #280, #324(이번 원인은 트리 누락이 아님) </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related:
agents/prd/web-shell-pivot-s4/prd.md; S3 #140Summary
Review
herdr-core/src/changes.rs,herdr-core/src/files.rs- Git scope and opened-handle identity.herdr-core/src/runtime/events.rs- checkout focus and History selection in one frame.web/src/HistoryList.tsx,web/src/editor/PatchView.tsx- readonly list and patch display.Evidence
56faaf5, focused History tests passed 16/16; runtime focus test, Rust lint, daemon build and S4 web E2E 2/2 passed.bef04b3showed nested working and branch diffs; outside sibling changes were absent.56faaf5passed all six required checks, including Rust, Swift and web.56faaf5. Prior Rust suites failed unchanged timing/PID tests; each passed alone and in CI.Verification record
agents/prd/web-shell-pivot-s4/prd.md; base5271703; head56faaf5f21c27fc75b7eb6463c3d3c3822886477.bef04b3sealed: Rust 658 passed, 3 path-alias tests failed; Swift/lint passed; 216.4s. Fixed at5b91b5e.5b91b5esealed: Rust FFI destroy timing failed twice (782ms, 751ms vs 250ms); Swift/lint passed; 250.7s and 72.5s.5b91b5eserial sealed: Rust opener PID parse failed on an empty file; Swift/lint passed; 81.3s.cargo test --locked --workspace.56faaf5focused: History 16/16, runtime focus, Rust lint, daemon build, S4 web E2E 2/2 passed.