Skip to content

Read a pane focus's late tab move as its answer - #612

Merged
yansfil merged 2 commits into
mainfrom
fix/flaky-594
Oct 6, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/flaky-594

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Refs #594
Related: #600 (같은 session.rs, 그 위에 rebase)

Summary

Agent cycle(⌃Tab)을 commit한 직후 다시 cycle을 열면 순서가 틀어지던 core 결함을 고칩니다. keys.spec.ts "⌃Tab and ⌥Tab commit once"가 macOS에서 가끔 첫 시도에 실패하던 원인입니다.

  • 기전: 다른 tab의 pane으로 가는 focus_pane은 Herdr에 pane.focus를 보냅니다. Herdr는 바로 답하고, 그 때문에 바뀐 active tab은 session stream으로 나중에 알립니다.
    • core에는 그 tab 이동을 기다리는 기록이 없어서, 늦게 온 이동을 Herdr 자신의 이동으로 보고 따라갔습니다(tab.focus.followed가 지나온 tab 순서대로 남음).
    • 화면이 이전 tab으로 돌아가고 shell이 그 pane을 방문으로 기록해, 다음 cycle의 순서가 틀어졌습니다(CI: cycle 2가 w1:p1 대신 w1:p4).
  • 고침: Herdr가 보이지 않는 tab의 pane focus는 그 tab을 기존 tab 기다림(pending_tab_focus)에 기록합니다. 새 장부는 없습니다.
    • pane focus와 함께 sent가 되고, 그 pane control이 도는 동안 만료되지 않으며, Herdr의 답부터 같은 3초 deadline을 받습니다.
    • 다음 이동이 대체하면 기존 규칙대로 superseded_tab_focus가 되어 늦은 답이 소비됩니다. 거절, 보내기 전 대체, lane이 받지 못함이면 지웁니다.
    • Herdr가 이미 그 tab에 있으면(또는 Hide의 남은 tab 요청이 그 tab이면) 아무것도 기록하지 않습니다.
  • docs/ARCHITECTURE.md의 pending model 문단에 이 기다림을 적었습니다. test 파일(keys.spec.ts)은 바꾸지 않았고 retry, timeout, sleep, allow를 더하지 않았습니다.

Review

  • 판단해 주세요: "Herdr가 tab을 옮기는가"를 herdr_active_tab_ids와 Hide의 남은 tab 요청으로 판단합니다. 남은 요청이 있으면 그 tab을 Herdr가 곧 보일 tab으로 봅니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/session.rs - runtime mutex 안. 추가된 일은 navigator에서 pane의 tab을 찾고 기다림 하나를 쓰는 것뿐이고 I/O는 없습니다.
  • 조심해서 볼 파일: session.rs expire_pending_view_focus - failure path. pane control이 도는 동안 그 pane이 건 tab 기다림은 만료하지 않습니다(pane 쪽 규칙과 같음).
  • 비용 검토: focus_pane마다 navigator의 tab과 pane을 한 번 훑습니다. 새 상시 작업, 알림, queue는 없습니다.

Evidence

  • 확인한 것 (수정 전 실패): 새 core test 2개는 기다림을 거는 함수를 비우면 실패하고 되돌리면 통과합니다.
  • 확인한 것 (Keep a retired selection on the tab the checkout shows before Herdr's keyboard tab #600 위): main af09e76(Keep a retired selection on the tab the checkout shows before Herdr's keyboard tab #600, Read a dropped focus acknowledgement as nothing in flight #602 포함)에 rebase한 162c1b54에서 nextest -p herdr-core 1491개 통과, clippy -D warnings, fmt 통과.
  • 확인한 것 (부하 아래 e2e, 162c1b5): yes x6, 3 workers, retries 0으로 agent-tab-groups 120/120(12개 x10), recent(Recent와 area cycle) 20/20.
  • 확인한 것 (재현 probe): commit 직후 다시 cycle하는 15 round probe를 같은 부하에서 12번: 수정 전 9개 cycle 불일치와 run 1개 실패, 수정 후(rebase 뒤 포함) 360개 cycle 모두 일치.
  • 확인하지 못한 것: keys.spec.ts(desktop native focus)는 로컬에서 돌리지 않았고, core만 바꾼 PR이라 CI가 desktop lane을 계획하지 않았습니다(skipped).
    • 머지 뒤 main push run과 nightly macOS에서 처음 돕니다. 원래 실패는 run 몇 번에 한 번이라 녹색 run 하나로 재발 없음을 증명하지 못합니다.
  • 확인하지 못한 것: core test usage_activity_hints_are_accepted_without_persisting_ui_state가 e2e 부하 중 전체 실행에서 한 번 실패했습니다. 단독 60번 반복에서 main 코드 1/60, 이 브랜치 2/60과 1/60이라 이 변경과 무관한 기존 경합으로 봅니다.
추가 증거
  • 새 test: view_authority_a_pane_focus_s_late_tab_move_is_its_answer_not_an_outside_focus(pane focus 4번 뒤 stream이 t3, t1, t2, t1을 늦게 알려도 화면은 t1, 그 뒤 Herdr 자신의 t3 이동은 따라감).
  • 새 test: view_authority_a_pane_focus_tab_wait_ends_when_no_tab_move_will_arrive(거절, Herdr가 이미 그 tab, stream이 끝내 알리지 않음의 세 경우 모두 기다림이 끝나고 이후 Herdr의 이동을 따라감).
  • 수정 전 실패 메시지: "Herdr naming w-order:t3 does not move the tab the operator chose last", "a focus in another tab moves Herdr's tab".
  • probe는 조사용이라 커밋하지 않았습니다.

A pane focus in a tab Herdr is not showing moves Herdr's tab too. Herdr
answers the focus at once, but its session stream reports the tab move
afterwards, and with nothing awaited the core followed each late move as
Herdr's own: a quick run of Agent cycle commits replayed every tab passed
through and left the screen on an older one.

The tab is now awaited in the existing tab focus wait, marked sent with
its pane focus, superseded by the next move, dropped when the focus is
refused or never leaves, and held with the running pane control.

Refs #594
@yansfil
yansfil merged commit 1e73fd5 into main Oct 6, 2026
19 checks passed
@yansfil
yansfil deleted the fix/flaky-594 branch October 6, 2026 04:23
yansfil added a commit that referenced this pull request Oct 6, 2026
Refs #629
Related: #612 (#594의 수정), #594

## Summary

#612 뒤에도 `keys.spec.ts` "⌃Tab and ⌥Tab commit once"가 macOS에서 같은 모양(cycle
2가 `w1:p1` 대신 `w1:p4`)으로 실패하던 core 결함을 고칩니다.

- 기전: Herdr가 느린 동안 tab click 두 번과 cycle commit이 lane에 쌓입니다. t2는 나가 있고,
t1은 lane에서 기다리고, commit의 pane focus가 t1의 기다림을 자기 tab 기다림(t3)으로 바꿉니다.
- `await_tab_focus`는 바뀐 요청을 이미 나갔을 때만 superseded로 기억합니다. 아직 나가지 않은 t1은
잊혔는데, pane focus는 lane에서 tab focus를 빼지 않아 t1은 그대로 Herdr에 갔습니다.
- Herdr의 t1 답이 기다림도 superseded도 아니어서 Herdr 자신의 이동으로 따라갔고, 화면이 t1로 돌아가
shell이 t1의 pane을 방문으로 기록했습니다.
- 고침: tab focus가 lane을 떠나는 순간(`mark_tab_focus_sent`) 그 요청이 더는 기다리는 것이
아니면 superseded로 기록합니다. 새 장부 없이 기존 `superseded_tab_focus`의 cap 16과 3초
deadline을 그대로 씁니다.
- `docs/ARCHITECTURE.md` pending model 문단을 "떠날 때 대체돼 있으면 superseded"로
고쳤습니다. `keys.spec.ts`는 바꾸지 않았고 retry, timeout, sleep을 더하지 않았습니다.

## Review

- **조심해서 볼 파일**: `herdr-core/src/runtime/control_lane.rs`
`mark_tab_focus_sent` - runtime mutex 안. 더한 일은 navigator에서 tab의
checkout을 찾고 기존 목록에 하나를 넣는 것뿐이고 I/O는 없습니다.
- **조심해서 볼 파일**: `herdr-core/src/runtime/session.rs` -
`supersede_tab_focus`는 `await_tab_focus`에 있던 retain, push, cap 제거를 그대로
옮긴 것입니다.
- **판단해 주세요**: 아래 "확인하지 못한 것"의 두 번째 결함(나가기 전 pane focus가 그 전 session에
확정되어 Herdr에 가지 않음)을 따로 다룰지.

## Evidence

- **확인한 것 (수정 전 실패)**: 새 core test
`view_authority_a_tab_focus_that_leaves_after_its_wait_was_replaced_is_superseded`가
main 코드에서 실패합니다("Herdr naming w-order:t1 does not move the tab the
operator chose last", left t1, right t3). 수정 후 통과.
- **확인한 것 (재현)**: 같은 순서를 web e2e probe(private hided와 Herdr, headless)로
재현했습니다. t2 click 직전에 private Herdr server를 SIGSTOP, cycle 1 commit 뒤
SIGCONT. 수정 전 3/3 실패(받은 값 `w1:p4`, cycle 2 직전 화면 t1, hided log
`tab.focus.followed` t3 -> t1), 수정 후 12/12 통과.
- **확인한 것 (CI와 같은 모양)**: 실패한 CI 시도(run 37444345044)의 Herdr log도
tab.focus t3 뒤 417 ms 공백, 그 뒤 tab.focus t2, t1, pane.focus가 2.5 ms 안에
연달아 도착해 lane에 쌓였던 것과 맞습니다.
- **확인한 것**: `nextest -p herdr-core` 1495개 통과(#612 test 2개 포함), clippy
`-D warnings`, fmt 통과.
- **확인하지 못한 것**: CI 실패 시도의 hided log는 artifact에 없습니다(desktop e2e는 실패 시
host log만 남김). 그래서 CI의 core 쪽 순서는 Herdr log와 위 재현으로 맞췄습니다. hided log를
남기는 진단은 따로 PR로 냅니다.
- **확인하지 못한 것 (별 결함, 이 PR 밖)**: 재현에서 수정 후에도 12번 중 10번은 cycle 1의 pane
focus가 Herdr에 가지 않았습니다. Herdr가 아직 t3에 있던 session이 나가기 전 pane focus와 그
tab 기다림을 확정합니다. Hide 화면은 맞고 Herdr만 다음 조작까지 t1에 남습니다.
- **확인하지 못한 것**: `keys.spec.ts`(desktop)는 로컬에서 돌리지 않습니다. 이 PR의 CI
desktop lane으로 봅니다. 원래 실패가 run 몇 번에 한 번이라 녹색 run 하나가 재발 없음을 증명하지 않습니다.
yansfil added a commit that referenced this pull request Oct 6, 2026
Refs #629
Related: #631

## Summary

나가지 않은 tab focus나 pane focus를 session이 확정하던 core 결함을 고칩니다. #631(늦게 나간
tab focus를 superseded로 기억)과 같은 뿌리입니다.

- 기전: lane에서 기다리는 요청이 나가기 전에 온 session은 그 요청 전의 Herdr입니다. 그런데 그 session이
요청의 대상을 보이고 있으면 답으로 읽혔습니다.
- 증상 1: 대기 중인 pane focus가 확정되어 끝내 Herdr에 가지 않았습니다. #629 재현에서 #631 뒤에도
12번 중 10번, Hide는 t3을 보이는데 Herdr는 다음 조작까지 t1에 남았습니다.
- 증상 2: Herdr가 스스로 옮겨 간 tab이 대기 중인 tab focus를 확정해 지우고, 그 요청이 나가면 #631이
superseded로 기억해 3초 안의 Herdr 진짜 이동을 답으로 소비했습니다.
- 고침: 확정은 나간 요청만, 두 경로로 합니다. (a) 그 tab을 보이는 session(pane은 그 tab의
layout), (b) Herdr의 성공 답이 왔을 때 Hide가 마지막에 읽은 session이 이미 그 tab을 보이면 그 답.
거절과 3초 deadline은 기존 규칙 그대로입니다.
- (b)가 필요한 이유: pinned Herdr 0.9.1은 이미 보이는 tab을 focus하면 event를 내지 않습니다.
private server로 확인했고(다른 tab으로 이동은 `tab_focused`와 `pane_focused`, 같은 tab
재focus는 없음), `docs/ARCHITECTURE.md`의 Herdr wire boundary 동작 gap에 적었습니다.
- `docs/ARCHITECTURE.md` control lane 문단에 확정 규칙과 그 이유를 더했습니다.

## Review

- **조심해서 볼 파일**: `herdr-core/src/runtime/session.rs`
`reconcile_visible_tabs`, `session_confirms_pending_pane` - runtime
mutex 안. 더한 일은 `sent` 확인뿐입니다.
- **조심해서 볼 파일**: `session.rs` `confirm_tab_focus_already_shown`,
`terminal.rs` pane focus 답 - failure path가 아닌 성공 답에서만,
`herdr_active_tab_ids` 조회 하나. I/O 없음.
- **판단해 주세요**: 기존 test 2개의 준비 단계를 고쳤습니다. 둘 다 lane이 영영 바쁜 fixture에서 나가지
않은 요청을 session이 확정하는 데 기대고 있었습니다(바로 이번에 없앤 동작). 기대값은 그대로입니다.
-
`view_authority_a_late_answer_to_a_superseded_switch_is_not_followed`(#413):
t2의 답 뒤 t1이 나가는 lane 단계를 넣었습니다.
-
`a_followed_reopen_seed_that_goes_leaves_the_operator_on_the_restored_tab`(#425):
Herdr가 답하지 않는 fixture라 click이 나가도록 lane을 한 칸 넘깁니다(`advance_lane`).

## Evidence

- **확인한 것 (수정 전 실패)**: 새 core test 3개가 수정 전 코드에서 각 증상으로 실패하고 수정 후 통과합니다.
-
`view_authority_a_pane_focus_that_has_not_left_is_not_confirmed_by_an_earlier_session`:
"the pane focus leaves after the tab focuses ahead of it"(수정 전 None).
-
`view_authority_a_tab_focus_that_has_not_left_is_not_confirmed_by_herdr_s_own_move`:
"Herdr moving to w-order:t3 on its own is followed"(수정 전 t1에 남음).
-
`view_authority_a_tab_focus_on_the_tab_herdr_shows_is_confirmed_by_its_answer`:
"Herdr's own move is followed at once, not after the deadline"(수정 전 t1에
남음).
- **확인한 것 (재현)**: #629 web e2e probe(private hided와 Herdr, t2 click 직전
SIGSTOP, commit 뒤 SIGCONT) 12번: cycle 2 12/12 일치, Herdr가 받은 pane.focus는
12번 모두 2개(cycle 1과 2). #631만 있을 때는 12번 중 10번이 1개였습니다.
- **확인한 것**: main 위로 rebase 뒤 `nextest -p herdr-core` 1498개 통과(#612 test
2개, #631 test 포함), clippy `-D warnings`, fmt, off-lock reader 검사 통과.
- **확인하지 못한 것**: `keys.spec.ts`(desktop)는 로컬에서 돌리지 않습니다. 이 PR의 CI
desktop lane으로 봅니다.
yansfil added a commit that referenced this pull request Oct 6, 2026
…#667)

Closes #653
Related: #612, #631, #635 (같은 장치의 이전 수정, 이 PR이 대체)

## Summary

`view-bookmarks.spec.ts`의 Agent tab View 복원이 t2, t1, t2 빠른 클릭 뒤 화면을 t1에
남기는 문제입니다.
CI hided 로그(run 37508081360)의 순서는 `tab.focus.late_answer` ->
`tab.focus.confirmed_by_answer` -> `tab.focus.followed`였습니다.
첫 t2 클릭 시점의 session이 마지막 t2 요청의 확정으로 읽혔고, 그 뒤 도착한 t1, t2 이동이 Herdr 스스로의
이동으로 따라가졌습니다.
규칙을 하나 더 얹는 대신 checkout의 tab 권한을 "보낸 순서의 미답 tab 이동 목록"
하나(`tab_focus_requests`, `herdr-core/src/runtime/tab_focus.rs`)에서 유도하도록
바꿨습니다.

순서 보장의 근거:
- control lane은 Herdr가 앞 요청에 답한 뒤에만 다음 요청을 보냅니다. 그래서 Herdr는 보낸 순서대로
적용합니다.
- Herdr [Socket API](https://herdr.dev/docs/socket-api/), Event
subscriptions: "Lifecycle and agent-status events are drained in bounded
batches, in order within each subscription." 그래서 이동 event도 그 순서로 도착합니다.

모델:
- Herdr 이동(workspace에서 새로 active가 된 tab, 또는 새 focus event)은 그 tab의 가장 이른
요청에 대한 답입니다. 그보다 먼저 보낸 요청도 함께 빠집니다.
- 이미 그 tab에 있던 요청은 Herdr가 event를 내지 않습니다. 그래서 답이 오면 그 자리에서 끝납니다. "이미 있던
tab"은 같은 workspace의 바로 앞 요청이고, 앞 요청이 없으면 마지막으로 읽은 Herdr입니다.
- 확실한 거절은 즉시 빠집니다. 답이 유실되었거나 보고가 없는 요청은 3초 deadline까지 남습니다. 목록 상한은
16개이고, 넘치면 가장 오래된 요청을 내보내며 `tab.focus.request_evicted`를 남깁니다.
- checkout에 보냈거나 lane에서 기다리는 요청이 남아 있으면 Herdr 이동을 따라가지 않습니다.

지운 규칙(모두 위 목록이 같은 답을 유도함):
- #612 `await_pane_focus_tab` / `drop_pane_focus_tab_wait`: submit 전에 거는
pane focus의 tab 대기. 이제 pane focus가 lane을 떠날 때 그 tab이 목록에
들어가고(`send_pane_focus_tab`), 답이나 거절로 빠집니다.
- #631 `mark_tab_focus_sent`: lane을 떠날 때 superseded로 표시하기. 목록은 보낸 요청을 모두
순서대로 갖고 있어서 따로 표시할 필요가 없습니다.
- #635 보낸 요청만 session으로 확정하기, `confirm_tab_focus_already_shown`:
session만으로는 아무것도 확정하지 않습니다. 이것이 이번 결함의 원인이었습니다. "이미 보이는 tab" 확정은 앞 요청이나
마지막 Herdr에서 유도합니다(`settle_where_herdr_already_was`).
- `superseded_tab_focus` 목록과 같은 tab 중복 제거(`retain`): 같은 tab 요청이 둘이면 이른
것이 먼저 답을 받습니다. 중복 제거가 그 순서를 지웠습니다.
- `pending_tab_focus` 슬롯, `PendingViewFocus`의 `scope_id`/`already_sent`,
`await_tab_focus`, `supersede_tab_focus`, `agent_areas`와 events의 pending
비우기. pane focus 슬롯(`pending_pane_focus`)은 pane 확정용으로 남깁니다.

## Review

- **조심해서 볼 파일**:
- `herdr-core/src/runtime/tab_focus.rs`: 새 모델 전체. runtime mutex 안에서 도는
작업이며 목록 상한은 16입니다.
- `herdr-core/src/runtime/session.rs` `reconcile_visible_tabs`:
Herdr/core ownership 경계입니다. 따라갈지, 답으로 읽을지를 여기서 정합니다.
- `herdr-core/src/runtime/control_lane.rs`: lane을 떠나는 시점(`start_job`)과
보내지 않은 claim을 되돌리는 시점입니다.
- `herdr-core/src/runtime/terminal.rs`: pane focus 답과 거절이 목록에 닿는 failure
path입니다.
- **비용 검토**:
- session 하나당 추가 작업은 active tab 집합과 지난 집합의 비교, 그리고 16개 이하 목록 순회입니다.
subprocess, I/O, 직렬화는 없습니다.
  - 새 timer, timeout, sleep은 없습니다. 3초 deadline과 16 상한은 그대로입니다.
- **질문**: ARCHITECTURE의 역사 문장은 이슈 번호(#413, #594, #629, #635)로 적었습니다. PR
번호로 바꿀지 판단해 주세요.

## Evidence

- **확인한 것**:
- 결정적 재현:
`view_authority_a_session_from_before_an_earlier_request_does_not_answer_a_later_one`은
수정 전 main에서 실패했습니다(left t2, right t1). 로그 순서 late_answer ->
confirmed_by_answer -> followed가 CI와 같았습니다. 수정 후에는 통과합니다.
- 순서 표 test
`view_authority_the_screen_stays_on_the_last_request_whatever_order_herdr_answers_in`은
6행입니다: 정순, 접힌 burst, A-B-A 접힘, 보이는 tab 재focus(event 없음), 다음 요청이 기다리는 중의
거절, deadline. 각 행의 기대값은 "마지막으로 보낸 요청의 tab"입니다.
- 상한, 만료, 거절 test 이름을
`view_authority_sent_tab_moves_stop_claiming_their_tab_when_capped_expired_or_refused`로
바꿨습니다. 확실한 거절과 애매한 유실을 모두 다룹니다.
  - 로컬 herdr-core nextest 1551개, clippy `-D warnings`, fmt를 모두 통과했습니다.
- **확인하지 못한 것**:
- `web/e2e/view-bookmarks.spec.ts`는 로컬에서 돌리지 않았습니다. 디스크 여유가 부족해 hided를
다시 빌드할 수 없어서, CI web e2e에 맡깁니다.
- `scripts/check-runtime-gates.sh`의 `hide-platform --test watch` 1건 실패는
이 diff가 hide-platform을 건드리지 않아서 조사하지 않았습니다.
yansfil added a commit that referenced this pull request Oct 8, 2026
Related: yansfil/sasu#30 (`/ship merge`가 이 검사를 매 머지마다 돌리고 출력을 보여 주게 하는
쪽)

## Summary

Hide와 GitHub은 PR과 이슈를 `Closes #N` 같은 closing keyword로만 잇는데, 10-06~07에
이슈를 끝낸 PR 7개(#607 #612 #614 #622 #631 #634 #712)가 이 줄 없이 머지됐고 이슈는 손으로 닫혀
연결이 남지 않았습니다.
이제 `scripts/premerge-check.py`가 닫는 이슈가 없는 PR에 머지 명령 바로 위에서 알림을 한 줄 찍습니다.
막지는 않습니다. 이슈 없이 시작한 PR(PRD 작업, CI·문서 변경)도 많기 때문입니다.

```
note: #454 closes no issue. If it finishes one, put `Closes #<issue>` on the body's Closes line before merging (editing the body does not rerun `verify`); with no issue, merge as it is.
#454 may merge now: gh pr merge 454 --merge --match-head-commit a1eda76...
```

## Review

- **판단해 주세요**: 알림만 하고 막지 않는 수준이 맞는지. 막으려면 "이슈 없음"을 PR 본문에 명시하는 규칙이 따로
필요합니다.

## Evidence

- **확인한 것**: 실제 PR로 실행. 이슈를 닫는 #781에는 알림 없음, 닫는 이슈가 없는 #454에는 위 알림이 찍히고
머지 가능 판정은 그대로.
- **확인한 것**: `test_premerge_check.py`에 알림 유무 테스트 1개 추가, `scripts/tests`
206개 통과, `check-no-attribution` 통과.
- **확인하지 못한 것**: PR을 만드는 순간의 알림은 없습니다. 머지 직전에만 알려서, 그때 본문을 고치는 흐름입니다.
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 9, 2026
… a macOS connect (with-hide#2158)

Closes with-hide/hide-private#585
Closes with-hide/hide-private#616
Closes with-hide/hide-private#603
Closes with-hide/hide-private#400
Related: with-hide/hide-private#630 (flaky-triage group 2),
with-hide/hide-private#612

## Summary

pane holder 시험이 가끔 실패하던 원인은 두 가지였습니다.

- macOS: 연결이 끝나자마자 상대가 연결을 닫으면, 연결 직후에 소켓 옵션을 다시 설정하는 단계가 `EINVAL`로
실패했습니다. macOS는 상대가 닫은 소켓의 옵션 설정을 거절합니다. 이제 macOS 연결은 소켓 옵션을 하나도 설정하지
않습니다. 원래 필요 없던 설정이었습니다.
- Windows와 macOS: "프로세스가 끝났는가"를 함수마다 다른 시점으로 읽었습니다. `start_time`은 프로세스가
끝나기 시작하자마자 끝났다고 했고, `is_alive`는 프로세스가 잡고 있던 것을 다 놓은 뒤에야 끝났다고 했습니다. 그래서
정리 코드가 아직 소켓을 쥔 holder를 "사라졌다"고 보고 소켓 파일을 남겼습니다. 이제 두 함수는 같은 시점을 끝으로
읽습니다.

스크린샷 없음: 화면을 건드리지 않는 플랫폼 계층 변경입니다.

## Review

- **판단해 주세요**: Windows에서 이미 끝나는 중인 프로세스에 `terminate`를 부르면 예전에는
`NotFound`, 이제는 `Ok`입니다(끝내 달라는 요청은 이미 이뤄지는 중). 호출자 중 이 차이에 기대는 곳은 찾지
못했습니다.
- **판단해 주세요**: macOS `start_time`은 이제 `proc_pidinfo` 대신 `is_alive`가 읽는
`KERN_PROC_PID` sysctl에서 읽습니다. 같은 커널 값(`p_start`)이라 기존 기록의 시작 시각과 일치합니다.
다른 계정 프로세스와 좀비도 이제 시작 시각을 답합니다(Linux와 같음).
- **조심해서 볼 파일**: `hide-platform/src/process.rs` - Windows `open_live`,
`ended`, `end`; failure path이고 모든 Windows 프로세스 질의가 지나갑니다.
- **조심해서 볼 파일**: `hide-platform/src/ipc.rs` - `connect_within`의 macOS
분기; Linux는 그대로입니다.

## Evidence

- **확인한 것**: 새 계약 테스트
`a_connect_the_listener_answers_and_closes_at_once_reads_the_answer_and_the_end`가
수정 전 macOS에서 300회 중 133번째에 #616과 같은 `Os { code: 22 }`로 실패, 수정 후 통과.
- **확인한 것**: 새 계약 테스트
`a_process_whose_start_time_says_it_ended_has_ended_for_is_alive_and_its_files`가
수정 전 macOS 0번째 회차에 실패(start_time은 끝, is_alive는 살아 있음), 수정 후 통과.
- **확인한 것**: macOS에서 `proc_pidinfo`와 sysctl 시작 시각을 42개 프로세스로 비교해 모두 같음.
- **확인한 것**: macOS 로컬 hide-platform 347개, hide-holder +
hide-holder-protocol 156개 전부 통과; hide-platform clippy를 macOS, Linux,
Windows 타깃으로 통과.
- **확인한 것**: 임시 반복 작업(이 PR에서 지움)으로 holder 시험과 process/ipc 계약을 시스템마다 20회,
재시도 없이: run 42202672225, Linux·macOS·Windows 각 20회(4개 작업 x 5회), 회차마다
263~296개, 실패 0. with-hide#603·#400의 records 시험이 Windows 20회에 포함됩니다.
- **확인하지 못한 것**: with-hide#612(Linux, 한 번)는 macOS에서 24개 동시 288회로도 재현되지 않았습니다. 다음
실패가 holder 로그를 남기도록 대기만 바꿨고 이슈는 열어 둡니다(#630에 기록).
- **확인하지 못한 것**: Windows는 로컬에서 실행하지 못했고 CI 반복으로만 확인했습니다.
- **닫음**: with-hide#401(2d4b791), with-hide#402(9adfa56)는 이미 고쳐진 옛 시험이라 근거와 함께 닫았습니다.

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

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