Skip to content

Ship device-parity - #261

Merged
yansfil merged 36 commits into
mainfrom
prd/device-parity
Sep 29, 2026
Merged

yansfil merged 36 commits into
mainfrom
prd/device-parity

Conversation

@yansfil

@yansfil yansfil commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Related: PRD agents/prd/device-parity/prd.md · follows #257 (bundled Herdr server start) and meets #255 (subtree close)

Summary

  • 지금까지 hide CLI 링크, Claude Code·Codex hook, 라벨 플러그인, hcoord는 기계마다 따로 맞춰야 했고 SSH 기기는 helper만 받았다.
  • 이제 설치 kit 하나(hide-kit)가 같은 구성요소를 이 Mac에는 설치된 앱의 첫 실행에, 각 기기에는 연결 때 묻지 않고 설치한다.
  • 업데이트, 운영자가 지운 구성요소(다시 설치 전까지 그대로), 기기 삭제(hcoord만 남김)가 이 Mac과 기기에서 같은 규칙이다.
  • Settings > Devices는 기계마다 구성요소별 상태와 위치를 보이고, 문제가 있는 행에만 Reinstall이 있다. Agents 탭은 기계별 hook 행을 보인다.
  • 기기의 agent pane은 로컬과 같은 함수로 계측을 판정한다(그 pane의 hook token과 그 기기의 kit). 기기 Memory는 범위 밖이다.

기기 행: 운영자가 지운 Claude Code hook은 이유와 함께 '지워짐'으로 남고, 문제가 있는 이 행에만 Reinstall이 생긴다

Review

  • 이번 머지의 동작: 이 Mac의 kit는 실행 중인 앱 번들을 원본으로 쓴다. /Applications 위치 제한은 별도 보안 검토 대상으로 남긴다.
  • 이번 머지의 동작: 같은 계정에 다른 기기 등록이 있으면 kit를 유지하고 확인창에 이유를 표시한다. 마지막 등록을 지울 때 제거한다.
  • 기존 결정 D-13: 계약 2로 허용한 기기는 다음 연결에 kit 전체를 받는다. 과거 동의 문구에는 hook과 설정 변경이 없었다는 점은 Breaking change에 명시했다.
  • 남은 제약: 두 Mac이 같은 기기 계정에 kit를 적용하면 마지막으로 실행한 kit가 hook과 링크를 소유한다. 계정 lock은 동시 쓰기만 막는다.
  • 조심해서 볼 파일: hide-kit/src/lib.rs - 운영자 설정 파일과 LaunchAgent를 바꾸는 유일한 경로(계정 lock, private 폴더).
  • 조심해서 볼 파일: hide-agent-hooks/src/install.rs - 운영자 설정 파일 쓰기의 failure path(mode와 symlink 보존, 임시 파일).
  • 조심해서 볼 파일: herdr-core/src/runtime/kit.rs - runtime mutex 밖 worker, 늦은 응답, 기기 삭제 순서와 helper 연결 종료.
  • 조심해서 볼 파일: herdr-core/src/remote/host.rs - 한 계정에 두 연결이 동시에 올리는 경합과 private 폴더.
  • 조심해서 볼 파일: herdr-core/src/runtime/device_catalog.rs - regroup마다 lineage pass를 다시 돈다(#255와 만나는 곳, mutex 안의 일).
  • 조심해서 볼 파일: desktop/src/main/host.ts - hcoord 준비 제거(kit 소유), 창은 status page 로드가 끝난 뒤에 shell을 연다.
  • 조심해서 볼 파일: herdr-core/src/model.rs, contracts/snapshot-wire-enums.json - snapshot wire의 DeviceSnapshot.kit.

Evidence

  • 확인한 것: 격리 sshd(비루트, 세션마다 private HOME과 HCOORD_HOME)로 실제 SSH 연결: 연결 한 번에 다섯 구성요소가 설치됐다.
  • 확인한 것: 같은 연결에서 다른 도구의 hook과 설정 키가 그대로였고, 기기 pane의 설치된 SessionStart hook이 Workspace 안내를 내고 Memory capsule은 없었다.
  • 확인한 것: 운영자가 지운 Claude hook은 '지워짐'으로 남았다가 Reinstall이 그것만 되살렸고, 삭제는 설정 파일을 원래 바이트로 돌리고 hcoord를 남겼다.
  • 확인한 것: 한 계정의 두 등록이 동시에 연결해 둘 다 설치됐고, 첫 삭제는 kit를 남기고(device.kit_left) 마지막 삭제가 걷어냈다.
  • 확인한 것: 패키지된 hide.app의 hided를 private HOME으로 실행하면 첫 실행에 다섯 개를 설치하고, 두 번째 실행은 설정 파일 mtime을 바꾸지 않았다(3회 반복).
  • 확인한 것: 전체 desktop e2e 26/26(merge 뒤), device-kit과 remote-workspace 3/3(검증 head), cargo test와 lint, verify-web, scripts, design contract 통과.
  • 확인한 것: 모든 실행에서 운영자의 hcoord daemon pid가 그대로였고, 실제 ~/.claude, ~/.codex, ~/.local/bin, ~/.hcoord, /Applications/hide.app은 건드리지 않았다.
  • 확인하지 못한 것: mini가 계약 2 동의에서 kit로 올라가는 실제 연결(merge와 설치 뒤에 일어난다, 코어 테스트만 있다).
  • 확인하지 못한 것: Linux 기기(단위 테스트만, hcoord는 macOS에서만 설치), GitHub로 설치된 라벨 플러그인을 넘겨받는 경로(가짜 socket 단위 테스트만).
  • 확인하지 못한 것: 재부팅 뒤 hcoord daemon이 kit 첫 pass에서 올라오는 순서(#257과 만나는 곳), /Applications 설치본 교체(운영자 소유라 하지 않았다).
  • 확인하지 못한 것: github::tests의 1초 deadline 테스트가 부하(load 9~13)에서 네 번 실패했다. 이 브랜치가 건드리지 않은 모듈이고 단독 실행은 통과했다.
추가 증거

This Mac 행: 패키지된 앱의 hided가 격리 HOME에 첫 실행 kit 다섯 구성요소를 묻지 않고 설치했다

Settings > Agents: 기계마다 hook 행, This Mac 먼저 그다음 기기 (이 캡처의 This Mac은 개발 빌드라 설치하지 않는 이유를 보인다)

기기 삭제 확인: 기기에서 지울 항목과 남길 hcoord를 말하고, 버튼 이름이 결과다

  • 창 navigation 경합: status page 로드 10~30 ms 뒤에 shell을 열면 Electron 44가 빈 code로 실패를 보고했다(20번 중 8번, 3번). 창은 shell에 도착했지만 Playwright가 멈췄다. 지금은 한 번에 하나만 연다.
  • 공유 머신 부하에서 remote-workspace의 hook 65회 반복 검사가 한 번 16번째에서 멈췄고, 단독 재실행은 통과했다(이 브랜치는 hook 버전 문자열만 바꿨다).

Breaking change

  • 설치된 앱은 실행마다 운영자 홈의 kit를 맞춘다. 전에 한 번 쓰던 hook(이제 v6)과 hcoord에 더해 ~/.local/bin/hide 링크, Herdr 플러그인 hide.agent-context-labels, ~/.hide/kit/가 새로 생긴다.
  • 예전 ~/.hide/agent-hooks/installed-once 표시는 설치 기록으로 보지 않아서, Hide hook이 없는 기계는 다음 실행에 hook을 받는다.
  • 같은 id로 GitHub에서 설치했거나 checkout에서 link한 라벨 플러그인은 kit 복사본으로 바뀐다(플러그인 config는 남는다).
  • 동의가 있는 기기(계약 2 포함)는 다음 연결에 같은 kit를 받는다. helper protocol은 10이고 helper는 연결 때 스스로 바뀐다.
  • 이 Mac의 kit를 한 번에 걷어내는 명령은 없다. 운영자가 지운 구성요소는 다시 설치하기 전까지 그대로 둔다.

AI tooling: 대부분 AI 도구. 사람이 손으로 대조한 것은 아직 없고, 이 PR의 리뷰가 그 대조다.

Verification record
  • PRD: agents/prd/device-parity/prd.md (sha256 f197c2cdf41e26a237da0d79a195e42f15cc67d6df57eed17cd63789b3d9a294)
  • Base efb51d1 → head 755839b, verified 2026-09-29T10:00:10.099Z: PASS
  • Verification report: agents/runs/device-parity/verification-report.json and agents/runs/device-parity/verification-report.md; source fingerprint 9e6c848822e7523665bf50ded685362f4e9d9c8df0e12c639c228a52a4e91239
  • Suites:
    • S1: GREEN bash scripts/verify-cargo.sh test (exit 0)
    • S2: GREEN bash scripts/verify-cargo.sh lint (exit 0)
  • Reviews: advisory, native subagents, six feature review sets through f3fac04, plus Fidelity, Code and Security follow-up reviews on verified merge head 755839b; no new actionable findings.
    • Fidelity (afe113d): Fix now 1, removing one of two registrations of one account kept the kit, a B23/D-16 departure; kept as a recorded deviation with tests and e2e. Fix now 2, an unread device kit judged hooks not installed; fixed 9a636c6, 749e095. Later heads: none.
    • Code (afe113d): Fix now 1 unread kit judged not installed, fixed 9a636c6/749e0959; 2 concurrent uploads of one account, fixed 6069955, 17108b0, 91354b0; 3 a late answer brought back a removed device, fixed 749e095; 4 hcoord failed on Linux, fixed f5155fb. 5382042: Fix now 1, a regrouped device session dropped its agents' lineage that Close an agent with the agents it spawned, deepest first, after one question #255's subtree close waits on, fixed f3fac04 with a regression test. Other heads: none.
    • Security (afe113d): Fix now 1 hook file mode and symlink replaced, fixed 0496815; 2 this Mac's kit runs from any app bundle, left for human judgment (see Review); 3 kit folders not private, fixed 68f8bc9. Later heads: none.
    • Follow-ups (not in this PR): a lineage pass on every device regroup even when nothing regrouped; a bounded status page wait; .upload-* leftovers after a crash; contract-2 carry with an unbound identity; hcoord shim ownership marker; relative PATH candidates; labels dev-link undo; process.rs kill/join order; digest-only reuse and payload caps before read; Herdr-down retry of labels; corrupt record healing; a lost Reinstall not requeued; blocked rows offering Reinstall; removal dialog default focus; two Macs sharing one device account; the github::tests 1 s deadlines under load.
  • Evidence: 7 registered (4 screenshot, 3 log); paths are local to the run directory
    • agents/runs/device-parity/evidence/this-mac-kit.png
    • agents/runs/device-parity/evidence/agents-hooks-per-machine.png
    • agents/runs/device-parity/evidence/device-kit-removed-part.png
    • agents/runs/device-parity/evidence/device-remove-confirm.png
    • agents/runs/device-parity/evidence/e2e-desktop-all-0ac13a23.log
    • agents/runs/device-parity/evidence/device-kit-daemon.jsonl
    • agents/runs/device-parity/evidence/device-kit-two-registrations-daemon.jsonl
  • Changed paths: 172 (see Files changed)

The installed hook now runs the helper only when it is there, so an app
moved or a device folder replaced leaves agent sessions working rather
than failing every hook. The version marker moves to 6, which reads an
older entry as outdated for the kit to replace.
The kit judges, installs and removes the hide command link, the Claude
Code and Codex hooks, the agent labels plugin and hcoord against an
explicit home, kit folder and Herdr socket, so this Mac and a device run
the same code. A record under ~/.hide/kit tells a part the operator took
away from one never installed, and another tool's files are never
rewritten. The labels plugin gains a packaged manifest with no build
step for the kit to link.
…r's socket from hcoord

The kit target carries a stop flag that ends a child it waits on, local.rs derives this Mac's target from the app bundle and refuses build directories, and hcoord's daemon check is told which Herdr socket to use.
…n Settings

A core-owned kit worker runs the launch pass, the operator's Reinstall and a re-read while Settings is open, with the runtime lock released. The first-run hook install, the per-runtime install event and the helper lookup it used are removed. Settings > Agents lists each machine's hook parts with Reinstall on a problem row only.
The release build adds the labels watcher, and the packager stages the packaged manifest, its scripts and the watcher in Contents/Resources/agent-context-labels, refusing to package when any is missing.
The helper's kit call points <root>/current at the build it runs from, removes older builds, and applies, reads or removes the kit for the helper root it was installed under; a request cannot name another folder. When the SSH channel closes, a kit step still running ends its child.
A device connection uploads the whole build (helper, hide, hook helper, labels plugin, hcoord) into its version folder, resuming what an interrupted install left, and the device's kit worker applies the kit on each connection, on Reinstall and when Settings opens. Consent contract 3 names the whole kit; a contract-2 consent for the same folders is carried to 3 on its next connection. Removing a connected device takes Hide's kit off it before its helper connection closes; a device that is not connected keeps it and the log says what stayed. The SFTP hide link and the older-build cleanup move to the kit and the helper.
A device pane's children come from the same judgement as a local pane's, with the pane's hook tokens carried from the device's Herdr and the device's kit report standing in for this Mac's hook files. The fixed remote-host reason is gone: a device where Hide may not install reads as not installed, and one not read yet as unknown.
…ne button

Every machine row lists the kit's parts with where each is or why it is not, and offers Reinstall only when a part needs it. Adding or allowing a device agrees to the whole kit once, with the parts and their locations on the form; Add without files is gone. The removal confirmation says in one line what comes off the device and that hcoord stays.
…emoval

ARCHITECTURE gains The install kit and consent contract 3, INSTALL says what a first launch and a device add install and how to take them off, agent-hooks describes the guarded v6 command and the kit's record instead of the first-run marker, UI_BEHAVIOR covers the Settings rows, and the docs index and build lists name the new owners.
…emoved, and carry hcoord's relocation through the kit
@yansfil yansfil changed the title Install one kit on this Mac and every connected device, asking nothing Ship device-parity Sep 29, 2026
@yansfil
yansfil merged commit b8a3504 into main Sep 29, 2026
8 checks passed
@yansfil
yansfil deleted the prd/device-parity branch September 29, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant