Skip to content

Show which pane holds the keyboard, its agent and zoom, and add a terminal menu - #281

Merged
yansfil merged 2 commits into
mainfrom
quick/pane-chrome-focus
Oct 1, 2026
Merged

yansfil merged 2 commits into
mainfrom
quick/pane-chrome-focus

Conversation

@yansfil

@yansfil yansfil commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

한 Agent 탭에 pane이 여러 개일 때 키보드가 어느 pane에 있는지 보이지 않았습니다.
포커스는 헤더 배경색(다크 #27292c 대 #1d1f21)으로만 구분됐고, 헤더에는 agent도 zoom 상태도 나오지 않았으며, 터미널 본문 우클릭에는 아무 메뉴가 없었습니다.
이 PR은 네 가지를 바꿉니다.

  • 탭에 pane이 둘 이상이면 키보드를 가진 pane에 primary 1px 테두리를 그립니다. 그 pane의 메뉴가 열려 있는 동안에도 남고, pane이 하나뿐이거나 zoom 중이면 그리지 않습니다. 포커스가 없는 헤더는 muted 색으로 읽힙니다.
  • 헤더는 [상태 마크][provider 마크] 제목 … [zoom 칩] 상태 ⋯ × 순서로 그리고, 마크는 사이드바 행과 같은 규칙을 따릅니다.
  • zoom 중에는 헤더 칩이 가려진 pane 수(⤢ +2)를 보여 주고, 누르면 unzoom한 뒤 키보드를 그 터미널로 돌려줍니다.
  • 본문을 우클릭하면 그 pane에 포커스가 가고 메뉴가 열립니다. Copy(선택이 있을 때만), Paste, Select all, Find, 그다음 Split right/down과 Zoom, 그다음 기존 pane 메뉴 순서입니다.

3개 pane 중 가운데 pane의 테두리와 본문 우클릭 메뉴

가운데 pane에 lime 테두리가 있고, 양옆 agent pane 헤더에 상태 마크와 Claude 마크가 있으며, 우클릭 메뉴에 단축키가 표시됩니다.

Review

  • 판단해 주세요: lime 테두리의 강도와, unzoom 칩 아이콘으로 쓴 Maximize2(⤢)가 적절한지 봐 주세요.
  • 판단해 주세요: 포커스가 없는 헤더 글자를 subtle에서 muted로 낮췄습니다. 이 변경은 모든 pane 헤더에 적용됩니다.
  • 조심해서 볼 파일: web/src/PaneGrid.tsx (high-frequency path). TabCanvas가 agents를 구독하게 됐고, PaneView는 원시값 props로 memo를 유지합니다.
  • 조심해서 볼 파일: web/src/PaneView.tsx, web/src/terminals.ts (Herdr/core ownership). 우클릭은 xterm textarea의 포커스로 focus_pane을 보내고, 메뉴 명령은 그 pane을 대상으로 지정합니다.
  • 조심해서 볼 파일: web/src/actions.ts. 로컬 create_pane에는 pane id가 없어서, core가 포커스 이동을 거절하면 split은 이전 pane에서 일어납니다. 이 동작은 원래대로입니다.

Evidence

  • 확인한 것: web typecheck, lint, 단위 테스트 703개(메뉴 항목 3개 추가), 디자인 계약 검사를 rebase한 head에서 통과했습니다.
  • 확인한 것: 격리된 Herdr 0.9.1과 hided로 e2e 15개를 통과했습니다(s2, s6, shell, agent-sleep, pane-scroll-find, agent-tab-groups, theme).
  • 확인한 것: S2에 다음을 확인하는 단계를 추가했습니다.
    • pane 3개 중 테두리는 하나뿐이다.
    • zoom하면 칩이 +2를 보이고 테두리가 사라진다.
    • 칩을 누르면 unzoom된다.
    • 포커스가 없는 pane을 우클릭하면 포커스와 테두리가 그 pane으로 옮겨간다.
    • 메뉴에서 Zoom pane을 고르면 zoom된다.
  • 확인한 것: 별도 리뷰를 두 차례 받았습니다. 1차 Fix now 항목은 모두 반영했습니다: 대상 pane 지정, sidebar와 같은 agent 소스, 원격 pane 수, 칩 접근성 이름, 문서. 2차 리뷰는 Fix now 없음입니다.
  • 확인하지 못한 것: Electron 데스크톱 앱과 원격 기기 pane에서 직접 확인하지 않았습니다. 원격 zoom 칩의 개수와 unzoom 뒤 포커스 복귀는 코드로만 확인했습니다.
  • 확인하지 못한 것: 라이트 테마에서 여러 pane에 테두리가 그려진 화면은 캡처하지 않았습니다.
추가 증거

zoom 중인 pane 헤더의 +2 칩

pane 3개 중 하나를 zoom하면 헤더 오른쪽에 ⤢ +2가 표시되고 테두리는 그려지지 않습니다.

후속 작업으로 남긴 것:

  • 원격 agent pane의 Find는 own_find를 보지 않고 일반 찾기 바를 엽니다. 이 PR 이전부터 그랬습니다.
  • 메뉴의 Paste는 텍스트만 붙입니다. 이미지를 붙이려면 ⌘V를 써야 합니다.

A tab with several panes outlines the one whose terminal holds the
keyboard; the header draws the agent's status mark and provider mark,
and a zoomed pane's header names how many panes it hides and unzooms.
A right-click in the terminal opens Copy, Paste, Select all, Find, the
split and zoom commands, then the pane menu.
…sidebar does

Split and Find from a terminal menu name the pane that was right-clicked,
the header reads the store's normalized agents, the zoom count comes from
the tab's panes on every device, and unzooming from the chip hands the
keyboard back to the terminal.
@yansfil
yansfil merged commit bea27a0 into main Oct 1, 2026
12 of 15 checks passed
@yansfil
yansfil deleted the quick/pane-chrome-focus branch October 1, 2026 08:39
yansfil added a commit that referenced this pull request Oct 1, 2026
…rea holds the keyboard (#284)

Fixes #269 · PRD `agents/prd/focused-area-tab-cycle/prd.md`

## Summary

- Ctrl+Tab과 Ctrl+Shift+Tab은 이제 키보드를 가진 Agent 또는 View 영역 안의 탭만 최근 사용 순서로
돌고, 다른 영역·checkout·Overview로 넘어가지 않습니다.
- 영역은 device, checkout, 영역 종류, area ID 전체로 식별합니다. Agent와 View의 area ID가
겹쳐도 다른 영역을 고르지 않습니다.
- 네이티브 브라우저 페이지에 키보드가 있어도 같은 순환이 됩니다. 호스트가 키 입력을 shell로 넘기고,
해제·Escape·blur를 한 번씩만 처리합니다.
- 전체 Recent Panels는 기본 단축키가 없는 별도 명령으로 남고, 메뉴·팔레트·설정에서 영역 순환과 이름이 구분됩니다.
- 키보드를 가진 영역은 탭 강조와 내용 경계로 표시하고, 다른 영역의 선택 탭은 읽을 수 있는 배경으로 남깁니다.

![실제 Ctrl+Tab을 누른 채: 오른쪽 View 영역의 탭 둘만 미리보기에 나오고 왼쪽 Page A는 빠지며, 키보드 영역에
강조 경계가
보입니다](https://github.com/yansfil/pr-assets/blob/main/hide/focused-area-tab-cycle/a3ae674/area-native-preview.png?raw=true)

## Review

- **판단해 주세요**: 포커스 표시. 강조색 경계와 탭 강조를 택했고 blur는 쓰지 않았습니다. #281의 pane 테두리와
Agent 영역에서 함께 보일 때 과하지 않은지 봐 주세요.
- **판단해 주세요**: 빈 ⌘K 명령 목록에 순환 명령 6개가 보입니다(B11 팔레트 접근). 빈 검색어에서는 숨길지 정해
주세요.
- **판단해 주세요**: 네이티브 hold 중 글자 키(Tab 외)는 페이지에 그대로 들어갑니다. shell hold와 다르게
둘지 정해 주세요.
- **조심해서 볼 파일**: `desktop/src/main/browser.ts` - 네이티브 입력 경로, hold 시작 시
shell로 포커스 이동, blur 후 복귀(failure path).
- **조심해서 볼 파일**: `web/src/keyboard.ts` - 모든 키가 지나는 high-frequency path,
확정과 원래 페이지 복귀 분기.
- **조심해서 볼 파일**: `web/src/viewFocus.ts`, `web/src/areaCycle.ts` - 키보드 소유
영역과 순환 범위의 기준.
- **운영자 수동 QA**: 네이티브 페이지에서 두 번째 hold(Escape 취소, blur 후 복귀)와 재바인딩한
Ctrl+Option+Tab 해제 후 즉시 입력.

## Evidence

- **확인한 것**: 격리 후보 앱에서 실제 HID 키 입력으로 기본 Ctrl+Tab을 두 번 확인했습니다(수정 전과 현재
소스).
한국어 페이지에서 누르는 동안 같은 영역의 탭 둘만 미리보기에 나오고, 놓으면 view_layout 확정이 한 번, Page B가
포커스를 받고, 입력한 숫자가 Page B에 들어갔습니다.
- **확인한 것**: 이전에 실패하던 해제 검사는 제품 결함이 아니었습니다. System Events의 `key down
control`이 flags-changed 이벤트를 보내지 않아 어느 페이지도 Control 해제를 받지 못했습니다. spec을
HID 이벤트로 바꿨습니다.
- **확인한 것**: `sasu implement verify` PASS(cargo test, lint). 최신
main(#282 팝업, #289, #290) 병합 뒤 web 754개, desktop 79개 단위 테스트와
browser.spec background 5개 통과.
- **확인한 것**: web e2e s2·overview·palette·recent를 로컬에서 통과시켰습니다. ⌥`가 영역
순환이 된 데 맞춰 기대한 순환 종류와 개수만 바꿨고 대상은 그대로입니다.
- **확인한 것**: 리뷰 Fix-now 4건(blur 후 복귀, 확정 없는 해제의 복귀, 영역 축소로 끝난 hold의 복귀,
테스트 입력 안전장치)을 고치고 각각 단위 테스트를 추가했습니다.
- **확인한 것**: CI macOS runner에서 실제 HID로 두 번째 hold의 Escape 취소가 통과했습니다. 선택과
키보드 소유가 유지되고, 원래 페이지로 포커스가 돌아와 입력이 도달했습니다. 이전 실패는 spec 헬퍼가 macOS 활성화 중의
포커스를 믿은 탓이었습니다.
- **확인하지 못한 것**: blur 복귀와 재바인딩 Ctrl+Option+Tab 해제 후 즉시 입력. 같은 spec의 뒤
구간이라 이번 CI desktop e2e가 확인합니다. 통과 전까지 운영자 수동 QA 항목입니다.
- **확인하지 못한 것**: 실제 Agent 터미널 pane, 브라우저 shell의 Alt+Backquote, 좁은 창·패널
상태 전체와 light/dark 실제 앱 캡처, idle/driven 성능 측정은 이번 head에서 돌리지 않았습니다.
- **확인하지 못한 것**: 로컬 verify에서 이 PR과 무관한 테스트 두 개가 부하 중 한 번씩
실패했습니다(`herdr-core` github 1초 timeout, `agent-context-labels` CLI 정지).
단독 실행은 각각 3/3 통과했습니다.

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

- PRD: `agents/prd/focused-area-tab-cycle/prd.md` (sha256
2183ea4cfe03d8c6208a924c6b4a24614ef127dd7e54a0f37effca927bc4ee0b)
- Base 8d9919f → head 7d48bc2, verified 2026-10-01T12:18:44.278Z: PASS
- Verification report:
`agents/runs/focused-area-tab-cycle/verification-report.json` and
`agents/runs/focused-area-tab-cycle/verification-report.md`; source
fingerprint
2a85ae2b459a6c4b4e556d04f4173dea162798e6f33c3fda859a961be891c0bc
- Suites:
  - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0)
  - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0)
- Reviews:
- Code (5ffb88a): Fix now 3 - blur-cancelled hold left the keyboard in
the shell (fixed 01f416f), a release on the origin of a panels/projects
cycle never refocused the page (fixed 01f416f), test input failed open
without a candidate pid (fixed 084469b). Follow-up: menu items show no
chord, a modifier pre-check before matchHost on native pages, native
hold not cancelled on shell reload, typed non-chord keys reach the page
during a native hold.
- Fidelity (5ffb88a): no Fix now; earlier D1 design-guide inventory
fixed in 5ffb88a. Listed runtime evidence still missing (second native
hold, rebound release, Agent PTY, Alt+Backquote shell, theme/panel
matrix, idle/driven measurements).
- Focused recheck (4b7c12c): closed the three Code items; Fix now 1 - a
hold reconciled away (area shrank to one tab) left the keyboard in the
shell (fixed a3ae674). No conflict with #281's pane outline.
- CI on a3ae674: desktop e2e failed at the second native hold (page
focus lost to the shell during macOS activation; spec focus helper now
waits for stable focus, 0713510); web e2e s2/overview/palette still
expected the old Alt+Backquote and palette contents (updated 31a3c56,
110c48a).
- CI rerun on 110c48a: the second native hold passed (Escape kept
selection and owner, focus returned, a typed digit reached the page);
only the caret-position check failed and now checks the landing only
(4e3b3ab). Background flakes seen once: session-labels (passed 2/2
locally), s7 side document (passed 3/3 locally).
- Evidence: 51 registered (24 log, 21 file, 6 screenshot); paths are
local to the run directory
-
agents/runs/focused-area-tab-cycle/collected/implementation-2f5ad90b/web-unit-2.log
-
agents/runs/focused-area-tab-cycle/collected/implementation-2f5ad90b/desktop-unit-2.log
-
agents/runs/focused-area-tab-cycle/collected/implementation-2f5ad90b/desktop-focused-1.log
-
agents/runs/focused-area-tab-cycle/collected/implementation-2f5ad90b/design-review/report.json
-
agents/runs/focused-area-tab-cycle/collected/implementation-06cd7ed2/desktop-focused-fixes.log
-
agents/runs/focused-area-tab-cycle/collected/implementation-06cd7ed2/desktop-unit-fixes.log
-
agents/runs/focused-area-tab-cycle/collected/implementation-06cd7ed2/focus-fixes-focused.log
-
agents/runs/focused-area-tab-cycle/collected/implementation-06cd7ed2/design-review/report.json
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/full-web-b61e4918.log
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/cargo-lint-b61e4918.log
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/cargo-test-b61e4918.log
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/design-tests-b61e4918.log
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/design-contract-b61e4918.log
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/script-tests-b61e4918.log
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/pane-reader-b61e4918.log
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/native-review-dispositions.md
-
agents/runs/focused-area-tab-cycle/collected/current-b61e4918/design-review/report.json
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/test-7.log
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/provenance.jsonl
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/native-events.json
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/01-documents.json.result
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/02-terminal.json.result
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/slot-cleanup.json
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/area-native-preview.png
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/area-native-readable.png
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/area-native-document-preview.png
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/area-native-document-reverse.png
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/failure-06cd7ed2/test-3.log
-
agents/runs/focused-area-tab-cycle/collected/native-slot-1-b61e4918/failure-caa7fb42/test-6.log
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/actual-native-d38-attempt8.log
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/01-documents.json.result
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/02-terminal.json.result
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/03-rebinding-menu.json.result
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/native-events.json
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/hid-batches.jsonl
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/provenance.jsonl
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/rebound-responder.jsonl
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/rebound-area-before-release.png
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/rebound-area-after-release.png
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/release-distinction.json
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/cleanup.jsonl
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/fixture-cleanup.json
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/runner-completion-attempt8.json
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/phase-close-audit.json
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/phase-close-receipt.txt
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/build-readiness.json
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/slot-attempt8.json
-
agents/runs/focused-area-tab-cycle/collected/d38-native-attempt8-closed/tab-genuine-clicks.jsonl
-
agents/runs/focused-area-tab-cycle/collected/fcee7150-source-only/fixture-carry-fcee7150-source-audit.json
-
agents/runs/focused-area-tab-cycle/collected/fcee7150-source-only/code-fcee7150-source.md
-
agents/runs/focused-area-tab-cycle/collected/fcee7150-source-only/fidelity-fcee7150-source.md
- Changed paths: 193 (see Files changed)

</details>
yansfil added a commit that referenced this pull request Oct 3, 2026
Related: #281, #284; `agents/prd/focus-treatment/prd.md`

## Summary

- 사이드바·Explorer·Overview에서도 Ctrl+Tab으로 최근 Agent를 전환합니다.
- 파일 View에 포커스가 있으면 기존처럼 그 영역의 파일 탭만 전환합니다.
- 선택한 B안에 맞춰 전체 초록 외곽선을 없애고 활성 탭 밑줄을 foreground 색으로 표시합니다.
- 분할된 터미널에서는 실제 입력 pane만 subtle-foreground 1px 선으로 구분합니다.

![포커스 표시 전후
비교](https://github.com/yansfil/pr-assets/blob/main/hide/focus-treatment/a970b79/focus-before-after.png?raw=true)
왼쪽은 기존 화면의 탭·pane 헤더를 각각 크롭한 모습이고, 오른쪽은 격리된 실제 데스크톱 앱의 분할 화면입니다.
전체 초록 외곽선 대신 활성 탭 밑줄과 입력 pane의 얇은 회색 선을 봐 주세요.

## Review

- **판단해 주세요**: Light/Dark에서 중립 밑줄과 얇은 분할 pane 선으로 입력 위치를 충분히 구분할 수 있는지.
- **조심해서 볼 파일**: `web/src/areaCycle.ts` - View 예외와 MRU origin을 구분하며, 키를
놓을 때 core 이벤트를 한 번 보냅니다.
- **조심해서 볼 파일**: `web/src/PaneView.tsx` - 실제 터미널 입력 소유권에 따른 기존 outline
조건을 유지합니다.

## Evidence

- **확인한 것**: 최신 통합 커밋의 verify·디자인 CI가 통과했습니다(Rust, Windows, Linux/macOS
웹·데스크톱 E2E 포함).

- **확인한 것**: web 864·desktop 94(플랫폼 조건 skip 3)·hcoord 48 unit/35 E2E와
타입·lint·build가 통과했습니다.
- **확인한 것**: 격리된 Herdr/hided에서 recent E2E, split/menu/zoom S2 2개,
Electron background 키 검사 2개가 통과했습니다.
- **확인한 것**: 실제 후보 앱에서 Dark/Light 분할·View 포커스와 zoom을 캡처했고, 브라우저에서도 두 테마를
확인했습니다.
- **확인한 것**: 디자인 contract와 관련 검사 77개, 960/720px Light/Dark 기준 비교가
통과했습니다.
- **확인하지 못한 것**: 물리 macOS 키 입력, 로컬 전체 Rust/전체 앱 E2E, Windows/Linux 수동
UI, release 설치 검사는 실행하지 않았습니다.
- **생성물**: Pen library 재직렬화에 기본 fontWeight 표기가 포함됩니다. ID·56개 sheet는 유지했고
screen은 소유 generator로 갱신했습니다.

<details><summary>추가 증거</summary>

![사이드바에서 최근 Agent
전환](https://github.com/yansfil/pr-assets/blob/main/hide/focus-treatment/91d663a/recent-agents-from-sidebar.png?raw=true)
최신 main과 통합한 실제 후보 앱에서, 사이드바 포커스의 Ctrl+Tab이 최근 Agent 목록을 엽니다.

![실제 분할 pane
포커스](https://github.com/yansfil/pr-assets/blob/main/hide/focus-treatment/a970b79/native-split-focus.png?raw=true)
실제 데스크톱 앱의 활성 탭 밑줄과 분할 pane 선입니다. 테스트 앱·daemon·Herdr는 모두 격리했고 종료했습니다.

![Dark 기준 디자인
비교](https://github.com/yansfil/pr-assets/blob/main/hide/focus-treatment/a970b79/design-focus-dark.png?raw=true)
왼쪽부터 승인 기준, 현재 Pen, 실제 웹 컴포넌트입니다. 같은 내용과 폭에서 활성 View 밑줄과 비활성 탭 선택을
비교했습니다.
Light/Dark 각 960/720px에서 키보드 소유 영역 하나, 일정한 레이아웃, 필터 없는 콘텐츠를 검사했습니다.

최근 Agent E2E의 Overview 진입은 각 시스템에 등록된 Project home 단축키를 사용합니다.
최근 Agent E2E는 사이드바·Explorer·Overview, 파일 탭 1개/복수, 프로젝트 간 전환과 역방향 전환을
다룹니다.
누른 동안 preview는 선택 이벤트를 보내지 않고, modifier를 놓으면 한 번 적용하며 Escape로 취소합니다.
후보 앱의 정확한 PID/window를 캡처했고 background focus guard를 통과했습니다.
Rust source, core ownership, wire, 입력 루프·subscription·timer·dependency는
변경하지 않았습니다.

</details>
yansfil added a commit that referenced this pull request Oct 29, 2026
…wner flakes (#1813)

Closes with-hide/hide-private#119
Closes with-hide/hide-private#281
Closes with-hide/hide-private#118
Closes with-hide/hide-private#120
Closes with-hide/hide-private#201
Closes with-hide/hide-private#313
Related: with-hide/hide-private#189, with-hide/hide-private#288 (원인 미확정,
이 PR에서 닫지 않음)

## Summary

hided 통합 테스트의 core_move·remote_core·node_owner flaky와 macOS remote
mailbox nightly 실패를 원인에서 고칩니다.
제품 코드 변경은 하나: 두 writer가 같은 진단 로그에 쓸 때 기록이 서로 섞이던 것을, 기록 하나를 한 번에 쓰도록
고쳤습니다.
나머지는 테스트 쪽입니다: 상태 대신 짧은 시간이나 한 번의 읽기에 기대던 대기, 실패한 run이 남긴 바이너리로 찬 디스크,
macOS에서 runner의 `gh`가 fixture의 것보다 먼저 잡히던 PATH.
#189/#288은 재현되지 않아 범위에서 뺐고, lane이 이제 실패와 flaky run의 `rc-*` 로그를 남깁니다.
스크린샷 없음: 화면을 건드리지 않습니다.

<details><summary>이슈별 원인과 처리</summary>

- **#119** node_owner refusal: `writeln!`이 줄과 개행을 두 번 write해,
`record_now`와 writer 스레드 사이에 다른 기록이 끼었습니다(CI 로그에 refusal 줄 뒤로
`start.step`이 붙어 있음). 줄과 개행을 한 `write_all`로 씀.
- **#118** a_newer_app...: 기기 helper upload(디버그 `hided`·`hide` 각 140MB)가
30초 bound를 넘던 것. #1751이 이미 고쳤고, 이후 CI는 `upload sent 0, reused 3`, 약 9초에
ready. 이슈에 근거 코멘트.
- **#281** manifest refusal: #1751 이후 남은 두 실패. (a) move back이
rolled_back을 기록한 뒤 node role이 시작되는데(#962) 이 테스트만 role을 한 번 읽음 -> 모든 move
back rollback이 쓰는 `back_rolled_back` helper. (b) `os error 11`: fixture
renderer가 handshake와 첫 snapshot을 2초 socket read로 묶어, 호출자의 30초 wait를 즉시
실패시킴 -> read는 hang guard만, 실패 시 무엇을 기다렸는지 말함.
- **#120** linked state folder: 같은 job에서 `/tmp`가 `Disk quota exceeded`가
된 직후의 timeout. 앞선 실패 run마다 바이너리 약 0.9GB가 남은 탓 -> 남기는 run은 native
program을 지우고 로그만 남김. fixture가 만들어지기 전 setup이 실패한 run도 같음.
- **#313** a_failing_move_back_check...(이 PR의 첫 CI에서 발견): supervisor가
journal `done`을 move view가 `linking`을 벗어나기 전에 써서, 그 사이 요청이 `move_busy`로
거절됨 -> `forward_done`이 창의 move view `done`까지 기다림.
- **#201** macOS nightly(10-17 이후 매번 실패): core가 `not_logged_in`으로 답함.
macOS login shell의 `path_helper`가 시스템 폴더를 앞에 두어 runner의 `gh`가 먼저 잡힘 ->
fixture HOME의 `.zprofile` 등이 계정 PATH를 앞에 둠(web fixture의
`fixtureLoginShellPath`와 같은 방식).
- **node_owner `hide connect`**: 5초 wall-clock 단언은 부하에서 daemon 시작 시간을
쟀습니다(load 30에서 11.7초). 지우고, 종료가 다음 look에서 wait를 끝낸다는 것은
`wait_healthy_within`에 종료 신호를 주는 fake-clock 테스트로 증명. 통합 테스트는 파일과 이유만 봄.
- **#189/#288** remote_core 화면(같은 테스트): Linux remote_core 23개 x
8회(184회), 로컬 macOS 69회, nightly macOS 23/23에서 재현 없음. lane이 `rc-*`를 올리지
않아 증거가 메시지뿐이었음. 결과와 다음에 볼 곳은 두 이슈에 코멘트.

</details>

## Review

- **판단해 주세요**: renderer의 2초 read를 30초 hang guard로 바꾼 것은 대기 늘리기가 아니라, 첫
snapshot이라는 신호를 오는 즉시 읽고 시간 추측으로 실패하지 않게 한 것입니다(TESTING.md, Writing a
Rust test 5).
- **조심해서 볼 파일**: `herdr-core/src/diagnostics.rs` - failure path(시작 거부
기록)의 쓰기 방식.
- **조심해서 볼 파일**: `hided/tests/it/support/run.rs` - 남기는 run에서 ELF/Mach-O만
지우고 link는 따라가지 않음.
- **조심해서 볼 파일**: `.github/workflows/remote-mailbox.yml` - flaky run도 로그를
올림, `rc-*`는 `*.log`와 `Logs/*.jsonl`만(fixture 경로는 담김), artifact 이름에
attempt.
- **비용 검토**: 진단 기록 한 건마다 줄을 재사용 버퍼에 한 번 복사합니다(`writeln!`의 두 write 대신 한
`write_all`). 버퍼는 writer가 본 가장 긴 기록 크기에서 멈추고, 그 뒤 할당은 없습니다.

## Evidence

- **확인한 것**: 새 diagnostics 테스트가 예전 `writeln!`에서 3/3 실패(CI와 같은
`{...}{...}` 섞임), 고친 코드에서 통과.
- **확인한 것**: fake-clock 테스트에서 350ms에 종료한 daemon의 wait가 그 뒤 pause 없이 다음
look(425ms)에서 `exited with`로 끝남.
- **확인한 것**: 바뀐 core_move 7개 x 3회(21회) 로컬 macOS 실패 0, 남은 `/tmp/hcm-*`
없음. diagnostics·node_owner·run 20회 반복 실패 0(load 26~30).
- **확인한 것**: nightly `lane=macos` dispatch(run 40725749658)의 remote
mailbox macos-15 첫 시도 통과: remote_core 23/23(#201 테스트 포함), core_move
44/44, flaky 0.
- **확인한 것**: PR CI Linux remote mailbox: core_move 44/44, remote_core
23/23, flaky 0.
- **확인하지 못한 것**: #189/#288 원인(Linux CI에서만 약 8% run에서 실패, stress 184회 재현
없음).
- **확인하지 못한 것**: #201 수정 전 실패의 로컬 재현(이 Mac의 `/etc/paths` 폴더에 `gh`가 없음).
같은 nightly run의 web e2e macOS 실패는 이 diff와 무관.
- **확인하지 못한 것**: windows check의 web 단위 테스트
`web/src/practice/worlds.test.ts` 5초 timeout(이 diff와 무관)은 실패 job만 한 번
재실행해 통과.

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

- Head: `def885735` (review fix on top of `c9290db54`)
- Base: `origin/main` (merge-order: Stay as you are)
- Local, macOS arm64: `cargo nextest -p herdr-core -p hided`
diagnostics·wait·node_owner 테스트 72/72 pass, 새 테스트 둘과 node_owner 20회 반복
실패 0, exit 확인을 deadline 뒤로 옮기면 새 cli 테스트 실패; clippy `-D warnings` 0
warnings, `cargo fmt --check` clean.
- Local, macOS arm64: core_move 7개(manifest, newer app, linked state,
failing move back, move back window, issues through move, staging
failure) x 3 = 21/21 pass at c9290db.
- CI: verify run 40729811159 at c9290db 39/39 pass (windows check 1회
재실행); nightly `lane=macos` run 40725749658 remote mailbox macos-15 pass.
- Temporary stress (51af1e7, reverted in c9290db): remote mailbox
ubuntu job 122933565889, remote_core 23 x 8 = 184 pass.
- Review fix (this head): node_owner fake-clock exit test, reused log
buffer, `rc-*` log allowlist.
- Changed paths: `herdr-core/src/diagnostics.rs`, `hided/src/cli.rs`,
`hided/tests/it/{node_owner,core_move}.rs`,
`hided/tests/it/support/{core_move,run}.rs`,
`hided/tests/it/support/remote_delivery/{mod,renderer}.rs`,
`.github/workflows/remote-mailbox.yml`.

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