Repository navigation
Move the core to another machine and back from the window - #961
Merged
Merged
Conversation
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.
… Explorer's open folders change machine
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.
…nto spec/core-host-node-move
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
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>
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.
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).
상대 기기가 링크를 받은 뒤 답하지 않으면 운영자가
그만 기다리기로(되돌리기에서는여기로 가져오기) 기다림을 끝낼 수 있습니다.옮기는 동안 창 위 띠가 단계와 입력 잠김을 보이고, 상대가 답하지 않으면 끝에
그만 기다리기가 붙습니다.Review
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에서도 뺐습니다.옮긴 뒤 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 측정).
비용은 링크 왕복입니다: 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) 같은 일을 빨리 하는 것이 아니라 일이 적은 것입니다.
<기기>에서 실행하세요 gh auth login과 복사를 주고, Hide AI는 기기 이름만 말합니다. agent별 로그인 명령은 제품이 검증한 것이 없어 만들지 않았습니다.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).hided/src/supervisor.rs,hided/src/supervisor/move_back.rs- 이동과 되돌리기, 재개, 포기의 순서.hided/src/core_move/(driver,target,gate,control,abandoned) - 상대 기기 단계와 lease, 포기 기록. 포기는 그것을 내놓은 기다림만 끝냅니다(11a65f8).herdr-core/src/node_migration/copy.rs,reown.rs- 상대가 이름 짓는 경로와 rekey. SQLite 확인의 경로는 UTF-8이 아니면 거절하고 ASCII 밖 바이트를 escape합니다(693bfad).hided/src/server.rs,hided/src/lib.rs- role 종료 때 core 소켓을 1012로 닫기.core_linkalias(c7f906e), node held screen의core_move전달과 처리(hided/src/node_daemon/screen.rshold()), 창의web/src/ws.ts(그리지 않은 창은 이동이 진행 중이거나 node가 잡고 있을 때만 붙들기, a9618e4).scripts/check-core-touches-no-machine.pySTORES 항목 네 개(이유 포함), workstation identity를 피한 테스트 경로 두 파일.a_core_that_gives_its_copy_back_forgets_its_login_item이#[cfg(unix)]가 되었고, Windows는 login agent 계약의 not-supported 테스트가 고정합니다.Review 세부: 번들과 다른 점, 바뀐 기존 동작, 결함 둘
승인된 디자인 번들과 다른 점:
desktop/static/status.css)는 daemon에서 운영자 테마를 읽을 수 없습니다. 번들 final-4는 Light도 그립니다.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 실행에서 찾았습니다.바뀐 기존 동작:
core-state.json에 한 번 쓰는focus_from_herdr를 남깁니다. 첫 세션이 쓰고 다음 저장이 지우며, 옛 빌드는 무시합니다.memory_hook입니다(main의memory는hide memory명령).agent_notice)은 이동 frame 옆으로 갑니다. 상태 페이지는 빌드 줄(#builds) 아래에 Copy diagnostics를 둡니다.memory_unavailable).core-placement.json에 남아 재시작 뒤에도 유지됩니다. 배치 기록 변경은 모두placement::update(프로세스 잠금 하나)로 갑니다.hide connect는 login item이 돌리는 core를 멈추지 않습니다. 더 새 앱은core-update로 업데이트하고, 더 옛 앱은core_newer를 받습니다.hide-platform의 OS 중립 계약 뒤에 있습니다. launchctl 자체가 실패하면 로그에 'launchctl did not answer: ...'가 남습니다(화면에는 닿지 않음).계약과 링크:
inspect단계에서 하고, attach socket의Release줄과 hello의move_intent는 attach 빌드 거절과 이동의 Build 확인이 지킵니다.VerifyOutcome::Lost추가도 같은 빌드끼리만 잇는 규칙(B10 option C)에 기댑니다.contracts/hided-ws.schema.json-core_moveframe과 이벤트(abandon포함),core_link의disconnected단계,alias. 더하기만 했습니다.copy::carried(옮기는 저장소 아래의 상대 경로)로만 읽고, verify와 place는node.json이 이 기기와--target을 가리키지 않는 사본을 거절합니다.core_move의alias). core_link의 alias와 같은 규칙입니다.factory.sqlite3를 rekey하고, 다시 읽히지 않는 schema-1 사본factory.v1.sqlite3는 rekey하지 않습니다.바뀐 기존 테스트:
delivery/ledger.rs,mailbox.rs의Letter::reserve_bell호출과watch.rs의 편지 리터럴: 서명에 ledger 시계가 더해졌고(빈 값은 예전처럼 벽시계), 확인하는 내용은 그대로입니다.node_migrationlegacy와 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
verify-cargo.sh nextest --workspace4274/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개로 돌렸습니다.verify-web.sh, remote_core journey 24/24.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 정의 없음).premerge-check.py 961이 main 2766ca98f에 대해 통과합니다.nextest --workspace첫 실행에서hide-nodea_flooding_pane_holds_back_neither_another_panes_keys_nor_its_frames가 load 18에서 한 번 실패하고 혼자서 5/5 통과했습니다(이 브랜치는 hide-node를 바꾸지 않음). 처음에 journey를 모두 한꺼번에 띄운 실행은 fixture가 디스크를 채워 실패했고, 지금 기록은 thread 3개 실행입니다.verify-cargo.sh nextest --workspace4217/4217(89 skip), web 1398 통과(1 skip), desktop 165 통과(4 skip), lint와 typecheck.<mini host>로 가렸습니다(#964).start.held기록,core_move.rs:2478)에서 실패했습니다. 은퇴한 기기의hided core-login은 0으로 끝났지만, 큐에 남은start.held를 writer가 쓰기 전에 프로세스가 끝나 기록이 사라졌습니다.core.jsonl에서 기록을 잃었고(stderr에는 남음), 고친 뒤는 load 없이 200번, load 옆에서 200번 모두 0번입니다. 기다리지 않는 drain을 심으면 새 단위 테스트가 20/20 실패하고, 고친 테스트는 50/50 통과합니다. journey는 load 옆에서 고치기 전 20/20, 고친 뒤 20/20 통과(로컬에서는 고치기 전에도 재현되지 않았습니다).@needs-focus와 Windows check는 로컬에서 돌리지 않음(CI green).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를 남겼습니다.이동:
<mini host>· reconnecting". 끊긴 동안 친 표시 키 12개는 어느 pane에도 닿지 않았고, sshd를 되살리자 2,324 ms에 다시 붙어 pane, 붙은 상태, 보기, 탭, URL이 같았습니다.B18 MacBook pane 짝(cand - b520d6e, idle과 driven, p50/p95):
dfc9118df의 짝 1-3과 f1-f4의 mini 행은 "기기 helper 없는 기준(host.failed)"이라 판정에 쓰지 않았습니다.
B18 mini pane, 다섯 세트(23:49-00:41, 모두 AC, MacBook load 8 이상 20개 실행 중 17개):
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키씩:
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 움직여, 멈춤은 시계 차가 필요 없는 링크 왕복(각 기계 자기 시계의 구간 차)으로 셌습니다:
멈춤은 두 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). 그래서 행끼리 같은 조건입니다:
b520d6e 행의 hide-agent-hooks는 2c23e057입니다(전에 쓴 2a38c874와 빌드 명령이 다름).
추가 증거
결함을 심어 실패를 본 증명(고친 코드를 빼면 실패하고, 넣으면 통과):
move_not_waiting, 두 번째 요청은 busy(control 단위 테스트). 끝난 제안의 포기는 같은 이동의 다음 기다림을 끝내지 않음(intent만 맞추는 코드를 심으면 실패).stopped_for로 시작이 막혔다가(시작 시도는 core 없이 0으로 끝남) 닿으면 retire되고 기록이 지워짐(J3). supervisor의 hold를 빼면 gate의 거절(exit 2)에서, 두 hold를 모두 빼면 상대에서 core가 켜져 실패.web/src/ws.test.ts가core_move는 보내고 다른 이벤트는 버리는지, 그리지 않은 창을 이동이나 node가 잡을 때만 붙드는지 확인.a_core_that_will_not_stop_is_restarted_unchanged). 상한을 풀면 exit를 기다리다 시간 초과.m1 ...)를 받고, node의hide memory show m1이 node의 Project 카드를 보입니다.node_link(..., "disconnected")에서 실패.native 캡처(후보 dev 창, 비공개 user data, 모든 상태 경로가 fixture 안, 격리 Herdr와 sshd):
측정과 메모:
move.abandoned,abandon.failed(상대의 handover 잠금을 잡아 둔 동안 busy), 잠금을 놓은 뒤 4 s 안에abandon.ended(answerended) 순서이고 기록 파일이 지워짐.core_move::a_failing_check_changes_nothing이 test renderer의 2 s 첫 snapshot 읽기에서 EAGAIN으로 한 번 실패(main의 support 코드). 혼자서는 통과.target/debug/hide가 잘린 적이 있습니다.a_resumed_move_whose_alias_cannot_be_read_waits_for_its_peer가 부하 아래 한 번 실패했습니다. 제품의 30 s 링크 대기 뒤에야 쓰이는 기록을 테스트도 30 s만 기다린 경쟁이었고, 이제 링크 대기에 준비 상한을 더해 기다립니다.ledger.load_failed(validation)가 남았고 b520d6e 기준에서도 같습니다(환경, 이동과 무관).Breaking change
contracts/hide-cli.json의 Letter에intake_from이 더해져 CLI 계약 digest가 바뀝니다. 더하기만 했지만, 옛 digest에 고정한 도구는 갱신할 때까지 거절합니다.Verification record
verify-cargo.sh nextest --workspace4274 통과(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)