Repository navigation
Ship core-host-node-terminal - #836
Merged
Merged
Conversation
A node owns its panes' terminal attaches: the herdr terminal session child, its reader and writer, the attach rules (wait for size, observe on owner conflict, frame guard, observer re-attach, bounded retries), held keys and the input facts the core hears. Not wired yet.
The core no longer carries terminal bytes. Keys and viewport reports go from the web socket to the terminal router, which hands them to the node that holds the pane (this machine's Herdr, or a device inside its node link). Output goes from the node into the screen-side hub, which keeps a bounded ring per pane, shares chunks between clients and resumes a client from one hub-wide sequence or redraws the pane. The core keeps the control facts: which panes are shown, asleep or closing, attach requests, resize, scroll and click, and the input reports the node sends for labels and delivery. Snapshot frames no longer carry terminal chunks, the terminal sequence, chunks_dropped or input_generation. The attach child and the attachment file removal leave the core: the clipboard image is removed by the core's own node through a new RemoveClipboard call, so the machine-access check lists neither file.
The web shell reads pane output from `terminal` frames the hub sends beside the core's snapshots, and keeps the hub's cursor rather than the snapshot's. A whole snapshot clears the cursor, and the hub then names the client's new one in a frame with no chunks; a client that kept its terminals but has no cursor has every pane drawn again from a full frame. The ws contract describes the terminal frame, the key and terminal_viewport events that go straight to the pane's node, and what have_terminal_sequence resumes.
ARCHITECTURE gains the terminal path: the node's terminal service, the router and the hub, a device's terminals inside its link, and the one table of what goes to the core and what goes between the screen and a node without it. PERFORMANCE_TESTING's ownership ledger names the terminal service, the report pump and the hub with their caps, and the keyboard rule now says a key never takes the runtime lock. Tests: a node reports keys while the runtime lock is held and a key publishes nothing (B5); a letter right after the first key on a quiet pane is held (B7); a SIGKILLed hided and a dropped device link each leave no terminal session child, on the pinned Herdr in the remote mailbox lane (B20).
The probe that drives a real device's owned fixture pane now attaches through the device's node link and its terminal service, as the screen's router does, rather than an SSH exec of its own from the core. It keeps its fixture variables, markers and assertions and names the build the device runs.
…emove an abandoned upload
…ce Herdr repaints a scroll as changed cells
…spells ~/ from the account's own home
…n home, before anything connects
Main builds each crate's integration tests as one binary, so the terminal children test and the remote terminal probe become modules of hided's and hide-node's tests/it, and the remote mailbox lane selects them by module.
…uns, and keep one base64 helper for terminal bytes The node runs every attach now, so LiveContext.herdr_bin had no reader. The core and the node each carried the same base64 pair; it lives once in hide_node_link::terminal, beside the lines that carry the bytes.
…a key flood once a window whether or not the node knows the pane Reports left the service after its lock was released, so a release could overtake a first frame's report and leave the core reading a pane as controlling with no session. Both sinks take a report without waiting, so they are now handed over under the lock, as output already was. A key into a pane the service has no entry for reported an error per key, each one a core error and a snapshot. One window per pane and kind now covers known and unknown panes alike.
… terminal line again when the link was only busy A chunk over 1 MiB was dropped as an overflow even with nothing queued, so a dense screen on a large display never drew and its redraw was asked for again and again. A full frame now replaces what of its pane waits for a reader and is never counted against the cap, and any chunk is taken when nothing counted waits, on the screen's hub and on a device's uplink alike. A line longer than any link carries (8 MiB) is dropped on the device with a diagnostic and no redraw loop. A device link's writer that another call held for 30 seconds sent nothing, yet the terminal writer treated it as a failed link and refused every key of the device until it reconnected. A busy link now gets the line again, first, with its keys still counted against their pane's cap.
…t it sends up A device's node is another machine's program, yet the router took output and reports for any pane it named. Output now reaches the screen's hub only for a pane the core attached on that device; a report only for such a pane or one on screen; a paste's outcome only for a paste held on that device; a creation request's discarded keys never, since the core opens those for this machine's panes. A device's word that a key moved the keyboard counts only for the pane the last screen key went to, and the core ignores an input report for a pane it does not project. What else a device sends is dropped and counted in the log once a window. The link's reader ends a link whose terminal line passes 8 MiB rather than decode it under the hub's lock, a device's diagnostic record keeps only its plain fields cut to size, and its proxy keeps a pane's state only for a pane the core attached. A key for a device with no link is refused once a window per pane, like a node's own refusals.
… its link returns B16: attaching five of a device's panes over the loopback sshd opens no connection of their own, and each pane's state comes back up the link. B17: after the link drops, the shown device pane attaches again inside the link that comes back.
…ading a caller's configuration hided's SSH parser and OpenSSH read some spellings apart (Port=22841, a tab, Include, Match), so a configuration the guard accepted through ssh -G could still send hided to an account's own sshd on port 22. The guard now takes the alias's parts, writes the one configuration hided reads, passes the same parts to the harness's own ssh with no configuration file, and refuses recorded host keys for any other host or port.
…usy link and what a device's node may send up
…s node may send the core A refused key past the first of its window, on a node or at the router, is counted and logged when the window passes, and at most 256 subjects hold a window of their own. A device's report is refused when a name in it is not a short plain name, its messages are cut to 512 characters, and at most 1,024 reports a second are taken from one device. A device's word that a key moved the keyboard counts within two seconds of that key, and output that raced a release is forgotten at the hub again. The held-keys test reads every input line, since the session can open before the keys.
…ull frame as nothing A chunk past 4 MiB is not drawn and its pane waits for a full frame that fits, asked for only when the long chunk was not full itself. A client takes at most 4 MiB of text per frame. A resumed client counts a full frame in the ring as it counts a live one, and a backlog that is not a full frame passes the cap even when nothing waited before it, on the hub and on a device's uplink. The guides state the pane bound as 3 MiB plus one waiting full frame, and the router's bounds.
…evice measurement
…e's lines only for its own panes Device ids are free text, so of devices `a` and `a:pane:b` the id remote:a:pane:b:pane:w1 read as either. The router now gives it to the longest device id that matches, tells each device only the shown panes it owns, and takes a device's output and reports only for panes that resolve to that device, so no device speaks for another's pane.
…past it as stalled Controls, views and redraws to a device had no bound; keys were capped per pane only. Everything waiting for one link is now capped at 8,192 lines and 8 MiB, keys included. Past either, what waited is dropped with its keys named in the log, later keys are refused, a diagnostic names the device and the link's number, and the writer ends the link, so the panes read unavailable and attach again on the next link, as with any link that ends.
A paste whose write fails is never written again: the core retires it once its session's generation changes, and a failed write means that session is gone. Keeping the keys typed behind it changed only what the node held until the operator cancelled, so the change and its test, which delivered the paste to a new session, are withdrawn.
A device node's stderr reaches no log, so a reader thread that died in the sink left its pane looking connected with no record of why.
Forgetting every never-attached, unshown pane at the 128 cap also forgot the asleep, closing and watched-frame flags the core sends once, so a sleeping agent's pane took keys again after it attached. Only the panes a view alone named, and not a paste's target, are forgotten now.
…en its reader cannot start
Main's resume test now loops until the daemon settles; on this branch a snapshot carries no terminal cursor, so it follows the revision alone.
A paste refused because the pane's writer is past its backlog cap, or because the session is read-only, dropped its live callback, which runs done(false) and takes the node service's lock the caller already holds. Every refusal now disarms the callback, as the closed-channel one did.
Past 16,384 waiting reports the queue dropped whatever arrived, a pane's state and a paste's result included, and a node never resends a state it already sent. A report past that limit now takes the place of the waiting one about the same subject, keys folding in a submit or a focus move, so the core still ends at each node's last word; the queue grows only by new subjects, which their nodes cap, and past 65,536 of those a report is dropped and logged. A stopping pump still applies what was waiting.
…its output outside the uplink lock A device dropped every report past 4,096 unsent, a pane's state included. Its uplink now keeps reports as what they say and folds a report past that cap into the waiting one about its subject, by the rule the core's report queue uses, now shared as TerminalReport::same_subject and superseded_by; diagnostics wait apart and are the ones dropped past their cap. A frame is encoded before the uplink's lock is taken, so a large one no longer holds up other panes' output, reports or the link writer.
… frame Every caller of the node service waited in the output hand-over until its own deliveries were handed, so a Release or Forget sent under the runtime lock could wait on another pane's multi-megabyte frame, and a sink panic resumed on the core's thread. Only a session's reader now waits for its frames; every thread hands over its own batch and the small deliveries callers that do not wait queue, and stops at another reader's frame, which that reader is waiting to take. A sink panic is logged and the hand-over goes on.
The node's pane caps count entries, so a client naming ids of any length grew a node's memory with each one it named. A screen's key and view now name a pane or creation id of at most 512 bytes, the longest a device pane's id can be, and are refused past it like any malformed event.
A WatchFrame, a wake for a pane never put to sleep, created a pane entry that the cap counted and could never forget, so panes watched and never attached (a hidden tab, a refused or failed attach) kept a new pane's view from being drawn. A wake for an unknown pane now creates nothing, and watches live in their own map, at most the 64 operations the core keeps open, ended when the pane is released or forgotten.
Every terminal_resize a view reported went to the pane's node, and on to a device's link, even when the size had not changed, and the core logged resize_settled beside the node's own record. The core now sends only a changed or released size and leaves the record to the node; a new view at the grid its session already runs at, which relied on that unchanged resize for its full frame, now has the node ask Herdr for the whole screen itself, as a redraw does.
A device whose link is up without terminals, because its helper speaks protocol 24 or its terminal service did not start, read on its panes as a helper that is not connected. The link now carries why it has none, the core hands that to the router, and the device's panes read unavailable with that reason until a link with terminals is installed.
A full frame, an overflow and a forget scanned a client's whole queue under the hub's one lock, every pane's chunks included, and freed what they dropped there: behind a client stalled with about a million small chunks across 64 panes, one pane's full frame held every other pane's output for 11.5 ms. A client's chunks now wait in a queue per pane, taken in the hub's order through an index of each pane's first chunk, and what a pane's change drops is freed after the lock; the same full frame held the lock about 10 us.
A waiting reader handed over the next reader's frame too, since its check had no upper bound, so with several panes printing one reader could stay in the hand-over while its own pane went unread.
The core tells a node once that a pane's agent sleeps or the pane is closing; a device linked again starts a fresh node that was never told, so keys reached the shell under a sleeping agent. The router keeps both sets beside the shown panes and replays them on install.
A device's node reports to the router that holds it, so with a device linked the router, this machine's terminal service and its sessions outlived the core's handle and ended only with the process. The handle removes every device's terminals once the core's owner thread is joined.
A client that asked for a pane's full frame while another client's ask was in flight lost its request, and an ask was repeated only while the pane printed, which the node does not pass on while it waits for a full frame; a lost answer left the pane blank. Each client's request now stays until a full frame of its pane arrives, is asked again every two seconds on a timer, and is given up and logged after ten.
A page that outlived its daemon named a cursor of the old hub, and once the new hub's sequence passed it the client was resumed with chunks it never held over the old daemon's screen. Each hub draws a random epoch, every terminal frame carries it, the client names it with its cursor, and a cursor from another hub, or one named without an epoch, has every pane drawn again.
A frame shown before Herdr's layout applied a zoom or resize does not count, and the core asked the pane's node to watch again on every such frame: one report, one runtime lock and one control per frame while the layout was pending. The core now watches when Herdr accepts the change and once more when the layout applies it.
The router tells a device's new link which panes are closing before the core attaches them, and the node dropped a closing control for a pane it did not track, so keys typed there read as a pane with no terminal and would be written once it attached.
yansfil
added a commit
that referenced
this pull request
Oct 10, 2026
Related: core-host-node 4단계 (core-host-node-remote-core). 선행 PR #836 (3단계, node가 가진 터미널 길). Closes #912 ## Summary core 위치 기록(`<state>/core-placement.json`)이 있는 기기의 hided는 자기 core를 켜지 않고 node 역할로 돌며, 그 기록이 가리키는 기기의 core에 SSH 연결 하나로 붙습니다. 화면은 지금처럼 자기 기기의 hided `/ws`에만 붙고, node가 화면의 core 트래픽을 그 연결로 중계하며 자기 pane의 키, 출력, 파일, 페이지는 자기 기기 안에서 처리합니다. core 쪽은 `hided attach`가 그 기기에서 이미 도는 core에 연결을 이어 주기만 하고, core를 켜지 않습니다. core에 닿지 못하면 창은 지금의 reconnecting 표시를 보이고 입력을 받지 않으며, SSH가 다시 닿으면 10초 안에 그대로 이어집니다. 이 기록은 5단계의 옮기기와 검증 fixture만 쓰므로, 합쳐져도 운영자 경로에서 보이는 것은 바뀌지 않습니다. main에도 닿는 수정 하나: pane bootstrap listener가 끝날 때 자기 `/tmp` 비공개 폴더까지 지워, 멈춘 hided가 폴더를 남기지 않습니다(SIGKILL로 죽은 경우는 여전히 남음). CI gate 하나도 바꿉니다: cargo-nextest pin을 0.9.143에서 0.9.146으로 올렸습니다. 0.9.145 전의 nextest는 macOS에서 함께 띄운 테스트가 옆 테스트의 출력 pipe를 물려받게 해, 아무것도 남기지 않은 테스트를 LEAK으로 표시했습니다(nextest-rs/nextest#3553). `.config/nextest.toml`은 그보다 오래된 로컬 nextest에 경고만 합니다. 측정 도구도 하나 고칩니다: `scripts/web-shell-measure/key-echo.mjs`는 키를 보낸 시각을 측정 프로세스(Node)의 시계로, 화면에 그려진 시각을 page의 시계로 읽어, 두 시계 사이의 실행마다 다른 차이(+75, -21, -22 ms를 봄)가 그대로 키-에코 값에 들어갔습니다. 이제 page에 심은 capture 단계 keydown listener로 두 시각을 모두 page 시계로 읽고, 음수 sample은 세지 않고 실행을 멈추며, Node 시계 값과 두 시계 차이는 교차 확인으로 함께 남깁니다(`summarize.py`가 trial마다 보고). ## Review - **판단해 주세요**: 보안 근거. C의 core는 M의 node가 자기 Herdr 소켓으로 이어 주는 NodeLink stream으로만 M의 Herdr에 닿습니다. C에는 streamlocal forward도 파일시스템 소켓도 없어, C 계정의 다른 프로세스(Hermes, `codex` daemon)는 M의 Herdr API를 얻지 못합니다. NodeId가 C 자신의 node이거나 C가 dial하는 SSH device인 inbound 링크는 거절하고, 살아 있는 node의 NodeId로 온 두 번째 링크는 앞 링크에 3초 Hello를 먼저 묻습니다(아래 재접속 줄). attach socket은 비공개 0700 폴더의 hide-platform ipc이고 같은 계정의 peer만 받습니다. C 계정의 프로세스는 이미 core의 화면 token을 읽을 수 있어 core의 신뢰 경계 안에 있습니다. - **판단해 주세요**: 보수적으로 읽은 것(구현 계획의 해석 1-5와 받아들여진 수정): - B4의 '파일 열기'는 파일 byte, viewer, macOS 열기를 뜻하고, 문서 텍스트는 core가 가집니다. - 동등 기능은 inbound node에만 켜고, SSH device는 오늘의 한계를 그대로 둡니다. - C 창이 M pane에 붙여넣거나 끌어 놓으면 이유와 함께 거절합니다(화면 기기로 SFTP 올리기 없음). - 위치 기록은 C의 프로그램과 선택적인 상태 폴더도 적습니다. - inbound node의 Explorer 감시는 2초 polling입니다. - 2초 SSH port probe로 B9의 10초와 D-20의 2-60초 backoff를 함께 지킵니다. - inbound device 행의 Retry는 거절하고(node가 스스로 다시 붙음), Remove는 그 링크의 권한을 거둡니다. - M이 링크로 붙어 있는 동안 운영자 알림은 링크로 M의 Herdr에 가고, 진단이 어느 Herdr인지 적습니다. - **판단해 주세요**: core를 C에 두면 C 계정이 M 계정과 같은 신뢰가 됩니다. M의 node는 C에 기기 계약 전체를 답하고, 허용 목록은 두지 않았습니다. - **판단해 주세요**: C의 agent가 `hide agent spawn --machine <M>`으로 M에 agent를 띄울 수 있습니다. 의도로 둘지, 운영자 허락 뒤로 막을지. - **판단해 주세요**: node 창에 뜬 페이지의 브라우저 제어(B4, B13, B15). M 창은 CDP gateway를 M의 hided에 등록하고(주소와 control token은 M을 떠나지 않음), core는 창의 owner pid만 relay grant로 받습니다. 권한(자격 확인, 범위 결정, 페이지 열기/닫기/선택)은 core가 정하고 M에 링크로 capability를 묻습니다. M의 호출자는 M loopback capability를 받고, 페이지 명령은 M hided의 relay 전용 loopback port에 있는 1회용 relay URL(10초)로 직접 붙어 CDP가 링크를 건너지 않습니다. M의 relay는 아직 쓰지 않은 ticket을 포함해 4개까지이고, 넘으면 gateway에 묻기 전에 `browser_relay_limit`으로 거절합니다. C나 device의 호출자는 core가 링크 stream(링크당 4개, 넘으면 `browser_relay_limit`과 `link_stream.cap_reached` 진단)으로 같은 relay에 중계하며, capability URL은 받지 않습니다(`browser_control_elsewhere`). 링크가 끝나면 M이 ticket을 버리고 relay를 4011 `browser_relay_gateway_lost`로 끝내며 gateway에 새 `POST /revoke`를 보냅니다(세 번까지 묻고 실패하면 `revoke.failed` 진단, 데스크톱의 기존 lease가 마지막 안전망). 창 선택 순서(호출자 기기의 창, core 창, 하나뿐인 node 창, 같은 종류가 여럿이면 `browser_control_ambiguous`)가 맞는지 봐 주세요. 이 순서 때문에 자기 창을 알리지 않은 M 호출자는 core 창이 있으면 그쪽으로 가고, 그때 CDP는 링크를 건넙니다. - **판단해 주세요**: 보안 리뷰 F1 - M의 창이 요청한 페이지 동작(열기, 닫기, 선택)은 core가 그 창의 이름으로 실행하므로, M은 자기 창에 보이는 어떤 checkout의 page View든 바꿀 수 있습니다. M의 화면이 이미 core에 shell 이벤트를 보내므로 권한 확대는 아니라고 읽었습니다. F3 - M이 알린 owner pid는 core가 확인할 수 없습니다(M 기기의 프로세스). M 계정을 core와 같은 신뢰로 두는 첫 번째 질문과 같은 결정입니다. - **판단해 주세요**: B1 확인(Observer 질문): 지금 구성(core가 이 Mac, mini는 device)에서 device pane의 `hide browser open`과 `connect` 답은 바뀌지 않습니다. node 창은 node 링크로 붙은 기기만 알리므로 SSH device 구성에서는 node 창이 없고, 창 선택이 core 창으로 가서 main과 같은 이 Mac loopback URL을 답합니다. `browser_control_elsewhere`는 core에 창이 없고 node 창이 하나뿐일 때, 즉 core를 다른 기기에 둔 새 구성에서만 나옵니다. 그때도 `hide browser open`은 열기를 성공으로 답하고 `browser_control: {state: "unavailable", reason, next_action}`을 붙입니다(`hided/src/cli.rs` `browser_open`, e2e가 reason과 next_action을 확인). - **판단해 주세요**: node link protocol은 28 그대로 두었습니다. 이 PR이 27에서 28로 올렸고 28은 아직 배포된 적이 없어, link stream이 끝을 이름 짓는 변경(`LinkOpen{end}`, `link_data`/`link_closed`)을 같은 28 안에 넣었습니다. main의 27 빌드가 설치한 device helper는 hello에서 거절되고(`only_the_audited_previous_helper_protocol_is_admitted`가 27을 거절함을 확인), 이 빌드가 가진 helper가 digest 비교로 다시 설치됩니다. - **판단해 주세요**: B13 차이: Pi/omp류 sleep은 node에서 거절, Herdr 이름 없는 node pane은 `wake-<pane>`으로 깨어남, device PR 행에 issue 연결 없음. - **판단해 주세요**: M의 `origin` URL이 C의 `gh` 로그인으로 읽을 저장소를 정합니다. 처음 본 저장소 고정이나 호스트 제한은 넣지 않았습니다. - **판단해 주세요**: B1 차이: device label lock이 그 기기 Herdr 소켓 옆으로 옮겼고(옛 `label-generators/*.lock`은 지우지 않음), SSH device workspace는 로컬 listener를 잡지 않으며, SSH device node는 무시하는 `Mirror` 줄을 받습니다. 기존 테스트 하나(`pane_auth::tests::long_state_directory_keeps_a_short_private_bootstrap_socket`)는 listener가 자기 비공개 폴더까지 지우게 바뀐 동작(조기 리뷰 L4)에 맞춰, 폴더를 직접 지우던 줄을 폴더가 사라졌는지 확인하는 줄로 고쳤습니다. - **판단해 주세요**: label 표시도 바뀌었습니다(조기 리뷰 R8, L18, 이 Mac의 core와 SSH device에도 해당): lock 첫 질의에 답이 없는 동안 그 기기의 저장된 label을 보이고(전에는 provider 이름), 대기 중인 worker는 저장된 label을 숨기며, protocol 27 node의 `InvalidRequest`를 더는 '서버 없음'으로 읽지 않습니다. 이에 맞춰 `labels/generator.rs`의 기존 assertion 네 곳을 고쳤습니다. 업그레이드 중 옛 빌드와 새 빌드가 잠깐 서로 다른 lock 파일을 잡을 수 있고, 옛 `label-generators/*.lock` 파일은 남습니다. - **판단해 주세요**: 테스트 설정 변경: `hided/tests/it/support/remote_delivery/mod.rs`는 설치 직후 device의 CLI를 한 번 실행합니다(macOS가 새 실행 파일의 첫 실행을 검사하는 시간이 hook 예산 1.25초 안에 들어가 spawn journey가 첫 시도에 떨어지던 문제, docs/TESTING.md 규칙 8). `.config/nextest.toml`에 `remote_core::`용 240초 hang guard를 remote mailbox와 같게 추가했습니다(제품 경계 30-60초를 기다리는 journey가 있어서). - **판단해 주세요**: 터미널 크기는 마지막으로 입력(키, 붙여넣기, 마우스 보고)을 보낸 화면을 따릅니다. 휴대폰의 키는 `hided/src/mobile/pane.rs`를 거쳐 Herdr에 바로 가고 core의 attach set이나 `Event::Key`를 지나지 않으므로 크기를 정하지 않습니다. 오늘의 동작 그대로입니다. - **판단해 주세요**: nextest pin은 CI만 지킵니다. `.config/nextest.toml`의 `nextest-version`을 `required`가 아니라 `recommended`로 둔 것은, 합쳐진 뒤 이 Mac의 Homebrew 0.9.143으로 도는 로컬 실행을 모두 거절하지 않기 위해서입니다. 오래된 nextest의 거짓 LEAK은 통과한 테스트에 표시만 남깁니다. - **판단해 주세요**: 테스트 설정 변경: `hided/tests/it/support/remote_delivery/mod.rs`의 fixture 계정은 운영자의 `GIT_` 변수를 넘기지 않고 `GIT_CONFIG_NOSYSTEM=1`을 둡니다. main의 `remote_delivery`, `held_letter_notice` journey도 같은 계정을 씁니다. `remote_core` journey의 `git`은 모두 그 계정의 git(`Herdr::git_init`, `environment.command`)으로 돌아, 운영자의 서명 설정과 agent가 fixture에 닿지 않습니다. - **질문**: 맥북 창의 rail은 mini의 core를 `This Mac`으로, 맥북 자신을 맥북의 호스트 이름과 `Remote`로 보입니다(native QA에서 확인, 캡처는 실행 기록에만 둠). PRD는 화면 기기의 창이 어느 기기를 This Mac이라 부를지 정하지 않았고, 이 단계에서 core 위치 기록은 fixture만 쓰므로 바꾸지 않았습니다. 5단계에서 core를 옮길 때 이 이름을 core 기준으로 둘지 화면 기기 기준으로 둘지 정해 주세요. - **판단해 주세요**: 같은 node id로 다시 붙으면 앞 연결에 3초 안에 Hello를 묻고, 답이 없으면 끊고 새 연결을 받습니다. node id를 흉내 낸 두 번째 클라이언트도 답 없는 연결은 끊을 수 있습니다. - **판단해 주세요**: 밀린 화면은 1013 `screen_fell_behind`로 닫히고 shell은 첫 재시도(1초)에 다시 붙습니다. 그 순간 reconnecting 표시가 보입니다. 1012/1013은 WebSocket 전송 종료 코드라 `/ws` schema의 closeCode(4001-4004)는 그대로 두었습니다. - **판단해 주세요**: 알려진 빈틈: M 화면에서 연 제3 기기 checkout의 page는 `host_unavailable`로 거절하고, M의 localhost에서 대신 열지 않습니다(`docs/BROWSER_DISPLAYS.md`). - **조심해서 볼 파일**: `hided/src/attach.rs` - 붙기 역할, supersede, relay grant 수명, accept 재시도 (failure path). - **조심해서 볼 파일**: `hided/src/node_daemon.rs`, `hided/src/node_daemon/screen.rs`, `hided/src/node_daemon/terminals.rs` - 화면 relay, 끊긴 동안 hold, core pane 키 보관 64 KiB/3초 (high-frequency path, failure path). 마지막 커밋(94b9a44)은 이 파일과 `server.rs`의 relay 부분을 `node_daemon/`과 `server/relay_routes.rs`로 옮긴 순수 이동입니다. - **조심해서 볼 파일**: `hide-node/src/ssh/host.rs`, `hide-node/src/ssh/link_streams.rs` - link control lane과 Herdr stream 닫기, 거절된 local link의 stream 정리, 링크당 close worker 하나와 close 알림 대기열 36개(넘으면 `link_stream.close_unsent` 진단, node가 5초 안에 답하지 않으면 `link_stream.close_unanswered`) (failure path). - **조심해서 볼 파일**: `herdr-core/src/runtime/inbound.rs`, `herdr-core/src/labels/generator.rs` - runtime mutex 아래의 inbound 등록과 상한, label lock 역할. - **조심해서 볼 파일**: `hided/src/relay.rs`, `hided/src/server.rs` - core 쪽 relay tap과 화면 relay 상한 (high-frequency path, snapshot wire). - **조심해서 볼 파일**: `hided/src/node_browser.rs`, `hided/src/browser_control.rs`, `hide-host/src/link_bridge.rs` - node의 gateway 등록, ticket과 relay, 링크 종료 때 revoke, core의 창 선택, 링크 stream 끝(Herdr와 browser relay) (ownership, failure path). - **비용 검토**: 모든 core는 attach socket 하나와 accept에서 막혀 쉬는 thread 하나를 더 가집니다(연결이 없으면 깨어나지 않음). node 역할에서만: core 위치 기록 감시(2초 간격), 끊긴 동안만 도는 port probe, node당 terminals relay 하나, relay grant당 link 종료를 기다리는 task 하나(폴링 없이 링크의 closed watch로 깨어남), 링크당 close worker 하나, node의 link stream마다 writer thread 하나(링크당 Herdr 32개, browser relay 4개 상한 안, stream과 함께 끝남), core 쪽 terminals relay마다 쓰기 task 하나(relay와 함께 끝남), 끊긴 동안 port probe의 이름 풀이 thread 최대 하나(probe는 1초만 기다림), link마다 control lane worker 최대 4개, 창 알림 task 하나(5초마다 창 pid 확인, 거절되면 2초에서 1분까지 늘려 재시도), relay 전용 loopback listener 하나. core 쪽 상한: inbound node 16개(`nodes_full`), node당 화면 relay 6개, relay 요청 64개, 화면당 4 MiB 뒤 1013 resync, core pane 키 보관 64 KiB/3초. - **판단해 주세요**: 브라우저 쪽에서 고치지 않고 남긴 낮은 위험: (1) M의 CLI는 core 답의 relay URL이 가리키는 loopback port면 어디든 붙습니다. core(링크를 쥔 쪽)나 M의 코드가 이미 있어야 쓸 수 있어 남겼습니다. (2) relay 전용 listener에는 header-read 시간 제한과 연결 수 상한이 없습니다. loopback 전용이고 daemon 본 listener와 같은 조건이며, 도는 relay는 4개로 묶입니다. (3) browser relay stream의 대기 상한은 chunk 128개(최대 48 KiB씩, stream당 6 MiB)로, byte가 아니라 chunk를 셉니다. (4) ticket은 claim 전에 발급되어 최대 10초 relay 자리 하나를 잡습니다. - **판단해 주세요**: 구조 리뷰(a660bb3) 반영. 기기의 링크가 열리는 방식을 `LinkOrigin { Dialed { ssh_alias }, Inbound }` 하나로 두고 runtime의 inbound 분기를 그 정책 메서드로 바꿨습니다(저장 형식 `ssh_alias`/`inbound: true`는 그대로, 둘 다 있거나 둘 다 없는 항목은 `device_registration.unreadable` 진단과 함께 버림). dial 전용 메서드는 `DialedTransport`로 나눠 inbound에 빈 identity와 helper_path가 없습니다. 링크 종료는 `RemoteHost`의 watch로 알리고 1초 폴링 네 곳을 지웠습니다. 재접속 분기와 health의 `core_link_reason`은 `LinkFailure` enum이 정하고, frame 종류는 serde로 읽어 키 순서에 기대지 않습니다. 화면 이벤트는 한 번만 parse합니다. node의 Boundary roots는 요청마다가 아니라 core가 root를 열 때 바뀝니다. backoff는 `hided/src/backoff.rs` 하나를 씁니다. 동작이 바뀐 넷(close worker, 재접속 분기, attach 결과, roots)은 바꾸기 전 코드에서 실패하는 테스트를 두었습니다. 그 밖에 바뀐 동작 둘: relay, 중계된 화면, relay grant가 링크 종료 뒤 1초 안이 아니라 바로 끝납니다. inbound 기기에 연결 테스트를 누르면 예전의 실패한 테스트 행 대신 `device.test_inbound` 오류(그 기기 쪽에서 테스트하라는 안내)가 나오고 테스트 행은 생기지 않습니다(`herdr-core` 단위 테스트가 확인). frame과 화면 이벤트의 종류를 serde로 읽으므로 frame마다 앞 32 byte가 아니라 전체를 한 번 훑습니다. 측정(B5, B21)은 기준 안이었습니다. - **판단해 주세요**: B3를 이렇게 읽었습니다. 'core 없음'은 기록이 없는 경우와 기록은 있으나 그 core가 더는 답하지 않는 경우를 함께 뜻하고, 어느 쪽이든 attach 역할은 아무것도 켜지 않습니다. health의 이유는 셋으로 나눴습니다: 기록 없음 `no_core`, 기록은 있으나 core가 답하지 않음 `core_not_answering`, 기록을 믿을 수 없음 `record_untrusted`. 화면에는 차이가 없습니다. `hide connect`는 `other_build`만 따로 답하고 나머지는 모두 ok로 창을 열며, 창은 같은 reconnecting 표시를 보입니다. node는 셋 모두 같은 backoff(2초에서 60초)로 다시 붙습니다. core 프로세스가 죽어 기록이 남은 경우는 이제 `no_core`가 아니라 `core_not_answering`이어서, 이를 확인하는 e2e(`a_screen_whose_core_is_not_running_attaches_and_waits_for_it`)의 기대값을 바꿨습니다. 같은 e2e가 이제 core를 다시 켜고(죽은 core의 attach socket은 그대로 둠) 화면에서 아무것도 하지 않아도 node 링크가 live가 되는지 확인합니다. node가 `core_not_answering` 뒤에 다시 붙지 않도록 결함을 심으면 이 테스트가 실패합니다. 오래된 기록(`Stale`)은 CLI 코드 `invalid_bootstrap_socket_record`를 그대로 씁니다. - **후속 이슈**: 구조 리뷰 10번 - `Runtime`에 기기별로 따로 붙은 HashMap 여섯 개(ports, disk, github 등)를 `DeviceFacts` 하나로 모으고 정리 경로를 하나로 합치는 일은 이 PR에서 하지 않았고, 후속 이슈 #900으로 남깁니다. - **판단해 주세요**: 코드 리뷰 1회차(6e3c688) 반영으로 바뀐 동작: - node가 보관한 core pane 키를 보내지 못하면(보내기 실패, 링크 종료, task 중단) 그 키는 화면의 기존 '보내지 못함' 오류로 알리고 다시 보내지 않습니다. 링크가 막 끝나 core에 닿을 길이 없을 때 core pane에 친 키는 'This machine's panes are not reachable now; this key was not sent'로 거절합니다(전에는 Ok로 답하고 사라짐). - 기다리는 node가 잠에서 깨거나 주소가 바뀌어 backoff를 2초로 되돌리는 것은 그 기다림이 '닿지 못함'이거나 '살아 있던 링크가 끊김'일 때뿐입니다. `other_build`, `nodes_full`, `dialed_device` 같은 core 거절은 60초까지 늘어난 backoff를 그대로 지킵니다. link-local 주소(IPv4 169.254/16, IPv6 fe80::/10)는 macOS의 awdl0, llw0이 스스로 바꾸므로 주소 변화로 세지 않습니다. - 붙기 실패 중 '닿지 못함'은 SSH 서버가 host key를 보이기 전에 끝난 dial뿐입니다. host key, 인증, 모르는 alias, channel 상한, exec 실패는 `ssh: ...` 이유로 끝나고 port probe를 하지 않습니다. fixture의 꺼진 sshd처럼 TCP를 받고 바로 끊는 경우는 key를 보이기 전이라 '닿지 못함'입니다. - port probe의 이름 풀이는 별도 thread(`core-resolve`, 한 번에 하나)에서 돌고 probe 전체가 1초에 묶여, 네트워크가 끊긴 동안 node를 끝내도 resolver 시간 제한만큼 기다리지 않습니다. - core의 terminals relay는 쓰기와 읽기를 나눠, 느린 forward로 가는 큰 출력이 node의 키와 링크 종료 읽기를 막지 않습니다. relay tap은 출력을 base64로 바꾸기 전에 가질지 정하고, tap 목록을 chunk마다 복사하지 않습니다. - 로컬 Herdr stream 읽기의 `Interrupted`는 링크를 끝내지 않고 다시 읽습니다. - GitHub 저장소 이름이 `.`으로 시작해도(`acme/.github`) 받고 `.`, `..`만 거절합니다. `https://` remote의 포트는 GHES host에 남기고, ssh/git remote의 포트는 버립니다. - **판단해 주세요**: F2 - core는 `establish`와 `accept_inbound_node` 전에 accepted를 씁니다. 흔한 거절(`own_node`, `dialed_device`, `already_linked`, `nodes_full`, `other_build`, `grants_full`)은 그 전에 답합니다. 그 사이 경쟁 구간의 거절이나 실패한 `establish`는 node에 stream 종료로만 닿고, 이유는 core의 로그에 남습니다. - **판단해 주세요**: F7 - node의 downstream 쓰기는 SSH data 메시지마다 `spawn_blocking` 하나를 씁니다(`BlockingWriter`도 같음). B5-B7과 B21은 기준 안이었고, 오래 사는 writer 하나로 바꾸는 일은 후속으로 둡니다. - **판단해 주세요**: F13 - attach 역할은 마지막 stdin 읽기부터 조용한 시간을 셉니다. core가 30초 넘게 멈춘 쓰기는 말이 많은 node를 `node_silent`로 끝내고, 어떤 끝이든 exit 0입니다. - **판단해 주세요**: 3단계(#836)의 키-에코 gate 숫자도 같은 두 시계 차이를 지녔을 수 있습니다. 그 차이는 실행마다 상수라 크면 불가능한 sample로 드러나지만, 몇 ms면 보이지 않습니다. 이 PR은 3단계 숫자를 다시 재지 않았습니다. - **판단해 주세요**: 코드 리뷰 2회차(f07116c) 반영으로 바뀐 동작: - core의 terminals relay에서 writer task가 panic하거나 취소되어도 relay가 끝난 task를 다시 기다리다 panic하지 않고 `writer_ended`로 끝나며, relay가 drop되면 writer도 끝납니다. relay가 끝나면 tap을 먼저 빼고, close frame은 100 ms까지만 기다립니다. - 보내지 못한 core pane 키 알림은 화면 연결마다 개수와 원인으로 모아 한 burst에 한 번 보냅니다(예: '70 keys for the core's panes were not sent: the link to the core ended'). 원인은 '너무 오래 기다림', '링크 종료', '쓰기가 끊김' 셋입니다. 전에는 줄마다 broadcast(64)로 보내 밀린 화면은 알림을 잃었고, 모두 '너무 오래 기다림'이라고 했습니다. - SSH 서버가 답한 뒤의 전송 실패(키 교환 중 reset이나 timeout, channel 실패, 끊기거나 답 없는 handshake)는 이제 기다리는 node를 잠/주소 변화에 깨웁니다. host key, 인증, alias, 이 빌드가 읽지 못하는 답은 깨우지 않습니다. known_hosts가 거절한 host key는 자기 operation(`remote-host-key`)을 가집니다. - 답하는 core port는 한 장애(닿지 못한 기다림과 그 사이의 dial들) 동안 한 번만 probe합니다(전에는 한 번 걸러 계속). 장애가 끝나거나(링크, 또는 port 너머의 실패) 기기가 움직이면 다시 시작합니다. 처음에는 phase가 바뀔 때마다 다시 시작했는데, 그러면 앞 기다림의 '답 없음'이 버려져 재시도 직후 SSH가 돌아오면 node가 16초 backoff를 기다렸습니다(B9 journey가 부하에서 3번 중 1번 실패). 장애 단위로 바꾼 뒤 혼자 5번, lane에서 통과했습니다. - port probe는 풀린 주소마다 남은 시간을 고르게 나눠, 먼저 나온 죽은 IPv6 주소가 살아 있는 IPv4 주소의 시간을 다 쓰지 않습니다. - link stream 닫기는 streams lock 밖에서 합니다(Windows에서 CancelIoEx가 stream마다 200 ms쯤 기다릴 수 있음). - `is_repository`는 `valid_repository`를 두 부분으로 쓰므로, `-`로 시작하는 owner나 이름을 이제 거절합니다. - **판단해 주세요**: 코드 리뷰 3회차(5525f4b) 반영으로 바뀐 동작: - 기다리는 redraw가 만료되거나 링크와 함께 지워지거나 쓰기가 끊겨도 화면에 '키를 보내지 못함'을 알리지 않고 로그(`terminals.redraw_dropped`)에만 남깁니다(화면의 다음 view가 다시 묻습니다). 키와 붙여넣기만 알립니다. - relay가 보내기 전에 같은 pane을 두 번 forget해도 node는 Forget을 한 번 받습니다(전에는 두 번째 forget이 앞서 넣은 Forget을 지워 node hub에 pane이 남았습니다). - `hide connect`, `hide status --json`, `hide open`은 daemon을 찾을 때 읽은 `/health`에서 역할과 node를 읽어 주소를 만듭니다. 두 번째 health 요청이 없으므로 방금 답한 daemon이 부하에서 그 요청을 놓쳐 실패하는 일이 없습니다. node가 이 빌드가 받지 않는 기기 id를 대면 주소를 내주지 않고 `connect`는 `no_response`와 이유로 답하며(데스크톱은 이미 이 이유를 실패로 보임), 전처럼 node 화면을 core 화면 주소(`&node=` 없음)로 열지 않습니다. - 화면 relay의 forward 실패는 dial처럼 나눕니다. 운영자가 고칠 실패는 움직임에 깨우지 않습니다. - **판단해 주세요**: H2 - `LinkWrite`는 control lane에서 돕니다. 읽지 않는 peer로 가는 쓰기는 그 worker를 `WRITE_TIMEOUT`(5초)까지 잡은 뒤 stream을 끝내므로, 그런 stream 넷이 한 번의 5초 동안 lane을 잡을 수 있습니다. 상한이 있고 예전 socket write timeout과 같으며, 막히지 않는 대기열은 후속입니다. `is_control` 문서를 그렇게 고쳤습니다. - **판단해 주세요**: H3의 남은 부분 - attach 프로그램이 끝나 handshake 전에 EOF가 오는 경우(예: 프로그램 경로가 틀림)는 여전히 transport 실패로 읽혀 움직임에 깨웁니다. attach channel은 EOF에서 읽기를 멈추고 exit status는 EOF 뒤에 올 수 있어, 그 구분은 싸게 얻을 수 없습니다. 틀린 경로는 움직일 때마다 한 번 더 dial할 뿐 backoff는 그대로입니다. - **판단해 주세요**: H6 - port가 한 번 답한 뒤에는 그 장애가 끝날 때까지 probe하지 않으므로, 한 장애 안에서 답했다가 사라졌다 다시 돌아온 port는(이 기기가 움직이지 않으면) 보지 못하고 node는 backoff(최대 60초)를 기다립니다. G3과 맞바꾼 것입니다. - **판단해 주세요**: H7 - 풀린 주소마다 1초 probe를 고르게 나누므로, 앞의 죽은 주소는 다음 주소에 0.5초를 남깁니다. happy-eyeballs식 경주는 후속입니다. - **판단해 주세요**: B6 판정 기준 - PRD는 B6(mini pane의 키-에코 p50, p95가 기준 build의 device pane보다 느리지 않음)에 noise 허용치를 두지 않았습니다. 세 pair의 후보-기준 차이 중간값이 p95는 0 이하, p50은 +0.5 ms 이하이면 '느리지 않음'으로 읽었습니다. 같은 세트에서 같은 경로끼리 비교한 B5 pair가 -0.6 ~ +0.8 ms로 흩어지므로, 0.5 ms는 이 계기의 pair noise 안입니다. 이 해석으로 충분할까요? - **질문**: L10 - SSH device 등록 때 같은 node id의 inbound node를 거절하려면 연결 전에 machine id가 필요합니다. 붙을 때의 한쪽 거절로 충분할까요? ## Evidence - **확인한 것**: - 최종 head f56fb5eac에서 remote mailbox lane 전체(`remote_delivery`, `held_letter_notice`, `remote_core`, `terminal_children`, 26개)를 cargo-nextest 0.9.146으로 이 Mac에서 통과, LEAK 0, FLAKY 0, 재시도 0. 같은 head에서 sasu verify(`verify-cargo.sh test`, `lint`) 통과, CI의 모든 check 통과(Linux remote mailbox 포함). f56fb5eac는 b875f51c4에 H5의 health 재사용(`hided/src/cli.rs`만)을 더한 head입니다. - 코드 리뷰 2, 3회차 수정도 caller가 볼 수 있는 것마다 테스트를 두었고, 각 테스트는 옛 동작을 심으면 실패합니다: 죽은 writer가 relay를 끝냄(`a_writer_that_dies_ends_the_relay_without_a_second_poll`), node가 받지 않는 Close가 relay를 붙잡지 않음(`a_close_the_node_does_not_take_never_holds_the_relay`), 보내지 못한 키는 화면마다 원인과 함께 한 번 알림(`a_burst_of_unsent_keys_is_one_notice_per_screen_with_its_cause`), 버린 redraw는 키로 알리지 않음(`a_dropped_redraw_is_never_told_as_an_unsent_key`), transport 실패는 움직임에 깨고 고쳐야 할 실패는 깨지 않음(`a_move_wakes_a_transport_failure_but_not_what_must_be_fixed`, `a_forward_that_must_be_fixed_does_not_wake_on_a_move`), 답하는 port는 한 장애에 한 번만 probe(`the_watch_probes_an_answering_port_once_per_outage`, `a_port_that_comes_back_between_two_unreachable_waits_wakes_the_node`), 조용한 첫 주소가 다음 주소의 몫을 남김(`a_silent_first_address_leaves_the_next_its_share_of_the_probe`), 두 번 잊은 pane도 한 번 잊힘(`a_pane_forgotten_twice_before_a_send_is_still_forgotten_once`), 저장소 이름 검사(`an_owner_and_name_is_what_the_repository_validator_takes_without_a_host`), daemon 주소는 이미 답한 health에서 나옴(`a_daemon_s_address_comes_from_the_health_it_answered`, port에 아무도 없어도 주소가 나오므로 두 번째 요청을 하던 방식에서는 실패). G8(stream close를 lock 밖에서)은 Windows에서만 차이가 나 테스트를 두지 않았습니다. c337a6263에서 lane의 B9(`a_node_that_loses_its_core_holds_its_screens_and_returns_as_it_was`)가 두 시도 모두 실패했습니다. G3가 phase가 바뀔 때마다 probe 기록을 지워 앞선 기다림의 조용한 probe를 잃은 탓이었고, 63c9a714b에서 기록을 한 장애 동안 유지한 뒤 B9 단독 5/5, lane 26/26으로 통과했습니다. 측정 harness의 요약 테스트(`scripts/tests/test_measure_echo_summary.py`)도 시계 값을 빼면 실패합니다. - 코드 리뷰 1회차 수정은 caller가 볼 수 있는 것마다 테스트를 두었고, 각 테스트는 옛 동작을 심으면 실패합니다: 보내지 못한 보관 키가 화면에 알려짐(`a_key_the_relay_took_and_did_not_send_is_told_to_its_screen`), core 거절 중에는 잠/주소 변화가 기다림을 줄이지 않음(`a_sleep_or_network_move_cuts_short_only_a_wait_a_move_can_change`), link-local 주소 변화는 무시(`link_local_addresses_coming_and_going_are_no_network_move`), SSH에 닿기 전의 dial만 '닿지 못함'(`only_a_dial_that_never_reached_ssh_is_unreachable`), 멈춘 resolver가 probe를 기한까지만 잡음(`a_resolver_that_hangs_holds_the_probe_only_until_its_deadline`, 옛 방식은 30초), node가 받지 않는 쓰기가 core relay의 키 읽기를 막지 않음(`a_send_the_node_does_not_take_never_stops_the_relay_reading_its_keys`), 저장소 이름과 포트(`gh.rs` 단위 사례). tap 결정 순서(F6)와 `Interrupted` 재시도(F9)는 caller가 볼 수 있는 차이가 없어 테스트를 두지 않았습니다. dial 분류를 처음 TCP 연결 단계로만 두었을 때 lane의 `a_node_that_loses_its_core_holds_its_screens_and_returns_as_it_was`가 실패했고(fixture의 꺼진 sshd는 TCP를 받고 바로 끊음), host key를 보이기 전까지를 '닿지 못함'으로 넓혀 통과했습니다. - Windows의 link stream: node가 자기 Herdr stream에 write timeout을 걸었는데 Windows pipe는 이를 거절해, Windows node의 Herdr에는 링크로 닿지 못했습니다(windows check에서 `link_streams` 테스트 6개 실패). 이제 stream마다 writer thread가 쓰고, 링크의 control lane은 chunk마다 최대 5초 기다린 뒤 stream을 끝내며, 그 shutdown이 막힌 write를 풉니다. 새 테스트(`link_bridge::tests::a_write_to_an_end_that_stops_reading_ends_the_stream_at_its_deadline`)는 옛 방식을 심으면 이 Mac에서도 실패합니다(호출자가 10초 묶임). `hide_platform::ipc` 계약에 'shutdown이 막힌 write를 푼다'를 더하고 세 OS에서 도는 contract 테스트로 고정했습니다. - LEAK 원인: 0.9.143에서 remote mailbox lane은 여러 실행에서 한 회에 0-2개의 테스트를 LEAK으로 표시했습니다. 595d30480에서는 `remote_core::a_node_screen_reads_its_own_checkouts_files_without_the_core`였고, 이 브랜치가 더하지 않은 `held_letter_notice`도 표시된 적이 있습니다. 모든 descriptor를 보는 감시로 보니, 0.9.143에서는 다른 테스트 프로세스와 그 자식(herdr, hided, git, sh)이 실행 중인 테스트의 stdout pipe를 fd 28로 쥔 경우가 9번 있었고, 그 실행에서 LEAK이 난 테스트의 pipe를 다른 테스트가 13.9초 뒤까지 쥐었습니다. 0.9.146에서 같은 감시를 두 번 돌리니 테스트가 도는 동안 남이 그 pipe를 쥔 경우는 0번이었습니다. 테스트가 끝난 뒤 같은 pipe 주소를 쥔 프로세스는 두 버전 모두에서 보였는데, 0.9.146에서는 LEAK이 없어 다시 쓰인 주소로 읽었습니다. 판정은 실행 중 횟수와 lane 실행에 기댑니다. 0.9.146으로 lane 전체를 bcd5fa820에서 3회, 6037a4b, 3481d53, 6e3c6887a에서 각 1회 돌려 모두 LEAK 0. 같은 head에서 0.9.143으로 한 번 돌린 대조 실행도 LEAK 0이었습니다(간헐적). - `scripts/ci-flaky-report.py`를 0.9.146이 쓴 JUnit에 돌렸습니다(scratch crate, `retries = 1`, 1초 slow-timeout, `gh`는 stub): retry로 통과한 테스트와 slow-timeout으로 끝난 뒤 통과한 테스트(`test timeout`)를 각각 이름으로 접수하고, 두 번 실패한 테스트는 `Failed test` annotation만 쓰며, 깨끗한 실행은 아무것도 접수하지 않습니다. 0.9.143의 JUnit과 요소, 속성 구조가 같았습니다(다른 것은 메시지 속 thread id뿐). - `remote_core::a_node_checkouts_pull_request_is_read_with_the_cores_login_by_repository_name`의 첫 시도 실패(`Couldn't find key in agent?`)는 fixture의 `git commit`이 운영자의 전역 git 설정(서명)을 읽은 탓이었고, 계정의 git으로 바꾼 뒤 재발하지 않았습니다. - head 595d304(구조 리뷰 반영 뒤 origin/main 50개 커밋을 병합; 충돌은 `hide-platform/src/host.rs`와 그 테스트 둘로, 양쪽이 따로 더한 항목을 모두 남김)에서 `scripts/check-hide-full.sh`, cli, remote mailbox lane(`remote_delivery`, `held_letter_notice`, `remote_core`, `terminal_children`, ignored 포함 26개), os-contract, web build, web e2e 250개, desktop e2e `remote-workspace.spec.ts`(@needs-focus 제외)와 `remote-browser-agent.spec.ts`(사설 sshd 뒤) 모두 통과. `hide-node`, `hide-node-link`, `hide-host`, `hide-kit` nextest 511개 통과. - node 창의 브라우저 제어(B4, B13, B15): `remote_core::a_node_window_s_page_is_driven_from_its_machine_off_the_link_and_from_the_core_through_it`가 node pane과 core pane에서 실제 `hide`를 실행합니다. node pane의 open/snapshot/click 동안 core가 연 browser relay stream 0개, node relay가 실은 byte = gateway가 받은 byte, core relay 기록 0개. core pane은 같은 창을 링크로 snapshot/click. 창의 page action은 다른 페이지가 차지한 영역을 되돌리고, 알리지 않은 pid는 409. 링크가 끝나기 전 capability가 붙고, 끝난 뒤 revoke로 거절되며, node pane은 `hide_unavailable`. revoke를 빼는 결함을 심으면 이 테스트가 실패합니다. - B5 판정 측정(한 시계): f56fb5e release hided(b4e9f2424820e7ce)와 기준 b520d6e release hided를 번갈아 3 pair, 각 50 sample, nearest-rank, 매회 10,000키. core는 mini의 격리 fixture, 두 쪽 모두 이 head의 harness이고 바뀐 것은 측정한 binary뿐이며, 각 half는 이 Mac의 1분 부하가 8 미만일 때만 시작했습니다(시작 때 7.0/7.8/7.2/7.9/7.8/5.6, 끝난 뒤 3.5-17.4). 키 시각과 에코 시각을 page의 시계 하나로 잽니다. 맥북 pane의 후보-기준 차이는 pair마다 idle p50 +0.50/-0.60/+0.20 ms, p95 +0.20/-0.20/+0.50 ms, driven p50 +0.80/-0.40/+0.20 ms, p95 -25.40/-0.40/-0.20 ms로 모두 5 ms 안입니다(pair 1 driven p95 -25.40은 기준 쪽이 44.3 ms). 음수 sample 0. idle p50은 기준 16.9-17.7 ms, 후보 17.1-17.9 ms. driver 시계와 page 시계의 차이(p50)는 idle -2.48 ~ -2.58 ms, driven -6.24 ~ -6.33 ms였습니다. 10,000키는 맥북 pane과 mini pane 모두 매회 사라짐, 순서 바뀜, 예상 밖 키 0. 맥북 hided의 driven CPU 중간값은 후보 1.94%, 기준 3.86-3.87%. b875f51c4에서는 측정하지 않았습니다: 그 head의 hided(1d5417135af89b34)는 f56fb5eac의 것과 다르고 그 위에서 끝난 half가 없어, 세트를 f56fb5eac에서 처음부터 돌렸습니다. - B6 판정 측정(한 시계): 기준 b520d6e release hided를 이 Mac에서 돌리고 mini의 격리 계정을 오늘의 SSH device로 붙여 device pane에 키를 넣은 것과, f56fb5e release hided(b4e9f2424820e7ce)를 core로 mini에 두고 core pane에 키를 넣은 것을 번갈아 3 pair, 각 50 sample, idle(core pane에는 driven이 없음), 매회 그 pane에 10,000키. 두 쪽 모두 이 head의 harness이고 각 half는 1분 부하 8 미만에서 시작했습니다(1.8-6.9). 후보-기준 차이는 pair마다 p50 -0.40/-1.20/-0.40 ms, p95 -2.50/-4.30/-4.60 ms, 중간값 p50 -0.40 ms, p95 -4.30 ms로 판정 기준(p50 +0.5 ms 이하, p95 0 이하)을 만족합니다. 기준 device pane p50 15.4-16.1 ms, p95 98.7-100.9 ms, 후보 core pane p50 14.9-15.5 ms, p95 94.1-98.0 ms. 두 쪽 모두 p95가 100 ms 안팎인 것은 원격 pane 경로가 같이 지닌 값입니다. 음수 sample 0, 시계 차이(p50) -0.64 ~ -0.80 ms. 10,000키는 매회 사라짐, 순서 바뀜, 예상 밖 키 0. 595d30480의 두 시계 mini pane 비교는 이 세트로 대신합니다. - (두 시계 값, 실행마다 모르는 차이를 지님, 기록으로만 둠) 측정(B5-B7, B21, 595d304 release build, core는 mini의 격리 fixture, 기준 b520d6eb와 번갈아 4회, 각 50 sample, nearest-rank): 맥북 pane의 키-에코는 pair마다 후보-기준 차이가 idle p50 -0.18/+0.07/+0.71 ms, p95 -0.68/+0.09/+0.86 ms, driven p50 -0.82/+0.59/+1.01 ms, p95 -0.76/+0.33/-0.23 ms로 5 ms 안. 기준의 3회차는 50개 sample 모두 95 ms 안팎이라(같은 시각의 후보와 3단계 빌드는 20 ms대) 판정에서 뺐고, 넣어도 5 ms 안입니다. 원인은 찾지 못했습니다(지연은 page가 아니라 hided와 Herdr 왕복에 있었고, 부하, 발열 기록, 로그는 정상). mini pane은 기준 device pane보다 p50이 pair마다 +0.04/-0.02/+0.50/-0.05 ms, p95가 -8.51/-6.50/-0.96/-2.83 ms(B6 판정은 위의 한 시계 세트). 10,000키는 맥북 pane과 mini pane 모두 매회 사라짐, 순서 바뀜, 예상 밖 키 0. 맥북 hided의 driven CPU 중간값은 후보 1.9%, 기준 3.9-4.8%, 최대 RSS는 후보가 기준보다 작았습니다. Observer가 raw sample에서 다시 계산한 값이 이 요약과 같았습니다. - (두 시계 값, 기록으로만 둠) 1회차 확인 측정(f07116c release build, core는 mini의 격리 fixture, 기준 b520d6eb와 번갈아, 각 50 sample, 매회 10,000키): 기준의 2회차는 50개 sample이 모두 음수(키를 보내기 전에 에코가 찍힘, 두 시계가 20 ms쯤 어긋남)라 빼고 3회차를 더 돌렸습니다. 센 pair 1, 3의 후보-기준 차이는 idle p50 -0.21/-0.28 ms, p95 -0.40/+4.94 ms, driven p50 +0.15/+0.32 ms, p95 -0.04/+0.37 ms로 5 ms 안입니다. idle 3회차 p95 +4.94 ms는 이 Mac의 부하가 13-22(다른 세션의 작업)일 때였고, 같은 pair의 driven은 +0.37 ms였습니다. 10,000키는 맥북 pane과 mini pane 모두 매회 사라짐, 순서 바뀜, 예상 밖 키 0. 맥북 hided의 driven CPU 중간값은 후보 1.94%, 기준 3.87-3.88%. mini pane p50은 16.87-17.41 ms. - native QA(595d304 release hided로 dev desktop을 node 역할로 띄우고 core는 mini fixture, 운영자 앱은 건드리지 않음): 붙은 뒤 core 상태가 그려지고, core를 멈추면(`no_core`) 죽이면(`core_not_answering`) 둘 다 같은 reconnecting 줄이 보이며, core를 다시 켜면 node의 다음 재시도에 다시 붙습니다. 맥북 pane에 `echo node-한글-ok`를 보내 에코가 그려지고, 그 pane의 agent를 재우면 잠든 pane(Wake agent)이 그려집니다. 화면에 넣은 입력은 node `/ws`의 화면 이벤트와 창의 accessibility press 하나뿐이었습니다(한글 IME 조합 자체는 native로 보지 못함). - mini 안전: 사설 sshd(22번 아님), `/tmp/hcr` 아래의 격리된 HOME, 상태 폴더, Herdr, 절대 경로, 연결마다 앞선 device guard를 지켰습니다. 실제 계정의 fingerprint를 전후로 비교했고(Observer도 따로 비교), 바뀐 것은 운영자 앱 업데이트뿐이었습니다: helper가 05:40에 4ea27f28에서 13707c1f로 바뀌었고 설치된 0.1.0-main.3ee6c5bd hided와 byte가 같으며, `codex` daemon이 스스로 업데이트했습니다. 마지막 mini 실행 뒤 `/tmp/hcr` 전체(87 MB, 이 fixture가 만든 것만)를 지우고 최종 fingerprint를 찍었습니다. 첫 fingerprint와 비교해 바뀐 것은 아래의 운영자 앱 업데이트와 운영자 Herdr 로그뿐이고, 22842 port와 `/tmp/hcr` 아래 프로세스는 남지 않았습니다. 한 시계 측정 두 세트의 전후 차이는 운영자 Herdr server가 스스로 쓴 로그와 이 측정의 ssh 세션뿐이었습니다. 운영자의 node, helper, Herdr server는 건드리지 않았고 남은 fixture 프로세스는 없습니다. - B9: `remote_core::a_node_that_loses_its_core_holds_its_screens_and_returns_as_it_was`가 사설 sshd를 멈췄다 다시 켜고, 붙잡아 둔 화면이 SSH가 답한 뒤 10초 안에 다시 붙는지 확인합니다. remote mailbox job이 Linux CI에서 돌립니다. - **확인하지 못한 것**: - desktop `remote-workspace.spec.ts`의 stalled-handshake 블록(`HIDE_E2E_SSH_PID`가 있을 때만 돎)은 현재 main 3ee6c5bd5에서도 같은 방식으로 실패합니다: `remote-workspace.spec.ts:709` `Expected: "pending"` / `Received: "completed"`. 이 브랜치(595d304)도 같은 줄에서 같은 값으로 실패합니다. 최종 lane은 이 블록을 빼고 돌렸습니다. - Windows 빌드는 이 Mac에서 확인하지 못했습니다(`windows check` CI lane이 확인). - nextest 0.9.146은 이 Mac의 remote mailbox lane과 scratch crate로만 돌렸습니다. Linux, Windows, os-contract, nightly lane은 CI에서 처음 이 버전으로 돕니다. - relay 상한(링크당 4개, node relay 4개)과 gateway의 client 상한이 `browser_control_busy`로 오는 것, 링크가 끝날 때 진행 중이던 relay가 4011로 끝나는 것은 unit test로만 확인했습니다. 3 MiB가 넘는 CDP frame이 링크를 건너는 경우는 시험하지 않았습니다. <details><summary>Verification record</summary> - sasu implement verify: PASS on f56fb5e (`verify-cargo.sh test` 210 s, `lint` 6 s); earlier PASS on 63c9a71, c337a62, 5525f4b, f07116c, 6e3c688 and 595d304. - Code review rounds 2 (G1-G10) and 3 (H1-H7): fixed G1-G10, H1, H3 (forward failures), H4, H5 (health carried, f56fb5e) and H2's doc; H3's EOF case, H6 and H7 are Review lines above. - Single-clock measurement: head f56fb5e, cand hided b4e9f2424820e7ce, base b520d6e; three alternating pairs, Accept yes. - B6 single-clock set: base-dev b520d6e (mini as SSH device) vs cand-core b4e9f2424820e7ce (core on the mini); three alternating pairs, median pair delta p50 -0.40 ms, p95 -4.30 ms, Accept yes. /tmp/hcr removed on the mini after it; final fingerprint taken. - Code review round 1 on 6e3c688: no high. Fixed here: F1 (unsent held key told to its screen), F3 (wake rule and link-local filter), F4 (bounded probe resolution), F5 (split core terminals relay), F6 (tap decides before encoding, no per-chunk Vec clone), F8 (only a dial that never reached SSH is unreachable), F9 (`Interrupted` retried), F10 (shared test `wait`), F11 (doc comment), F12 (dot-leading repository names, HTTPS port). F2, F7 and F13 are Review lines above. - Review on 595d304 (Fidelity, Code, Security): no blocker. Fix now dispositions: Code F1 (a unix-only call in a `hided` lib test would break the Windows build) fixed in 1f523d3; Fidelity F1-F3 (this body's diagnostic name, placeholders, unlisted behavior changes) fixed here; Fidelity F3's untested `device.test_inbound` now has a test (1f523d3). Follow-ups left: a close notice dropped past the 36-notice queue keeps that stream until the link ends; a stored registration with both or neither of alias and inbound is dropped on load; a screen frame with a duplicated `kind` key skips the node's routing and goes to the core as an ordinary event; the per-frame serde scan cost; a node of an older build reads a newer core's attach outcome as a parse error. - Follow-up review of 1f523d3..6e3c688 (nextest pin, fixture git, restart wait): no blocker, high or medium. Fixed from it: the version floor now warns locally (`nextest-version`), fixture git drops the operator's `GIT_` variables and system config, every remote_core `git init` runs as its account, and the restarted core's attach-record wait (earlier review V1) now waits for the new core's own record. Left: the 0.9.145 floor is stated in the install script, the nextest config and TESTING.md, and the `nextest-version` key sits under the file's header comment. Security follow-ups: the nextest download has no sha256 check (unchanged by this PR), and the fixture account forwards the operator environment minus a denylist. - Observed on main, not changed here (Refs #899): two `remote_delivery` journeys never call `remove_run_dir`, so each lane run keeps about 900 MB of run folders. - Lane logs, measurement summary and native QA captures are kept in the run record, not in this repository. </details>
yansfil
added a commit
that referenced
this pull request
Oct 12, 2026
Related: core-host-node 5단계(core-host-node-move). 선행 PR #898(4단계, 다른 기기 core의 node로 도는 hided), #836(3단계). 관련 이슈 #950, #951, #875. #966은 이 브랜치 위에서 D-29(이동 뒤 node 프로젝트의 Issues, New issue, worktree 정리)를 채웁니다. Follow-up은 #963(리뷰에서 남긴 항목, 번호는 그 이슈와 같음. main merge의 리뷰 4라운드에서 50-53), #964(node 창이 같은 Mac을 화면마다 다르게 부름. 그래프와 시작 시트 포함), #974(gh 로그아웃 때 Local 프로젝트의 이슈 출처), #976(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 - **판단해 주세요 (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 예산 안입니다. 줄이는 일은 #963 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에서는 찾을 수 없으며, #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 기록'이 경로 이름과 함께 실패합니다(툴팁에 경로). 행 이름이 이 경우를 설명하지 않지만 설치가 만드는 경우가 아니어서 두었고, #963 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를 설명하지 않습니다. 문구와 디자인 프레임을 바꿀까요? <details><summary>Review 세부: 번들과 다른 점, 바뀐 기존 동작, 결함 둘</summary> 승인된 디자인 번들과 다른 점: - 번들 장면의 기기 탭에는 설정 창 틀이 없고, 제품은 설정 안에 그립니다. - 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를 보내지 않습니다. - #985 - hook이 core에 묻는 요청의 wire 이름은 `memory_hook`입니다(main의 `memory`는 `hide memory` 명령). - #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개 상한은 도는 채널만 셉니다. </details> ## 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으로 넘긴 것**: #963 50-53(링크가 끊긴 node Project의 Memory 탭이 `Unreadable`로 보이고 다시 닿아도 다시 읽지 않음, node Project의 Memory 켜기가 core의 hook 진단을 봄, hook stdin의 `write_all`에 기한이 없어 Windows 8 KiB 프롬프트에서 설 수 있음, `copy::unplace`가 pending core가 만든 store를 되돌려 재시도가 같은 verify 거절을 만날 수 있음), #964(node 창의 그래프 `THIS_DEVICE` 경로와 시작 시트 `localDevice`가 core 기기를 '이 Mac'으로 부름. a97f18ed3에도 있었음), #976(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(#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키씩). - **확인한 것 (#986, 원인)**: CI의 첫 시도는 hang guard가 아니라 테스트 자신의 30초 기다림(`start.held` 기록, `core_move.rs:2478`)에서 실패했습니다. 은퇴한 기기의 `hided core-login`은 0으로 끝났지만, 큐에 남은 `start.held`를 writer가 쓰기 전에 프로세스가 끝나 기록이 사라졌습니다. - **확인한 것 (#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(#966)이 들어간 뒤 실제 이동을 하고, mini의 launchd job이 core를 처음 켜는지 확인합니다. - **생성물**: `web/src/generated/hided-ws.ts`(계약에서 생성), `design/hide-ui.lib.pen` 토큰 두 개(`scripts/gen-pen.mjs`, main 대비 8줄). <details><summary>seat 측정 (mini 격리 seat, 3b96704)</summary> 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와 빌드 명령이 다름). </details> <details><summary>추가 증거</summary> 결함을 심어 실패를 본 증명(고친 코드를 빼면 실패하고, 넣으면 통과): - 그만 기다리기, 앞으로: 상대가 옛 빌드인 채 다시 닿으면 이 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):                     측정과 메모: - 배치에서 대상 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 기준에서도 같습니다(환경, 이동과 무관). </details> ## Breaking change - `contracts/hide-cli.json`의 Letter에 `intake_from`이 더해져 CLI 계약 digest가 바뀝니다. 더하기만 했지만, 옛 digest에 고정한 도구는 갱신할 때까지 거절합니다. <details><summary>Verification record</summary> - PRD: core-host-node-move(로컬 계약), 위험 high - base: origin/main 9596ea1(merge한 main), head: 8b89e76 (리뷰 4라운드 수정; main merge 99cc1b7, 647a626, 2a247c7, 그 앞 a97f18e #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는 이 브랜치에서 반영, 남은 것은 #963 </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: #751 (core-host-node 2b), #794 (기기 helper 설치)
Summary
지금은 모든 키와 출력 바이트가 core의
Mutex<Runtime>을 지나고, 키마다 snapshot이 나가며, device pane은 attach마다 SSH 연결을 새로 엽니다.이 PR은 core를 mini로 옮기는 작업의 3단계로, 터미널 길을 pane이 있는 기기의 node가 갖게 합니다: 이 Mac pane은 hided 안의 node 터미널 서비스가, device pane은 그 기기 node 연결 안의 같은 서비스가 attach와 바이트 흐름을 맡습니다.
화면의 키와 출력은 router와 hub(
hided/src/terminal_hub.rs)를 거쳐/ws의 별도terminalframe으로 오가고, core는 Enter 제출, 입력 시각, 포커스, attach 상태 같은 사실만 받습니다.core가 이 Mac에 있는 지금 구성에서 보이는 변화는 없습니다(D-04).
기기 helper 설치 수정(병렬 업로드, 버린 staging 정리)은 이 작업 중 찾았고 #794로 이미 main에 들어가 이 diff에는 없습니다.
Review
input_generation은 읽는 곳이 없어 wire에서 지웠습니다(chunks,terminal_sequence,chunks_dropped와 함께).NotAllowed) 기존 unavailable 상태와 Settings 동작만 보입니다.:를 받지 않습니다. pane idremote:<기기>:pane:<pane>을 첫:pane:에서 나누는데,a:pane:b나x:pane같은 id는 다른 기기의 pane id를 자기 것으로 읽을 수 있었습니다.register_device이벤트를 직접 보내거나 UI 상태 파일을 손으로 쓴 경우에만 생깁니다. 추가 폼은 id를[a-z0-9_-]로 만들고, 운영자의 등록은mini하나입니다.device.invalid(추가 폼이 이미 보여 주는 이유)로 거절되고, 저장돼 있던 것은 연결하지 않고device.connect_failed에 id와 이유를 남기며 행은 unavailable입니다. 다른 기기는 그대로 연결합니다.hide-node/src/terminal/mod.rs- 서비스 lock 안에서 sink에 보고를 넘깁니다(순서 보장). sink가 막히거나 되부르면 교착입니다.hand_over- 리뷰 2차 5번: 출력은 lock 안에서 줄 세우고 lock 밖에서 넘깁니다. session reader만 자기 frame이 넘어갈 때까지 기다리고(backpressure), core의 control과 키는 기다리지 않으며 다른 reader의 frame을 넘기지 않습니다. sink panic은terminal.sink_panicked로 남기고 이어 넘깁니다(failure path).hide-node/src/terminal/session.rs- 리뷰 2차 1번: 거절된 paste는 callback을 부르지 않습니다. callback은 서비스 lock을 잡고, 거절을 받는 쪽이 이미 그 lock을 쥐고 있습니다(교착).hide-node/src/terminal/router.rs- 다른 기계가 보낸 것을 받는 경계(failure path). 그 기기 자신의 pane 중 core가 붙였거나 화면에 있는 것과, 그 기기에 맡긴 paste만 받습니다.hide-node/src/terminal/device.rs- 기기 줄을 core로 넘기는 proxy(failure path). 키 상한, 로그 기록 상한, Error를 note로 바꾸는 곳입니다.hide-node-link/src/terminal.rssplit_device_pane_id,herdr-core/src/runtime/{events,devices}.rs- 기기 id 규칙과 거절 경로.hided/src/terminal_hub.rs- high-frequency path. 출력 chunk마다 한 번 렌더하고 client끼리 나눕니다. resume, overflow, redraw 규칙이 여기 있습니다.hide-node/src/ssh/host.rs- 연결 reader의 줄 상한과 writer가 바쁠 때 다시 쓰는 규칙(failure path).herdr-core/src/runtime/terminal.rs- core가 받는 보고(runtime mutex). 투영하지 않은 pane의 입력 보고는 무시합니다.herdr-core/src/terminal_reports.rs,hide-node/src/terminal/device.rs- 리뷰 2차 2번: 보고 줄이 상한(core 16,384개, 기기 4,096개)을 넘으면 버리지 않고 같은 대상(pane 상태, 첫 frame, 보인 frame, 키, paste 결과, 생성 취소)의 기다리는 보고를 대신합니다. 규칙은TerminalReport::same_subject,superseded_by하나를 둘이 같이 씁니다.contracts/hided-ws.schema.json,web/src/store.ts- snapshot wire 변경.hide-node-link/src/protocol.rs,hide-node/src/ssh/host.rs- main과 합칠 때 양쪽이 모두 25로 올려 26으로 정했습니다(Herdr contract 밖, device link). main의 25 node는 거절되고 다시 설치되며, 감사된 24 연결은 터미널을 시작하지 않습니다.host.rs:1196) 그 helper를node serve로 띄우므로(host.rs:1209), 이 빌드가 기기 플랫폼의 helper를 싣는 한 서빙 node는 26입니다. 24 Hello는 이 빌드가 띄우지 않은 helper에서만 옵니다(host.rs:974의 건너뜀은 그 경우).herdr-core/src/runtime/terminal.rs- main의 pane header 계산을 node가 보고한 상태 투영 위에서 합쳤습니다(runtime mutex). 파일별로 어느 쪽을 지켰는지는 아래 접은 칸에 있습니다.reread_device_facts). 기기를 지울 때만 지웁니다(forget_device_directories).hide명령은 시작할 때 checkout 문맥에 묶이고 실행 전에 바뀌면 거절되므로, 그 사이에 걸친 명령이pane_changed나caller_context_changed로 거절됐습니다.host.panes_started)와host.ready사이에 터미널 서비스 시작을 넣어 틈을 넓혔습니다. 테스트는 고치지 않았습니다(D-23).reread표시를 가짐).IdentityChanged) 남긴 답을 지웁니다. 그 기기 pane은 다시 허락할 때까지 폴더 행입니다.MAX_KNOWN_PATHS). 넘으면 지금 세션이 보이는 것만 남기고 로그에 남깁니다. 넘지 않으면 지우지 않아, 떠났다 돌아온 폴더의 pane이 바로 묶입니다.herdr-core/src/runtime/{device_catalog,devices,events,hosts}.rs- Retry, 기기 삭제, 바뀐 기계가 지우는 범위(ownership). 남긴 facts는 새 연결의 helper 답으로만 바뀝니다.hide-node-link/src/terminal.rs,herdr-core/src/runtime/terminal.rs- 리뷰 1차 2번: core가 키를 기다리지 않고 키보드가 간 pane을 node에 알립니다(TerminalControl::Focus, 이 PR의 프로토콜 26 안). 화면 키가 그 pane과 다르면 node가 포커스를 보고합니다.WatchFrame)은 pane 밖에 64개까지 두고, 모르는 pane을 깨우는 control은 아무것도 만들지 않습니다. 이 Mac pane writer의 쓰지 못한 입력은 기기 키와 같은 256 KiB(D-18)이고 넘으면 그 쓰기만 거절합니다.need_full을 가짐)은 이제 node가 합니다: 세션이 이미 그 grid로 돌면 node가 Herdr에 화면 전체를 다시 그리라고 합니다(redraw와 같은 길)./wswire에 hub epoch를 더했습니다. hub마다 무작위 16자리 hex epoch를 정하고,terminalframe은terminal_epoch로, handshake는have_terminal_epoch로 싣습니다. 같은 epoch일 때만 cursor에서 이어 받고, 다른 epoch나 epoch 없는 cursor(데몬보다 오래 산 페이지)는 모든 pane을 다시 그립니다. schema, web 생성 타입, web store, hided를 같은 커밋에서 바꿨습니다.terminal.redraw_unanswered를 남깁니다. 그동안 답하지 못하는 node는 세션이 없고, 다음 세션의 첫 frame은 full이기 때문입니다. 10초는 PRD에 없던 숫자입니다.hide-node/src/terminal/mod.rshand_over- 리뷰 3차 1번: 기다리는 reader는 자기 묶음(first..=through)까지만 넘깁니다. 전에는 다음 reader의 frame도 넘겨, 여러 pane이 찍는 동안 한 reader가 넘기기에 머물며 자기 pane을 읽지 못할 수 있었습니다.hide-node/src/terminal/router.rs- 리뷰 3차 2번: core가 잠들었다고, 닫는 중이라고 말한 기기 pane을 router가 기억하고(core의 집합을 그대로 따름), 기기의 새 연결에 화면 pane, 키보드 pane과 함께 알립니다. node는 모르는 pane이라도 잠듦이나 닫힘을 들으면 그 pane을 기억합니다(c20c882, 자체 리뷰가 찾음).hided/src/core.rsshutdown- 리뷰 3차 4번: owner thread를 join한 뒤 모든 기기 터미널을 지웁니다(Router::remove_every_device). 기기 node가 자기를 가진 router에 보고해 둘이 서로를 붙잡았고, 기기가 연결된 채 handle을 놓으면 router, 이 Mac 터미널 서비스와 세션이 프로세스가 끝날 때까지 남았습니다(ownership, failure path).ready()가 깨어날 때마다 다음 redraw 시각을 읽으려 hub lock을 한 번 더 잡습니다(client당, 남은 요청만 훑음). h11 쌍이 이것을 포함한 head를 쟀습니다.TerminalRoutes::terminals_unstarted). 키 거절 문구도 "기기 터미널이 연결되지 않음"으로 바꿨습니다(kind는 그대로terminal.device_disconnected).remote:<그 기기>:pane:안으로만 이름 붙어 다른 기기나 이 Mac pane의 core 상태에 닿지 않습니다. 제출 규칙은 node 몫(D-13)이라 router가 다시 판정할 수 없습니다.사고 기록 (2026-10-09): 이동한 remote probe가 mini의 사설 sshd를 거쳐 실제 계정 홈의
~/.hide/host-helper/6536958e73c1f8e2에 helper를 올렸습니다(00:39-00:46 KST).SFTP는
~/를 계정의 passwd 홈으로 풀고,SetEnv HOME은 명령에만 닿아서입니다. Observer가 00:49에 그 폴더만 지웠고,current, LaunchAgents, Herdr 설정은 바뀌지 않았습니다.가드: probe와 측정 harness가 연결 전에 격리 계정 외의 대상을 거절합니다(0908272, ac1b70b, 2c4e62d, 6c4e1bc).
제품 follow-up: 설치가 SFTP 홈과 명령의
$HOME이 같은지 확인하지 않습니다. 사설 sshd 뒤의 기기에서 같은 일이 날 수 있어 별도 이슈로 다룹니다.Evidence
sasu implement verifyPASS: S1bash scripts/verify-cargo.sh test(워크스페이스 전체), S2 lint.Resume::After가 epoch를 가져 그대로는 옛 코드에서 돌지 않습니다. 실패 기록은 같은 장면을 옛 형태로 쓴 것입니다.terminal.unavailable). 그 커밋의 짧은 후속 Code 리뷰는 Fix now가 없었습니다.hided/tests/it/handshake.rs하나: main의 재시도 loop를 지키고 cursor는 revision만 따름), 3114815b0의 CI가 모두 통과했습니다(Linux 원격 mailbox, Windows check와 e2e 포함, 실패 0, workflow가 건너뛴 2개).herdr-core,hided,hide-node,hide-node-link,hide-host) 테스트 2,504개 중 2,503개 통과(e2a6aa3). 실패 하나는hide-hostgit 테스트가 이 Mac의 커밋 서명 agent를 기다리다 난 것(이 diff 밖)이고hide-host133개를 다시 돌려 모두 통과했습니다. 그 뒤 head는 워크스페이스 전체verify-cargo.sh test로 봤습니다.scripts/tests317개 통과. web은 바뀌지 않아 verify-web은 다시 돌리지 않았습니다.pane_changed,caller_context_changed), Retry 수정 뒤 3/3 통과. 임시 branch와 그 로그 코드는 지웠습니다.remote_delivery,held_letter_notice) 4개,terminal_children2개,real_herdr1개 통과(고정 Herdr 0.9.3). 5714e43a2에서 워크스페이스 전체cargo test3,693개 통과 0 실패와scripts/verify-web.sh(web 1,308, desktop 162 테스트) 통과(hide-hostgit fixture는 커밋 서명을 끄고). 그 뒤 c20c88234는 node 한 곳과 테스트 하나이고 hide-node 158개 통과. 새 core 테스트 3개(재연결, Retry, 삭제)는 각각 수정 없이 실패합니다.remote_delivery::a_spawn_with_machine_starts_the_agent_on_the_device_under_its_caller가 head 11회 중 2회, 기기 hook의 1.25초 intake 기한을 넘겨 실패했습니다(편지 거절이 아니라deadline). main a03ac5821도 같은 필터, 같은 load에서 5회 중 1회 같은 메시지로 실패해 이 PR 전부터 있던 load 민감 테스트로 봅니다. 테스트는 고치지 않았습니다(D-23).cargo test3,568개 통과 0 실패,scripts/verify-web.sh(web 1,306, desktop 162 테스트, typecheck, lint, build), design contract, Herdr contract(schema), pin, workstation identity 검사 통과.bash scripts/verify-cargo.sh nextest --profile ci --workspace3,445개 통과, 22 skipped. flaky 1개(hide-hostgit 테스트, 재시도 통과, 이 diff 밖).local-kit.spec.ts통과.aNNNNz를 치기 직전(t0)부터 그 pane 버퍼(스크롤백 포함)에 표식이 처음 보이는 xterm write까지입니다. idle과 driven이 같은 표식 50개를 칩니다.~/.hide/host-helper는 그대로.gh자식 26.7 MiB)입니다. h2의 한 표본 +38.6 MiB 자식은 이름 기록 전이고, 기준도 같은 크기(39.1 MiB)를 한 번 보였습니다.@needs-focus제외)는 40 통과, 8 skipped, 18 실패이고 실패는 모두 macOS가 창 캡처를 거절한 것입니다(화면 기록 권한 없음, 권한 창은 건드리지 않음). CI의 macOS lane이 캡처까지 봅니다.server-session-search네이티브 테스트도 첫 창 캡처에서 같은 이유로 멈췄고, 그 전 단언은 통과했습니다.device_kit테스트로만 봤고 실제 mini 링크를 끊어 보진 않았습니다. B11, B12의 끊김 뒤 화면과 pane 일치는 hub 단위 테스트와 측정의 실제 overflow, redraw까지만 봤습니다.측정 (이 Mac, 실제 Mac mini device pane)
이 Mac, headless (b520d6eb와 이 PR을 번갈아 11쌍, 2026-10-09 KST: h1-h4는 844717054로 03:02-03:50, h5-h6은 a589a8efd로 04:40-05:03, h7은 main을 합친 ff732a538로 06:14-06:25, h8은 리뷰 1차 뒤 de8650825로 08:16-08:28, h9는 자체 리뷰 수정 뒤 52e827a12로 09:31-09:42, h10은 리뷰 2차 뒤 bc1a1949a로 11:09-11:21, h11은 리뷰 3차 뒤 c20c88234로 12:00-12:11)
scripts/web-shell-measure/run.shkeys 시나리오, 키 10,000개,--isolated-headless, 고정 Herdr 0.9.3. 회차마다 50개 idle echo와 50개 driven echo.docs/PERFORMANCE_TESTING.md): 11쌍 idle 18.53 -> 18.86 ms(+0.33), driven 17.18 -> 17.35 ms(+0.17). 10쌍 idle 18.52 -> 19.33 ms(+0.81), driven 17.00 -> 17.26 ms(+0.26). 9쌍 idle 18.51 -> 19.80 ms(+1.29), driven 16.81 -> 16.89 ms(+0.08). 8쌍 idle 18.45 -> 19.17 ms(+0.72), driven 16.69 -> 16.84 ms(+0.15). 7쌍 idle 18.38 -> 19.80 ms(+1.42), driven 16.81 -> 16.89 ms(+0.08). 6쌍은 +1.12, +0.05, 기준 h5를 빼면 +1.11, -0.07.herdr5개 4-6 MiB씩, 잠깐 뜨는 자식) 최대: 기준 53.0-60.6 MiB, head 54.9-99.0 MiB. 이름이 기록된 잠깐 자식은lsof(약 1 MiB)와 head h5 driven의gh26.7 MiB.terminal.output_overflow3번과 redraw 3번을 남깁니다(창이 닫힌 동안 뒤처진 client). 두 빌드 모두 full redraw 5번.실제 Mac mini device pane (b520d6eb와 8447170 번갈아 2쌍씩, 2026-10-09 03:56-04:05 KST)
기기는 mini의 격리 계정(사설 sshd 22841, 격리 Herdr 0.9.3)이고 화면은 이 Mac의 격리 hided와 headless Chrome입니다.
hide-node/tests/it/remote_terminal_probe.rs)도 head에서 node 연결로 통과했습니다(5.9초). 실제 계정의~/.hide/host-helper는 그대로였습니다.main과 합친 충돌 해결 (파일별)
main(a03ac58)을 합친 충돌 7개 파일과 고친 테스트
hide-node-link/src/protocol.rs: 양쪽 모두 24에서 25로 올렸습니다(main은 Hello의 reader 기능, 이 PR은 터미널 줄). 26으로 올려 둘 다 담았습니다. main의 25 node는 Hello에서 거절되고 이 빌드의 payload로 다시 설치됩니다.hide-node/src/ssh/host.rs: main의 규칙(감사된 24와 현재 버전만 받음)을 지키고,Inner에 양쪽 필드(terminals,readers)를 둘 다 둡니다. 24 연결에는 터미널을 시작하라고 묻지 않고host.terminals_unstarted를 남깁니다. 테스트가 25 거절을 고정합니다.herdr-core/src/runtime/delivery.rs: main이 키에 붙인reopen_resolved_session을 이 PR이 나눈note_delivery_key_at으로 옮겼습니다. node의 입력 보고가 이 길로만 오기 때문입니다.herdr-core/src/runtime/operations.rs: main의tick_session_day와 이 PR의sync_terminal_intents를 둘 다 둡니다.reattach_resized_observers는 node로 옮겨 core에 없습니다.herdr-core/src/runtime/terminal.rs: main의 header 변화 검사(refresh_pane_headers)를 이 PR의 투영(node가 보고한 상태)에서 계산합니다.herdr-core/src/runtime/tests/agents_settings_remote.rs: 이 PR의 다시 붙지 않음 단언과 main의 세션 resolution 단언을 둘 다 둡니다. main에 남아 있던 core 터미널 세션 단언은 이 PR이 지운 것이라 뺐습니다.hided/tests/it/node_contract.rs: 테스트 도우미의 생성자 둘(start_with터미널,start_with_packages패키지)을start_with(pane_events, terminals, retained_packages)하나로 합쳤습니다.control_frames_keep_headers_without_derivation_until_a_relevant_transition은 core 터미널 세션을 썼습니다. 바이트가 core에 오지 않으므로transport_and_scroll_transitions_derive_pane_headers_once_each로 바꿔 node 상태 보고 100번에 header 계산 0번, 실제 변화마다 1번을 봅니다.web/src/generated/hided-ws.ts는 main 스키마의factory_question_guard가 빠진 채라 그대로 두었습니다(follow-up).옮긴 단위 테스트 (D-23, 파일별)
web, desktop e2e와
hided/tests/it/real_herdr.rs는 고치지 않았습니다(git diff비어 있음). 아래는 wire 모양이나 Runtime 안의 터미널 상태를 직접 고정했던 단위 테스트입니다.herdr-core/src/live.rs에서hide-node/src/terminal/로session.rs:first_wheel_reaches_the_pipe_without_waiting_for_a_frame,next_wheel_reaches_the_pipe_without_waiting_for_a_terminal_frame,keyboard_input_keeps_its_order_after_scroll_input(이름 그대로)protocol.rs:official_terminal_ndjson_boundary_decodes_frames_and_closed_reasons,official_terminal_cli_arguments_never_request_takeover(그대로),official_terminal_control_boundary_encodes_input_resize_and_release->..._input_resize_scroll_and_releaseherdr-core/src/labels/input.rs에서only_a_typed_return_is_a_submit->hide-node/src/terminal/input.rs(base64 경우는 빠짐, 키가 바이트로 옴)herdr-core/src/runtime/tests/terminal.rs에서hide-node/src/terminal/tests.rs로an_observed_frame_at_an_old_grid_reattaches_the_observer_at_the_views_grid,an_observed_view_that_changes_size_reattaches_once_the_size_settles,a_control_session_attaches_at_the_grid_the_view_reported,retry_preserves_the_canvas_until_a_matching_replacement_frame,a_rebuilt_view_for_an_attached_pane_is_given_a_frame_to_drawa_foreign_grid_is_held_until_a_matching_full_frame_arrives->a_frame_at_a_foreign_grid_waits_for_a_full_frame_at_the_view_grid;one_launch_holds_an_attach_until_the_view_reports_a_size->an_attach_without_a_size_waits_for_one_then_attaches_at_itattach_failure_names_its_reason_on_that_pane_and_leaves_the_others_idle,runtime_owner_conflict_observes_ignores_stale_delivery_and_reconnects_once- node 쪽 절반은 hide-node로, core 투영 절반은 남음herdr-core/src/runtime/tests/key_routing.rs에서keys_for_an_unknown_request_reach_no_pane,keys_for_a_split_older_than_the_age_limit_reach_no_pane->input.rsan_unnamed_request_stops_holding_after_its_lifetimeinput_to_an_attaching_pane_is_kept_and_written_in_order->input.rsan_attaching_pane_keeps_keys_in_order_up_to_the_cap,tests.rskeys_typed_while_the_session_opens_are_written_first_in_orderinput_held_for_a_pane_whose_retries_ran_out_is_not_written_on_reconnect->tests.rs(그대로)input_held_through_a_reconnect_is_written_only_within_the_age_limit->input.rsan_attaching_pane_gets_keys_held_up_to_the_age_limit_and_not_older_ones단언이 바뀐 core 테스트
agent_sleep.rsinput_to_a_sleeping_pane_goes_nowhere: dispatch 거절 대신TerminalControl::Asleep이 잠듦 끝 뒤에만 나가는지snapshot_delta.rsretained_views_keep_a_hidden_tabs_output_arriving: 숨은 탭 pane에 Release/Forget이 없고controlling으로 남는지(바이트는 hub 테스트가 봄)agents_settings_remote.rsremote_session_sync_reconciles_target_scoped_structured_terminals: core 세션 대신 Attach(40x120),controlling, Forget;ordinary_click_uses_detected_pane_agent_and_never_sends_enter:TerminalControl::Write바이트labels.rs두 테스트,delivery.rsno_hide_key_ends_a_draft_not_even_the_enter_that_opens_a_picker:key이벤트 대신 node의 입력 보고, 같은 수devices.rsreturning_to_this_machine_gives_the_keyboard_back_to_the_local_pane: 입력 보고 전 pane 투영(core가 투영하지 않은 pane의 보고를 무시하므로)pane_geometry.rs도우미runtime_on,resizes: 쓴 JSON 줄 대신TerminalControl::Resizesnapshot_delta_payload(rev, seq)->(rev)서명만:snapshot_delta.rs,operator_focus.rs,factory_screen.rs,lineage.rs,links.rs,project_sessions.rs,projects.rs,recent_checkouts.rs,view_areas.rs,workspace_view.rsLiveContext.herdr_bin제거만:agent_connection,control_order,home,key_routing,repository_clone,session_navigation,terminal,tree_close,session_sync/{coordinator,tests},attachmentshided, web
hided/tests/it/handshake.rsa_reconnect_resumes_from_the_client_cursor: snapshot에 terminal 필드가 없고 terminal cursor 0으로 이어짐; 도우미send_event가terminalframe을 건너뜀hided/src/server.rs두 테스트:classify_frame의chunks_dropped인자 제거(그 경우는 hub 테스트로)hided/tests/it/node_contract.rs도우미Device::start->start_with(pane_events, terminals)web/src/store.test.ts: delta chunk 대신terminalframe과 cursor; 초기 fixtureterminalSequence0 -> nullofficial_remote_terminal_session_fixture_probe->hide-node/tests/it/remote_terminal_probe.rs: node 연결로, 표식은 vt100 화면에서 읽음(Herdr 0.9.3이 스크롤을 바뀐 셀로 다시 그려서, b520d6eb에서도 실패)follow-up 후보
리뷰에서 나왔지만 이 층 밖이거나 위험이 낮아 남긴 것입니다. 머지 뒤 이슈로 엽니다.
RemoveClipboard경로 범위, close reason에 들어가는 serde 문구.Client.unsent의 0 항목 정리, core 로그의 node 기록 중복.schema_version값과 디코드 크기 상한.install-timing), SFTP 설치의 크기 검사와 staging 정리.kind에 기기 표시 없이 들어갑니다(core 기록처럼 읽힐 수 있음).pane.split_failed등)는 기기 Herdr의 문구를 last error로 가져옵니다(운영자가 시작한 동작의 답).install_device가 routes lock 안에서 Shown을 보내 멈춤 기록을 남길 수 있습니다.device-guard.sh: 키와 known_hosts 경로의%거절,MEASURE_DEVICE_HOME을 realpath로.run.sh의 sidebar 단계 주석도 한 칸 sidebar에 맞게.web/src/generated/hided-ws.ts에 main 스키마의factory_question_guard가 빠져 있습니다.ask_facts의 첫 실패), 남은 폴더는 지난 연결의 답을 다음 연결까지 씁니다. catalog는 그동안 unavailable을 이유와 함께 보입니다.unavailable로 잠깐 남습니다. 모든 폴더가 답해져 있으면 화면에 보이지 않고, helper가 다시 붙으면 지워집니다.FrameShown의u64::MAX시각과 여러 스레드의 출력 순서를 직접 고정하는 테스트가 없습니다(saturating_sub와 drainer 순서는 코드로만 봄).hide-host의 git 테스트 도우미가 운영자 git 설정의 커밋 서명을 따라, 서명 agent가 멈추면 실패합니다(-c commit.gpgsign=false가 없음, 이 diff 밖).IdentityChanged만).terminal.sink_panicked, 넘김은 이어집니다).Shown이 아직 오지 않은 view도 함께 잊힙니다(상한 길에서만)./ws토큰을 가진 쪽이 오래된 키 하나씩 붙잡은 pane으로 상한을 채울 수 있습니다(이 PR 전부터). 키가 모두 나이 상한을 넘은 hold는 빈 것으로 보는 쪽이 닫습니다.Overflowed) 세션 없는 pane은 잊히지 않습니다.DeviceSink::output이 frame마다 routes mutex를 두 번 잡고(attach 확인, release 경합) 그 안에서routes.due()를 돕니다. 키, control, 보고와 다툽니다(효율).have_terminal_epoch의 wire 수준 테스트가 없습니다.hided/tests/it/handshake.rs는 epoch 없이 cursor를 보내 이제 다시 그리기로 가지만, pane이 없어 이어 받기와 같아 보이고 frame 종류만 봅니다. hub와 web store 테스트가 양 끝을 봅니다.terminal.redraw_unanswered는 창 단위로 묶지 않습니다(client, pane, 10초 요청마다 최대 한 줄).RemoteHost없이 평범한 link로 봅니다. 실제 연결의 line handler를 거치는 고리는 core가 host를 놓으면 풀린다고 코드로만 봤습니다.Breaking change
/wswire와 node 프로토콜이 바뀝니다(PROTOCOL_VERSION26, main의 25는 reader 기능). 다른 빌드의 화면은 붙지 않고, 번들의hide connect가 지금 규칙대로 다른 빌드 데몬을 교체합니다.:가 있으면 등록되지 않고, 저장돼 있던 것은 연결되지 않습니다. 추가 폼으로 만든 id에는:가 없습니다.Verification record
agents/prd/core-host-node-terminal/prd.md(sha256 8c3ad2236a02833444791e78027f0396a29ffc32350b068c134c042ef6b666a8)agents/runs/core-host-node-terminal/verification-report.jsonandagents/runs/core-host-node-terminal/verification-report.md; source fingerprint 0112e4a79bb45a7f5502901314871da4dad8c45b3eeca4bb9cb791af32b176b0bash scripts/verify-cargo.sh test(exit 0)bash scripts/verify-cargo.sh lint(exit 0)spec/core-host-node-terminal, basemain