Repository navigation
Pin the watch queue's cap where it is decided and stop counting a burst over time - #669
Merged
Merged
Conversation
…st over time The burst test asserted at most CAPACITY + 1 changes for one burst, but once the reader takes the overflow, what the system is still delivering queues again, so a loaded machine saw 6,311 and 8,238 changes (issue 651). The cap is on what waits at once: three queue unit tests now pin it, and the integration test keeps the system-facing claim, an overflow rather than silence. The module doc and ARCHITECTURE.md say the same.
yansfil
added a commit
that referenced
this pull request
Oct 7, 2026
… a hand-started Codex runs in its own pane (#656) Closes #641 Related: #668 (settings-cleanup가 키트 줄을 없애고 팝오버 링크를 만듦), #669 (issue 651), #616 ## Summary - 공유 Codex daemon이 돌고 있으면 손으로 연 Codex가 그 daemon에 붙어 hide가 그 pane을 따라가지 못합니다(issue #641). - main의 Not connected 팝오버 링크 "Turn off Codex's shared server…"는 자동 시작만 끄고 떠 있는 daemon은 두어서, 누른 뒤에도 다음 손으로 연 Codex가 여전히 붙었습니다. - 이제 링크가 먼저 확인 창(대상 기계, 붙은 Codex가 끊기고 `codex resume`으로 이어감, hide가 연 Codex는 계속 돎)을 열고, 확인하면 자동 시작을 끈 뒤 떠 있는 daemon까지 멈춥니다(운영자 선택 C). - 자동 시작은 이미 꺼졌는데 daemon이 떠 있는 기계에서도 그 pane은 공유 서버 이유와 링크를 보이고, 그때 링크는 멈추기만 합니다. - 이 Mac과 SSH device가 같게 동작합니다(helper protocol 21). 처음 열었던 Settings 키트 줄 방식은 #668이 그 줄을 없애서 대체했습니다.   ## Review - **판단해 주세요**: settings-cleanup의 "A running daemon is never stopped (D-23)"를 운영자 선택 C로 의도적으로 뒤집었습니다(`codex_daemon.rs` 모듈 설명, UI_BEHAVIOR, ARCHITECTURE, INSTALL, status-model). - **판단해 주세요**: 확인 창 문구(en) "Turn off Codex's shared server on {machine}?" / "Codex stops starting its shared server, and the one running now stops." / "Every Codex attached to it disconnects. In its pane, run codex resume to continue." / "Codex that Hide started doesn't use this server and keeps running." / 버튼 "Leave it running", "Turn off and stop" (ko "그대로 두기", "끄고 멈추기"). - **판단해 주세요**: PRD D-07/B9(위임된 가정). 자동 시작이 꺼졌는데 daemon이 떠 있으면 pane을 "Started before Hide was set up" 대신 공유 서버로 읽고 링크를 둡니다. 판단은 마지막 키트 읽기 기준이고 새 polling은 없습니다. 원하는 동작이 맞나요? - **판단해 주세요**: `daemon version`이 실패하면 Codex의 제어 소켓(`CODEX_HOME/app-server-control/app-server-control.sock`)이 없을 때만 "daemon 없음"으로 봅니다. 이 규칙은 pane 이유를 정하는 읽기에만 쓰고, 확인한 끄기는 소켓으로 판단하지 않습니다: `daemon version`이 실행 중이라고 읽지 못하면 `daemon stop`을 실행하고 그 타입 있는 답(`notRunning`, `stopped`)을 믿습니다(0.160에서 관찰한 형식). - **판단해 주세요**: 그래서 daemon이 없을 때도 끄기는 `daemon stop`을 한 번 실행합니다(아무것도 멈추지 않고 `notRunning`으로 답함). PRD B5의 "멈추기를 시도하지 않는다"와 글자로는 다르고, 보이는 결과(done, 멈춘 것 없음)는 같습니다. - **조심해서 볼 파일**: `hide-agent-hooks/src/codex_daemon.rs` - failure path. daemon을 멈추는 유일한 경로와 소켓 판단. - **조심해서 볼 파일**: `herdr-core/src/runtime/kit.rs` - runtime mutex 아래의 요청, 실행 번호, 연결이 끊긴 device의 요청 정리. 자식 프로세스는 키트 스레드와 helper에서만 돕니다. - **조심해서 볼 파일**: `hide-host/src/protocol.rs`, `hide-kit/src/lib.rs` - helper 계약. protocol 21, `codex_daemon_off`가 멈추기까지 하므로 20 helper는 연결에서 거절됩니다. - **조심해서 볼 파일**: `web/src/PaneConnection.tsx` - 확인 창, 두 번 보내지 않는 guard, 링크가 사라지면 창도 닫힘. - **조심해서 볼 파일**: commit하는 Git test fixture의 `commit.gpgsign=false` - 범위 밖, 서명을 요구하는 전역 git 설정에서 실패해서 둠. - **비용 검토**: 키트 읽기마다 `daemon version` 한 번이 늘어납니다(Codex에 설정이 있는 기계만, 키트 스레드와 helper에서). 멈추기는 운영자의 확인 한 번에 한 번입니다. ## Evidence - **확인한 것**: 실제 Codex CLI 0.160.0, 전용 HOME과 CODEX_HOME(daemon 소켓과 프로세스가 그 CODEX_HOME 소속임을 먼저 확인), 격리 Herdr, dev hided에서 팝오버, 확인 창 en/ko(포커스된 버튼 없음, 개수 없음), 그대로 두기는 아무것도 보내지 않음. - **확인한 것**: 같은 환경에서 확인하면 진행 표시 뒤 done, 한 번에 자동 시작 꺼짐과 daemon 멈춤, `--no-daemon` Codex는 계속 답함, 새로 손으로 연 Codex는 자기 서버로 돌고 세션과 작업 라벨을 받음. - **확인한 것**: B9 라이브. 자동 시작이 꺼진 뒤 손으로 띄운 daemon은 다음 키트 읽기에서 공유 서버 이유와 링크를 만들고, 다시 누르면 멈추기만 하며, 그 뒤 이유가 돌아옴. - **확인한 것**: 소켓 규칙 라이브. `daemon stop`은 끝나기 전에 소켓을 지움(3/3), SIGKILL된 daemon은 소켓을 남기고 `daemon stop`은 `notRunning`으로 답함. - **확인한 것**: SSH device 경로는 desktop e2e(private sshd, 가짜 codex)에서 device의 끄기가 그 device의 daemon을 멈춤. 패키징한 앱으로 `local-kit.spec` 통과(CI는 PR에서 macOS 패키지를 만들지 않음). - **확인한 것**: 바뀐 4 crate는 retry 없이 전부 통과, 전체 workspace nextest(CI의 retry 1)는 통과(retry는 main의 hided opener 테스트뿐), lint, `verify-web.sh`, design contract 통과. 새 테스트는 결함을 심으면 각각 실패. - **확인하지 못한 것**: 실제 Codex로 SSH device에서 멈추기(e2e는 가짜 codex), Mac mini는 쓰지 않음(운영 기계). `daemon bootstrap`으로 관리되는 daemon. - **확인하지 못한 것**: sasu의 전체 `cargo test` suite(S1)는 이 run에서 issue 651 때문에 제외된 채로 남습니다(#669가 고쳤지만 amend는 제외를 되돌리지 못함). 대신 위의 전체 workspace 실행. - **확인하지 못한 것**: 연결이 끊긴 device에서 거절된 확인은 화면에 새로 보이는 것이 없음(로그만, 링크는 남음). <details><summary>추가 증거</summary>  - 후속: main의 테스트 `device_kit::the_latest_agent_switch_wins_over_one_still_queued`의 경쟁 조건은 #689로 남김(이 diff의 경로가 아님). - 후속: 격리 daemon의 자체 업데이트 루프가 검증 도중 0.160.1로 바꿈(daemon 멈춤과는 무관한 upstream 동작). - 코드 리뷰(옵션 C 1차)에서 남긴 것: 키트 읽기마다 `daemon version` 프로세스가 하나 더 돌고, 끄기 pass는 Codex 명령을 여섯 번쯤 차례로 실행합니다(마지막 읽기는 멈춤이 이미 확인한 것을 반복). - 코드 리뷰(옵션 C 1차)에서 남긴 것: core가 요청을 거절하면(헬퍼 연결 안 됨 등) 팝오버에 새로 보이는 것이 없고(로그만), 같은 실패가 다시 오면 진행 표시를 놓친 경우 숨을 수 있습니다. - 코드 리뷰(옵션 C 1차)에서 남긴 것: 잊히는 device에서 대기 중인 끄기를 정리하는 일이 잠깐 Failed 상태를 내보내고, 진행 중인 끄기는 채널 오류가 늦으면 시간 초과(180초)까지 진행 중으로 남습니다. </details> <details><summary>Verification record</summary> - PRD: `agents/prd/codex-daemon-apply/prd.md` (sha256 0855bd5e7604c29a52bb0b47c4402a201ed75b71634e776f7f65067bf34fa250) - Base b520d6e → head bbbded8, verified 2026-10-07T02:35:22.540Z: PASS - Verification report: `agents/runs/codex-daemon-apply/verification-report.json` and `agents/runs/codex-daemon-apply/verification-report.md`; source fingerprint 22fe5e7e3bda4412077198f5916ebc47ab134f32abdc17b3d73ea8cd9eccb767 - Suites: - S1: EXCLUDED `bash scripts/verify-cargo.sh test` - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Reviews: kit-row version (superseded by #668): Fidelity, Code, Security sets and two PR code review rounds, all fixed or listed. Option C (amendment 3): Fidelity, Code and Security on 755c8b4d found three (retry link lost after an unreadable stop failure, uncapped Codex text in logs, quit mid-stop read as stop_failed), fixed in 755c8b4d; all three flagged a failed daemon version read as no daemon, decided by the Observer: no daemon only while the control socket is absent (5f4d6514); follow-up Code+Security review found a crashed daemon's stale socket would block every retry, settled by daemon stop's typed notRunning inside the confirmed turn-off (4c73d043, ad77171a), verdict correct; rebase review on e008417 clean. PR code review round 1 on e008417: two fixed in cc9c309 and bbbded8 (the confirmed stop never decides from the socket and trusts daemon stop's typed answer; the unreachable line no longer claims the setting is unchanged), follow-up review met; four deferred, listed under Evidence. - Evidence: 138 registered (33 screenshot, 101 log, 4 file); paths are local to the run directory - agents/runs/codex-daemon-apply/live/screens/1-running-en.png - agents/runs/codex-daemon-apply/live/screens/2-confirm-en.png - agents/runs/codex-daemon-apply/live/screens/2-confirm-ko.png - agents/runs/codex-daemon-apply/live/screens/4-settled-en.png - agents/runs/codex-daemon-apply/live/screens/5-labels-after-stop-expanded.png - agents/runs/codex-daemon-apply/live/02-scope-after-start.txt - agents/runs/codex-daemon-apply/live/03-before-stop.txt - agents/runs/codex-daemon-apply/live/04-after-stop.txt - agents/runs/codex-daemon-apply/screens/device-e2e/codex-daemon-running.png - agents/runs/codex-daemon-apply/screens/device-e2e/codex-daemon-confirm.png - agents/runs/codex-daemon-apply/screens/device-e2e/codex-daemon-stop-failed.png - agents/runs/codex-daemon-apply/screens/device-e2e/codex-daemon-stopping.png - agents/runs/codex-daemon-apply/screens/device-e2e/codex-daemon-stopped.png - agents/runs/codex-daemon-apply/live/05-after-new-codex.txt - agents/runs/codex-daemon-apply/verify/nextest-ci-workspace.log - agents/runs/codex-daemon-apply/verify/strict-touched-crates.log - agents/runs/codex-daemon-apply/verify/opener-base-b520d6eb.log - agents/runs/codex-daemon-apply/verify/opener-bisect.log - agents/runs/codex-daemon-apply/verify/nextest-ci-workspace-f4baf4ce.log - agents/runs/codex-daemon-apply/verify/strict-touched-crates-f4baf4ce.log - agents/runs/codex-daemon-apply/verify/review-fixes-planted.log - agents/runs/codex-daemon-apply/verify/nextest-ci-workspace-60e83a88.log - agents/runs/codex-daemon-apply/verify/strict-touched-crates-60e83a88.log - agents/runs/codex-daemon-apply/verify/nextest-ci-workspace-1f9417dd.log - agents/runs/codex-daemon-apply/verify/device-kit-stress.log - agents/runs/codex-daemon-apply/verify/nextest-ci-workspace-0402652c.log - agents/runs/codex-daemon-apply/verify/strict-touched-crates-0402652c.log - agents/runs/codex-daemon-apply/verify/round2-device-kit-e2e.log - agents/runs/codex-daemon-apply/verify/round2-planted-e2e.log - agents/runs/codex-daemon-apply/verify/round2-planted.log - agents/runs/codex-daemon-apply/verify/web-0402652c.log - agents/runs/codex-daemon-apply/screens/device-e2e-round2/codex-daemon-confirm.png - agents/runs/codex-daemon-apply/screens/device-e2e-round2/codex-daemon-running.png - agents/runs/codex-daemon-apply/screens/device-e2e-round2/codex-daemon-stop-failed.png - agents/runs/codex-daemon-apply/screens/device-e2e-round2/codex-daemon-stopped.png - agents/runs/codex-daemon-apply/screens/device-e2e-round2/codex-daemon-stopping.png - agents/runs/codex-daemon-apply/verify/lint-a3e7140b.log - agents/runs/codex-daemon-apply/verify/nextest-ci-a3e7140b.log - agents/runs/codex-daemon-apply/verify/strict-touched-a3e7140b.log - agents/runs/codex-daemon-apply/verify/git-fixture-signing-a3e7140b.log - agents/runs/codex-daemon-apply/verify/verify-web-a3e7140b.log - agents/runs/codex-daemon-apply/verify/policy-a3e7140b.log - agents/runs/codex-daemon-apply/verify/device-kit-e2e-a3e7140b.log - agents/runs/codex-daemon-apply/screens/merged-device-kit-a3e7140b/codex-daemon-running.png - agents/runs/codex-daemon-apply/screens/merged-device-kit-a3e7140b/codex-daemon-confirm.png - agents/runs/codex-daemon-apply/screens/merged-device-kit-a3e7140b/codex-daemon-stopping.png - agents/runs/codex-daemon-apply/screens/merged-device-kit-a3e7140b/codex-daemon-stop-failed.png - agents/runs/codex-daemon-apply/screens/merged-device-kit-a3e7140b/codex-daemon-stopped.png - agents/runs/codex-daemon-apply/verify/strict-touched-51c416ff.log - agents/runs/codex-daemon-apply/verify/lint-51c416ff.log - agents/runs/codex-daemon-apply/verify/build-bins-51c416ff.log - agents/runs/codex-daemon-apply/verify/device-kit-e2e-51c416ff.log - agents/runs/codex-daemon-apply/screens/merged-device-kit-51c416ff/codex-daemon-confirm.png - agents/runs/codex-daemon-apply/screens/merged-device-kit-51c416ff/codex-daemon-stopping.png - agents/runs/codex-daemon-apply/screens/merged-device-kit-51c416ff/codex-daemon-stopped.png - agents/runs/codex-daemon-apply/verify/review1-fixes-before-8dde1c3e.log - agents/runs/codex-daemon-apply/verify/review1-fixes-after-8dde1c3e.log - agents/runs/codex-daemon-apply/verify/review1-strict-touched-8dde1c3e.log - agents/runs/codex-daemon-apply/verify/review1-strict-touched-signing-config-8dde1c3e.log - agents/runs/codex-daemon-apply/verify/review1-lint-8dde1c3e.log - agents/runs/codex-daemon-apply/verify/review1-verify-web-8dde1c3e.log - agents/runs/codex-daemon-apply/verify/review1-design-contract-8dde1c3e.log - agents/runs/codex-daemon-apply/verify/review1-device-kit-e2e-8dde1c3e.log - agents/runs/codex-daemon-apply/screens/review1-device-kit-8dde1c3e/codex-daemon-stop-failed.png - agents/runs/codex-daemon-apply/screens/review1-device-kit-8dde1c3e/codex-daemon-stopping.png - agents/runs/codex-daemon-apply/screens/review1-device-kit-8dde1c3e/codex-daemon-stop-failed-row.png - agents/runs/codex-daemon-apply/screens/review1-device-kit-8dde1c3e/codex-daemon-stopping-row.png - agents/runs/codex-daemon-apply/verify/review1b-before-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/review1b-after-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/review1b-lint-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/review1b-strict-touched-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/review1b-device-kit-e2e-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/review1b-package-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/review1b-local-kit-e2e-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/final-package-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/final-local-kit-e2e-6ef5f8ed.log - agents/runs/codex-daemon-apply/verify/final2-strict-hide-host-f5facb4e.log - agents/runs/codex-daemon-apply/live-c/02-scope-after-start.txt - agents/runs/codex-daemon-apply/live-c/03-before-stop.txt - agents/runs/codex-daemon-apply/live-c/screens/2-popover-en.png - agents/runs/codex-daemon-apply/live-c/screens/3-confirm-en.png - agents/runs/codex-daemon-apply/live-c/screens/3-confirm-ko.png - agents/runs/codex-daemon-apply/live-c/04-go.txt - agents/runs/codex-daemon-apply/live-c/screens/4-answer-en.png - agents/runs/codex-daemon-apply/live-c/05-after-stop.txt - agents/runs/codex-daemon-apply/live-c/06-after-new-codex.txt - agents/runs/codex-daemon-apply/live-c/screens/5-settled-en.png - agents/runs/codex-daemon-apply/live-c/07-b9.txt - agents/runs/codex-daemon-apply/live-c/08-b9-second-request.txt - agents/runs/codex-daemon-apply/live-c/screens/6-b9-popover-en.png - agents/runs/codex-daemon-apply/live-c/core.jsonl - agents/runs/codex-daemon-apply/e2e-c/device-kit.log - agents/runs/codex-daemon-apply/e2e-c/hide-desktop-kit-HgtUMT-daemon.jsonl - agents/runs/codex-daemon-apply/verify/c-strict-tests-3.log - agents/runs/codex-daemon-apply/verify/c-strict-letter-origin-rerun.log - agents/runs/codex-daemon-apply/verify/c-mutation-run.log - agents/runs/codex-daemon-apply/verify/c-mutation-run-2.log - agents/runs/codex-daemon-apply/verify/c-mutation-run-3.log - agents/runs/codex-daemon-apply/verify/c-lint.log - agents/runs/codex-daemon-apply/verify/c-verify-web-3.log - agents/runs/codex-daemon-apply/verify/c-design-contract-2.log - agents/runs/codex-daemon-apply/review-c/review-set.md - agents/runs/codex-daemon-apply/verify/c-review-fix-tests-2.log - agents/runs/codex-daemon-apply/verify/c-review-fix-mutation.log - agents/runs/codex-daemon-apply/verify/c-lint-2.log - agents/runs/codex-daemon-apply/verify/c-workspace-nextest.log - agents/runs/codex-daemon-apply/e2e-c/local-kit.log - agents/runs/codex-daemon-apply/verify/c-strict-tests-final.log - agents/runs/codex-daemon-apply/verify/c-socket-tests.log - agents/runs/codex-daemon-apply/verify/c-socket-mutation-a.log - agents/runs/codex-daemon-apply/verify/c-socket-mutation-b.log - agents/runs/codex-daemon-apply/verify/c-strict-tests-socket.log - agents/runs/codex-daemon-apply/verify/c-ssh-hosts-rerun.log - agents/runs/codex-daemon-apply/verify/c-lint-3.log - agents/runs/codex-daemon-apply/live-c/09-socket-live.txt - agents/runs/codex-daemon-apply/verify/c-socket-tests-2.log - agents/runs/codex-daemon-apply/verify/c-socket-mutations-2.log - agents/runs/codex-daemon-apply/verify/c-strict-tests-socket-2.log - agents/runs/codex-daemon-apply/verify/c-lint-4.log - agents/runs/codex-daemon-apply/review-c/review-socket.md - agents/runs/codex-daemon-apply/verify/c-socket-tests-3.log - agents/runs/codex-daemon-apply/verify/c-socket-mutation-widen.log - agents/runs/codex-daemon-apply/verify/c-lint-5.log - agents/runs/codex-daemon-apply/review-c/review-rebase.md - agents/runs/codex-daemon-apply/verify/c-rebase-strict.log - agents/runs/codex-daemon-apply/verify/c-rebase-lint.log - agents/runs/codex-daemon-apply/verify/c-rebase-verify-web.log - agents/runs/codex-daemon-apply/verify/c-rebase-design.log - agents/runs/codex-daemon-apply/e2e-rebase/device-kit.log - agents/runs/codex-daemon-apply/verify/c-r1-strict.log - agents/runs/codex-daemon-apply/verify/c-r1-codex-trust-rerun.log - agents/runs/codex-daemon-apply/verify/c-r1-mutation.log - agents/runs/codex-daemon-apply/verify/c-r1-lint.log - agents/runs/codex-daemon-apply/verify/c-r1-verify-web.log - agents/runs/codex-daemon-apply/verify/c-r1-design.log - agents/runs/codex-daemon-apply/review-c/review-r1.md - agents/runs/codex-daemon-apply/verify/c-r1-tests-2.log - agents/runs/codex-daemon-apply/verify/c-r1-lint-2.log - Changed paths: 348 (see Files changed) </details>
yansfil
added a commit
that referenced
this pull request
Oct 7, 2026
…nce (#664) Related: core-host-node 1/5 (항상 켜진 노드에서 core 돌리기). origin/main 2c15edb 위로 rebase했습니다. #661과 #669는 main에 들어가서 이 PR에서 빠졌습니다. 저장소의 attribution 검사에 걸린 커밋 문구 두 개(제품 이름)만 고쳐 head가 b5ddca5e로 바뀌었고, tree는 030b1867과 같습니다. ## Summary core는 자기 기계를 `local`이라는 문자열로 불렀습니다. 그래서 기기 행, 등록, 폴더 owner mark, 라벨 키, 편지, 프로젝트 id에 모두 `local`이 박혀 있었고, core를 다른 기계로 옮기면 어느 기계의 것인지 가릴 수 없었습니다. 이제 core는 자기 기계를 node id(그 기계 `machine_id`의 소문자)로 부릅니다. device를 적지 않은 이벤트는 여전히 core 자신의 node를 뜻하고, `local`을 명시하면 모르는 기기로 보고 거절합니다. `local`로 쓰인 상태 폴더는 hided가 core를 띄우기 전에 한 번 변환합니다. - JSON 저장소는 원자적으로 다시 씁니다. - Memory, 세션 검색, 링크 기록(#638)은 SQLite 트랜잭션 하나로 키를 다시 붙입니다. - 원본은 `node-migration-backup/<ms>/`에 남깁니다. - 마지막에 `node.json`에 폴더의 주인 node를 적습니다. 변환하지 못하면 원본은 그대로 남고, 앱 창이 어느 파일 때문에 시작하지 못했는지 보여 줍니다. ```text Can't connect to hided hided could not start because of this file, which was left unchanged. <state folder>/node.json [Retry] ``` 화면 캡처에는 워크스테이션의 사용자 이름과 경로가 보여서 올리지 않았습니다. 캡처는 로컬 run 기록에 있습니다. ## Review - **정해진 것(운영자 결정)**: `node.json`은 "이 폴더에서 qualify되지 않은 키를 가진 node"를 뜻하고, 다른 node 이름이 적힌 폴더(새 Mac, Migration Assistant로 옮긴 폴더)는 layer 5의 옮기기와 되돌리기가 다룹니다. 그때까지는 그 파일을 보여 주며 시작을 거절하는 지금 동작을 유지합니다. 형식은 layer 5에서 바뀌지 않습니다(D-23). - **판단해 주세요**: 세션 검색 인덱스(운영 기계에서 170 MB)는 백업하지 않습니다. 새 키에 이미 행이 있으면 새 행을 남기고 옛 행을 지운 뒤 개수를 기록합니다. 옛 Copied history 설정도 이 규칙을 따릅니다. - **판단해 주세요**: 프로젝트 id가 node id를 해시에 넣으므로, 변환 전에 transcript에 찍힌 Memory receipt는 더 이상 검증되지 않습니다. - **조심해서 볼 파일**: `herdr-core/src/node_migration.rs` (failure path) - 저장소 하나라도 변환에 실패하면 시작을 멈춥니다. - 재시도하면 수렴합니다. pair는 지금의 Memory와 등록에서 다시 얻고, 백업은 같은 폴더에 한 번만 남깁니다. - 변환된 인덱스는 읽기만 합니다. - **조심해서 볼 파일**: `hided/src/cli.rs` `wait_healthy`. `hide connect`는 자기가 띄운 daemon이 먼저 끝나면 10초를 기다리지 않습니다. 대신 Logs에서 그 pid가 spawn 이후에 쓴 거절 기록을 읽어 `state_refused`로 답합니다. - **조심해서 볼 파일**: `herdr-core/src/checkout_owner.rs` (Herdr contract). owner mark가 node id로 바뀌고, 기존 `local` mark도 이 node의 것으로 읽습니다. - **조심해서 볼 파일**: rebase 뒤 main이 더한 코드에서 이 기계를 `"local"`로 부르던 곳(adea3d9, 문구를 고치기 전 e3f0688). `herdr-core/src/runtime/kit.rs`(Codex CLI shared server 끄기와 에이전트 연결 읽기), `herdr-core/src/runtime/agents.rs`, `web/src/PaneConnection.tsx`, `web/src/settings/{AgentsTab,DevicesTab,HideAiTab,agentRows}.ts*`가 이제 node id 또는 기기 행의 kind로 이 기계를 찾습니다. main의 동작은 바꾸지 않았습니다. - **조심해서 볼 파일**: `desktop/src/main/browser.ts`. node id를 받기 전에는 loopback 페이지를 원격 파티션에 두고, id가 오면 파티션이 바뀐 페이지를 다시 만듭니다. - **질문**: 기계 id가 바뀐 Mac(새 Mac 설정, 재설치)은 자기 옛 폴더를 다른 node의 것으로 보고 거절합니다. 지금은 창에 파일을 보여 주고 문서로 "새 state 폴더로 시작"을 안내합니다. 이 경우는 layer 5의 move/restore가 맡는 것으로 보면 될까요? - **질문**: daemon frame에 `node_id`를 더하지 않았습니다(웹은 자기 기기 행에서 읽습니다). layer 4에서 화면의 node와 core의 node가 갈라질 때 더하려고 합니다. - **질문**: snapshot wire의 pane과 checkout id qualify는 layer 4의 요구사항으로 남깁니다. ## Evidence - **확인한 것**: `sasu implement verify` PASS on bce1a82(S1 Rust 전체 suite, S2 lint). 지금 head f422844b는 main #722, #725 위로 rebase만 한 것입니다. range-diff로 본 차이: #725가 없앤 checkout caller의 pane hint 코드에 있던 node 고정이 함께 빠졌고, 배달 권한 목록은 #725의 pane 조건과 node id 확인을 함께 둡니다. #725가 더한 테스트 5곳은 `TEST_NODE`로 고정했습니다. 그 head에서 herdr-core와 hided 테스트 1982/1982, workspace lint 통과. - **확인한 것**: main이 더한 테스트의 fixture 경쟁을 고쳤습니다(bce1a82, 제품 동작 변경 아님, issue 641 영역). 가짜 Codex CLI app-server의 `hang` 모드가 `hooks/list`를 받은 뒤에야 자식을 띄워서, load 65에서 요청 한도가 먼저 끝나면 시간 초과 테스트가 자식을 찾지 못했습니다. 자식을 시작 때 띄우게 했고, 요청 한도 50 ms에서 옛 fixture는 실패, 새 fixture는 통과합니다. - **확인한 것**: rebase한 head에서 clippy 통과, Rust workspace nextest 2804/2805. 남은 1건 `hided` `opener_lifecycle::acceptance_timeout_ends_cli_spawned_before_watcher`는 load 24에서 실패했고, 단독 5회 반복(load 24에서 34)에서 4/5 통과, 1회는 20초 pid 대기 deadline에서 실패했습니다. 이 PR은 `hided`의 spawn과 opener를 바꾸지 않습니다. - **확인한 것**: web(129 files, 1164)과 desktop(16 files, 158) typecheck, lint, unit, build 통과(rebase 뒤). - **확인한 것**: 변환 계약 테스트 - `KEYS`의 모든 키에 fixture 값이 있습니다. - 다시 쓴 키에서는 `local`이 사라지고, node 소유 키는 그대로입니다. - `KEYS`와 `UNBOUND` 어디에도 없는 파일이 있으면 실패합니다. - 재시도 수렴, 충돌 시 rollback, 백업 1부, 변환된 폴더를 다른 writer가 잡고 있어도 시작되는 경우를 다룹니다. - **확인한 것**: 69693b51의 debug hided로 운영자 `~/.hide/state`의 새 복사본을 변환했습니다(HOME 격리, Herdr 없음, 상태 폴더 0700). - core-state, ledger, labels, workspace-views의 `"local"` 13/481/1/225가 0이 되었고, Memory 2개 프로젝트와 세션 검색 20,925행의 키를 다시 붙였습니다(버린 행 0). - 변환 후 ledger를 읽었고, 두 번째 시작은 아무것도 변환하지 않았으며 백업 폴더도 1개 그대로였습니다. - 운영자 원본 ledger, workspace-views, Memory의 mtime과 sha256은 그대로였습니다. 운영자 폴더에는 node.json도 백업도 생기지 않았습니다. - **확인한 것**: 네이티브 QA. 설치된 빌드(b520d6e)가 격리 Herdr에서 쓴 폴더를 candidate 앱이 열었습니다. - This Mac 아래에 두 프로젝트가 보였습니다. - 같은 Herdr workspace id와 두 번째 탭이 유지되었습니다. - 다른 node 폴더는 0.3초 만에 파일을 보여 주었습니다. - **확인한 것**: rebase 전 web e2e 186/187. rebase 뒤 main이 더한 `agents-tab`, `devices-settings` spec 6건 중 5건 통과, desktop e2e(focus 제외) 55 통과 7 skip 1 실패(아래 dense hover). `home-layout` 통과, `local-kit`은 패키지된 앱이 필요해 로컬에서 skip. Herdr schema contract(0.9.1), Herdr pin single source, design contract, workstation identity, harness anchor, capability readers, worktree removal boundary 통과. - **확인하지 못한 것**: 이 diff 밖에 있고 main에서도 재현되는 실패들입니다. 고치지 않았습니다. - flaky #653 view-bookmarks: 전체 실행에서 1회 실패했고, 단독 2/2 통과. - desktop terminal-links dense hover: 이 노트북 화면에서 창이 184 columns라 필요한 215를 넘지 못합니다. - web e2e `agents-tab` 목록 테스트: kit이 `/opt/homebrew/bin`도 찾는데 이 Mac에 OpenCode가 있어 Installed가 4가 아니라 5입니다. - `hide-platform` watch burst(#651): main의 #669가 고쳤습니다. 그 전 head들의 실패는 아래 Verification record에 남겼습니다. - **확인하지 못한 것**: 운영자의 실제 링크 기록 레이아웃. 설치된 앱이 #638 이전 빌드라 `links.sqlite3`가 없어서 fixture 계약 테스트로만 확인했습니다. - **확인하지 못한 것**: `check-herdr-contract.sh`의 실행 중 서버 확인. 이 PR은 Herdr 호출을 바꾸지 않습니다. <details><summary>리뷰와 처리</summary> rebase 뒤 리뷰(adea3d9, 문구를 고치기 전 e3f0688): 충돌 해결이 main과 layer 1의 동작을 모두 지켰는지, main이 더한 코드의 `local`이 모두 node id로 바뀌었는지, 명시한 `local`이 어디서도 통과하지 않는지 봤고 Fix now는 없었습니다. 따라온 두 가지는 030b1867에서 고쳤습니다: 이 Mac을 `local`로 적던 기기 id 주석, 그리고 활성 Memory 항목의 검색 행까지 옮기는 변환 테스트. Fidelity, Code, Security 리뷰를 두 라운드 돌렸습니다(62b777c, e071177). Fix now 항목은 모두 이 PR에서 고쳤고, 고친 diff를 본 세 번째 라운드(4c287ce)는 Fix now가 없었습니다. - 재시도 수렴, 조용한 `UPDATE OR IGNORE`, FTS 고아 행: 2c3f5c7, 4c287ce. - `KEYS` 누락 필드와 `UNBOUND` 분류: 2c3f5c7. - B2 창 표시: d63dd60. - 매 시작마다 잡던 검색 인덱스 쓰기 잠금, 재시도마다 늘던 백업, pid만으로 맞추던 거절 기록: 4c287ce. CI `windows check`가 4c287cec부터 실패했습니다. Windows 전용 hook 테스트가 Project를 아직 `local`로 만들고 있었기 때문이고, 06b2425f에서 node id로 바꿨습니다. 코드 리뷰 1라운드(4c287ce) 처리는 69693b51입니다. - 두 이름으로 쓰인 `device_expanded_paths` 목록은 합칩니다(전에는 옛 목록을 버렸습니다). - 더 긴 node id 때문에 ledger가 loader 한도(16 MiB)를 넘게 되면 시작을 멈추고 파일을 알려 줍니다. - 밀려난 `#[cfg(unix)]`를 브라우저 alias 테스트에 되돌렸고, `hide connect` 거절 테스트를 unix 전용으로 했습니다. - 4라운드(f93ef22 네이티브 리뷰) 처리는 6605c78c입니다. ledger 크기 확인을 어떤 파일도 쓰기 전에 하므로, 거절되면 모든 파일이 제자리에 그대로 남습니다. 이미 한도를 넘은 ledger는 loader에 맡기고, 거절 문구에 해결 방법을 적었습니다. 목록 합치기와 중복 제거는 선형이고, node 경계 테스트는 다시 모든 OS에서 돕니다. - 2라운드(69693b5) 처리는 c85aeef4입니다. `expanded_inactive_project_device_ids`가 이미 node를 담고 있으면 변환 뒤에도 한 번만 남깁니다. - 2라운드에서 바꾸지 않은 것: core-state 8 MiB 한도(그 한도는 제거된 native 앱의 상태 파일에만 적용되고 core-state에는 loader 한도가 없음), 이전 앱이 다시 쓴 `local` 행과의 Memory/링크 충돌(아래 후속), 10초 health 창 안의 큰 변환(아래 후속), 등록도 Memory도 없는 프로젝트의 Sessions mode(기본값으로 돌아가고 인덱스는 다시 만듦), `hide-kit` `search_path`(이 diff 밖), 브라우저 partition(위 Review 파일). - 바꾸지 않은 것: hook이 실행마다 기계 id를 읽는 비용(`ioreg` 0.01초, hook은 hide-kit에 의존할 수 없음), `node.json` 해석과 desktop/web 동시 배포(위 Review 질문). 후속으로 남긴 것: - 일반 `daemon.start_failed` 기록. - `try_wait` 오류 처리. - 큰 변환이 10초를 넘을 때의 Retry 안내. - 롤백한 빌드가 다시 쓴 `local` 행의 Memory와 링크 충돌. 지금은 시작을 멈추고 파일을 알려 줍니다(layer 5). - 등록도 Memory도 없는 프로젝트의 Sessions mode 키. - 실패한 백업 복사의 `.partial` 정리와 rename 전 fsync. - 검색 FTS 고아 행을 직접 세는 테스트. - `node.json`이 있는 폴더에서 실패를 재시도할 때 백업 폴더 재사용. </details> <details><summary>테스트 고정값 변경 (PRD changes the wire id, D-21)</summary> 아래 파일에서는 `local` 고정값만 node id로 바꿨습니다. Rust는 `crate::node::TEST_NODE`, e2e는 daemon의 `node.json`, web 단위 테스트는 helper의 node 인자를 씁니다. assertion은 바꾸지 않았습니다. - Rust: `herdr-core/src/runtime/tests.rs`, `herdr-core/src/runtime/tests/*`(26 files), `herdr-core/src/labels/tests.rs`, `herdr-core/src/session_sync/tests.rs`, `hided/tests/mobile.rs`, `hide-agent-hooks/tests/windows_hook_command.rs`(Windows 전용이라 macOS 검색에서 빠졌고, 06b2425f에서 고침). inline test module도 바꿨습니다: `workspace.rs`, `runtime/delivery.rs`, `coordination/executor.rs`, `delivery/worker.rs`, `live.rs`, `files.rs`, `labels/import.rs`, `changes.rs`, `runtime/attachments.rs`. - web: `web/e2e/{device-rail,home,mobile,s3,s7,start-panel}.spec.ts`, `web/e2e/hided-fixture.ts`, `web/src/{RequestView,addProject,areaCycle,buffers,linkPanel,numbering,revealExternal,store,viewLayout,workspaceManage}.test.*`. - desktop: `desktop/e2e/{add-project,agent-spawn,browser,device-home,home-layout,local-kit,remote-workspace,workspace-columns}.spec.ts`, `desktop/src/main/{browser,browserSync}.test.ts`. - 두 번째 rebase 뒤 main이 더한 Factory 코드와 테스트: `herdr-core/src/runtime/delivery.rs`, `herdr-core/src/runtime/factory.rs`, `herdr-core/src/delivery/watch.rs`, `herdr-core/src/coordination/mod.rs`의 테스트, `web/e2e/agents-tab.spec.ts`의 session 수 단계. 운영 코드에서는 Factory의 수신자(`Actor::factory`)가 core의 node id를 받고, `hide factory` 명령의 기기 확인이 `"local"` 대신 core의 node id와 비교합니다(5d343e0). - rebase 뒤 main이 더한 테스트: `herdr-core/src/runtime/tests/{agent_connection,agents_settings_remote,lineage,ui_state_focus}.rs`, `web/e2e/{agents-tab,devices-settings}.spec.ts`, `desktop/e2e/{home-layout,local-kit}.spec.ts`의 Connection details 단계. 새 테스트만 더한 파일입니다: `hided/tests/node_owner.rs`, `hide-session/tests/search.rs`, `desktop/e2e/desktop.spec.ts`, `desktop/src/main/cli.test.ts`. </details> <details><summary>Verification record</summary> - rebase 2와 3: b5ddca5e에서 origin/main 3ee278f(#700, #702, #705, #706, #713, #715, #724 포함)로 옮겼고, 그때 head는 34c44011이었습니다. 충돌 파일: `herdr-core/src/delivery/worker.rs`, `herdr-core/src/runtime/delivery.rs`, `herdr-core/src/runtime/tests/agent_connection.rs`, `web/e2e/agents-tab.spec.ts`, `desktop/e2e/home-layout.spec.ts`(main의 동작에 node id를 더해 해결). - main이 더한 코드의 node id: Factory의 수신자와 `hide factory` 기기 확인(667a25c 계열), main의 자기 기기 fixture 5곳과 #724의 show-here 테스트(e88caa6, 2a929dc). `hide factory`의 기기 확인은 core 한 곳에서만 하고, Factory가 없을 때도 다른 기기는 main처럼 `factory_local_only`를 먼저 받습니다. - rebase 뒤 리뷰(667a25c): Fidelity, Security Fix now 없음. Code Fix now 1(main의 자기 기기 fixture가 `"local"`로 남음) e88caa6c에서 고침. 후속: `factory_local_only` 테스트, move 층에서 `factory:` actor의 node id 다시 쓰기, 저장된 등록이 core node와 같은 id일 때 연결에서 거르기. - `sasu implement verify` PASS on 667a25c(S1, S2). 그 전 head 5d343e0e에서는 load 30 이상에서 main의 `gh` 5초, `lsof` 10초 시간 초과와 harness 정리 단계의 `kill EPERM`으로 세 번 실패했고, 각 테스트는 단독으로 통과했습니다. 2a929dcd에서는 main의 GitHub 테스트가 가짜 `gh`에 준 5초 기한이 load 아래에서 다시 넘어, 34c44011에서 같은 파일의 `FIXTURE_DEADLINE`(10초)으로 맞췄습니다(GitHub 테스트 46/46). `sasu implement verify` PASS on 34c4401(S1, S2, load 14). - rebase 4: origin/main bcfce96(#656, #716 포함)로 옮겼고, 그때 head는 9cf059c6이었고, 그 뒤 fmt 49deea1, fixture bce1a825를 더했습니다. 충돌 파일: `herdr-core/src/runtime/tests/agent_connection.rs`, `herdr-core/src/runtime/agents.rs`(main의 동작에 node id를 더해 해결). #656이 더한 Codex CLI shared server 끄기의 자기 기기 확인(`runtime/kit.rs`, 연결된 helper가 필요 없는 쪽)을 core의 node id로 바꿨고, 그 테스트 9곳의 `"local"`을 `TEST_NODE`로 고정했습니다(9cf059c). web 단위 테스트 `PaneConnection.test.tsx`의 `"local"`은 snapshot이 주는 기기 id 데이터라 그대로 두었습니다(다른 web 단위 테스트와 같음). - main이 더한 테스트의 fixture 경쟁 수정(bce1a82, 제품 동작 변경 아님, issue 641 영역): `hide-agent-hooks/tests/fixtures/fake-codex.py`의 `hang` 모드가 자식 프로세스를 `hooks/list`를 받은 뒤에야 띄워서, load 65에서 1.5초 요청 한도가 먼저 끝나면 `a_codex_that_does_not_answer_is_stopped_and_nothing_of_it_is_left`가 "it started a child"로 실패했습니다(verify 49deea1). 자식을 stand-in 시작 때 띄우게 바꿨습니다. 요청 한도를 50 ms로 줄이면 옛 fixture는 같은 panic으로 실패하고 새 fixture는 통과합니다. 테스트의 주장(시간 초과 뒤 app-server와 자식이 모두 끝남)은 그대로입니다. `sasu implement verify` PASS on bce1a82. - rebase 5: origin/main 411f34a(#722, #725 포함)로 옮겼고, 지금 head는 f422844b입니다. 충돌 파일: `herdr-core/src/runtime/delivery.rs`, `herdr-core/src/runtime/workspace_control.rs`, `herdr-core/src/runtime/factory.rs`. #725가 checkout caller의 pane hint를 없앴으므로 main 쪽을 따랐고, 배달 권한 목록의 자기 기기 확인만 node id로 바꿨습니다. #725가 더한 테스트의 `"local"` 5곳을 `TEST_NODE`로 고정했습니다(f422844). 관련 테스트 128/128. - rebase: 옛 head 6605c78(base 104d308, #661 e071177f와 #669 f93ef22 포함)에서 새 base origin/main 2c15edb0로 옮겼고, 새 head는 e3f06887입니다. 두 carried commit은 빠졌습니다. 충돌 파일: `herdr-core/src/{lib.rs,labels/mod.rs,runtime/kit.rs,runtime/memory.rs,runtime/tests/lineage.rs}`, `web/src/{IssueDialogs.tsx,SettingsSheet.tsx,settings.ts}`, `desktop/e2e/{local-kit,home-layout}.spec.ts`. - `sasu implement verify` PASS: e3f0688(S1 229.2s, rebase 뒤). 030b1867은 주석과 `hide-memory` 테스트 1건만 더했고, 그 테스트와 clippy, web lint를 따로 돌렸습니다, 6605c78(S1 179.9s), f93ef22(S1 192.6s), 4c287ce. rustc 1.99.0. - 네이티브 Fidelity, Code, Security 리뷰: 4c287ce, f93ef22, 6605c78c에서 Fix now 없음. - #669 이전 head의 S1 실패 기록(모두 `hide-platform/tests/watch.rs` `a_burst_is_bounded_and_ends_in_an_overflow_rather_than_silence`만 실패, S2 통과): - 69693b5: 6,311에서 8,047 changes가 3회, load 11-16. 그 전 1회는 `hide-kit` 하위 프로세스 timeout 3건이었고 단독 실행으로 통과했습니다. - c85aeef: 7,396 changes(load 6.5에서 12.4), 8,807 changes(load 7.1에서 9.5). - main 재현: load 14에서 3/3. - 운영자 상태 복사본 변환: 69693b51의 debug hided(sha256 3aac76ed...). - 네이티브 QA: a7a3d80f의 candidate 앱. - 마지막 sasu verify head: bce1a82. 그 뒤 바뀐 것(range-diff bcfce96..bce1a82 vs 411f34a..f422844): 1, 3, 17번 commit의 충돌 해결(#725 쪽을 따름), 새 commit f422844(#725 테스트 5곳 `TEST_NODE`). herdr-core와 hided nextest 1982/1982, `scripts/verify-cargo.sh lint` 통과 on f422844. </details> ## Breaking change - 상태 폴더(`~/.hide/state`, `~/Library/Application Support/hide`의 Project Memory)는 첫 시작에 한 번 변환됩니다. 이전 앱으로 돌아가면 이 Mac의 프로젝트가 다른 기기의 것으로 보입니다. 되돌리려면 `node-migration-backup/<ms>/`의 파일을 제자리에 복사합니다(`docs/INSTALL.md`). - daemon wire나 `hide` 명령에서 `device_id: "local"`을 명시하면 이제 모르는 기기로 거절됩니다. device를 적지 않으면 지금처럼 이 기계를 뜻합니다.
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 #651
Summary
hide-platform/tests/watch.rs의 burst 테스트가 부하 걸린 macOS에서 "8238 changes for one burst"로 실패해, 이 Mac의 전체 Rust suite와 sasu verify가 어느 브랜치에서든 막혔습니다.CAPACITY+ 1"을 기대한 것입니다. reader가 overflow를 읽고 나면 시스템이 아직 보내는 같은 burst가 다시 줄을 섭니다.CAPACITY개까지이고, 넘으면 하나의Overflow로 접히며, 잃은 변경은 침묵이 아닙니다. burst가 시간에 걸쳐 내는 변경 수에는 상한을 두지 않습니다.watch.rs단위 테스트 세 개로 검증합니다. 통합 테스트는 시스템 쪽 주장인 "10,000개 파일은 overflow로 끝나고 watch는 살아 있다"만 확인합니다.docs/ARCHITECTURE.md의 "a burst costs a bounded number of changes"를 같은 계약으로 고쳤습니다.Review
hide-platform/tests/watch.rs- OS 계약 테스트라 macOS, Linux, Windows에서 모두 돕니다. 총수 assert를 빼고 overflow 도착을ARRIVES안의 이벤트로 기다립니다.hide-platform/src/watch.rs- 제품 코드는 바뀌지 않았고 doc 주석과#[cfg(test)]모듈만 더했습니다.Evidence
hide-platform전체 nextest 205/205 통과,--stress-count 5로 5회 반복 통과, watch 테스트만--stress-count 6(16 threads) 6회 통과. 모두 load 10-11.lost()가 overflow를 남기지 않게 하면 통합 테스트가 "no overflow among 1808 changes"로 실패합니다.cargo fmt --check,clippy -p hide-platform --all-targets -D warnings, workstation identity, attribution, harness ignore anchor 검사 통과.hide-host/tests/git.rs가 서명하는 전역 git 설정에서 실패하는 별개 문제가 있고, #656이 고칩니다).