Repository navigation
fix: remove the causes of the hided core move, remote core and node owner flakes - #1813
Merged
Merged
Conversation
…plit a line A start refusal written with record_now and the diagnostics writer thread append to the same core.jsonl. writeln! sent the line and its newline as two writes, so another record could land between them and leave the refusal unparseable (with-hide/hide-private#119). The sibling hide connect test asserted a five-second wall-clock bound that measured the daemon's start under load; the state_refused reason already proves the exit was seen before the health wait ran out.
…ailed runs small The manifest refusal journey read the window's role once right after the journal said rolled back, which comes before the node role starts (#962); every move-back rollback now waits through one helper. The fixture renderer bounded its handshake and first snapshot by a two-second socket read, which failed the caller's 30 s wait at once as a bare os error 11; the read is now only the fixture's hang guard and says what it waited for. A kept run removes its native programs (about 0.9 GB per core-move run), which filled the runner's /tmp after earlier failures and timed out later journeys. The remote mailbox lane keeps rc-* runs and keeps logs for a flaky run too.
On macOS the login shell's path_helper puts the system folders first, where the runner keeps a signed-out gh, so the core read the node checkout's pull request as not logged in (with-hide/hide-private#201). Each fixture HOME now writes the startup files fixtureLoginShellPath writes for the web fixtures.
Temporary: reverted in this pull request once one Linux run has kept the logs behind with-hide/hide-private#189.
The supervisor writes the journal's done before the move's view leaves linking, and a request in between is refused as move_busy; a_failing_move_back_check_changes_nothing hit it on Linux. moved_forward and the journeys that go back right after a forward move now wait for the window's view at done. A core-move fixture whose start fails before the fixture exists sheds its programs too; a failed codesign left 156 MB per run under /tmp.
Its Linux run passed 8 iterations of the 23 remote core journeys, so it kept no failing run; the lane keeps rc-* runs and flaky runs' logs from now on.
The hide connect integration test checks only the file and reason a refused start names; that the wait ends at the look after the daemon's exit, with no further pause, is now a fake-clock unit test of wait_healthy_within, which fails when the exit is read only at the deadline. The diagnostics log reuses one record buffer instead of allocating per append, and the remote mailbox lane keeps only the logs of rc-* runs.
yansfil
added a commit
that referenced
this pull request
Oct 29, 2026
…nk (#1817) Closes with-hide/hide-private#284 ## Summary main push verify(run 40795002451, 047d094)를 빨갛게 만든 `a_flooding_pane_holds_back_neither_another_panes_keys_nor_its_frames`는 #1813 때문이 아니라 10-12부터 Linux·Windows에서 반복된 flaky입니다. 테스트가 flood frame 40개를 가짜 세션에 넣기만 하고, 그 pane의 reader 스레드가 그것을 링크 큐에 넘겨 1 MiB cap을 넘기기 전에 읽기를 시작할 수 있었습니다. 그러면 읽는 만큼 자리가 나 flood가 계속 올라가고, quiet pane의 echo가 그 사이 몇 번째에 끼는지는 스케줄러가 정했습니다(4-15줄). 이제 테스트는 flood가 cap을 넘겨 버려진 상태를 기다린 뒤 key·echo·읽기를 하고, echo 앞에 flood 줄이 하나도 없음을 확인합니다. 제품 코드는 바뀌지 않습니다. ## Review - **판단해 주세요**: 기대값을 `<= 3`에서 `== 0`으로 좁혔습니다. cap을 넘긴 flood는 버려지므로 0이 바깥에서 정해지는 답이라고 봤습니다. - **조심해서 볼 파일**: `hide-node/src/terminal/device_tests.rs` - 기다림이 링크 큐의 내부 상태(`dropping`)를 봅니다. 이 모듈의 다른 테스트도 `lock(&uplink.state)`를 읽고, 기다림은 모듈의 `wait_for`(WAIT hang guard)입니다. ## Evidence - **확인한 것**: #1813은 hide-node가 빌드하는 crate(hide-node와 path 의존 13개)와 Cargo.lock을 바꾸지 않아 b51d78e7c와 047d0944d의 테스트 입력이 같습니다(`git diff --stat` 빈 결과). - **확인한 것**: 고치기 전 047d094, load 33-42에서 12개 병렬로 360회: 7회 실패. 실패 7회 모두 읽기 시작 때 flood가 아직 cap 전이었고, cap을 넘긴 348회는 모두 통과. - **확인한 것**: 고친 뒤 같은 조건으로 직렬 100회 + 12개 병렬 600회(load 약 42): 0회 실패. - **확인한 것**: mutation - 버려진 pane의 output을 다시 받게 바꾸면 "the echo waited behind 7 flood lines"로 실패합니다. - **확인한 것**: `verify-cargo.sh fmt-check`, `nextest -p hide-node`(224 pass), `clippy -p hide-node --all-targets -D warnings` 통과. - **확인하지 못한 것**: Windows 로컬 반복은 못 했습니다(이 기계에 Windows 없음). 같은 원인으로 보며 PR CI의 windows check에 맡깁니다. merge 뒤 main push verify는 conductor가 확인합니다. <details><summary>Verification record</summary> - base 047d094, head 3145afa - 재현 명령: `target/debug/deps/hide_node-* --exact terminal::device::tests::a_flooding_pane_holds_back_neither_another_panes_keys_nor_its_frames` 반복 </details>
yansfil
added a commit
that referenced
this pull request
Oct 30, 2026
… s early edge for other prints The earlier change widened the window to 30 s either way, which would also count a session that only listed a new pull request on a skewed clock as its maker. The window goes back to 2 s before and 30 s after GitHub's createdAt, and an address its creating call gave back (session_prs.made, a label sighting's made) is the session's making at any distance. Version 12 of the link record adds the column and reads the last 90 days of files again, so mission-13's #1810 to #1813, printed by their own gh pr create 2.6 s to 3.2 s before GitHub's time, are found.
yansfil
added a commit
that referenced
this pull request
Oct 30, 2026
## Summary 같은 세션이 태스크 줄, pane 머리, 세션 기록에서 서로 다른 PR 수를 보였습니다(한 Conductor가 기록 15개, 태스크 줄 3개). 화면마다 PR을 따로 모았고, 끝난 자식의 PR은 줄에서 빠졌으며, 닫힌 PR은 버려졌기 때문입니다. 이제 core가 세션마다 PR 목록 하나를 만들고(자기 것 + 살아 있거나 끝난 모든 자손의 것), 모든 화면이 그 목록만 읽습니다. merge된 PR은 모두, 닫힌 PR은 흐리게 남습니다. GitHub 목록(최근 200개) 밖의 PR은 기록의 마지막 상태로 stale 표시하며 남깁니다. 기록에서 merge된 PR 4개가 빠지던 원인도 고쳤습니다: 각 세션의 `gh pr create`가 주소를 GitHub 생성 시각보다 2.6~3.2초 먼저 찍었는데(두 시계 차이), 판정 창이 앞쪽 2초뿐이었습니다. 이제 PR을 만드는 호출(`gh pr create`, `gh api` POST `repos/o/n/pulls`, `create_pull_request` 도구)이 성공해 돌려준 주소는 GitHub 생성 시각 -10초~+30초 안이면 그 세션이 만든 PR입니다. 그 밖의 출력은 예전 창(-2초/+30초) 그대로입니다.  사이드바 줄: 리드의 목록에 끝난 자식(P4)의 PR 두 개가 남고, 닫힌 #819는 흐리게 그려집니다(gallery). ## Review - **판단해 주세요**: 닫힌 PR을 목록 끝에 흐리게 남기고 개수에도 셉니다(예전에는 빠짐). 부모 줄 개수가 늘어납니다. - **판단해 주세요**: 기록이 이제 pane이 체크아웃 브랜치로 맡은 PR도 보입니다(줄 표시와 같게). 예전 기록은 세션이 만든 PR만 보였습니다. e2e 두 개의 기대 수를 2에서 3으로 바꿨습니다. - **판단해 주세요**: 만든 세션 판정은 생성 행위입니다. 호출과 출력을 형식별 id로 짝짓고(Claude `tool_use_id`, Codex `call_id`, Pi·Grok `toolCallId`, OpenCode는 한 part), 출력에서 줄 하나가 주소뿐인 것 또는 응답 JSON의 `html_url`만 만든 PR로 봅니다(본문에 든 다른 PR 주소는 아님). agy는 결과가 호출을 가리키지 않아 시간 창만 씁니다. - **판단해 주세요**: link 기록 v12가 `session_prs.made` 열을 더하고 최근 90일 파일을 다시 읽습니다(v10 때와 같은 방식). 그래야 업그레이드 전에 만든 PR도 잡힙니다. 업그레이드 직후 한 번 읽기 부하가 있습니다. - **판단해 주세요**: 생성 호출로 인정하는 조건. 호출에 `||`가 없고(앞 명령이 실패해야 도는 명령이 없음), 기록이 실패로 표시하지 않은 호출(Claude `is_error`, Codex 종료 코드, Pi `isError`·`exitCode`, Grok `failed`, OpenCode 상태·종료 코드)만입니다. 실패한 `gh pr create`는 브랜치에 이미 있는 PR 주소를 찍기 때문입니다. `&&`, `;`, 파이프로 이어진 호출은 인정합니다: #1810~#1813을 만든 호출이 모두 `cd … && B=…; cat > $B <<EOF … EOF` 다음 `gh pr create … | tail -1` 모양이었습니다. - **판단해 주세요**: 생성 호출 출력의 앞쪽 창은 -10초입니다. 이 Mac 기록에서 생성 출력 234개 중 가장 이른 것이 GitHub 시각보다 3.4초 앞이었습니다(#1810~#1813은 2.6~3.2초). 10초 창이 같은 호출에서 조회만 한 오래된 PR(`gh pr create && gh pr view 42`)을 걸러냅니다. - **남는 위험**: 생성 호출이 같은 호출 안에서, 다른 세션이 10초 안에 만든 PR을 조회해 주소만 한 줄로 찍으면 그 PR도 이 세션이 만든 것으로 잡힙니다. - **알려진 위험(이번 범위 밖, 기존과 같음)**: 뒤쪽 +30초 안에 다른 세션이 같은 주소를 찍으면(예: 리드가 막 생긴 PR을 `gh pr view`) 그 세션도 만든 세션으로 잡힙니다. - **조심해서 볼 파일**: `hide-session/src/links.rs`, `named_prs.rs`, `opencode.rs`, `conversation_cursor.rs`, `hide-shell/src/lib.rs` - 생성 호출 판별(`ShellLine::fallback`), 형식별 실패 표시, 호출-출력 짝짓기, 아직 출력이 없는 호출 id를 체크포인트에 실어 다음 poll로 넘김(최대 16개). - **조심해서 볼 파일**: `herdr-core/src/runtime/session_state.rs` - high-frequency path, 모든 줄을 다루는 교차 패스에 목록 계산을 얹었습니다. - **조심해서 볼 파일**: `herdr-core/src/agent_state/work/family.rs` - 새 단일 출처. 줄, 기록 그룹, 200개 창 밖 처리가 모두 여기서 나옵니다. 기록 그룹은 잘린 목록만 나눠 담고 같은 `omitted`(`pr_omitted`)를 싣습니다. 여러 장비가 같은 PR을 읽으면 fresh > 최근 read > 나쁜 상태 순으로 고르고, 살아 있는 줄의 PR도 고른 read의 상태와 제목을 씁니다(read가 없을 때만 줄이 든 값). - **조심해서 볼 파일**: `herdr-core/src/links/ledger_store.rs`, `links/store.rs`, `links/mod.rs` - 판정 창 SQL(made면 -10초, 아니면 -2초)과 요약에 부모 간선, 만든 PR의 상태를 싣는 부분. - **조심해서 볼 파일**: `web/src/prMark.ts`, `components/pr-mark.tsx` - snapshot wire: `AgentRow.pulls` 신설, `state.pr` 삭제, `pr_groups[].pulls`. - **비용 검토**: 목록은 기존 교차 패스 안에서 메모리로만 계산합니다. lock 밑 I/O나 subprocess는 없습니다. - **비용 검토**: 기록 쪽 색인은 link worker 요약이 바뀔 때만 다시 만듭니다. 줄은 목록이 바뀐 때만 publish되고, 기록 그룹은 비교 후 바뀐 때만 복사합니다. fresh PR은 읽은 시각을 싣지 않아 GitHub가 같은 답을 다시 줘도 목록이 바뀌지 않습니다. - **비용 검토**: `sync_session_state`는 자동 해결을 저장했을 때만 두 번째 projection을 돌립니다. - **비용 검토**: 줄당 PR 200개 상한, 넘으면 `omitted` 개수와 넘는 순간 진단 한 번. 기록 세션 탐색은 줄당 2000개 상한이고 넘으면 같은 진단에 `lineage_capped`로 남깁니다. 상한 안에서 PR을 하나도 못 찾아도 이 사실은 남습니다. - **비용 검토(측정 안 함)**: lock 보유 시간과 snapshot 크기는 재지 않았습니다. 계산이 메모리 안이고 상한으로 묶인다는 것까지만 말할 수 있습니다. - **비용 검토**: 조상이 자손 PR을 반복해 실으므로 snapshot이 트리 깊이만큼 커지지만, 줄당 상한으로 묶입니다. ## Evidence - **확인한 것**: 운영자 `links.sqlite3` 읽기 전용 사본과 원래 transcript 복사본에 새 reader를 돌림(이번 규칙으로 다시). #1810(-2744ms) #1811(-2968ms) #1812(-2586ms) #1813(-3182ms) 모두 자기 세션의 복합 `gh pr create` 호출 출력으로 made. 같은 주소를 나중에 찍은 다른 세션 출력은 made 아님. - **확인한 것**: 검토 반례 테스트. `gh pr create --fill || gh pr view 42` 호출은 Claude·Codex·Grok·Pi·omp·OpenCode 두 스키마 모두 made 아님. 실패한 Claude 생성 호출이 찍은 기존 #42도 made 아님. 하루 전에 만든 #42를 `||`와 `&&` 호출이 찍은 세션은 store에서 둘 다 Worked뿐(Created 아님). #1810~#1813의 실제 복합 호출 모양은 -3.2초에 Created, -12초 made 출력은 빠짐. - **확인한 것**: 생성 행위 테스트. Claude·Codex·Grok·Pi·omp·OpenCode 두 스키마에서 `gh pr create` 출력은 made, agy와 `bash scripts/ship.sh` 출력은 아님. 호출과 출력이 다른 poll에 읽혀도 made. 목록에 혼자 있는 주소는 made 아님. - **확인한 것**: 저장 경로 테스트. 생성 호출이 3.2초 먼저 찍은 PR은 Created, `gh pr list`가 3초 먼저 찍은 PR은 아님. v11 기록이 열과 재읽기로 업그레이드됨. 기록 출력에서 made 3.4초 전은 남고 made 12초 전과 목록 3초 전은 빠짐. label 판정도 같음. - **확인한 것**: core 목록 테스트. 줄이 옛 open #42를 들고 reads가 최신 merged를 줄 때 줄 목록이 merged(read 순서 3가지 모두), fresh 재읽기는 목록 같음, 상한 뒤 세션에만 PR이 있는 2001개 lineage는 빈 목록이지만 `lineage_capped`이고 `pulls.capacity` 진단 한 번, 끝난 자식 100+101개에서 줄 200개 omitted 1과 기록 200개 pr_omitted 1이 같은 URL 집합, 세션 2001개 lineage는 `lineage_capped`, A→B→C에서 B의 줄·기록이 C 진행 중과 끝난 뒤 모두 같음. - **확인한 것**: web 태스크 자식 줄 테스트(A→B→C의 B가 #41·#42 둘 다). web vitest 전체 262개 파일 2283개 통과, `tsc`, eslint 통과. - **확인한 것**: hide-shell·hide-session nextest 전체 365개 통과, herdr-core 바뀐 모듈 nextest 254개 통과, hide-agent-hooks nextest 395개 통과, `clippy`(herdr-core, hide-session, hide-shell, hide-agent-hooks, all-targets) 경고 없음, `cargo fmt --check` 통과. - **확인하지 못한 것**: 전체 Rust suite, Playwright e2e, Windows·Linux lane은 CI에 맡깁니다. - **확인하지 못한 것**: 실제 Conductor 세션 native 확인, 업그레이드 후 재읽기를 실제 기록에서 돌려본 것. 운영자 앱·서버는 건드리지 않았습니다. <details><summary>추가 증거</summary>  세션 기록 PR 영역을 펼친 상태: 같은 목록에서 그룹을 나누고, 끝난 자식의 닫힌 #1538은 흐리게(gallery). </details> <details><summary>Verification record</summary> - base `origin/main`, head `0ca41fd92` - `scripts/verify-cargo.sh nextest -p hide-shell -p hide-session`: 365 passed - `scripts/verify-cargo.sh nextest -p hide-agent-hooks`: 395 passed - `scripts/verify-cargo.sh nextest -p herdr-core -E 'test(/links::|labels::facts|work::family|session_state|request_view|session_record|node_migration|pulls/)'`: 254 passed - `scripts/verify-cargo.sh clippy -p herdr-core -p hide-session -p hide-shell -p hide-agent-hooks --all-targets -- -D warnings`: clean; `check --workspace --all-targets`: clean; `cargo fmt --check`: clean - `scripts/verify-web.sh web test` (head `7d46918d7`, no web change since): 262 files, 2283 passed; `typecheck`, `lint`: clean </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.
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-*로그를 남깁니다.스크린샷 없음: 화면을 건드리지 않습니다.
이슈별 원인과 처리
writeln!이 줄과 개행을 두 번 write해,record_now와 writer 스레드 사이에 다른 기록이 끼었습니다(CI 로그에 refusal 줄 뒤로start.step이 붙어 있음). 줄과 개행을 한write_all로 씀.hided·hide각 140MB)가 30초 bound를 넘던 것. #1751이 이미 고쳤고, 이후 CI는upload sent 0, reused 3, 약 9초에 ready. 이슈에 근거 코멘트.back_rolled_backhelper. (b)os error 11: fixture renderer가 handshake와 첫 snapshot을 2초 socket read로 묶어, 호출자의 30초 wait를 즉시 실패시킴 -> read는 hang guard만, 실패 시 무엇을 기다렸는지 말함./tmp가Disk quota exceeded가 된 직후의 timeout. 앞선 실패 run마다 바이너리 약 0.9GB가 남은 탓 -> 남기는 run은 native program을 지우고 로그만 남김. fixture가 만들어지기 전 setup이 실패한 run도 같음.done을 move view가linking을 벗어나기 전에 써서, 그 사이 요청이move_busy로 거절됨 ->forward_done이 창의 move viewdone까지 기다림.not_logged_in으로 답함. macOS login shell의path_helper가 시스템 폴더를 앞에 두어 runner의gh가 먼저 잡힘 -> fixture HOME의.zprofile등이 계정 PATH를 앞에 둠(web fixture의fixtureLoginShellPath와 같은 방식).hide connect: 5초 wall-clock 단언은 부하에서 daemon 시작 시간을 쟀습니다(load 30에서 11.7초). 지우고, 종료가 다음 look에서 wait를 끝낸다는 것은wait_healthy_within에 종료 신호를 주는 fake-clock 테스트로 증명. 통합 테스트는 파일과 이유만 봄.rc-*를 올리지 않아 증거가 메시지뿐이었음. 결과와 다음에 볼 곳은 두 이슈에 코멘트.Review
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
writeln!에서 3/3 실패(CI와 같은{...}{...}섞임), 고친 코드에서 통과.exited with로 끝남./tmp/hcm-*없음. diagnostics·node_owner·run 20회 반복 실패 0(load 26~30).lane=macosdispatch(run 40725749658)의 remote mailbox macos-15 첫 시도 통과: remote_core 23/23(#201 테스트 포함), core_move 44/44, flaky 0./etc/paths폴더에gh가 없음). 같은 nightly run의 web e2e macOS 실패는 이 diff와 무관.web/src/practice/worlds.test.ts5초 timeout(이 diff와 무관)은 실패 job만 한 번 재실행해 통과.Verification record
def885735(review fix on top ofc9290db54)origin/main(merge-order: Stay as you are)cargo nextest -p herdr-core -p hideddiagnostics·wait·node_owner 테스트 72/72 pass, 새 테스트 둘과 node_owner 20회 반복 실패 0, exit 확인을 deadline 뒤로 옮기면 새 cli 테스트 실패; clippy-D warnings0 warnings,cargo fmt --checkclean.lane=macosrun 40725749658 remote mailbox macos-15 pass.rc-*log allowlist.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.