Repository navigation
Measure web shell Stage 0 with per-hop evidence - #129
Merged
Merged
Conversation
Independent hided and xterm.js crates under spikes/web-shell, plus scripts that start a private Herdr server, compare key-to-echo latency against the Swift shell, capture redacted snapshot deltas, and record Chrome replay frames.
yansfil
added a commit
that referenced
this pull request
Sep 21, 2026
Related: follows #129 (S0) · PRD `agents/prd/web-shell-pivot-s1/prd.md` ## Summary - First product web shell: `hided` daemon + `hide` CLI + React app (sidebar + one xterm.js pane), the core linked through a new pub Rust API beside the C ABI. - Loopback WS with token, Origin, schema 2 and a cap of eight clients; HTTP is `/`, `/assets`, `/health` only; a release `hided` embeds `web/dist`. - Swift coexistence is decided per socket: only an attach to the socket the Swift shell holds prompts (or refuses without a TTY); an isolated socket never does. - `hided` resolves the `herdr` binary (`HERDR_BIN_PATH`, then PATH) so pane terminals attach; the previous head passed none and could not show any terminal. - A reconnecting client resumes from its cursors: a delta when the core can serve them, a self-contained snapshot when it dropped chunks or the daemon restarted, and the pane re-requests its view after every snapshot. - Design tokens live in `design/tokens.json`; CSS and HideTheme stay in lockstep.  ## Review - **판단해 주세요**: B17 live UX-01 on the operator session after closing Swift (user-run; commands in the Evidence section). - **판단해 주세요**: the e2e/measurement seam `window.__hideProbe` exists only with `?probe=1`; it reads the WebGL-drawn buffer, which nothing else can. - **판단해 주세요**: B12 was measured on the live driven pipeline (pane printing every 8 ms) rather than the spike's in-page replay, so no spike code entered the product. - **조심해서 볼 파일**: `hided/src/coexist.rs` - reads another process's environment from the kernel; the Unknown case refuses without a TTY. - **조심해서 볼 파일**: `hided/build.rs` + `hided/src/server.rs` - release embed fails the build without `web/dist`; exact-key lookup, no traversal path. - **조심해서 볼 파일**: `herdr-core/src/ffi.rs` - owner thread and snapshot latch behind the new Rust API. - **조심해서 볼 파일**: `hided/src/server.rs` `classify_frame` - the resume rule against `snapshot_delta.rs` (rest gated by revision, future cursor read as zero, `chunks_dropped`); a wrong branch here shows as a pane that stays blank after a reconnect. - **조심해서 볼 파일**: `web/src/terminal.tsx` - viewport then resize, chunks off the store, writer registered before the view request, probe writer only when armed. - **질문**: Is mapping `socket_missing` to 소켓 없음 and `stale` to 무응답 the right B6 split? ## Evidence - **확인한 것**: B8 echo on the product release `hided` (embedded web/dist, head f715105; the commits since touch no per-chunk write path, so the numbers stand for this head) on an isolated pinned herdr 0.9.1 `cat` pane, Chrome 153 via CDP: three trials x 50 markers, t0 = `herdr pane send-text` CLI return, t1 = xterm write completion with the marker in the parsed buffer; trial p95 1.186 / 1.061 / 0.847 ms, median 1.061 ms vs threshold 11.228 ms (S0 Swift 6.228 + 5, reused); 0 negative samples; load averages 24-26. - **확인한 것**: B12 frames on the same setup: one 120.0 s window, pane printing a line every 8 ms, 14400 rAF frames, 0 over 16.7 ms (0.0%), max dt 9.5 ms, 6741 WS delta frames received during the window. - **확인한 것**: B5 reproduced both ways with the Swift app running: isolated `HERDR_SOCKET_PATH` + `hide serve --keep-alive` without a TTY starts and writes its state file; default socket without a TTY refuses naming the Swift pid and socket. 10 coexist tests including a live child-environment read. - **확인한 것**: CI `verify` green on 8d6e998 (rust workspace, swift shell, repository invariants, static-design, web shell with the e2e on the fetched pinned herdr); the web lane had never reached its tests before: the lockfile lacked `@types/node`, and the runner's bash login shell never printed the fixture prompt until the fixture named `SHELL=/bin/zsh`. - **확인한 것**: Playwright Chromium, 3 tests: missing-socket row, refused-token copy, and sidebar click -> `[data-terminal-pane]` switches -> typed `echo-two-…` then `echo-one-… 한글` echo in each pane on an isolated pinned herdr with two compiled fake `claude` agents. - **확인한 것**: release `hided` from a cwd without `web/dist` serves `/` and `/assets/*.js` from the binary, `/assets/../../hided.json` and `/anything` are 404; 10 hided handshake tests (a resumed cursor gets a `delta` without `rest`, a cursor from the future gets a `snapshot` with `rest`, the daemon exits and removes its state file after its last client leaves), 3 server unit tests, 11 coexist tests, 14 vitest cases, sealed cargo test / swift test / cargo lint PASS on 8d6e998, design contract and repository gates locally. - **확인하지 못한 것**: B17 real-session UX-01 (user). 10-minute idle-exit wall clock (the integration test runs it at 1 s). Korean IME composition on the product page under a real input method (S0 human PASS; Playwright types composed text). kitty `CSI 13;2u` branch of B9. `hide dev` Vite proxy end to end. - **생성물**: `web/src/tokens.css` and `web/src/generated/hided-ws.ts` from generators. Follow-up: `hide dev` should start Vite itself through the one spawn helper (today it only sets the allowlist and expects `pnpm -C web dev`); kitty keyboard negotiation for Shift+Enter (`CSI 13;2u`) waits for the core to expose the pane's kitty state; the probe module should leave the production bundle (`import.meta.env.PROD`); the web diagnostics list has no sink yet (capped at 200 with the overflow counted); a future-revision resync reads the core twice. **AI tooling**: 대부분 AI 도구. Measurement numbers, the B5 reproduction, the release embed curl checks and the Playwright run were executed locally and read by hand against the report. <details><summary>Verification record</summary> - PRD: `agents/prd/web-shell-pivot-s1/prd.md` (sha256 2a9e6eadb34c273f4fb6cb7e698e5c896d32dc056040a9ad5ba7805b67c905cb) - Base 66fd2dd → head 8d6e998, verified 2026-09-21T13:39:52.312Z: PASS - Verification report: `agents/runs/web-shell-pivot-s1/verification-report.json` and `agents/runs/web-shell-pivot-s1/verification-report.md`; source fingerprint a83b2fef38aad4c8ffae825f17f7079acafe6710240f125776b39bc268c0fdee - Suites: - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0) - S2: GREEN `bash scripts/verify-swift.sh test` (exit 0) - S3: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Reviews: Fidelity (head e1390ef, re-review after the 61f795e round): Fix now none; the three 61f795e findings were fixed in 90b2cef, b411ab0, 9b514b7 and e1390ef (first frame read from the client cursors with a resync on a gap, integration tests for a resumed cursor / a future cursor / the idle exit, the B5 decision as a pure `coexist::decide`). Follow-ups: the double read on a future-revision resync, a stubbed-stdin test for `confirm_coexist`. Code (head e1390ef): Fix now none; the three 61f795e findings (startHided inside the try, probe hook gated once per connection, prompt polling instead of a fixed sleep) fixed in b411ab0 and e1390ef. Follow-ups applied in 3df10ee (dead `pending` chunk queue removed, dist watch only in a release build); still open: `diagnosticsDropped` has no sink, the mount effect sends one extra viewport request, the token length short-circuit. Security (head 61f795e full, e1390ef delta): Fix now none; follow-ups: compare on a fixed-size buffer instead of a length gate, the resolved-binary log line joins the path-disclosure follow-up, probe out of the production bundle, embed guard against sourcemaps. Code+Fidelity delta (head 3df10ee): Fix now none, no follow-ups; the dropped-chunk claim was traced through `terminal_frames_need_full` for initial load, pane switch and reconnect. Code+Security delta (head 8d6e998): Fix now none, no follow-ups; the lockfile diff is the declared `@types/node` and its peer re-keying, `onlyBuiltDependencies` sits at the workspace root, and `SHELL=/bin/zsh` stays inside the private fixture env on the macos-15 runner. - Evidence: 11 registered (2 screenshot, 3 log, 6 file); paths are local to the run directory - agents/runs/web-shell-pivot-s1/screenshots/s1-sidebar-pane.png - agents/runs/web-shell-pivot-s1/measure/attempt2/identity.txt - agents/runs/web-shell-pivot-s1/measure/attempt2/run.log - agents/runs/web-shell-pivot-s1/measure/attempt2/echo-summary.json - agents/runs/web-shell-pivot-s1/measure/attempt2/frames-summary.json - agents/runs/web-shell-pivot-s1/measure/attempt2/echo-1.json - agents/runs/web-shell-pivot-s1/measure/attempt2/echo-2.json - agents/runs/web-shell-pivot-s1/measure/attempt2/echo-3.json - agents/runs/web-shell-pivot-s1/measure/attempt2/frames.json - agents/runs/web-shell-pivot-s1/screenshots/s1-click-flow.png - agents/runs/web-shell-pivot-s1/e2e/playwright-takeover.log - Changed paths: 78 (see Files changed) </details>
yansfil
added a commit
that referenced
this pull request
Oct 29, 2026
…back runs (#1835) Closes with-hide/hide-private#127 ## Summary - Settings에서 언어를 고른 직후 글자 크기 slider에 End를 누르는 desktop 테스트 3개가 가끔 실패했습니다(#127: 17 대신 13). - 원인: 닫히는 언어 Select가 키보드를 자기 버튼에 돌려주는 일을 타이머로 미룹니다. 부하가 걸리면 그 타이머가 테스트의 `slider.focus()` 뒤에 돌아 End가 버튼으로 갑니다. - 제품 수정: Select가 닫힌 뒤 다른 컨트롤이 이미 키보드를 가져갔다면, 늦게 도는 반환이 그 focus를 빼앗지 않습니다. 아무것도 가져가지 않았으면 예전처럼 Select 버튼으로 돌아갑니다. 메뉴와 대화상자가 쓰는 같은 보호(`useReturnFocus`)를 Select도 거칩니다(`docs/UI_BEHAVIOR.md`: a delayed focus return from any layer leaves a newer control or layer's focus in place). - 테스트: 세 테스트는 그 반환이 끝난 상태(언어 버튼에 focus)를 기다린 뒤 키보드를 옮깁니다. 대기 시간, retry, lane은 그대로입니다. 스크린샷 없음: 키보드 focus가 어디로 가는지만 바뀌고 그려지는 화면은 같습니다. 이 묶음(mission-13 flaky2-mac-viewarea)의 10개 이슈 처리, 10-23~10-29 macOS desktop CI 기록 304회 기준: | 이슈 | 테스트 | 처리 | | --- | --- | --- | | #127 | pane-move 글자 크기 | 이 PR (304회 중 3회 재발) | | #157 | new-tab ⌘T/⌘W | #1650이 고침, 닫음 (마지막 실패 커밋은 #1650 이전) | | #177 | group-tabs 새 터미널 | #1493이 고침, 닫음 | | #178 | new-terminal | macOS 서명은 #1493이 고침; 10-28 Windows 서명이 남아 열어 둠 | | #249 #182 #175 #231 | lane drag, owl, area cycle, page note | 0회 재발, 고친 커밋 미확인: 원인 후보만 코멘트, 범위 밖 | | #129 | close-policy ⌘W | 1회: 후보 앱 main process가 멈춤(teardown도 실패), 범위 밖 | | #160 | agent-logo-peek | herdr fixture의 CLI 30 s 타임아웃(다른 spec에도 같은 서명), fixture 작업으로 넘김 | 의심했던 "data-pane-view 두 개"(#178)는 제품 결함이었습니다: 빈 그룹에서 연 새 터미널이 잠깐 Ungrouped에 놓여 두 pane이 같이 그려졌고, #1493이 core에서 고쳤습니다. ## Review - **조심해서 볼 파일**: `web/src/components/ui/select.tsx` - 모든 Select가 닫힐 때의 focus 반환 경로입니다. Select root가 열림 상태와 trigger를 context로 내려 주고, content는 `useReturnFocus(open, { target: trigger })`로 반환합니다. 호출자가 `onCloseAutoFocus`에서 `preventDefault`하면(`AddProjectDialog`의 host 변경) 그쪽이 이깁니다. - **조심해서 볼 파일**: `web/src/components/ui/layer.ts` - 모든 layer의 늦은 반환 보호. 반환 대상(trigger)을 감싼 surface가 focus를 가진 것은 "새 컨트롤"로 보지 않습니다. 고른 항목이 사라질 때 Settings 대화상자의 focus trap이 키보드를 대화상자 자체로 옮기는데, 첫 수정은 이것을 새 focus로 읽어 정상 닫힘에서도 trigger로 돌려주지 않았습니다(b72ba42 CI의 세 e2e 실패). - **조심해서 볼 파일**: `desktop/e2e/pane-move.spec.ts`, `restoration.spec.ts`, `project-settings.spec.ts` - 같은 원인을 가진 세 곳에 같은 대기를 넣었습니다. ## Evidence - **확인한 것**: macOS desktop CI 기록 609개 report(294개 커밋)에서 이슈별 재발을 셈. #127의 3회 모두 End 뒤 13 그대로. - **확인한 것**: 회귀 테스트 `web/src/components/ui/select.test.tsx`는 Settings처럼 대화상자 안의 실제 Select로 두 순서를 고정합니다. "고름 -> 새 컨트롤 focus -> 늦은 반환"은 수정 전 Select에서 실패(focus가 Select 버튼으로 감)하고 수정 후 통과합니다. "고름 -> 늦은 반환 -> trigger focus"(정상 닫힘)는 `layer.ts` 수정 없이 실패(focus가 대화상자에 남음, CI e2e와 같은 증상)하고 수정 후 통과합니다. 테스트는 고정 대기 없이 fake timer로 Radix의 늦은 반환 타이머를 명시 실행하고, 그 전후에 `onCloseAutoFocus` 호출과 focus를 단언합니다. root는 `afterEach`가 정리합니다. - **확인한 것**: `verify-web.sh` 전체 통과(web test 2251, desktop test 294, lint, typecheck, build). - **확인한 것**: `verify-web.sh desktop lint`, `desktop typecheck` 통과. - **확인하지 못한 것**: desktop e2e 로컬 실행. 디스크가 5 GiB라 debug 빌드를 하지 않고, 이 PR의 macOS desktop job과 같은 커밋 반복으로 확인합니다.
HyunjunJeon
pushed a commit
to HyunjunJeon/hide
that referenced
this pull request
Nov 12, 2026
…here (with-hide#2366) Closes with-hide/hide-private#808 Closes with-hide/hide-private#507 Closes with-hide/hide-private#404 Refs with-hide/hide-private#129 Refs with-hide/hide-private#135 Refs with-hide/hide-private#171 Refs with-hide/hide-private#442 Closes with-hide/hide-private#500 Refs with-hide/hide-private#586 Closes with-hide/hide-private#544 ## Summary 데스크톱에서 웹 페이지가 스스로 다시 로드되는 동안 조작자가 키보드를 터미널로 옮기면, 로드가 끝나는 순간 페이지가 키보드를 도로 가져가 터미널로 돌아오지 않았습니다 (제품 결함, with-hide#507 #808). 호스트는 "로드가 시작될 때 키보드를 누가 쥐고 있었나"로 판단했는데, 이제 로드 중인 문서마다 표시를 두고 "페이지가 포커스를 받는 그 순간 누가 쥐고 있나"로 판단합니다. 테스트 쪽 원인도 하나로 모았습니다. e2e의 `focusPage`는 페이지 로드 도중에 포커스를 줘서, 호스트가 이를 정상적으로 "로드가 키보드를 가로챔"으로 보고 쉘에 되돌렸고 쉘은 페이지가 키보드를 받았다는 말을 듣지 못했습니다 (with-hide#404 #808 with-hide#129, Command W가 페이지가 아니라 터미널에 간 경우). 이제 로드가 멈춘 같은 턴에 포커스를 줍니다. Windows 첫 페이지 로드가 10초를 넘는 일(with-hide#135 with-hide#171)은 원인을 찾지 못해 테스트는 건드리지 않았고, 이슈는 열어 둡니다. 화면(web/src)은 바뀌지 않아 스크린샷은 없습니다. ## Review - **판단해 주세요**: 같은 "로드가 키보드를 가로챔" 규칙을 제품은 그대로 두고 테스트 헬퍼가 규칙에 맞추도록 했습니다. 규칙 자체(운영자의 클릭이 아닌 포커스는 로드 중이면 되돌린다)는 맞다고 봤습니다. - **조심해서 볼 파일**: `desktop/src/main/browser.ts` - 포커스 이벤트 처리 경로(`contents.on("focus")`, `undoGrab`), 고빈도는 아니고 문서 로드당 한 번. - **닫지 않은 이슈**: with-hide#129 with-hide#135 with-hide#171 with-hide#442 #586은 `Refs`입니다. 무엇을 확인했고 무엇이 남았는지는 아래 Evidence의 "확인하지 못한 것"에 있습니다. 원인을 고친 #808 with-hide#507 #404와, 이미 #2149가 고친 원인이 반복에서 재발하지 않은 with-hide#500 #544만 `Closes`입니다. ## Evidence - **확인한 것**: - 호스트 로그로 원인 증명: 야간 42730366343의 `browser.page_focus ... navigating:true` 다음 `navigation_focus_returned`(쉘이 못 들음), 같은 로그의 첫 시도는 `navigating:false`로 로드가 시작될 때 페이지가 키보드를 쥔 경우(제품 결함 모양). - 새 단위 테스트(`browser.test.ts`)는 수정 없이 실패하고 수정 후 통과합니다. 데스크톱 단위 32개, 데스크톱 typecheck와 lint 통과. - 임시 커밋 231062f(되돌림 c0d51b3)에서 재시도 없이 반복한 CI 실행 (그 실행의 head는 231062f14이고, 이 PR의 최종 head 1f2678713과는 `browser.spec.ts`의 첫 로드 대기, 진단 덤프, 임시 변경의 되돌림만 다릅니다) https://github.com/with-hide/hide/actions/runs/42785031933 : - macOS 데스크톱 browser·close-policy·new-tab 스펙 x10: 4개 샤드 모두 통과, 각 50개, 합 200개 (jobs 129725125529, 129725125682, 129725125745, 129725125916). - Windows 데스크톱 페이지 폭 2개와 device size x10: 30개 통과, 같은 job의 진단 시험 10개를 합쳐 40개 (job 129725125921). 이 반복은 `openUntilLoaded`가 있던 231062f14에서 돌렸고, 최종 코드(대기는 main 그대로)는 일반 CI에서만 통과를 확인했습니다. - Windows 웹 pane-focus-ordering, stale-snapshot-focus, shell 스펙 x20: 통과 (jobs 129727940499, 129727940557). 같은 job의 20개 실패는 grep(`shell.spec`)에 같이 걸린 `sidebar-shell.spec.ts:46`으로, Windows 경로 표기(`\` 대 `/`) 때문에 매번 실패하는 이 노드 밖의 결함입니다. - Linux 웹 같은 스펙 x20: 통과, 260개 (jobs 129728372563, 129728372677). - with-hide#500 with-hide#544 with-hide#586(30초 시간 초과)와 with-hide#442(30초)는 모두 11-05 이전이고, 호스트 로그의 `task_operation.busy`로 둘째 에이전트 시작이 거절된 모양이었습니다. 11-06의 with-hide#2149(첫 에이전트가 시작된 뒤에 다음을 시작)가 이미 이를 고쳤고 그 뒤 재발이 없습니다. 이 PR의 반복은 그 수정이 유지됨을 보이며, 새 웹 수정은 없습니다. - **확인하지 못한 것**: - with-hide#135 with-hide#171: Windows에서 첫 페이지 로드가 CLI `--wait`의 10초를 넘는 원인은 못 찾았습니다. 진단 시험(새 세션의 프록시 해석과 로드)은 10회 모두 0.5초 안이었습니다. 이 PR은 이 부분을 바꾸지 않았고 한도도 그대로입니다. 남은 일: Windows 러너에서 첫 로드의 어느 구간이 느린지 측정. - #129의 첫 모양(후보 앱 메인 프로세스가 90초 멈춤, 10-26 한 번)과 #586의 `ERR_NO_BUFFER_SPACE`(11-07 한 번), #442의 11-09 `h1:p2` 없음(Windows)은 원인 미확정입니다. #442는 다음 실패에 페이지가 무엇을 그렸는지 남도록 덤프를 달았습니다. - macOS @needs-focus 테스트를 로컬에서는 돌리지 않았습니다 (OS 포커스를 가져가므로). <details><summary>Verification record</summary> - base: main (fetch 시점 ab0cd44 이후), head: 1f26787 - 변경 경로: desktop/src/main/browser.ts, browser.test.ts, desktop/e2e/fixture.ts, new-tab.spec.ts, web/e2e/pane-focus-ordering.spec.ts, docs/BROWSER_DISPLAYS.md - 단위: 데스크톱 browser.test.ts 32개 통과 (새 테스트는 수정 없이 실패), 데스크톱 typecheck와 lint 통과 - 반복 CI: run 42785031933, head 231062f, 재시도 0. macOS 데스크톱 x10 200개, Windows 데스크톱 30개(+진단 10개), Windows 웹 x20, Linux 웹 x20 260개 통과 - 일반 CI: head c0d51b327의 run 42794038744 통과(web and desktop checks, web e2e linux 6/6, windows desktop, windows e2e, windows check), 최종 head 1f2678713의 CI는 Hide가 기록 - 리뷰: m46-reviewer 1차 fail(대기 연장, 원인 미확정 Closes) 후 반영, 재리뷰 pass - 실행하지 않음: macOS @needs-focus 테스트의 로컬 실행 </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: PRD
agents/prd/web-shell-pivot-s0/prd.mdSummary
cli_return_ms)**입니다. CLI 비용은 별도 보존하고 +5ms 임계값은 유지합니다.ime-verdict.md.ModifiedTerminalInputPolicymapping (ESC CR / CSI 13;2u, ⌘⌫, ⌘←/→) is carried to S1 as a requirement.Review
measure/write-report.py의 양쪽 동일 t0,src/s0.ts의 message/write 시각,measure/run-s0.sh의 종료 소유권입니다.Evidence
AI tooling: 대부분 AI 도구. 원시 시각, 격리 앱 창, 브라우저 echo와 프로세스 정리를 대조했습니다.
Verification record
agents/prd/web-shell-pivot-s0/prd.md(sha256 e086b4e58cbc571e6d4893149522a19eb439d488b2699a6904ffeec1f6f4de97)agents/runs/web-shell-pivot-s0/verification-report.jsonandagents/runs/web-shell-pivot-s0/verification-report.md; source fingerprint 24bcf17a5949bb091a03189d10a8a08fa4107669bab201c454a0f1a88918d12bbash scripts/verify-cargo.sh test(exit 0)bash scripts/verify-swift.sh test(exit 0)bash scripts/verify-cargo.sh lint(exit 0)