Skip to content

TEMP flaky 660 evidence for #674 (do not merge) - #676

Closed
yansfil wants to merge 5 commits into
mainfrom
temp/flaky-660-674
Closed

yansfil wants to merge 5 commits into
mainfrom
temp/flaky-660-674

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

TEMP evidence for #660 under #674. First push: main (d13419b) with #660's order as a row of the tab focus table and the desktop test 'Agent edge drag splits the desktop column into two live tab groups' repeated 60 times with --retries 0 on macOS. Second push: #674's head with the same workflow. Closed without merge.

A session folds Herdr's events into one state, and one that ends on t2
cannot say whether Herdr went t2 or t2, t3, t2: a folded t2, t3, t2
answered only the first t2 and held Herdr's own moves for the deadline.
The replica now keeps each tab_focused it applies as a move (the
latest 16 and a count), and the core consumes the moves it has not read,
each answering the earliest request on its tab. A snapshot read outside
the stream answers nothing; dropped moves (over 16, a new replica) fall
back to the tabs newly active and are logged.

Which tab Herdr shows is one value, not one per workspace: Herdr emits
tab_focused for another workspace's active tab. Each request records it
as it leaves, a withdrawn request hands it to the next, and its answer
settles it when it was already there. A refusal with no request left is
reported, and the outstanding asks are collected once per reconcile.
@yansfil
yansfil force-pushed the temp/flaky-660-674 branch from 0dc974c to 1b0c20c Compare October 6, 2026 23:44
yansfil added a commit that referenced this pull request Oct 7, 2026
Related: #653, #667 (#667 리뷰 후속, main d13419b 위)
Related: #660 (fixed by #667; this keeps the order as a regression row)

## Summary

#667은 checkout의 tab 권한을 "보낸 순서의 미답 tab 이동 목록"에서 유도합니다. 이 PR은 그 목록에 답하는
쪽을 Herdr의 이동 하나하나로 바꿉니다.

- 문제: session은 Herdr의 event를 하나의 상태로 접습니다.
  - t2로 끝난 session은 Herdr가 t2로 갔는지, t2, t3, t2로 갔는지 말하지 못합니다.
- 접힌 t2, t3, t2는 첫 t2만 지워 [t3, t2]가 3초간 남았습니다. 그동안 Herdr 스스로의 이동은 따라가지
않았고, agent가 t3로 옮기면 남은 항목이 그 이동을 답으로 먹었습니다.
- "session이 마지막 요청의 tab을 보이면 모두 지움"(A안)은 e1(t2) | e2(t3) | e3(t2)가 따로 올
때 e2를 따라가 화면과 keyboard가 t3로 갑니다(#413 증상).
- 고침:
- replica가 적용한 `tab_focused` 하나를 이동 하나로 기록합니다(`SessionTabMoves`: 개수와 최근
16개).
- core는 아직 읽지 않은 이동을 차례로 소비합니다. 이동 하나가 그 tab의 가장 이른 요청에 답하고, 그 앞에 보낸 요청도
함께 빠집니다.
- 틈 처리: 이동이 16개를 넘어 빠졌거나 reconnect로 replica generation이 바뀌면, 지금의 diff
규칙(새로 active가 된 tab, 새 focus event)으로 물러섭니다. 이때 `tab.focus.moves_gap`을
log에 남깁니다.
- event stream 밖에서 읽은 snapshot은 아무 요청에도 답하지 않습니다. 해당하는 것은 close나
creation의 fresh projection, editor status 응답입니다. 이것이 답하면 같은 이동이 replica
session에서 한 번 더 세어집니다.
- (2) "이미 그 tab에 있었나"는 보낼 때 항목에 기록합니다. 값은 앞 요청의 tab이고, 앞 요청이 없으면 마지막
session의 focused tab입니다.
  - 거절, 미발송, pane 소멸로 빠지는 항목은 이 값을 다음 항목에 물려줍니다.
  - 답이 온 시점의 active tab으로 판단하면, 답보다 먼저 Herdr가 스스로 움직인 경우 3초를 기다렸습니다.
- 격리된 Herdr 0.9.1 probe에서 새로 확인한 사실: 다른 workspace의 active tab으로
`tab.focus`해도 `tab_focused`가 나옵니다. 그래서 "보이는 tab"은 workspace마다가 아니라
Herdr의 focused tab 하나입니다. #667의 workspace별 판단은 지웠습니다.
- (3)
- 요청 항목이 없을 때 온 거절(deadline이 지난 뒤, lane이 시작하기 전)도 그 뒤에 물은 것이 없으면
`tab.focus.refused`로 보고합니다.
- 미결 ask는 reconcile 한 번에 한 번만 모읍니다(`TabAsks`). 전에는 checkout마다 lane을 다시
훑었습니다.
- #660(둘째 Agent 영역 입력 글자 유실): CI hided 로그의 순서(click t2 답, click t1 답,
Herdr t2, click t2 답, Herdr t1, Herdr t2)를 표 test 한 행으로 넣었습니다. 늦게 온 t1을
따라가 keyboard가 둘째 영역을 떠나던 원인입니다.
- held replica의 publish: 이동만 바뀐 경우에는 layout을 기다리는 workspace가 있는 상태를
publish하지 않습니다. 이동은 다음 publish에 함께 실립니다. 이전 commit에서는 새 workspace의
`tab_focused`가 그 workspace를 뺀 상태를 publish했습니다. 그래서 creation worker가 이미
projection한 pane이 retire되었고, Windows CI의
`hided_opens_a_pane_on_the_pinned_herdr_and_a_typed_line_echoes`가 두 번 모두
실패했습니다.
- 변경 없음: cap 16(`TAB_FOCUS_LIMIT` 상수 하나를 요청 목록과 이동 기록이 함께 씁니다), 3초
deadline, shell wire와 snapshot 계약. 새 timeout과 sleep은 없습니다.

## Review

- **판단해 주세요**: remote 경로. replica는 local과 remote에 같은 코드라 이동을 똑같이 기록합니다.
다만 remote session(`RemoteSessionSnapshot`)에는 tab 요청 목록이 없어 이동을 싣지 않았습니다.
소비자가 없는 필드를 만들지 않으려는 선택입니다.
- **조심해서 볼 파일**:
- `herdr-core/src/runtime/tab_focus.rs` `take_tab_focus_answers`,
`withdraw_tab_move`, `settle_where_herdr_already_was`: Herdr/core
ownership 경계입니다.
- `herdr-core/src/session_sync/replica.rs`: `tab_focused` 적용 시 기록합니다.
partial publish에는 그때까지의 이동이 실리지만, 이동만 바뀐 것으로는 partial publish가 일어나지
않습니다(`refresh_published_state`). 이동이 publish를 일으키면 held topology가
creation worker의 projection을 되돌립니다.
  - `herdr-core/src/sidebar.rs` `SessionTabMoves::since`: 틈 판정을 맡습니다.
- **비용 검토**:
- lock 안 추가 작업은 소비하는 이동 수(16 이하)마다 16 이하 목록을 한 번 훑는 정도입니다. 이동은 payload에서
참조로 읽고 복사하지 않습니다.
  - replica는 `tab_focused`마다 문자열 하나를 넣고 17번째를 버립니다.
  - checkout마다 하던 lane 훑기는 reconcile당 한 번으로 줄었습니다.

## Evidence

- **확인한 것**:
- 표 test
`view_authority_the_screen_stays_on_the_last_request_whatever_order_herdr_answers_in`은
10행입니다. #667의 답 규칙을 그대로 되돌려 돌린 결과:
- 실패: "t2, t3, t2 folded into one session"(모든 요청이 답해지지 않음), "the shown
tab's answer comes after Herdr moved on its own".
    - 통과: "t2, t3, t2 each in its own session".
- A안을 넣어 돌리면 이 행이 "after Herdr(["t3"]) 화면이 w-order:t3"로 실패합니다. #413 회귀를
지키는 행입니다.
- `view_authority_dropped_moves_fall_back_to_the_tabs_newly_active`: 16개
초과와 generation 변경 두 경우 모두 diff로 물러서 요청을 답하고, 각각 gap 진단을 하나씩 남기는지 확인합니다.
#667에서는 진단이 없어 실패합니다.
- `view_authority_a_refused_tab_focus_keeps_the_tab_and_reports_it`:
deadline 뒤에 온 거절도 보고합니다. #667에서는 보고 1건으로 실패합니다.
- replica test
`every_applied_tab_focus_is_one_move_and_the_latest_are_kept`: 순서, cap,
틈 판정, raw snapshot에는 이동이 없음을 확인합니다.
- #660 재현: 닫은 #673의 core test
`view_authority_answers_confirmed_ahead_of_their_events_are_not_followed`(같은
순서, 옛 session 모양)를 그대로 돌린 결과:
- acc8087(#667 이전): 실패. "Herdr naming w-order:t1 does not move the tab
the operator chose", 화면이 t1.
- main d13419b(#667): 통과. session에 replica처럼 focus event를 실어도 통과합니다.
- 이 PR: 같은 순서의 표 행("a click back and a click forward each answered
before the move before it") 통과.
- #660 e2e(TEMP, macOS `agent-tab-groups` `--repeat-each 60 --retries
0`): #667 직전 main acc80875에서 4/60 실패(TEMP #671, run 37543522493), #667 뒤
main d13419b9에서 0/60(TEMP #676, run 37545543305). 이 PR head 18788eef를
main 5a8d59b2에 merge한 ref에서 0/60(TEMP #676, macos-15-arm64, desktop
`agent-tab-groups` 'edge drag splits'). 4/60의 실패는 모두 둘째 영역의 입력 글자
유실이었습니다. 증상은 #667이 이미 없앴고 이 PR은 회귀가 없습니다. 추가한 표 행은 #660의 순서를 이 PR의 이동
모델에서도 지키는 회귀 test입니다.
- replica test
`a_move_into_a_held_workspace_rides_on_the_publish_that_releases_it`:
layout을 기다리는 새 workspace로의 `tab_focused`는 publish하지 않고, 그 workspace가 풀리는
publish에 이동 하나가 실리는지 확인합니다. 고침을 되돌리면 "the move waits for the workspace
it moved into"로 실패합니다.
- Windows CI(cfc4c24):
`hided_opens_a_pane_on_the_pinned_herdr_and_a_typed_line_echoes`가 재시도까지
두 번 모두 실패했습니다. hided 로그에 `pane.selection_retired`("Retired pane w1:p1;
the selected checkout is now empty")가 `pane_cwd.corrected`보다 앞서 찍혔습니다.
같은 test가 통과한 main run에는 retire가 없습니다.
- 로컬 herdr-core nextest(18788ee): 1604개 중 1603개 통과.
`github::tests::timed_out_gh_and_its_pipe_holding_helper_are_terminated`는
전체 실행의 부하 아래에서 한 번 실패했고, 단독 재실행에서는 통과했습니다. 이 PR이 건드리지 않은 module입니다.
- Herdr 0.9.1 probe(격리 server): 보이는 tab focus는 event 없음, 다른 tab은 있음, 다른
workspace의 active tab도 있음, pane focus로 tab이 바뀌면 있음, focus와 함께 만든 tab과
`workspace.focus`도 있음, t1,t2,t1 burst는 순서대로 세 건.
- 로컬 herdr-core nextest 1553 통과, clippy `-D warnings`와 fmt 통과. 단 #667
head(235480b) 위에서 잰 결과입니다. main(d13419b)으로 rebase한 뒤 충돌은 없었고, fmt만 다시
돌렸습니다.
- 기존 test 10개는 session에 이동을 싣도록 고쳤습니다(`HerdrMoves` test helper가
replica처럼 이동과 focus event를 붙입니다). 기대값은 바꾸지 않았습니다. 단 split checkout 확인
test의 설명은 "그 workspace가 tab을 보이면 확정"에서 "그 tab으로의 이동이 답"으로 바꿨습니다.
- **확인하지 못한 것**:
  - 18788eef의 clippy는 로컬에서 돌리지 않았습니다(디스크 8GiB 미만). CI가 확인합니다.
- web e2e(`view-bookmarks.spec.ts` 등)는 로컬에서 돌리지 않았습니다. 디스크 여유가 8GiB 아래라
hided를 다시 빌드하지 않았고, CI에 맡깁니다.
  - hided와 다른 crate의 테스트도 같은 이유로 CI에 맡깁니다.
- rebase 뒤의 compile, clippy, herdr-core test도 디스크 규칙(8GiB 미만)에 걸려 로컬에서
다시 돌리지 않았습니다. CI rust workspace lane이 확인합니다.
@yansfil

yansfil commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

TEMP evidence run; results are recorded in #674 and on the issue. Closing without merge.

@yansfil yansfil closed this Oct 7, 2026
@yansfil
yansfil deleted the temp/flaky-660-674 branch October 7, 2026 00:16
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