Skip to content

Move the core to another machine and back from the window - #961

Merged
yansfil merged 140 commits into
mainfrom
spec/core-host-node-move
Oct 12, 2026
Merged

yansfil merged 140 commits into
mainfrom
spec/core-host-node-move

Conversation

@yansfil

@yansfil yansfil commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Related: core-host-node 5단계(core-host-node-move). 선행 PR #898(4단계, 다른 기기 core의 node로 도는 hided), #836(3단계). 관련 이슈 with-hide/hide-private#75, with-hide/hide-private#74, with-hide/hide-private#84. #966은 이 브랜치 위에서 D-29(이동 뒤 node 프로젝트의 Issues, New issue, worktree 정리)를 채웁니다. Follow-up은 with-hide/hide-private#72(리뷰에서 남긴 항목, 번호는 그 이슈와 같음. main merge의 리뷰 4라운드에서 50-53), with-hide/hide-private#71(node 창이 같은 Mac을 화면마다 다르게 부름. 그래프와 시작 시트 포함), with-hide/hide-private#70(gh 로그아웃 때 Local 프로젝트의 이슈 출처), with-hide/hide-private#69(Project Memory 2라운드. SessionStart payload 지연과 hide memory 요청 schema)에서 추적합니다.

Fixes #962: 실패한 pull 여정은 journal이 rolled_back이 된 뒤 node 역할을 기한 안에서 기다립니다(rollback은 node 역할을 켜기 전에 journal을 씁니다). remove_staging은 파일 아래의 경로를 이미 없는 것으로 보아, 그 rollback이 rollback.unclean 없이 깨끗하게 끝납니다(다음 이동의 staging은 그 파일에서 실패하고 이름을 댑니다).

Fixes #986: hided는 끝나기 전에 diagnostic 기록 큐를 비웁니다(diagnostics::drain, 1초 안에서). 이 프로세스가 연 writer를 모두, 다시 설치되어 교체된 것까지 기다리고, 그 시간을 넘긴 writer는 stderr에 diagnostics.drain_timed_out 한 줄로 남깁니다. main의 모든 종료(0, 2)와 멈춤을 확인하지 못한 종료(3) 앞에서 비우며, main 밖으로 나가는 panic과 SIGKILL은 다루지 않습니다.

Summary

설정 > 기기에서 연결된 기기의 ⋯ 메뉴 core를 이 기기로 옮기기…로 core(상태와 기록)를 그 기기로 옮기고, 그 기기 node 창의 되돌리기로 이 Mac에 다시 가져옵니다.
옮기기 전에 대상 기기를 확인하고(연결, 다른 node, 대상 상태 폴더, Herdr, 신원, 빌드, gh와 Hide AI 로그인, GUI 세션, 잠자기), 하나라도 실패하면 아무것도 바꾸지 않습니다.
core는 어느 순간에도 하나만 돕니다: 원래 core를 멈추고, 복사본을 놓고, 대상 core를 pending으로 켠 뒤 이 Mac의 node가 붙어야 확정하며, 그 전의 실패는 원래 core로 되돌립니다.
core가 멈추면 그 기기의 터미널 세션도 함께 닫혀, 새 core가 같은 pane을 다시 엽니다.
창은 새로고침 없이 이동을 따라가고(W1 띠: 다섯 단계, 입력 잠김) 새 core에 다시 붙습니다. 대상 기기에서는 login item이 core를 켜 두고, 앱이 더 새로우면 core 기기를 업데이트합니다(B10).
상대 기기가 링크를 받은 뒤 답하지 않으면 운영자가 그만 기다리기로(되돌리기에서는 여기로 가져오기) 기다림을 끝낼 수 있습니다.

옮기는 동안 창 위 W1 띠 (native, Light)
옮기는 동안 창 위 띠가 단계와 입력 잠김을 보이고, 상대가 답하지 않으면 끝에 그만 기다리기가 붙습니다.

Review

  • 판단해 주세요 (main merge, b70d00a, cf6c98e, 9596ea1): #985의 이 기기 전용 Memory 검사(D-22, B16)를 inbound linked node에도 열었습니다(B14, Q20). 다이얼한 기기는 여전히 memory_device_unsupported입니다. 그대로 두면 이동 뒤 MacBook에서 Memory 탭, hide memory, 분석이 사라지기 때문입니다.
    다이얼한 기기의 거절이 남은 곳: herdr-core/src/runtime/hosts.rs(linked_node가 dialed_device로 답하고 memory_nodes, memory_scope가 그것을 씀), herdr-core/src/runtime/project_memory.rs(prepare_memory, memory_folder), herdr-core/src/runtime/memory_analysis.rs(receipt_batches).
    이를 고정하는 테스트: hide_memory_answers_only_a_caller_on_this_machine_in_the_checkout_it_named(다이얼한 기기의 호출이 memory_device_unsupported), a_project_only_a_device_lists_is_kept_on_that_device_not_unregistered(다이얼한 기기의 Project 탭이 unavailable), memory_is_answered_for_this_machine_and_a_linked_node_only(hook 범위, 분석이 걷는 기기, receipt 묶음에서 다이얼한 기기가 빠짐).
    #985의 나머지는 그 설계대로 node를 거칩니다. SessionStart는 receipt 없는 index를, 프롬프트는 이미 받은 카드를 뺀 카드와 receipt를 받고, hook은 working folder를 보내지 않습니다(#985가 경로 순위를 없앰). 30분 쉼 분석은 node의 세션을 그 링크로 읽고, 링크가 끊긴 node의 닫힌 세션은 다시 닿을 때까지 기다립니다. 저장소 올리기는 Project의 기기에서 agent를 시작하고 그 기기의 PR 목록을 봅니다. 분석 provider는 core 기기에서 부릅니다.
    merge를 따로 본 코드 리뷰 4라운드(fad7437)가 이 규칙을 #985의 모든 자리에서 확인했고, 그 지적으로 8b89e76c6이 node pane의 hide memory show를 그 node 세션의 receipt로 남기고(다음 프롬프트가 그 카드를 다시 받지 않음), 다이얼한 기기의 세션을 분석 대기열에 넣지 않으며, 다이얼한 기기 Project의 Memory 문구(네 언어)와 주석 둘을 고쳤습니다.
    Memory 저장소(schema 8)는 이동에서 파일째 옮겨지고, 이동은 schema 버전을 보지 않고 SQLite 무결성만 확인합니다. main이 없앤 Sessions 모드(sessions_mode_by_project)는 이동의 rekey 목록과 journey에서도 뺐습니다.
  • 운영자 결정 (B18 mini 키 에코, 2026-10-12): 이 측정에서 B18의 mini p95는 기준을 넘지 못했고, 운영자가 이를 네트워크의 것으로 받아들여 merge하기로 했습니다(답: Accept as network). 유선 재측정은 merge 조건이 아닙니다.
    옮긴 뒤 mini pane p95 +2.8 ms(18.7->21.5), 20 ms 넘는 키 6->19개/250, 원인 hop: net_down(터미널 relay forward, SSH 위) 3/7, herdr_echo 2/7.
    Nagle을 끈 재측정에서도 같은 크기(약 85 ms)의 멈춤이 남았고 기기 배치에도 2/150 나타나, hide가 여는 소켓 아래(SSH 연결, 네트워크)의 멈춤으로 봅니다. 그래도 remote-core 배치에서 더 자주 보였습니다(두 측정 합 13/300 대 2/300).
    두 기계 모두 Wi-Fi(같은 AP)로 이어져 있고, 같은 크기(약 85 ms)의 멈춤은 Wi-Fi 절전이 다음 비콘(약 100 ms)까지 프레임을 잡아 두는 모양과 맞습니다. 이 가설은 운영자의 전원이나 네트워크 설정을 바꿔야 확인할 수 있어 확인하지 않았습니다.
    p50은 같습니다(16.6 대 16.8). 다섯 세트 모두 b520d6e 기기 배치(A)와 이 PR의 remote-core 배치(D)를 번갈아 쟀고, 운영자 결정으로 load 8 이상에서 측정했습니다. 배제한 것: 1 ms 넘는 잠금, 키 옆의 relay 프레임과 link 데이터, hide 소켓의 Nagle(Evidence의 hop 측정).
  • 운영자 결정 (node pane의 hook 시간, 2026-10-12): MacBook pane의 hook이 core일 때(되돌린 뒤)보다 node일 때(옮긴 뒤) p50으로 SessionStart +131 ms(36/46 -> 167/195, p50/p95), 프롬프트 +112 ms(33/36 -> 145/176), 질문 가드 +51 ms(27/31 -> 78/163) 깁니다. 같은 빌드입니다. 운영자가 이를 그대로 받아들였습니다(답: Accept as is).
    비용은 링크 왕복입니다: SessionStart는 hide 자식 2개와 왕복 약 3번(hide-agent-hooks/src/workspace_context.rs:31, :37, core의 신원 확인 hided/src/pane_auth.rs:430), 프롬프트는 자식 2개(hook-inner와 hide inbox --hook, hide-agent-hooks/src/delivery.rs:126)와 왕복 약 3번, 가드는 자식 1개(hide-agent-hooks/src/spawn_guard.rs:1005)입니다.
    프롬프트마다 약 110 ms가 더해지며 D-12의 2 s 예산 안입니다. 줄이는 일은 with-hide/hide-private#72 14번(F21)에 남깁니다.
    오늘의 기기 pane(mini, 기기 배치)은 SessionStart가 20 ms로 빠르지만, 그 pane의 세션은 Workspace 부분 없이 시작해(출력 1,080 bytes, core와 node pane은 2,683-3,347 bytes) 같은 일을 빨리 하는 것이 아니라 일이 적은 것입니다.
  • 정해진 순서: 이동 뒤 MacBook의 프로젝트는 모두 node 프로젝트가 되고, 4단계의 node 경계 때문에 Issues(GitHub와 Local. Local 데이터는 core와 함께 옮겨져 새 core의 저장에도 남고, 되돌리면 번호 그대로 이 Mac의 것으로 돌아오지만, 옮겨진 동안 읽는 행이 없습니다), New issue, worktree 정리가 없습니다. 운영자가 정한 대로 D-29는 고치지 않고, 이를 채우는 별도 PR #966이 운영자의 실제 이동 전에 들어갑니다.
  • 판단해 주세요: node 프로젝트의 PR 행은 Overview를 열 때 최대 5분 묵은 값일 수 있습니다.
  • 판단해 주세요: B10 - 다시 붙기는 업데이트가 성공한 뒤나 core 기기가 업데이트된 뒤에만 성립하고, 서로 다른 빌드 사이에서는 성립하지 않습니다.
  • 판단해 주세요: Memory는 편지와 같은 방식으로, pane credential을 거쳐 daemon에 닿습니다. 일회성 HIDE_STATE_DIR로 시작한 daemon은 그 변수가 없는 pane에서는 찾을 수 없으며, Revert #949: Memory locator가 첫 connect의 옛 daemon 종료를 막음 #958 이후의 main과 같습니다. locator는 별도 PR로 돌아옵니다.
  • 판단해 주세요: Q17은 이동 뒤에도 Factory가 같게 동작하도록 하는 최소한입니다. 저장소 단위 Factory와 worker 기기 선택은 #875에 남습니다.
  • 판단해 주세요: B13 - 예약 뒤 링크와 함께 잃은 벨은 세 번 중 한 번을 씁니다(실패한 호출이 이미 쳤을 수 있음). 편지는 agent의 다음 턴에 그대로 전해집니다.
  • 판단해 주세요: B15 - gh 행은 <기기>에서 실행하세요 gh auth login과 복사를 주고, Hide AI는 기기 이름만 말합니다. agent별 로그인 명령은 제품이 검증한 것이 없어 만들지 않았습니다.
  • 판단해 주세요: B1 차이 - 창의 이 기기 이름은 #972의 시스템별 이름(This Mac, This PC, This computer, 번역됨)이고, node 창도 자기 기기를 그 이름으로 부릅니다(B2). main은 core 기기만 그렇게 불렀습니다. Overview와 설정 칩이 같은 Mac을 호스트 이름으로 부르는 것은 #964에 남습니다.
  • 판단해 주세요: 그만 기다리기의 문구와 위험 한 줄(아래 이미지). 되돌릴 수 없고, 상대가 끊기기만 했다면 이 Mac이 닿을 때까지 그쪽 core가 계속 돕니다.
  • 판단해 주세요: 여기로 가져오기는 복사본으로 이 Mac core를 켜고, 상대 core는 retire될 때까지 시작이 막혀 core가 둘이 되지 않습니다.
  • 판단해 주세요: 대상의 상태 폴더가 심링크 뒤에 있으면 확인 행 '{기기}의 이전 core 기록'이 경로 이름과 함께 실패합니다(툴팁에 경로). 행 이름이 이 경우를 설명하지 않지만 설치가 만드는 경우가 아니어서 두었고, with-hide/hide-private#72 49번이 실제 경로를 따라 옮기면서 이 거절을 없앱니다.
  • 조심해서 볼 파일 (ownership, runtime 수명): hided/src/core.rs, hide-node/src/terminal/mod.rs - core가 멈추면 그 기기의 터미널 세션을 닫고(d2fdc6a), 역할이 바뀐 뒤 새 core가 같은 pane을 엽니다. CoreHandle::shutdown은 owner thread와 local service를 한 값(Running)으로 쥐어 shutdown과 Drop 중 먼저 온 쪽만 끝냅니다(ba3d6ee). 세션 worker는 시작 전에 수를 세어, close가 그보다 먼저 돌아도 기다리고 그 뒤로는 열리지 않습니다(80bb2b4).
  • 조심해서 볼 파일 (failure path, ownership: core 하나): hided/src/supervisor.rs, hided/src/supervisor/move_back.rs - 이동과 되돌리기, 재개, 포기의 순서.
  • 조심해서 볼 파일 (failure path): hided/src/core_move/ (driver, target, gate, control, abandoned) - 상대 기기 단계와 lease, 포기 기록. 포기는 그것을 내놓은 기다림만 끝냅니다(11a65f8).
  • 조심해서 볼 파일 (failure path): herdr-core/src/node_migration/copy.rs, reown.rs - 상대가 이름 짓는 경로와 rekey. SQLite 확인의 경로는 UTF-8이 아니면 거절하고 ASCII 밖 바이트를 escape합니다(693bfad).
  • 조심해서 볼 파일 (high-frequency path): hided/src/server.rs, hided/src/lib.rs - role 종료 때 core 소켓을 1012로 닫기.
  • 조심해서 볼 파일 (snapshot wire): 링크 변경 - core_link alias(c7f906e), node held screen의 core_move 전달과 처리(hided/src/node_daemon/screen.rs hold()), 창의 web/src/ws.ts(그리지 않은 창은 이동이 진행 중이거나 node가 잡고 있을 때만 붙들기, a9618e4).
  • 조심해서 볼 파일 (gate 변경): scripts/check-core-touches-no-machine.py STORES 항목 네 개(이유 포함), workstation identity를 피한 테스트 경로 두 파일. a_core_that_gives_its_copy_back_forgets_its_login_item이 #[cfg(unix)]가 되었고, Windows는 login agent 계약의 not-supported 테스트가 고정합니다.
  • 비용 검토: 상시 작업은 포기 기록이 있는 동안만 도는 task 하나(상한 8개, 1분까지 늘어나는 재시도)와 core 기기의 login item입니다. 고빈도 경로에는 core 소켓당 role 종료 watch 하나가 더해집니다.
  • 질문: node에서 잠들지 못하는 agent(Pi, OpenCode, Grok, Omp, Cursor)의 Factory worker는 Factory가 멈춰도 pane에 남습니다. 그대로 둘까요, follow-up으로 둘까요?
  • 질문: B14 - 다이얼한 SSH 기기의 Sessions 문구("Sessions on {device} are not available here…")는 연결된 node가 있는 core를 설명하지 않습니다. 문구와 디자인 프레임을 바꿀까요?
Review 세부: 번들과 다른 점, 바뀐 기존 동작, 결함 둘

승인된 디자인 번들과 다른 점:

  • 번들 장면의 기기 탭에는 설정 창 틀이 없고, 제품은 설정 안에 그립니다.
  • Light의 대화상자 뒤 배경은 제품의 옅은 wash를 씁니다.
  • 확인 항목이 번들의 4개가 아니라 9개입니다.
  • 문구는 '이 Mac을 덮어도'입니다. 시스템은 그 기기가 MacBook인지 알 수 없습니다.
  • node 창의 core 행은 플랫폼만 보입니다.
  • 사이드바는 제품의 사이드바입니다.
  • W5(연결 끊김 띠)는 번들에 없어 W3을 따라 그렸습니다(B16이 요구).
  • W4는 Dark로만 그립니다. 호스트 상태 페이지(desktop/static/status.css)는 daemon에서 운영자 테마를 읽을 수 없습니다. 번들 final-4는 Light도 그립니다.
  • W4의 빌드 줄에 번들의 짧은 빌드 해시가 없습니다.

native QA가 찾은 결함 하나(c0fe9e6): 이동이 성공한 뒤 창이 멈춘 core의 소켓에 남아 이동의 done 뒤로 아무것도 받지 못했습니다.
role이 끝나면 core 소켓을 모두 1012 role_ended로 닫고, move screen을 core(되돌리기에서는 node)가 멈추기 전에 띄웁니다. 옛 순서를 심으면 앞으로와 되돌리기 검사가 각각 3/3 실패합니다.

같은 종류의 결함 하나 더(a4a8d13): 이동이 잡은 창은 모든 이벤트를 버려 그만 기다리기가 move screen에 닿지 않았습니다. 이제 core_move만 보내고 나머지는 버립니다. 단위 테스트(가짜 dispatch)와 journey(raw renderer)로는 보이지 않았고 native 실행에서 찾았습니다.

바뀐 기존 동작:

  • 재시작이 저장된 pane이나 checkout을 찾지 못하면 이제 Herdr가 focus한 pane과 그 checkout으로 엽니다. 이동만이 아니라 모든 재시작입니다. Herdr의 focus가 모든 checkout 밖이면 catalog 첫 항목 그대로입니다.
  • rekey가 core-state.json에 한 번 쓰는 focus_from_herdr를 남깁니다. 첫 세션이 쓰고 다음 저장이 지우며, 옛 빌드는 무시합니다.
  • Agent 영역이 오늘의 inbound node(3, 4단계의 원격 core 기기)에서도 이 기기의 Workspace처럼 나뉘고 옮겨지고 크기가 바뀝니다.
  • 다이얼한 기기의 split 이유 문구가 SSH 기기를 말합니다(en, ko, zh, ja).
  • B13 - 다이얼한 SSH 기기로 가는 편지도 그 기기가 닿을 수 있는 동안만 기다립니다(벽시계 60분이 아님). 계속 떨어져 있으면 열린 편지 1024개 상한까지 쌓입니다.
  • B13 - 플랜은 링크와 함께 잃은 벨이 attempt를 쓰지 않는다고 했으나 PRD가 요구하지 않아 지금 동작(한 번 씀)을 두었습니다.
  • B14 - 프롬프트 앞 8 KiB가 hook에서 core로(node에서는 링크로) 갑니다. 검색 입력으로만 쓰고 로그에 남기지 않습니다(journey가 두 기기의 로그를 찾음). 전에는 SHA-256만 떠났습니다.
  • B14 - Project는 hook의 cwd가 아니라 호출 pane의 checkout이 정합니다. hook은 cwd를 보내지 않습니다.
  • Project Memory: 30분 쉼 분석, 프롬프트 매칭, 충돌 규칙, 저장소 올리기와 Memory 탭 #985 - hook이 core에 묻는 요청의 wire 이름은 memory_hook입니다(main의 memory는 hide memory 명령).
  • First run: a three-step setup wizard, notifications on each system, and Add project on the Projects title #975 - 데스크톱 창의 agent 알림(agent_notice)은 이동 frame 옆으로 갑니다. 상태 페이지는 빌드 줄(#builds) 아래에 Copy diagnostics를 둡니다.
  • B14 - SessionStart의 payload 대기가 75 ms에서 프롬프트 hook과 같은 500 ms가 되었습니다.
  • B14, Q20 - core가 다이얼하는 기기는 Memory가 없습니다(memory_unavailable).
  • B14 - 오른쪽 패널의 Sessions와 Memory, 이름 붙은 Project의 Sessions가 이 기기와 다이얼해 들어온 node에서는 Project의 node를 거쳐 읽힙니다. 링크가 끊긴 node는 "{device} is not connected."로 답합니다.
  • B16 - node의 연결 끊기가 core-placement.json에 남아 재시작 뒤에도 유지됩니다. 배치 기록 변경은 모두 placement::update(프로세스 잠금 하나)로 갑니다.
  • 이동 대화상자는 Connection이나 GuiSession 확인이 실패하면 통과 수를 보이지 않습니다(뒤 확인이 돌지 않았을 수 있음).
  • Q13 - 다른 빌드의 번들 hide connect는 login item이 돌리는 core를 멈추지 않습니다. 더 새 앱은 core-update로 업데이트하고, 더 옛 앱은 core_newer를 받습니다.
  • login agent는 hide-platform의 OS 중립 계약 뒤에 있습니다. launchctl 자체가 실패하면 로그에 'launchctl did not answer: ...'가 남습니다(화면에는 닿지 않음).

계약과 링크:

  • link protocol은 28 그대로입니다. 대상 확인은 SSH inspect 단계에서 하고, attach socket의 Release 줄과 hello의 move_intent는 attach 빌드 거절과 이동의 Build 확인이 지킵니다. VerifyOutcome::Lost 추가도 같은 빌드끼리만 잇는 규칙(B10 option C)에 기댑니다.
  • contracts/hided-ws.schema.json - core_move frame과 이벤트(abandon 포함), core_link의 disconnected 단계, alias. 더하기만 했습니다.
  • 상대 기기가 이름 짓는 파일 이름은 copy::carried(옮기는 저장소 아래의 상대 경로)로만 읽고, verify와 place는 node.json이 이 기기와 --target을 가리키지 않는 사본을 거절합니다.
  • 대상의 gh와 Hide AI 확인은 계정의 GUI 세션에서 login item의 환경으로 한 번 도는 job입니다. 되돌리기는 받는 쪽의 Ai, Gh, GuiSession, Sleep을 확인하지 않습니다.
  • 이동이 잡은 창이 새로고침되어 core를 그리기 전이면, 상대 기기를 이동 기록의 SSH 별칭으로 부릅니다(core_move의 alias). core_link의 alias와 같은 규칙입니다.
  • 그만 기다리기(F6, 운영자 결정으로 이 PR에 들어간 4번째 변경)는 상대에 이 Mac의 빌드를 먼저 설치하고 단계를 돌립니다(다른 빌드의 단계는 답이 거절되기 전에 이미 움직임). 상대가 다른 이동을 하고 있다고 답해도 기록을 끝냅니다. AttachSent 뒤의 영구 원인도 그 원인과 함께 기다림으로 보이고, 출구가 그만 기다리기입니다.
  • 알려진 한계: 이동은 factory.sqlite3를 rekey하고, 다시 읽히지 않는 schema-1 사본 factory.v1.sqlite3는 rekey하지 않습니다.

바뀐 기존 테스트:

  • delivery/ledger.rs, mailbox.rs의 Letter::reserve_bell 호출과 watch.rs의 편지 리터럴: 서명에 ledger 시계가 더해졌고(빈 값은 예전처럼 벽시계), 확인하는 내용은 그대로입니다.
  • node_migration legacy와 reown fixture에 node_clocks가 더해졌습니다.
  • held_letter_notice의 한 테스트에 페어링된 core의 serve 기록이 더해졌습니다(B17은 core가 노출된 곳에서 페어링한 휴대폰에만 보냄).
  • hide-agent-hooks의 opencode helper, windows_hook_command, hook_deadline: Memory를 core에 묻는 요청으로 확인합니다. plugin/helper.rs의 단위 테스트는 지웠고, Pi와 omp의 host id, 첫 프롬프트의 index와 카드 요청은 tests/it/opencode_helper.rs가 확인합니다. herdr-core의 receipt 테스트는 core의 답(memory_hook::answer)을 묻고, 두 번째 경로를 지키던 테스트 하나는 그 경로와 함께 지웠습니다.
  • web/src/addProject.test.ts, web/src/screenMachine.test.ts: 첫 host와 창의 기기가 시스템별 이름("This Mac", "This PC")입니다.
  • design/review-targets.json: 이 브랜치의 ready를 main의 readySelector로 맞췄습니다.
  • .config/nextest.toml과 테스트 support: support::run::finish가 이 브랜치의 journey와 core_move fixture도 끝냅니다. fixture sshd의 채널 128개 상한은 도는 채널만 셉니다.

Evidence

  • 확인한 것 (main merge, 로컬): fad7437(origin/main b70d00a3c와 cf6c98e19를 merge)에서 verify-cargo.sh nextest --workspace 4274/4274(89 skip), lint, hakari가 통과합니다. 2a247c7(9596ea1 #988을 더 merge, Rust 변경 없음)에서 verify-web.sh(web, desktop, typecheck), fmt check, design contract가 통과하고, web 단위 테스트는 플랫폼을 Linux와 Windows로 바꿔도 1440/1440입니다. core_move journey 40/40(647a626), remote_core journey 24/24(647a626, Memory journey에서 node의 index와 hide memory show m1, 답 35 ms와 36 ms)를 thread 3개로 돌렸습니다.
  • 확인한 것 (CI 실패와 수정): 647a626 CI(run 38197395136)의 fmt 실패는 fad7437eb에서, web 테스트 5개 실패는 cd6b590d3에서 고쳤습니다. 테스트가 이 창의 기기 이름(#972의 시스템별 이름)을 실행 기기의 navigator에서 읽어 Linux runner에서 'This computer'가 되었고, 이제 그 테스트들은 Mac을 고정합니다.
  • 확인한 것 (리뷰 4라운드 수정, 8b89e76): 새 테스트 둘이 고친 코드를 빼면 실패하고 넣으면 통과합니다(node pane의 reader가 이 기기 세션으로 가고, 다이얼한 기기의 닫힌 세션이 대기열에 들어감). herdr-core, hided, hide-agent-hooks, hide-memory nextest 2886/2886, lint, verify-web.sh, remote_core journey 24/24.
  • 리뷰 4라운드에서 follow-up으로 넘긴 것: with-hide/hide-private#72 50-53(링크가 끊긴 node Project의 Memory 탭이 Unreadable로 보이고 다시 닿아도 다시 읽지 않음, node Project의 Memory 켜기가 core의 hook 진단을 봄, hook stdin의 write_all에 기한이 없어 Windows 8 KiB 프롬프트에서 설 수 있음, copy::unplace가 pending core가 만든 store를 되돌려 재시도가 같은 verify 거절을 만날 수 있음), with-hide/hide-private#71(node 창의 그래프 THIS_DEVICE 경로와 시작 시트 localDevice가 core 기기를 '이 Mac'으로 부름. a97f18ed3에도 있었음), with-hide/hide-private#69(SessionStart payload가 500 ms를 넘으면 진단 없이 Memory가 빠짐, memory 요청 type의 schema 정의 없음).
  • 확인한 것 (CI, 8b89e76): verify run 38200872088에서 22개 check가 통과했고(계획된 skip 하나), rust workspace, remote mailbox, windows check, os contract(macOS)에 TRY나 FLAKY 줄이 없습니다. premerge-check.py 961이 main 2766ca98f에 대해 통과합니다.
  • 로컬 실행의 메모 (main merge): fad7437eb의 nextest --workspace 첫 실행에서 hide-node a_flooding_pane_holds_back_neither_another_panes_keys_nor_its_frames가 load 18에서 한 번 실패하고 혼자서 5/5 통과했습니다(이 브랜치는 hide-node를 바꾸지 않음). 처음에 journey를 모두 한꺼번에 띄운 실행은 fixture가 디스크를 채워 실패했고, 지금 기록은 thread 3개 실행입니다.
  • 확인한 것 (CI, merge 전): a97f18e(Flaky test: hided::it core_move::a_driver_killed_after_the_retirement_finishes_the_move_back #986 수정, origin/main 59d1a297c를 merge한 ba52e3d 위)에서 모든 lane이 green입니다(verify run 38173557286). 실제 launchd(login agent가 kill 뒤 다시 켜지고 성공 뒤에는 켜지지 않으며 제거로 끝남, 일회성 job)는 같은 head의 os-contract(macOS) lane이 증명합니다(job 114571114198, 2/2).
  • 확인한 것 (로컬, merge 범위): verify-cargo.sh nextest --workspace 4217/4217(89 skip), web 1398 통과(1 skip), desktop 165 통과(4 skip), lint와 typecheck.
  • 확인한 것 (리뷰 3라운드 여섯 수정): 각 수정의 테스트가 고친 코드를 빼면 실패하고 넣으면 통과합니다(terminal close와 worker, 비 ASCII 경로, 포기의 대상 기다림, 창의 붙들기, copy.sent 한 번, shutdown 한 번). 고친 crate의 테스트와 해당 journey 7/7.
  • 확인한 것 (journey): core_move와 remote_core journey(remote mailbox lane), 각 수정에 결함을 심어 실패를 확인(아래 접힌 블록). 읽기 전용 close 결함은 앞으로와 되돌리기 journey가 심은 결함으로 실패합니다. 기다림 없는 close를 심은 journey는 10/10 통과했고, 그 기다림은 단위 테스트가 고정합니다.
  • 확인한 것 (native): 후보 dev 창(Electron, fixture의 격리 Herdr와 sshd)으로 이동, 되돌리기, W1-W4, B15, 그만 기다리기를 Light와 Dark로 캡처.
  • 확인한 것 (mini 격리 seat, 3b96704): 실제 이동, 키 에코, B22, 되돌리기, hook. 운영자 결정으로 load 8 이상에서 측정했고, 각 행에 MacBook의 전원과 두 기기의 load를 적었습니다(아래 표). mini의 호스트 이름은 <mini host>로 가렸습니다(#964).
  • 확인한 것 (B18 MacBook): 두 arm이 같은 전원(AC)이었던 f2, f3 짝에서 cand - b520d6eb가 idle p50 +0.80 / -0.20, p95 +0.30 / -0.30, driven p50 +0.10 / +0.10, p95 -0.30 / +0.20 ms로 모두 +5 ms 기준 안입니다.
  • 확인한 것 (B18 mini): 다섯 세트의 p50은 같습니다. p95는 넘지 못했고, 운영자가 2026-10-12에 네트워크의 것으로 받아들였습니다(Review. 두 번의 hop 측정과 배제한 것은 아래 접힌 블록).
  • 확인한 것 (seat 빌드 뒤의 변경): seat는 3b96704a1에서 돌았습니다. 그 뒤의 커밋은 리뷰 3라운드 여섯 수정과 main merge입니다. 그중 키 경로에 닿는 것은 세션 worker 시작(80bb2b4)과 창의 붙들기(a9618e4)이고, ba52e3d87에 시각 기록만 더한 빌드의 hop 측정에서 키 에코가 seat와 같은 범위였습니다(기기 배치 16.8/18.6, remote-core 16.8/20.0, p50/p95, 150키씩).
  • 확인한 것 (Flaky test: hided::it core_move::a_driver_killed_after_the_retirement_finishes_the_move_back #986, 원인): CI의 첫 시도는 hang guard가 아니라 테스트 자신의 30초 기다림(start.held 기록, core_move.rs:2478)에서 실패했습니다. 은퇴한 기기의 hided core-login은 0으로 끝났지만, 큐에 남은 start.held를 writer가 쓰기 전에 프로세스가 끝나 기록이 사라졌습니다.
  • 확인한 것 (Flaky test: hided::it core_move::a_driver_killed_after_the_retirement_finishes_the_move_back #986, 수치): 고치기 전 held start 600번 중 3번이 core.jsonl에서 기록을 잃었고(stderr에는 남음), 고친 뒤는 load 없이 200번, load 옆에서 200번 모두 0번입니다. 기다리지 않는 drain을 심으면 새 단위 테스트가 20/20 실패하고, 고친 테스트는 50/50 통과합니다. journey는 load 옆에서 고치기 전 20/20, 고친 뒤 20/20 통과(로컬에서는 고치기 전에도 재현되지 않았습니다).
  • 확인하지 못한 것: 운영자의 실제 이동(D-17, 이 작업 범위 밖), 유선 연결에서의 B18 mini 재측정, B7과 B14의 멈춘 core 분기와 B26(구성상 성립과 단위 테스트까지). desktop e2e의 @needs-focus와 Windows check는 로컬에서 돌리지 않음(CI green).
  • merge 뒤 운영자가 할 일: Issues를 채우는 PR(Keep Issues, New issue and cleanup on a linked node's projects #966)이 들어간 뒤 실제 이동을 하고, mini의 launchd job이 core를 처음 켜는지 확인합니다.
  • 생성물: web/src/generated/hided-ws.ts(계약에서 생성), design/hide-ui.lib.pen 토큰 두 개(scripts/gen-pen.mjs, main 대비 8줄).
seat 측정 (mini 격리 seat, 3b96704)

seat: mini의 격리 sshd(새 포트), 격리 HOME, 상태 폴더, Herdr, /tmp 아래 절대 경로. 운영자의 Herdr, gateway, LaunchAgent, 상주 daemon, node와 helper는 건드리지 않았고, 매 seat 전후 mini 계정의 지문이 운영자 앱의 변화를 빼고 같았습니다.
바이너리(shasum 앞 16자): cand 3b96704 hided dd6bd6e843563742, hide d5659195391c021e, hide-agent-hooks a5f0580065cf7b2b. b520d6e hided 0cc6ddb16e81a6a1, hide 885f6d6ad727911a, hide-agent-hooks 2c23e057b4f68c5e, hide-host-helper 1f1765bcbbbf8b2c. main f0d6fba hided f88c163a950dbe2f, hide 2b8969755fa635e2, hide-agent-hooks 84092eef3d6b37f5.
mini에 설치된 helper는 seat의 바이너리보다 각각 약 18 KB 큽니다(설치의 서명).
다섯 세트와 hop 측정의 기기 배치 실행은 모두 host.ready를 남겼습니다.

이동:

  • 앞으로(moved-7): done 4,023 ms(checks 624, stop 1,675, copy 1,340 for 126,555 B, start 164, link 199), MacBook load 6.77, 전원 battery.
  • 옮긴 뒤: MacBook pane idle 16.9/17.9, driven 15.9/17.4, mini(core) pane 16.6/18.9(p50/p95 ms), 음수 0, 10,000키 정확.
  • B22: 링크를 끊자 띠가 바로 "reconnecting", 3 s 뒤 "Cannot reach the core on <mini host> · reconnecting". 끊긴 동안 친 표시 키 12개는 어느 pane에도 닿지 않았고, sshd를 되살리자 2,324 ms에 다시 붙어 pane, 붙은 상태, 보기, 탭, URL이 같았습니다.
  • 되돌리기: done 2,364 ms(checks 478, stop 914, copy 657 for 130,909 B, start 266). mini core가 끝나고 mini는 node serve로 돕니다.
  • 되돌린 뒤: mini pane 16.4/18.5(load 37.32에서 100.7 ms 한 표본 포함), MacBook pane 16.5/17.6(load 21.39).
  • 옛 세션: 이동마다 core의 터미널 세션 다섯이 사라지고 새 core 아래에 다섯이 새로 생겼으며 겹치지 않았습니다.
  • 옮기는 저장소 크기(운영자 상태 폴더, stat만): 27.4 MB(가장 큰 것 delivery-ledger.json 6.3 MB, links.sqlite3 8.7 MB + wal 4.4 MB).

B18 MacBook pane 짝(cand - b520d6e, idle과 driven, p50/p95):

짝 시각(KST) MacBook 전원 판정에 씀
f1 21:11-21:23 첫 실행 불명, 나머지 AC 참고(#966 로컬 작업과 겹침: 21:10:47-21:17:39)
f2 21:23-21:36 AC 예
f3 21:36-21:48 AC 예
f4 21:48-22:01 짝 안에서 전원이 바뀜 따로 세지 않음

dfc9118df의 짝 1-3과 f1-f4의 mini 행은 "기기 helper 없는 기준(host.failed)"이라 판정에 쓰지 않았습니다.

B18 mini pane, 다섯 세트(23:49-00:41, 모두 AC, MacBook load 8 이상 20개 실행 중 17개):

arm p50 p90 p95 p99 20 ms 넘는 키
A b520d6e 기기 배치 16.6 18.2 18.7 22.4 6
B main f0d6fba 기기 배치 16.4 18.4 18.9 92.1 8
C 이 PR 기기 배치 16.8 18.8 19.8 360.0 12
D 이 PR remote-core 16.8 19.3 21.5 97.3 19

250키씩, nearest rank. C의 p50이 B보다 다섯 세트 모두 높습니다(중앙값 +0.5 ms). 판정 규칙으로는 잡음 안이고, 기기 경로에서 코드 원인을 찾지 못한 관찰입니다.

hop 측정(ba52e3d87에 시각 기록만 더한 로컬 빌드, 두 번, 각 세트 3개 CD DC CD, 모두 AC). C는 이 PR의 기기 배치, D는 remote-core 배치입니다.
첫 번째(01:27-01:49, MacBook load 5.2-12.1, mini 2.4-4.3), p50/p95 ms, 150키씩:

구간 C D
MacBook 안(입력, 전송, 출력) 0.20/0.31, 0.03/0.05, 0.04/0.07 0.19/0.38, 0.02/0.05, 0.02/0.05
MacBook에서 mini로 (±2.7-3.1) 2.93/4.85 3.10/7.52
mini 안(PTY 쓰기, 되보내기) 0.06/0.08, 0.06/0.09 0.07/0.12, 0.11/0.17
PTY 쓰기에서 Herdr 프레임까지 10.17/12.34 9.18/11.85
mini에서 MacBook으로 (±2.7-3.1) 2.93/3.49 3.09/4.77

1 ms 넘게 잠금을 쥔 곳은 두 arm 모두 없었고(mini core의 ingest 최대 0.84 ms), node 세션 이벤트는 두 arm 모두 초당 약 1개입니다. 느린 키 옆에 relay된 화면 프레임(0/7 대 1/143)이나 link 데이터(0/7 대 3/143)는 없었습니다.

두 번째(02:06-02:29, MacBook load 6.9-10.8, mini 1.9-2.9): SSH 소켓, forward의 로컬 소켓, relay 양 끝의 Nagle을 껐습니다.
키가 russh에 닿기까지는 바로였고(node 전송에서 forward 읽기 p95 0.13 ms, forward 읽기에서 채널 쓰기 최대 0.03 ms), 멈춤은 그 뒤에 남았습니다.
세트 하나(q3-D) 동안 두 기계의 시계 차가 150 ms 움직여, 멈춤은 시계 차가 필요 없는 링크 왕복(각 기계 자기 시계의 구간 차)으로 셌습니다:

C 멈춤 D 멈춤 C 20 ms 넘는 키 D 20 ms 넘는 키
첫 번째(Nagle 켜짐) 0/150 3/150 0/150 7/150
두 번째(Nagle 꺼짐) 2/150 10/150 7/150 15/150

멈춤은 두 arm, 두 방향 모두 79-92 ms로 크기가 같습니다. mini의 PTY 쓰기에서 Herdr 프레임까지가 15 ms를 넘은 키는 첫 번째 C 0, D 2, 두 번째 C 1, D 3입니다.

hook(50번, 앞 5번 제외, p50/p95 ms, 600번 중 실패 0). 모든 hook 행은 battery에서 쟀습니다(22:16-23:03). 그래서 행끼리 같은 조건입니다:

배치 pane SessionStart 프롬프트 질문 가드 그 기기 load
main f0d6fba, 기기 배치 MacBook(core) 51/85 63/102 45/58 11.3
main f0d6fba, 기기 배치 mini(기기) 20/21 13/17 8/11 2.3
이 PR, 기기 배치 MacBook(core) 36/77 32/35 27/33 7.8
이 PR, 기기 배치 mini(기기) 21/22 13/16 8/13 2.5
이 PR, 옮긴 뒤 MacBook(node) 167/195 145/176 78/163 11.1
이 PR, 옮긴 뒤 mini(core) 37/42 32/35 26/30 3.0
이 PR, 되돌린 뒤 MacBook(core) 36/46 33/36 27/31 15.1
이 PR, 되돌린 뒤 mini(node) 173/426 135/179 83/171 2.2
b520d6e (참고) MacBook(core) 37/69 30/39 11/14(이 빌드는 가드 질의 없음) 6.6

b520d6e 행의 hide-agent-hooks는 2c23e057입니다(전에 쓴 2a38c874와 빌드 명령이 다름).

추가 증거

결함을 심어 실패를 본 증명(고친 코드를 빼면 실패하고, 넣으면 통과):

  • 그만 기다리기, 앞으로: 상대가 옛 빌드인 채 다시 닿으면 이 Mac 빌드를 설치하고 core를 멈춰 core가 하나로 끝남(J1). 연결 때 abandon 단계가 없거나 설치를 빼면 "the peer's core stopped, leaving one core"에서 실패.
  • 그만 기다리기, pending core: 상대의 pending core가 멈추고 정리됨(J2). 기다림 밖의 포기는 move_not_waiting, 두 번째 요청은 busy(control 단위 테스트). 끝난 제안의 포기는 같은 이동의 다음 기다림을 끝내지 않음(intent만 맞추는 코드를 심으면 실패).
  • 여기로 가져오기: 이 Mac이 바로 core가 되고, 상대는 stopped_for로 시작이 막혔다가(시작 시도는 core 없이 0으로 끝남) 닿으면 retire되고 기록이 지워짐(J3). supervisor의 hold를 빼면 gate의 거절(exit 2)에서, 두 hold를 모두 빼면 상대에서 core가 켜져 실패.
  • 이동이 잡은 창의 전송: web/src/ws.test.ts가 core_move는 보내고 다른 이벤트는 버리는지, 그리지 않은 창을 이동이나 node가 잡을 때만 붙드는지 확인.
  • 확정 전 알 수 없는 답을 '확정 안 됨'으로 읽기, 영구 거절을 끝없이 재시도하기, 요청이 lease를 다시 늘리기, 잘못된 SSH 별칭이 daemon 시작을 막기: 각 수정에 심은 결함이 해당 테스트를 실패시킴.
  • 상대가 이름 짓는 경로(F1): 적대적인 상대 두 journey(복사 밖 파일 요청, manifest의 복사 밖 파일)가 옛 복사 코드를 심으면 실패. 이름이 ASCII 밖인 폴더 아래의 복사가 SQLite 확인을 통과(옛 URI를 심으면 실패).
  • 멈추지 않는 core: 20 s 뒤 exit 3, login item이 다시 켜고 저널이 되돌림(a_core_that_will_not_stop_is_restarted_unchanged). 상한을 풀면 exit를 기다리다 시간 초과.
  • 터미널 세션 수명: close가 worker 시작보다 먼저 돌아도 기다리고 그 뒤로 아무것도 열리지 않음(hold를 spawn 뒤로 심으면 실패).
  • Memory 경로(B14): node와 core의 agent가 core 하나의 Memory를 읽음. node의 답 28 ms, core의 답 19 ms(debug 빌드, fixture, merge 전). Project를 core의 node로 정하는 결함을 심으면 실패. merge 뒤 node의 SessionStart는 receipt 없는 index(m1 ...)를 받고, node의 hide memory show m1이 node의 Project 카드를 보입니다.
  • B16 연결 끊기: 링크 thread가 플래그를 무시하는 결함을 심으면 node_link(..., "disconnected")에서 실패.
  • 심링크 뒤의 대상 상태 폴더: core를 멈추기 전의 확인이 경로 이름과 함께 실패.

native 캡처(후보 dev 창, 비공개 user data, 모든 상태 경로가 fixture 안, 격리 Herdr와 sshd):

W1 띠 끝의 그만 기다리기, Dark (native)

그만 기다리기 확인, Light (갤러리 렌더, 현재 코드: 위험 줄이 본문 색)

그만 기다리기 확인, Dark (갤러리 렌더, 현재 코드)

여기로 가져오기 확인, Light (갤러리 렌더)

그만 기다린 뒤, 역할이 core로 돌아온 창, Dark (native)

이동 확인, Light (native)

실제 stand-in 확인 4개 실패, 통과 수 숨김, Light (native)

옮기는 동안 W1, Light (native)

옮기는 동안 W1, Dark (native)

되돌리는 동안 W1, Light (native, 호스트 이름 가림)

되돌리는 동안 W1, Dark (native, 호스트 이름 가림)

W2 더 새 앱이 core 기기를 업데이트하는 중, Light (native, 가림)

W2, Dark (native, 가림)

W3 링크가 끊긴 동안, Light (native, 가림)

W3 새 창이 별칭으로 부름, Light (native)

W3 새 창, Dark (native)

W4 업데이트 실패, 두 빌드와 다시 시도, Dark (native, 가림)

W4 core가 더 새 빌드, Dark (native, 가림)

B15 gh 행이 core 기기와 고칠 명령을 말함, Light (native, 가림)

B15 Hide AI가 core 기기를 말함, Light (native, 가림)

측정과 메모:

  • 배치에서 대상 core의 Started까지 p50 308 ms, 최대 508 ms. 남은 pending lease 최소 89 s.
  • 그만 기다리기 native 실행: 원래 core 로그가 move.abandoned, abandon.failed(상대의 handover 잠금을 잡아 둔 동안 busy), 잠금을 놓은 뒤 4 s 안에 abandon.ended(answer ended) 순서이고 기록 파일이 지워짐.
  • 로컬 flake(이 변경 아님): 이동 journey 52개를 한꺼번에 띄운 부하에서 core_move::a_failing_check_changes_nothing이 test renderer의 2 s 첫 snapshot 읽기에서 EAGAIN으로 한 번 실패(main의 support 코드). 혼자서는 통과.
  • remote mailbox lane의 journey(remote_delivery, held_letter_notice, remote_core, core_move)는 thread 수를 낮춰 돌립니다. 전체 병렬에 실패 fixture가 쌓이면 디스크가 차서 target/debug/hide가 잘린 적이 있습니다.
  • 같은 lane에서 a_resumed_move_whose_alias_cannot_be_read_waits_for_its_peer가 부하 아래 한 번 실패했습니다. 제품의 30 s 링크 대기 뒤에야 쓰이는 기록을 테스트도 30 s만 기다린 경쟁이었고, 이제 링크 대기에 준비 상한을 더해 기다립니다.
  • 격리 core마다 delivery ledger.load_failed(validation)가 남았고 b520d6e 기준에서도 같습니다(환경, 이동과 무관).

Breaking change

  • contracts/hide-cli.json의 Letter에 intake_from이 더해져 CLI 계약 digest가 바뀝니다. 더하기만 했지만, 옛 digest에 고정한 도구는 갱신할 때까지 거절합니다.
Verification record
  • PRD: core-host-node-move(로컬 계약), 위험 high
  • base: origin/main 9596ea1(merge한 main), head: 8b89e76 (리뷰 4라운드 수정; main merge 99cc1b7, 647a626, 2a247c7, 그 앞 a97f18e Flaky test: hided::it core_move::a_driver_killed_after_the_retirement_finishes_the_move_back #986 수정; seat 빌드 3b96704, hop 측정 빌드 ba52e3d + 시각 기록과 그 위의 Nagle 끔, 로컬 전용이며 지움)
  • CI: 8b89e76 22개 check 통과(verify run 38200872088, 계획된 skip 하나, TRY나 FLAKY 없음), premerge-check는 main 2766ca98f에 대해 통과. 2a247c7 22개 check 통과(647a626 run 38197395136은 fmt와 web 테스트로 실패, 고침). merge 전 a97f18e 모든 lane green(verify run 38173557286), os-contract(macOS) job 114571114198의 실제 launchd 테스트 2/2
  • 로컬 실행: fad7437eb에서 verify-cargo.sh nextest --workspace 4274 통과(89 skip), lint, hakari; 2a247c79f에서 verify-web.sh, fmt check, design contract, Linux와 Windows 플랫폼의 web 단위 테스트; core_move 40/40과 remote_core 24/24(647a626, --test-threads 3)
  • 리뷰: 구조, 코드, 보안, 충실도 리뷰(06211c9)와 코드 리뷰 2, 3라운드의 Fix now는 이 브랜치에서 반영, 남은 것은 with-hide/hide-private#72

node_migration's key table now says how each machine-bound key moves when
the core changes machines, and reown applies it to a staging copy: the new
owner's keys lose their qualifier, the old owner's gain its id, project and
checkout ids map through the source core's id table, and a key that still
names the new owner by its old id stops the move with its place. The table
gains the keys it was missing (session folds and resolutions, dormant sleep,
descendant signals, the Factory secretary, ledger native machines and spawn
machines, registration and checkout ids) and local-issues' real shape.

Label records travel one hop as labels.json's moved section, taken into
memory for that machine and never written again, so a device's conversation
stays off disk as before. Every other machine's base branches, issue
sources, Inactive folds and Explorer selection persist beside the owner's
and leave with a removed device.
A seat binds the listener, mints the token and holds the instance lock
once, and serves every request through the router its current role
mounted. The core and node roles mount on a seat instead of binding their
own, so a role can change inside one process without the window's address
or token changing and without /health going unanswered. /health reports
the mounted role's instance. start_daemon and start_node_daemon keep their
shape on a seat of their own, which closes and forgets the daemon when the
role ends, as before.
A supervisor in hided runs the core or node role on one seat and drives
a forward move from its journal: checks, stop, a move screen, copy and
verify, place, start the target's pending core, link, then commit or
roll back. The target's pending core admits only the node that carries
the move's intent. Early requests wait for the seat's first role, a
copied UI state keeps every field its reader requires, and the fixture
starter accepts a marked HOME under /tmp by the account database.
… copy

Journeys for a failing check, a target core that cannot start, a source
killed mid-move and a lost link answer. The target takes a copy back only
while it holds its instance lock, the fixture starter reports a core that
exited at its start, the load check opens SQLite immutable, and a store's
log counts as brain state and never returns with a copy. The supervisor
logs from its start and names the interrupted step from the journal.
Downloads stream ranged reads in order into a private part file and
rename it into place once it holds the size the other machine stated;
uploads and downloads share one SFTP channel setup, and the helper
read-back shares the ranged read.
The node's own hided drives the move back from its node role: the core's
machine is asked over its attach socket to check and record the stop and
export what only it knows, its stopped folder is staged and pulled, the
owner change runs in reverse with the forward move's ids beside the core's
listing, and the copy is placed here before the core's machine retires
its core, which is the commit. Before it every failure resumes that core
from its untouched folder; while it cannot be reached this machine waits
and starts no core. The supervisor records hided.json once for the seat,
a start held by a stop or retirement ends at once, and a recent entry
whose checkout is gone is dropped rather than left without an id.
A login agent's property list starts it at load and at each session
start, restarts it after a failure or a kill at most every ten seconds,
and leaves it stopped after a successful exit. The macOS contract leg
proves that on its runner's real launchd; everywhere else a stand-in
launchctl answers.
The machine taking the core installs a login agent for its state folder
that runs hided core-login with the Herdr binary and socket it resolved;
at each start it starts the Herdr server only when Herdr says none runs,
then runs the daemon. A folder other than the account's default gets a
login item of its own.
After a core move the saved pane and checkout name the other core's
device, and that core kept this machine's selection only in this
machine's Herdr. The first local session now opens on Herdr's focused
pane and the checkout holding it instead of the catalog's first
checkout; with nothing saved the catalog's first checkout stays the
start.
The machine the core moves off becomes a node that dials in, and its
Workspaces had Agent areas while the core ran there. The core now
admits Agent layout intents for such a node, takes its tabs into the
saved tree when its session arrives, asks its Herdr for the tab of the
area in use, follows its focus, and attaches the panes of every shown
area's tab. The window draws one remote canvas per area. A device the
core dials keeps one area and the refusal, now worded for SSH devices,
and its Workspace publishes no Agent layout.
The other core held this machine as a device, whose selection is its
Herdr's focus and is never saved, so a move back could find no saved
selection and open on the catalog's first pane. The move's rekey now
leaves a one-shot focus_from_herdr hint in core-state.json; the first
local session takes it and opens on Herdr's focused pane and its
checkout, and the next save drops the key.
The journey seeds folds, path settings, Views, a second tab and an
Agent split through the window's own events, and a label and a held
letter at rest, then compares each machine's stored state and the
window's visible state (machine in front, its checkout, tab and pane,
every machine's tabs, the front Workspace's Agent areas) before the
move, after it commits and after the move back.
The rekey and login item tests spelled home folders after real
accounts, which the workstation identity check refuses.
A Herdr focus outside every catalog checkout left a selected pane with
no checkout to show it; a missed restore now starts catalog-first then.
A core started on a move's copy may still be rolled back, and then the
core it replaced starts again on the folder the copy came from. Until the
link carrying the move's intent commits it, the core now holds every
effect outside its machine behind one EffectHold: no provider call for
labels or Memory, no bell, no watch reading, no human notice claim, no
GitHub read, no Factory engine, no device dial or helper, no agent sleep,
and Mobile serves, pushes and runs tailscale for nothing. hided starts
the core held while its handover is pending and releases it when the
move gate opens; release dials every registered device at once.
The source now refuses a move, changing nothing, when the machine taking
the core runs another build, has no gh login, has no one logged in to its
desktop, sleeps on power, holds Hide AI settings unlike this machine's, or
cannot answer for an agent this machine's Hide AI asks; or when this
machine's Hide AI is not set up or one of its agents is asleep with its
pane closed. The target's checks run in the core-move inspect step the
move already runs there over SSH, since a device's node answers no AI
request. The state journey now waits for both projects to be saved before
it kills the source.
The move's copy now carries ai.json, which lives outside the state
folder. The machine taking the core gets it where it keeps its settings,
keeps its own file when it chooses the same, and refuses one that
chooses otherwise before anything moves; a rollback takes the copy's
file back, and the commit sets the left file aside in moved-out with the
brain stores. A copy without settings is refused, since a core's machine
always holds them, and a move back checks both machines' settings too.
Closing this machine's terminal service let its sessions go but left each
attach child to a reaper thread, so the role that followed in the same
process could attach a pane while the old child was still on its way out,
meet it as another client (owner_conflict) and view the pane read-only;
a node's panes then wait for the operator's Reconnect, so the race would
have stuck.

A service now counts each attach child from before it starts until its
reaper has seen it exit, and Service::close returns only once none is
left (bounded at 5 s, logged as terminal.close_unfinished). The node's
link end closes its service the same way instead of dropping it, so on a
move back the returning core attaches only after the node's children
exited. A unit test holds a child's exit and checks the close does not
return until it is let go; with the wait removed, it fails.
The core move's terminal journey viewed the pane as soon as its socket
opened. A window draws a pane only once its first snapshot has come, and
the node's screen joins its pane output then, so a view sent before it
could draw nothing: one run in ten after the move read an empty screen.
The journey now waits for the first snapshot, as the node role's journey
does, and that helper moves to the shared window support.
The move's copy is sent over SFTP to the target's state folder by its own
path, making each missing folder on the way and refusing one that is a
link or not a folder. A state folder reached through a link (macOS's /tmp)
therefore passed every check and failed the copy only after the source's
core had stopped, leaving a rollback to undo it.

The target's inspection now walks its state folder's path from the root
and names the first link or file on the way, and the source fails the
target-state check with it before anything stops. Following the real path
instead is a later change.
A close that ran before a spawn's worker thread counted its child could
return early and let the worker open a session after it. The spawn now
takes the child count before starting the thread and the worker opens
nothing once the service is closed.
The immutable URI re-encoded each byte of 0x80 or more as its own
character, so a state folder under a Korean or accented name failed the
integrity check on every move. Every such byte is now percent-escaped
from the name's UTF-8, and a name that is not UTF-8 is refused by name.
An abandon is published after its take, so an end of the offer that ran
in between left a stale abandon of the same move that a later wait would
read as one the operator never gave. Each offer now has its own number,
and a wait hears only its own offer's abandon.
…ds it

Every role sends an idle core_move first, and a window that had not
drawn the core read it as a move, so a slow core showed the move strip
before its first snapshot. An idle frame now leaves the window
connecting; it is held only while a move is under way or a node holds
its screens.
A copy the peer found whole only after the second pass returned without
writing copy.sent. Both passes now run in one loop whose single success
exit writes it once, with every file either pass sent.
Drop ran shutdown again after an explicit one, so a close that had
timed out waited out its children a second time on a tokio worker. The
owner thread and the local terminal service now live in one value the
first shutdown takes, so a later call finds nothing to close.
release.yml takes main's version: main packages a release through
package.yml, whose version step already fetches main's history for the
build order on every build that is not a 0.0.0 CI build.
A hided that ended could lose the diagnostic records it queued last: the
writer thread was detached and nothing waited for it, so a held start's
`start.held`, a stop's `process.stopped` or a pending core's
`pending.lease_ended` could miss Logs/core.jsonl. The core-move journey
whose retired machine starts again waited for that `start.held` and timed
out when the record was lost (#986).

`diagnostics::drain` ends every writer the process started, the ones a
later install replaced included, once each has written what it holds,
within 1 s; a writer still running then is named by one
`diagnostics.drain_timed_out` line on stderr and the exit goes on. hided's
main drains before each exit after its roles end, and the unconfirmed-stop
exit drains before it writes its own record at once. The list of writers
keeps only those still running. A panic out of main and a SIGKILL are not
covered.

Fixes #986
Project Memory v2 now runs through the core's node routing: hooks ask the
core without a working folder, the session start gets the index without a
receipt, and the pass, the Memory tab, hide memory and promotions cover this
machine's Projects and those of a node that dials in.
First-run onboarding joins the core move: a desktop window's agent
notifications ride beside the move frames, the status page keeps the build
line with Copy diagnostics, and design review targets wait on readySelector.
…vices out of the Memory pass

A node pane's hide memory show is recorded for the session the node
reports, so its next prompt leaves the card out; a device the core dials
hands no sessions to the pass. The remote-device Memory line, the scope
comments and the Memory wait's start now say what the code does.
@yansfil
yansfil merged commit 0e2d809 into main Oct 12, 2026
23 checks passed
@yansfil
yansfil deleted the spec/core-host-node-move branch October 12, 2026 06:14
yansfil added a commit that referenced this pull request Oct 12, 2026
Related: #961 (이 PR의 base, core move 본체). 따름 이슈 #963, #974, #983, #984.

## Summary

core가 다른 기계로 옮겨 간 뒤에도 원래 기계의 프로젝트에서 Issues, New issue, Start, worktree
cleanup이 옮기기 전과 같게 동작하도록 D-29를 채웁니다.
원래 기계의 프로젝트는 이제 core에 접속한 node의 프로젝트입니다.
- GitHub 이슈는 node가 답한 저장소 이름으로 core의 `gh`가 읽고 만듭니다.
- Local 이슈는 core `local-issues.json`의 `devices[<node id>][<root>]`에서 읽고
씁니다. reown이 옮겨 둔 자리입니다.
- 이슈 연결, Start로 만든 worktree의 연결, worktree cleanup은 node 링크와 node의 Herdr로
node에서 실행합니다. core 기계의 git과 디스크는 건드리지 않습니다.
- node 프로젝트는 node가 알려 준 worktree를 pane이 없는 것까지 모두 행으로 보이고, core 자신의
프로젝트와 같은 규칙으로 Inactive에 접습니다. 그래서 cleanup 후보가 옮기기 전과 같습니다.
- node 프로젝트의 PRs 탭이 pull request를 보이고, 이슈 잇기, 피드백 읽기, 맡기기가 node에서 동작합니다.
브랜치의 checkout이 없는 PR을 맡기면 node의 링크로 브랜치를 확인하고 node의 Herdr가 worktree를
만듭니다. 옮긴 뒤 이 탭은 비어 있었습니다.
- New issue의 `어디에` 목록이 두 기계의 프로젝트를 담으면 모든 행이 기계 이름을 붙입니다. 이 창의 기계는 `이
Mac`입니다.
- 웹 게이트(Overview, ⌘K, 보드, 사이드바 PR 행)는 core가 이미 내보내는 사실(`tasks.source`,
`Device.dials_in`, `readsHere`)로 판단합니다. core가 다이얼한 기기는 예전처럼 빠집니다.

<img width="1440" alt="옮긴 뒤 맥북 프로젝트의 디스크 정리 시트: pane 없는 fix-sidebar가 후보로
나옵니다 (Light)"
src="https://github.com/user-attachments/assets/0f69bcdd-8c5d-45ac-b725-f3654868ce53"
/>

옮긴 뒤 맥북 프로젝트의 디스크 정리 시트(격리 fixture, native). pane 없는 `fix-sidebar`
worktree가 main과 함께 후보로 나옵니다.

## Review

- **판단해 주세요**: Start issue가 node 프로젝트에서도 새 worktree에 이슈를 연결합니다. 예전에는 모든
기기에서 연결을 버렸습니다. F3의 "같은 방식으로 연결"을 Start까지로 읽었습니다.
- **판단해 주세요**: 옮겨 둔 동안 mini 자신의 프로젝트에 만든 Local 이슈는 맥북의 `devices` 아래 남아,
되돌린 뒤에는 보이지 않습니다(#963).
- **리뷰 1회차에서 바로잡은 것**: 리뷰가 짚은 '접기가 비는' 장면은 화면에 나온 적이 없습니다. lineage pass가
발행 전에 접기를 되돌렸습니다. 수정은 node derive마다 돌던 lineage pass 하나를 없애고, 접기를 한
함수(`project_context.rs` `refresh_device_folds`)가 정하게 합니다.
- **알고 둔 지연**: 위임한 자식 pane의 토큰은 다음 derive 한 번 뒤에 부모 checkout의 연결로 나타납니다.
이 기계의 `sync_issues`와 같은 지연입니다.
- **기존 브랜치 worktree를 기기에서 허용**: `start_worktree_task`의 기기 거부를 뺐습니다.
`existing_branch`로 부르는 곳은 `pr_delegate` 하나이고, 그 대상은 `issue_project`로
core나 core에 다이얼하는 node의 프로젝트로만 풀리므로, core가 다이얼한 기기로 가는 새 길은 생기지 않습니다.
- **알고 둔 한계**: 한 node에 GitHub 저장소가 64개를 넘으면, Overview 앞의 프로젝트를 먼저 읽느라 한도
밖으로 밀린 프로젝트의 마지막 답이 버려지고 포커스를 옮길 때마다 다시
읽힙니다(`node_github_repositories`). 64개 이하에서는 영향이 없어 이 PR에서는 고치지 않습니다.
- **wire**: 새 snapshot 필드는 없습니다. client event의 `local_issue_update`,
`issue_set_open`에 `workspace_id`가 필수가 됐습니다. contract가 client event를
kind와 payload로만 선언해 `hided-ws.ts` 재생성 diff는 없습니다.
- **조심해서 볼 파일**:
- `herdr-core/src/runtime/issues.rs` - `project_node_issues`는 runtime
mutex 안의 `derive_device_session`에서 돕니다. node 쓰기의 failure path는
`ingest_node_issue_write`입니다.
- `herdr-core/src/runtime/pull_requests.rs`, `herdr-core/src/github.rs`
`write_closing_line` - Hide가 pull request에 하는 유일한 쓰기입니다. node PR의 본문 쓰기와
피드백 읽기는 저장소 이름(`Where`)으로 가므로, `Where`가 틀리면 다른 저장소의 PR 본문을 고칩니다. 저장소 이름이
없는 node 프로젝트는 worker를 띄우기 전에 `github_place`에서 실패합니다.
- `herdr-core/src/worktree_cleanup.rs`, `runtime/projects.rs`
`cleanup_place` - 지우는 경로가 node 링크와 node Herdr로 갑니다. pane id를 node Herdr
이름으로 바꾸지 못하면 unverified입니다.
- `herdr-core/src/local_issues.rs`, `hide-factory/src/project.rs` -
store와 `IssueBook`이 기계를 받습니다. cap은 자기 프로젝트와 `devices`를 함께 셉니다.
- `herdr-core/src/device_catalog.rs` `apply_worktrees`,
`runtime/agents.rs` `refresh_inactive_groups` - node session에 행을 더하고
Inactive 접기를 계산합니다. 둘 다 mutex 안이며, 이미 읽어 둔 worktree 답만 씁니다.
- `runtime/events.rs` `inactive_checkouts_toggle` - 폴더 경로로 찾으므로, core와
node에 같은 경로의 프로젝트가 있으면 펼침 상태를 함께 씁니다.
- **판단해 주세요**: 두 기계에서 같은 절대 경로에 있는 프로젝트는 Inactive 접기와 Issue source를 함께
씁니다. 경로 키가 옮기기 전후로 접기와 source를 그대로 잇기 때문에(D-29) 경로 키를 유지했고, New issue
목록이 두 기계에 걸치면 모든 행에 기계 이름을 붙였습니다.
- **비용 검토** (docs/PERFORMANCE_TESTING.md, Resident work cost review):
- 입력: `project_node_issues`는 `derive_device_session` 안에서만 돕니다. node의 raw
session이 지난 것과 다를 때(node의 topology, agent 상태, 토큰)와
`refresh_device_catalog`(node의 worktree, GitHub, facts 답, issue source
선택, 연결 쓰기, Start)입니다. 바뀌지 않은 답의 idle fetch는 발행본을 그대로 쓰고 이 일을 하지 않습니다.
- 한 번에 하는 일(node의 Git 프로젝트마다): 열린 이슈 목록 복사 한 번, pane 토큰과 lineage로 family
토큰 계산, checkout마다 연결 chain과 이슈 목록 선형 탐색(C x I), `project_tasks` 한 번.
I/O, subprocess, `Mutex<Runtime>` 밖의 lock은 없습니다.
- 측정(디버그 빌드라 상한, checkout 20, GitHub 이슈 100, 열린 PR 50, 토큰 5, 200회):
`project_node_issues` p50 122 us, max 149 us. derive 전체 p50 330 us, max
495 us. 바뀐 답의 `ingest_remote_session` 전체 p50 1.90 ms 중 투영은 약 6%입니다. 이
수치로 cache는 두지 않았습니다.
  - fan-out: derive 결과는 발행본과 다를 때만 발행됩니다(기존 규칙). 결과가 같으면 frame이 늘지 않습니다.
- 남는 것: 잘못된 연결 값 기록(`InvalidLinks`)은 checkout 1024개가 상한이고, 넘으면 비우고 다시
셉니다. node의 미확정 토큰은 node workspace마다 하나이고 node session과 함께
지워집니다(`forget_device_catalog`).
  - 프로젝트당 `gh` 호출은 늘지 않습니다. 연결 이슈는 기존 node 읽기에 실립니다.
- branch note는 core에 다이얼하는 node의 worktree 읽기에서만, 읽기마다 `Call::PathFacts`를
한 번, lock 밖에서 부릅니다.
  - cleanup은 진행 단계마다 node session을 한 번 다시 만들고, 단계 수는 행과 셀 수로 묶입니다.
  - 아직 하지 않은 것: C x I 탐색은 참조로 찾는 map으로 바꿀 수 있지만, 20 x 100에서는 이득이 없습니다.
- 알고 둔 비용(따름 작업): 연결 쓰기 한 번, Overview 열기나 카드 refresh 한 번마다 그 node의 모든
Git 저장소를 링크 너머로 다시 읽습니다(`request_device_worktrees(node, true)`). 한 root만
읽는 길이 아직 없습니다. 읽기는 lock 밖 worker에서 하나씩 돌아 막히지는 않습니다. 이 기계의
`refresh_worktrees`도 모든 저장소를 읽지만, node에서는 링크와 node 쪽 git 실행이 비용입니다.
- **따름 이슈** (이 PR이 닫지 않음):
- #974 `gh`가 설치돼 있지만 로그아웃이면, GitHub remote가 없는 프로젝트도 Local 대신 'GitHub,
not logged in'으로 보입니다. reader가 remote를 보기 전에 NotLoggedIn으로 답하기
때문입니다(`github.rs` `read_root`). 옮기기 전과 후가 같습니다.
- #983 `lsof`는 listener가 없으면 빈 출력과 exit 1로 답하는데 hide-host가 이를 실패로 읽어,
listener가 없는 리눅스 기계에서는 cleanup을 할 수 없습니다.
- #984 core의 checkout card(`snapshot.card`)와 `card_refresh`는 web,
desktop, hided 어디서도 읽거나 보내지 않습니다(web `SnapshotRest`에 `card`가 없음). F5대로
node 체크아웃도 채웠고, 지우는 일은 따름 이슈로 둡니다.
  - #963 core 이동 리뷰 follow-up 묶음(옮겨 둔 동안 만든 mini 자신의 Local 이슈).

## Evidence

- **확인한 것**:
- CI verify: head `4c27e3563`(#961 head `8b89e76c6` 병합 위)에서 계획된 모든 레인
통과, Windows와 desktop e2e macOS 포함(run 38204305228, #2164). Design
contract도 같은 head에서 통과(run 38204304831, #2082). package와 os contract
macOS는 계획되지 않았습니다. 재시도로 통과한 테스트는 없습니다.
- 앞선 head `10a534c61`의 CI에서는 #961의 `hided::it
core_move::a_driver_killed_after_the_retirement_finishes_the_move_back`이
60 s hang guard로 한 번 끊기고 재시도에서 통과해, `docs/TESTING.md`의 flaky 정책대로 CI
flaky report가 #986을 열었습니다. 그 수정(#961 `a97f18ed3`, 종료 전 진단 기록 비우기)을 병합한
뒤로는 첫 시도에 통과합니다(`4c27e3563`에서 37.165 s).
- 되돌리기까지 도는 journey(F6)
`core_move::a_moved_machine_s_project_keeps_its_issues_through_the_move_and_back`:
로컬 `58b21a1bd`에서 통과(19.601 s, 그 뒤 커밋은 web 테스트 주석 한 줄만 바꿈), CI remote
mailbox 레인 `4c27e3563`에서 통과(29.246 s), `issue_source_set` 없이.
- `runtime::tests::node_issues` 32개 통과: 실제 host dispatch(FakeDevice)와 실제
git 위에서, node Herdr는 FakeHerdr로.
- 결함 심기: 첫 구현 8종과 리뷰 1, 2, 3회차 수정마다 하나씩. 심을 때마다 해당 테스트만 실패했고, 복원 후
통과했습니다.
- native(격리 fixture 이동 rig, Light/Dark): 맥북 프로젝트의 GitHub와 Local Issues,
New issue, cleanup 시트. 행 수정 뒤 재캡처에서 pane 없는 `app.worktrees/fix-sidebar`가
cleanup 후보로 나옵니다. New issue로 만든 L-3이 core store의 `devices[<node
id>][notes]`에 들어간 것까지 확인했습니다.
- `web/src/ProjectOverview.node.test.tsx`: gallery `node-project` 장면의
snapshot으로 실제 Overview를 그려, node 프로젝트에서는 세 event가 node 프로젝트 id를 싣고 다이얼
기기에서는 아무것도 보내지 않는 것을 확인합니다.
- 로컬 gate: `7c4e844ac`에서 verify-web(web 1406, desktop 165), herdr-core와
hide-factory nextest 2261 통과, `cargo clippy --workspace --all-targets -D
warnings`, fmt, attribution, design contract, workstation identity,
capability readers, core-touches-no-machine, worktree removal boundary,
runtime gates, harness ignore. 병합 head `58b21a1bd`에서 fmt, clippy, web
typecheck, lint, test 1448, build, herdr-core nextest 2059, workstation
identity, runtime gates, capability readers, core-touches-no-machine,
attribution 통과. design contract는 `4c27e3563`에서 통과. hided 전체 nextest는
`58b21a1bd`에서 521/522(아래 확인하지 못한 것), CI rust workspace 레인은 `4c27e3563`에서
통과했습니다.
- **확인하지 못한 것**:
- check-hide-full, `nextest --workspace`, sasu verify: 디스크 여유 때문에 로컬에서
돌리지 않았습니다. CI의 rust workspace 레인은 통과했습니다.
- desktop e2e: 로컬에서는 돌리지 않았습니다. CI의 desktop e2e macOS와 Windows 레인은
통과했습니다.
- `ee2784dfb`의 로컬 nextest에서 `hided::it
node_session_activity::serve_preserves_kit_protocol_alongside_activity`
하나가 부하 중에 5 s capture deadline으로 실패했고, 혼자 세 번 돌리면 모두 통과했습니다(1.5 s).
`58b21a1bd`에서도 다른 worktree의 빌드 셋과 겹친 중에 같은 테스트가 child 시작 EAGAIN(os error
35)으로 한 번 실패했고, 혼자 세 번 모두 통과했습니다. 이 PR이 건드리지 않은 테스트이고, CI에서는 통과했습니다.
  - 측정은 디버그 빌드입니다. release 빌드로는 재지 않았습니다.
- checkout 없는 node PR 맡기기: 테스트의 가짜 Herdr가 `worktree.create`를 거절하므로,
worktree가 만들어진 뒤 node에서 agent가 시작되는 단계는 테스트에서 돌지 않았습니다. 그 단계는 새 브랜치
worktree와 같은 node 연결을 씁니다.
- 리눅스 node의 cleanup: 위 lsof 따름 이슈 때문에, listener가 없는 리눅스 기계에서는 cleanup이
실패합니다.
- cleanup이 프로젝트 경로를 PathBuf로 되돌려 철자를 바꾸던 것(리뷰 3회차 사소 5): macOS와 리눅스에서는 그
왕복이 같은 글자라 심은 결함이 실패할 수 없습니다. 철자가 바뀌는 것은 Windows core뿐이고, Windows 레인은
herdr-core의 node 테스트를 돌리지 않습니다. 테스트는 review가 프로젝트 경로를 그대로 싣는지만 지킵니다.

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

- journey 통과 줄(CI run 38204305228, remote mailbox ubuntu-latest, head
`4c27e3563`): `PASS [ 29.246s] (16/41) hided::it
core_move::a_moved_machine_s_project_keeps_its_issues_through_the_move_and_back`.
로컬 `58b21a1bd`: `PASS [ 19.601s]`. 이 journey는 core에 창(`client_kind`
web)을 붙여 둡니다. 창이 없으면 core가 GitHub 배경 읽기를 하지 않기 때문입니다. 두 core의 `gh`는 로그인된
대역입니다.
- `node_issues`가 확인하는 것: Local 읽기와 쓰기, 키 오적용 거부, GitHub 목록과 연결, gh 로그아웃
사유, 저장소 이름으로 생성, node에만 쓰는 연결, Overview 포커스, node cleanup(병합된 worktree
삭제, 바뀐 worktree 거부, pane 없는 worktree 포함), 옮기기 전 id 유지와 Inactive 접기와 펼침,
Factory, Start 연결, 다이얼 기기 제외.
- 결함 심기, 리뷰 1회차(각각 실패한 테스트):
  1. node derive의 접기 계산을 뺌: derive 단계 assertion(`[moved]` 접기).
2. 실패한 GitHub 읽기가 node의 지난 답을 통째로 바꿈: 보드의 tasks, task_key, 실패 사유와 마지막 읽기
시각.
  3. issue source 선택이 node 행을 다시 그리지 않음: 보드가 바로 바뀌는 테스트.
  4. node PR의 연결, 새 Local 이슈, 맡기기를 이 기계에서 함: 세 테스트 모두.
  5. 연결 해제가 저장소 이름을 요구: 해제 테스트(10 s 대기 끝에).
  6. chain helper에서 lineage나 미확정 토큰을 뺌: 각자 자기 테스트만.
7. New issue 목록에서 node 행만 기계 이름: `expected [ 'herdr-ide · Local', …(1)
]`.
  8. 다이얼한 기기에도 branch note를 물음: 그 테스트.
  9. 잘못된 연결 값을 매번 기록: `left: 7, right: 1`.
  10. 두 화면이 `s.rest` 전체를 구독: Profiler 테스트 둘 다 `expected 6 to be 5`.
  11. 저장소 이름이 없는 node 연결을 task 전에 거부: task가 생기지 않아 실패.
- 결함 심기, 리뷰 2회차(각각 실패한 테스트):
1. checkout 없는 node PR의 기존 브랜치 worktree를 거부: node Herdr에
`worktree.create`가 가지 않아 실패.
  2. All projects 의존 보드가 Local 키를 프로젝트 없이 묶음: 맥북의 L-1이 사라짐.
  3. GitHub 요청이 wake마다 링크 목록을 다시 계산: published 세션에만 있는 토큰을 읽어 실패.
  4. 바뀐 cleanup이 이전 node 행에 남음: 그 node 행의 옛 review.
  5. 저장소 이름이 없다는 이유를 버림: "origin이 GitHub가 아니다"라는 틀린 이유.
  6. node fold가 창의 선택을 무시: 고른 pane 없는 행이 접힘.
  7. 끊긴 링크로 branch note를 물음: `PathFacts` 호출이 남음.
  8. node 프로젝트 재읽기가 이 기계의 worktree와 디스크도 다시 읽음: 세대가 움직임.
  9. node 행이 이슈 목록을 `home_issues`에 다시 실음: wire에 두 번.
- 결함 심기, 리뷰 3회차(각각 실패한 테스트):
  1. node 행의 저장소 이름이 GitHub 답을 기다림: worktree 읽기만 답한 상태에서 `left: None`.
  2. 디스크 정리 시트가 이 기계의 행만 봄: node 정리가 도는 동안 시트가 `busy` 대신 `pending`.
  3. node가 거부한 저장소의 보드: 이유 없이 영원히 `reading`.
  4. cleanup 답이 프로젝트 경로를 싣지 않음: review의 `repository_root`가 빈 문자열.
- 결함 심기, 첫 구현(각각 실패한 테스트):
  1. reader가 `projects`만 읽음: Local 읽기와 쓰기, node 연결 쓰기.
  2. cleanup을 core 기계에서 실행: node cleanup.
  3. node 제외를 되살림: GitHub 목록, 로그아웃, Local 읽기와 쓰기, GitHub 생성, 연결 쓰기.
  4. `IssueBook`이 기계를 무시: Factory.
  5. Start가 이 기계에서만 연결: Start 연결.
  6. node 투영이 `repository == None`을 무시: source가 `local` 대신 `github`.
  7. 웹 게이트가 `remote_target_id`만 봄: `overview_refresh`가 비어 실패.
8. node의 pane 없는 worktree에 행을 더하지 않음: pane 없는 worktree의 cleanup과 옮기기 전
id 테스트 둘 다 실패(행이 생기기를 기다리다 시간 초과).
- native 재캡처(head `ca593dd58`, Light/Dark): app 프로젝트 줄이 `워크트리 1개`(수정 전
0개), cleanup 시트가 `전체 2`로 main과 `작은 체크아웃 1` 안의 `fix-sidebar`(워크트리 8.0
KB)를 후보로 보입니다. 수정 전 시트에는 main만 있었습니다. 사이드바는 pane 없는 worktree를 `에이전트 없는
worktree 1`로 접습니다.
- `fix-sidebar`는 `끝난 것`이 아니라 `쉬는 것`입니다. 브랜치가 main과 같은 커밋이고 연결 기록이 없어
landed가 아니기 때문입니다.
- 비용 측정 전체(디버그 빌드, 부하 평균 7.24 8.18 10.09, 200회, 두 번째 실행):
`project_node_issues` p50 121.8 us, p90 135.1 us, max 149.3 us.
`derive_device_session` p50 330.1 us, p90 340.4 us, max 494.7 us.
`ingest_remote_session` 바뀐 답 p50 1.900 ms, max 2.155 ms, 같은 답 p50 1.624
ms, max 1.861 ms. `refresh_device_catalog` p50 492.6 us, max 772.5 us. 첫
실행과 3% 안쪽으로 같습니다.
- 같은 시트, Dark:

<img width="1440" alt="옮긴 뒤 맥북 프로젝트의 디스크 정리 시트 (Dark)"
src="https://github.com/user-attachments/assets/613c5458-f3fb-4ac0-9cff-c1f830cfb60c"
/>

</details>

## 머지 절차

이 PR의 base는 #961의 브랜치(`spec/core-host-node-move`)라서, 그 전에는
`premerge-check`가 판정하지 않습니다(base가 main이 아니면 거절).
1. #961이 main에 머지된 것을 확인합니다.
2. 이 PR의 base가 main으로 바뀌었는지 확인합니다. 이 저장소는 머지된 head 브랜치를
지우고(`delete_branch_on_merge`), GitHub가 그 브랜치를 base로 둔 PR을 main으로 옮깁니다.
바뀌지 않았을 때만 `gh pr edit 966 --base main`을 실행합니다.
3. `python3 scripts/premerge-check.py 966`을 실행하고, 그것이 출력하는 머지 명령을 그대로
칩니다.

base가 바뀌어도 verify는 새로 돌지 않습니다(`pr.yml`은 opened, synchronize, reopened,
ready_for_review에만 돕니다). premerge-check는 head의 마지막 verify 결과를 읽고 그때의
main과 합친 결과에서 빠른 검사를 돌리므로, push는 필요 없습니다.
yansfil added a commit that referenced this pull request Oct 12, 2026
## Summary

Memory's analysis and receipt walk refused a whole session read when one
JSONL line passed 256 KiB (`session_capacity:line_bytes:262144`).
On the installed 0.1.0-main.b70d00a3 build, 134 of 310 recent herdr-ide
Claude Code sessions hold such a line, mostly a screenshot tool result:
none of them was analyzed, their receipts were never read, and each pass
logged the failure again (about 5 per 90 s).

- Both readers now read through the conversation reader the label read
and search already use (`Call::SessionConversation`). It reads past an
oversized record without holding it and counts it; the pass logs that
count once (`receipts.records_skipped`, `analysis.records_skipped`).
- A cursor saved by the old reader resumes at its offset
(`CursorCheckpoint` converts into `ConversationCheckpoint`).
- A session that still cannot be read is logged once per version of its
file (size, mtime), at most 4,096 remembered, and the record now names
the session.
- The line reader (`SessionCursor::read`, `Call::SessionChunk`,
`hide_host::sessions::chunk`) had no other caller and is removed with
its tests.
- A node advertises the Memory reader for a runtime only beside its
conversation reader. Protocol 24 predates `SessionConversation`
(protocol 26) and now advertises none, and the walk reads a session only
when the node holding it advertises both. An older node's sessions are
left unread, as for a runtime with no Memory reader, never logged as
`walk_failed`.

## Review

- **조심해서 볼 파일**: `herdr-core/src/runtime/memory_analysis.rs` - failure
path: `read_through` records the file size when a read reached the end
it saw, so a torn last line is not reread every pass (the old reader
recorded its read position the same way).
- **조심해서 볼 파일**: `hide-node-link/src/protocol.rs` - a `Call` variant is
removed; Memory only asks the core's own node, which ships in the same
build.
- **비용 검토**: no new resident work; each pass makes the same one bounded
read per session (1 MiB cap) and keeps one map of failed reads, capped
at 4,096 entries, owned by `MemoryWork`.
- **조심해서 볼 파일**: `hide-node-link/src/sessions.rs` - the protocol-24
reader contract shrinks (Memory removed for Claude Code and Codex CLI),
since this PR removes the call such a node answered for Memory.
- **Merge order with #961**: both edit the Memory paragraph of
`docs/ARCHITECTURE.md` (the one on receipts and the 1 MiB read).
Whichever lands second resolves that one conflict; the Rust files merge
cleanly.

## Evidence

- **확인한 것**: new test
`a_session_holding_an_oversized_tool_result_is_analyzed_and_its_receipts_read_past_it`
writes a Claude Code session with the operator's rule, a 300 KiB
tool_result, an assistant reply and a signed receipt, and runs real
passes through `hide_node::Local`. The provider input holds both turns
and no tool bytes, the receipt is recorded, the skip is logged once with
`{"non_conversation_capacity": 1}`, and a second pass logs nothing.
- **확인한 것**: the same test on the base code (fix reverted, test kept)
fails: the pass reports `analyzed` with no card instead of `learned
one`.
- **확인한 것**:
`a_session_that_cannot_be_read_is_logged_once_per_change_of_its_file`:
an unreadable saved cursor logs both failures on the first pass, nothing
on the second, and both again after the file changes.
- **확인한 것**: `verify-cargo.sh lint` (fmt + workspace clippy) clean;
nextest over every crate the change reaches (herdr-core, hide-factory,
hide-host, hide-node, hide-node-link, hide-session, hided): 3284 passed,
38 skipped.
- **확인한 것**: `check-core-touches-no-machine.py`,
`check-no-workstation-identity.sh`,
`check-capability-readers-off-lock.sh` pass.
- **확인한 것**:
`an_older_nodes_sessions_are_not_read_for_memory_and_log_no_failed_read`:
a node built from a protocol-24 Hello that refuses
`session_conversation` gets no read, no provider call and no Memory log
line. The test fails with `receipts.walk_failed` if protocol 24 still
advertises Memory.
- **확인한 것 (live)**: hided built from this branch ran on an isolated HOME
and state folder (`/tmp`, removed after), with a private pinned Herdr
0.9.3 and `HIDE_MACHINE_ID=live-check-node`. It walked a scratch git
Project with Memory on (seeded with card m1) and a Claude Code session:
a rule, a screenshot `tool_use`, a 300 KiB image `tool_result`, an
assistant reply and a signed receipt.
- **확인한 것 (live)**: `core.jsonl` logged `receipts.records_skipped` and
`analysis.records_skipped` once each (`non_conversation_capacity: 1`)
and never `walk_failed`, `session_failed` or `line_bytes`. The receipt
was recorded at `event:308911` (after the image line), card m2 was
learned, and both cursors reached 309473 (the file size). Over 150 s of
later passes, no new Memory line.
- **Provider in the live check**: stubbed. `claude` on the login PATH
was the repository's `hide-ai/tests/fixtures/fake-claude.py` with
`FAKE_REPLY` set. The prompt it received (463 chars) held both turns and
no image bytes. The first pass deferred analysis until the weekly usage
was read (`analysis.deferred: weekly_usage_unread`), as designed.
- **확인하지 못한 것**: macOS/Windows CI lanes run only in CI.
yansfil added a commit that referenced this pull request Oct 12, 2026
…ory (#1000)

## Summary

- 지금 추출 프롬프트는 30 KB 그룹당 카드 약 4.7장을 만들고 절반이 "한 작업의 설계"라서, 운영자가 지운 카드의
39%를 같은 출처에서 다시 만들었습니다.
- 추출 프롬프트를 교체하고(세션당 새 카드 2장, 운영자 발언 3회 미만 세션은 카드 없음, 에이전트가 시작시킨 세션의 사람
이벤트는 `parent_agent`), 카드가 의존하는 파일·경로·명령을 증거로 저장합니다.
- 증거가 바뀐 카드는 `확인 중`으로 에이전트 인덱스와 프롬프트 매칭에서 빠지고, 하루 한 번 provider가 다시 확인해
유효(복귀)·수정(새 revision, Undo 가능)·삭제(Undo 가능) 중 하나로 정합니다.
- 규칙·교훈을 제안하기 전에 저장소 AGENTS.md/CLAUDE.md와 링크 문서, 운영자의 전역 지침 파일을 한 번 대조해,
이미 적힌 카드는 포인터 카드로 바꾸거나 제안하지 않습니다.
- 에이전트가 `hide memory outdated <card> <reason>`으로 승격 중 낡은 카드를 알릴 수 있고, 탭은
`확인 중` 표시 한 가지만 더 그립니다(4개 언어).
- **공개 변경**: 공개 문구(disclosure)가 버전 3으로 올라 저장소 파일과 지침 파일 전송을 명시하므로, 기존에 켠
모든 Project는 한 번 꺼지고 다시 동의를 묻습니다. 저장된 Memory는 그대로입니다.

화면 변경은 카드 상태 슬롯의 `확인 중` 한 줄과 disclosure 문구입니다. 캡처는 로컬(`agents/runs/`)에만
있어 이 본문에는 올리지 못했습니다.

## Review

- **판단해 주세요**: 추출 프롬프트 `newb`(운영자 선택)가 `new`보다 지운 카드를 3장 더 닮습니다(5 vs 2).
수치는 아래 Evidence입니다.
- **판단해 주세요**: 전역 지침 파일 매칭이 `in_docs`이면 포인터 대신 카드를 forget합니다(Undo 가능).
포인터는 저장소 경로가 있어야 하기 때문입니다.
- **판단해 주세요**: 점검 호출은 일일 상한의 절반(`MAINTENANCE_CALL_LIMIT` 500)까지만 씁니다.
PRD D-08보다 엄격합니다.
- **조심해서 볼 파일**: `herdr-core/src/runtime/memory_analysis.rs` - #961(다중
노드 pass)·#991(긴 줄)과 겹쳐 main을 두 번 병합했고, `analyze_session`이 `delegated`와
`stat`를 모두 받습니다.
- **조심해서 볼 파일**: `herdr-core/src/runtime/memory_verify.rs`,
`memory_evidence.rs` - 분석 worker 위의 provider 호출·노드 읽기. runtime mutex
안에서는 아무것도 하지 않습니다.
- **조심해서 볼 파일**: `hide-memory/src/store.rs` - 스키마 9(`VACUUM INTO` 백업 후
마이그레이션, 기존 카드는 모두 `확인 중`으로 시작), 판정은 읽은 revision과 claim에만
적용(`confirm_card`, `revise_card`, `forget_checked`).
- **조심해서 볼 파일**: `hide-memory/src/verify.rs` - provider로 가는 발췌. 긴 파일은
카드와 단어가 겹치는 섹션을 고르고, 자격 증명 이름의 파일은 읽지 않습니다.
- **비용 검토**: 점검은 pass당 재확인 4장, 제안 전 점검 3장, 증거 비교 200장, 지문 읽기 300+200회로
상한이 있고, 카드당 하루 한 번(답이 온 경우) 물으며 hook은 노드도 모델도 부르지 않고 SQL 조건 하나로 `확인 중`을
거릅니다.
- **알려진 한계(코드 수정 안 함)**: 노드 링크가 끊긴 사이에 쓴 카드는 증거 없이 검증되어 이후 비교되지 않습니다.
- **알려진 한계(코드 수정 안 함)**: 운영자 발언 3회 미만이어서 건너뛴 세션의 앞부분은 이후에 다시 읽지 않습니다(닫힌
세션이 영원히 미정으로 남는 것을 피하려는 선택).
- **알려진 한계(코드 수정 안 함)**: 지침 파일 속 지시문이 provider의 수정 판정 텍스트에 영향을 줄 수 있습니다.
수정은 새 revision이며 Undo가 가능하고, 비밀·credential 검사는 거칩니다.
- **알려진 한계(코드 수정 안 함)**: 이 변경 전에 만든 카드는 위임 세션에서 온 사람 횟수를 그대로 가집니다. 이전
hook 도우미는 스키마 9 저장소를 읽을 때 kit이 갱신될 때까지 닫힌 채 실패합니다(fail closed).
- **알려진 한계(코드 수정 안 함)**: 260px 폭의 한 줄 맞춤은 갤러리에서 수동 확인했고 자동 테스트는 없습니다.
Pen 라이브러리는 갱신하지 않았습니다.
- **질문**: 운영자의 herdr-ide 저장소는 기존 카드 895장을 가집니다. 설치 후 비우고 새 규칙으로 다시 추출할지는
운영자 결정입니다.

## Evidence

- **확인한 것**: `scripts/verify-cargo.sh clippy` 경고 없음,
`scripts/verify-cargo.sh test -p hide-memory` 워크스페이스 46개 테스트 바이너리 모두
통과(herdr-core 라이브러리 테스트 2천여 개 포함), `verify-web.sh` 통과,
`check-design-contract`, `check-core-touches-no-machine`, 워크스테이션 신원 검사
통과.
- **확인한 것**: 프롬프트 비교(30개 실제 세션 + 지운 카드의 근거 68개 그룹). 현재 4.70장/세션, `new`
0.27, `newb` 0.40. 지운 67장 중 같은 내용을 다시 만든 수는 현재 26, `new` 2, `newb` 5. 보존
가치가 있는 비율은 현재 34%, `new` 85%, `newb` 92%.
- **확인한 것**: 실제 저장소 복사본(895장 규모)으로 스키마 8 -> 9 마이그레이션과 백업 파일 생성, 증거 추출기
정밀도(지운 카드 67장 중 7장이 이동한 이름을 가짐, 유지 카드 89장 중 0장).
- **확인한 것**: 네이티브 리뷰 3종(Fidelity, Code, Security)을 돌려 지적을 고쳤습니다. 마지막 리뷰
head는 병합 전이고, 이후 변경(자격 증명 이름 파일 제외, 답이 온 점검만 실패 표시 해제, 발췌 단어에 alias 포함)은
테스트로만 확인했습니다.
- **확인하지 못한 것**: 운영자의 설치된 앱과 실제 provider로 하는 라이브 점검. 격리 HOME의 합성 저장소
테스트와 스크립트된 provider 응답까지만 확인했습니다.
- **확인하지 못한 것**: `parent_agent` 이벤트 종류가 포함된 프롬프트의 실제 모델 동작. 위임 세션은 운영자
발언 0회로 계산되어 모델까지 가지 않습니다.
- **확인하지 못한 것**: 프로젝트의 필수 suite가 sasu에 설정돼 있지 않아 `sasu implement
verify`는 필수 suite 0개로 통과했습니다. 위 lane은 제가 직접 돌린 결과입니다. 스크린샷은 업로드하지 않았습니다.

## Breaking change

- 공개 문구 버전 3: 기존에 켠 모든 Project가 한 번 꺼지고 Settings에서 다시 켜야 합니다(저장된 Memory
유지).
- 스키마 9로 올라가면 이전 빌드는 이 저장소를 열 수 없고, 마이그레이션 직전 상태는
`project-memory.sqlite3.v8-backup`에 남습니다.

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

- Base: origin/main 04721d3 병합 후 head는 PR 상단 참조. 로컬 PRD
`memory-card-quality`(사람 승인 완료).
- `sasu implement verify`: PASS(필수 suite 없음), 프로젝트 lane은 위 Evidence에 직접
기재.
- 리뷰: Fidelity P1-P2 수정, P3-P7 Review 노트로 수용. Code 16건 중 한계로 남긴 항목(링크
끊김, 첫 청크, 전역 파일 전송 등)을 제외하고 수정. 후속 Code 리뷰에서 N1-N3 수정. Security: 자격 증명
이름 파일 제외로 수정, 나머지 낮은 위험은 한계로 기재.

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

1 participant