Skip to content

Measure web shell Stage 0 with per-hop evidence - #129

Merged
yansfil merged 4 commits into
mainfrom
prd/web-shell-pivot-s0
Sep 21, 2026
Merged

yansfil merged 4 commits into
mainfrom
prd/web-shell-pivot-s0

Conversation

@yansfil

@yansfil yansfil commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Related: PRD agents/prd/web-shell-pivot-s0/prd.md

Summary

  • 웹 셸 S0 측정을 hop별 시각, 양쪽 3×50 표본, 전체 120초 replay로 다시 수행했습니다.
  • Observer 승인으로 양쪽 t0는 **send-text CLI 반환 시각(cli_return_ms)**입니다. CLI 비용은 별도 보존하고 +5ms 임계값은 유지합니다.
  • polling·최신 chunk 시각 덮어쓰기·짧은 frame 창·종료 순서를 수정했습니다. notifier는 ACK 없이 즉시 snapshot을 요청합니다.
게이트 값 기준선 / 임계값 결과
① 한글 IME V9 사람이 4개 항목 확인 네 항목 모두 통과 PASS (사용자 판정 2026-09-21)
② CLI 반환→echo p95 web 0.888ms Swift 6.228ms + 5 = 11.228ms PASS
③ 탭 renderer + hided RSS 228.25MiB ≤400MB PASS
④ 16.7ms 초과 frame 0/14,407, 120.004초 ≤1% PASS
  • Gate ① was judged by the user on the live spike on 2026-09-21: all four Hangul IME checks pass ("오 다 잘된다"). Verbal verdict, no screenshots; recorded in the run directory as ime-verdict.md.
  • Observed outside the gates: Shift+Enter sends plain CR. The Swift shell's ModifiedTerminalInputPolicy mapping (ESC CR / CSI 13;2u, ⌘⌫, ⌘←/→) is carried to S1 as a requirement.

Review

  • 판단해 주세요: CLI 반환은 입력 인계의 측정 대리값이며, 물리 키·compositor 지연은 아닙니다. ① 완료 전 S1은 시작하지 않습니다.
  • 조심해서 볼 파일: measure/write-report.py의 양쪽 동일 t0, src/s0.ts의 message/write 시각, measure/run-s0.sh의 종료 소유권입니다.
  • 측정 요청의 고정 worktree 기준선을 유지했습니다. 현재 main보다 48개 commit 뒤여서 병합 시 통합 검증은 별도입니다.

Evidence

  • 확인한 것: 각 셸 150개 표본, no-ACK push, owner queue, WS 전송·도착, xterm write 완료를 각각 기록했습니다.
  • CLI spawn→return p95는 web 110.722ms, Swift 13.000ms입니다. 제외 전 p95 111.485/22.871ms도 원본에 보존했습니다.
  • notifier→request 0.079ms, owner queue 0.028ms, snapshot/copy 0.098ms, WS→message 0.373ms, message→write 0.300ms(p95)입니다.
  • 격리 dev bundle의 실제 창과 Browser pane의 ASCII echo를 확인했습니다. 운영 topology 18/19/21 유지, 최종 잔류 프로세스 0개입니다.
  • Rust test·Swift test·Rust lint, 측정 회귀 5개, 디자인 계약 검사 통과. 캡처·trace·스크린샷은 저장소 규칙에 따라 로컬 보관합니다.
  • 확인하지 못한 것: 실제 한글 IME, 물리 display 지연, release 빌드 동등성. Swift draw trace에는 marker 식별자가 없습니다.
  • 첫 255ms의 정확한 원인은 옛 기록에 hop 시각이 없어 소급 확정하지 않았습니다. 캡처의 터미널 내용은 길이만 남긴 치환값입니다.

AI tooling: 대부분 AI 도구. 원시 시각, 격리 앱 창, 브라우저 echo와 프로세스 정리를 대조했습니다.

Verification record
  • PRD: agents/prd/web-shell-pivot-s0/prd.md (sha256 e086b4e58cbc571e6d4893149522a19eb439d488b2699a6904ffeec1f6f4de97)
  • Base c942b95 → head 65dd381, verified 2026-09-21T07:55:15.190Z: PASS
  • Verification report: agents/runs/web-shell-pivot-s0/verification-report.json and agents/runs/web-shell-pivot-s0/verification-report.md; source fingerprint 24bcf17a5949bb091a03189d10a8a08fa4107669bab201c454a0f1a88918d12b
  • 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)
  • Fidelity reviewed 65dd381: no Fix now; follow-ups are interval CPU, sanitized topology ID comparison, and explicit RSS byte units.
  • Code reviewed 65dd381: prior PID-publication cleanup finding fixed with red/green real-child regression; no remaining Fix now. Follow-ups are CDP deadlines and future marker/draw correlation.
  • Historical first-pass evidence is retained. Current measurements are pass2-attempt6; collection used 2790b4d and scoring uses the unchanged CLI-return correction from 2458901. The final commit only repairs PID publication failure cleanup.
  • Evidence: 67 registered (52 file, 11 log, 4 screenshot); paths are local to the run directory
    • agents/runs/web-shell-pivot-s0/capture.jsonl
    • agents/runs/web-shell-pivot-s0/echo-web-1.json
    • agents/runs/web-shell-pivot-s0/echo-web-2.json
    • agents/runs/web-shell-pivot-s0/echo-web-3.json
    • agents/runs/web-shell-pivot-s0/echo-swift-1.json
    • agents/runs/web-shell-pivot-s0/echo-swift-2.json
    • agents/runs/web-shell-pivot-s0/echo-swift-3.json
    • agents/runs/web-shell-pivot-s0/chrome-trace.json
    • agents/runs/web-shell-pivot-s0/frames-summary.json
    • agents/runs/web-shell-pivot-s0/rss-tab.json
    • agents/runs/web-shell-pivot-s0/frames.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/REPORT.md
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/hop-summary.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/rss-tab.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/frames.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/frames-summary.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/chrome-trace.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/capture.jsonl
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/snapshot-stats.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/operator-before.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/operator-after.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/cleanup-processes.txt
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/herdr-contract.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/echo-web-1.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/echo-web-2.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/echo-web-3.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/echo-swift-1.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/echo-swift-2.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/echo-swift-3.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/logs/hided-1.log
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/logs/hided-2.log
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/logs/hided-3.log
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/logs/swift-1.log
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/logs/swift-2.log
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/logs/swift-3.log
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/swift-echo-1.png
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/swift-echo-2.png
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/swift-echo-3.png
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/swift-windows-1.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/swift-windows-2.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/swift-windows-3.json
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/idle-hided-1.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/idle-hided-2.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/idle-hided-3.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/idle-swift-1.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/idle-swift-2.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/idle-swift-3.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/driven-hided-1.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/driven-hided-2.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/driven-hided-3.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/driven-swift-1.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/driven-swift-2.ps
    • agents/runs/web-shell-pivot-s0/pass2-attempt6/driven-swift-3.ps
    • agents/runs/web-shell-pivot-s0/REPORT.md
    • agents/runs/web-shell-pivot-s0/second-pass-notes.md
    • agents/runs/web-shell-pivot-s0/logs/measurement-tests.log
    • agents/runs/web-shell-pivot-s0/logs/design-check.log
    • agents/runs/web-shell-pivot-s0/logs/second-pass-build.log
    • agents/runs/web-shell-pivot-s0/browser-qa4/snapshot.txt
    • agents/runs/web-shell-pivot-s0/browser-qa4/views.json
    • agents/runs/web-shell-pivot-s0/browser-qa4/cleanup.txt
    • agents/runs/web-shell-pivot-s0/browser-qa4/pane.json
    • agents/runs/web-shell-pivot-s0/browser-qa4/observation.md
    • agents/runs/web-shell-pivot-s0/browser-qa4/live.png
    • agents/runs/web-shell-pivot-s0/final-process-audit.json
    • agents/runs/web-shell-pivot-s0/logs/pid-failure-red.log
    • agents/runs/web-shell-pivot-s0/logs/pid-failure-green.log
  • Changed paths: 36 (see Files changed)

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 yansfil changed the title Add the web-shell Stage-0 spike and S0 measurements Measure web shell Stage 0 with per-hop evidence Sep 21, 2026
@yansfil
yansfil merged commit 66fd2dd into main Sep 21, 2026
5 checks passed
@yansfil
yansfil deleted the prd/web-shell-pivot-s0 branch September 21, 2026 08:37
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.

![Isolated Herdr e2e: two fake claude rows in core order, Agent one
focused, typed marker and 한글 echoed by the
pane](https://github.com/yansfil/pr-assets/blob/main/hide/web-shell-pivot-s1/61f795e/s1-click-flow-crop.png?raw=true)

## 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>
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