Skip to content

fix: bootstrap device Herdr before connecting its services - #1702

Merged
yansfil merged 6 commits into
mainfrom
feat/device-herdr-bootstrap
Oct 26, 2026
Merged

yansfil merged 6 commits into
mainfrom
feat/device-herdr-bootstrap

Conversation

@yansfil

@yansfil yansfil commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Related: mission-6 (local short PRD)

Summary

  • Herdr가 없거나 이전 프로토콜이어도, 허용한 기기에 helper와 pinned Herdr를 먼저 설치합니다.
  • 서버가 없으면 시작하며, SSH 연결을 끊거나 기기를 제거해도 서버는 계속 실행됩니다.
  • 연결되지 않은 기기에도 허용하고 설치를 표시하고, 동의창에서 서버 설치와 시작을 안내합니다.
  • 서버 시작에 실패하면 기기 행에 원인 한 줄과 재시도를 표시합니다. 정상 연결은 helper 준비 뒤 kit를 실행합니다.

연결 전에도 허용하고 설치가 보이는 기기 행

Herdr 시작 실패 안내와 기기 행의 재시도

Review

  • 판단해 주세요: 연결 전 설치 버튼과 서버 수명을 설명하는 동의 문구가 충분한지 확인해 주세요.
  • 조심해서 볼 파일: hided/src/herdr_handoff.rs - 서버 준비 확인, 시작 실패 정리와 계정으로 소유권 이전.
  • 조심해서 볼 파일: hide-node/src/ssh/host.rs, herdr-core/src/runtime/hosts.rs - kit 실행 순서와 대기 중 작업 처리.
  • 비용 검토: 연결당 자동 kit 한 번, 서버가 없을 때만 시작 프로세스 하나. 서버 준비 15초, 시작 호출 전체 20초 상한.

Evidence

  • 확인한 것: macOS 실제 SSH에서 빈 계정 설치, 기본 소켓 연결, terminal 서비스 준비와 제거 후 서버 응답.
  • 확인한 것: 격리한 Herdr 0.8.2에서 pin으로 전환 후 pane 프로세스 유지. 별도 소켓과 기존 Herdr 파일 유지.
  • 확인한 것: pin 버전 서버 유지, Rust lint, 웹 전체 검사, 기기 행과 동의창의 영어·한국어 브라우저 확인.
  • 확인한 것: Linux 원격 CI에서 새 설치·기기 제거 후 서버 유지, 이전 프로토콜 전환, 원격 core 이동 44건 모두 통과.
  • 확인하지 못한 것: 물리 원격 기기와 Intel Mac 실행. Mac 앱의 다른 플랫폼 포함은 별도 작업입니다.
Verification record
  • Base: 67bb2837b8f34bcf1260f39ad5ff1eac0b6daffa
  • Head: 4c05d7681426621af07fa8a60e596a98004ee661
  • bash scripts/verify-cargo.sh lint: PASS.
  • bash scripts/verify-cargo.sh test -- --test-threads=8: PASS on product commit 6a56a773b. 5847 passed, 120 ignored. The subsequent changes reclaim test servers by their private socket, register reported PIDs earlier and update the support table.
  • bash scripts/verify-web.sh: PASS. Web 2165 passed, 1 skipped; desktop 260 passed, 4 skipped.
  • Scoped web row and consent tests: 35 passed. Restoring the old row condition rejects the new regression case.
  • Device kit runtime checks: 52 passed, including start failure persistence and retry. Device row unit checks: 16 passed.
  • Real SSH bootstrap/removal and normal-server connection order after the final fixture correction: 2 passed (6.92 s). Planted version-check and lost-kit-reply failures confirmed the detached fixture server exited on Drop, including before any PID was recorded. The prior CI first-failure core-move journey passes locally (28.87 s).
  • Real SSH bootstrap/removal: PASS. Herdr 0.8.2 device handoff: PASS. Current server preservation: PASS.
  • Pinned binary schema, pin single source, design contract, core machine boundary and workstation identity checks: PASS.
  • Initial unrestricted Rust run hit a deadline in an unchanged OpenCode hook test; the isolated rerun passed.
  • Screenshots: this worktree's production Devices components in an isolated gallery with synthetic missing/older-protocol and start-failed snapshots. Retry emits kit_reinstall; English and Korean (125% text scale) were checked.
  • No installed app, operator server or physical remote host was used. The first Linux CI passed fresh-device bootstrap but failed core-move readiness during uploads before kit execution, then exhausted disk as failed fixture copies accumulated. No upload-count increase was found in the diff or logs; the new fixture now confirms detached-server and SSH cleanup, and normal connections defer the kit. Linux CI 40350997317 on 6a56a773b then passed all remote groups (6/23/44/2/8 tests), including the Herdr 0.8.2 device handoff, without retry. The initial upload slowdown is not conclusively attributed. Final-head CI is tracked in the PR checks. No test timeout, assertion or parallelism was relaxed.

@yansfil
yansfil marked this pull request as ready for review October 26, 2026 15:01
@yansfil
yansfil merged commit 68c210a into main Oct 26, 2026
32 checks passed
@yansfil
yansfil deleted the feat/device-herdr-bootstrap branch October 26, 2026 17:00
yansfil added a commit that referenced this pull request Oct 27, 2026
…1722)

Related: #1702, #1700

## Summary

- 기기에 서버가 없어도 Herdr가 고른 소켓을 유지하고, 못 읽으면 기기의 소켓·세션 환경 설정을 따릅니다.
- 서버 시작 실패의 Retry는 연결을 다시 열어 pane 서비스와 터미널 경로도 복구합니다.
- 보내기로 한 Herdr의 전송 실패는 기기 행의 설치 실패로 전달하고, 이전 유효 사본과 링크를 보존합니다.

## Review

- **판단해 주세요**: 시작 실패 뒤 연결 전체를 다시 여는 복구 범위와, 필수 Herdr 전송 실패의 재시도 경로.
- **조심해서 볼 파일**: `runtime/kit.rs`의 연결 복구, `ssh/host.rs`의 전송 오류,
`hide-host/src/kit.rs`의 링크 교체 순서.
- 기존 연결 worker를 사용하며 Runtime 잠금이나 session-sync에 I/O를 추가하지 않습니다.

## Evidence

- **확인한 것**: 세 항목 모두 현재 main에서 확인했고, 수정 전 회귀 테스트가 각각 실패했습니다.
- **확인한 것**: host/node 및 core Retry 테스트, 플랫폼 소켓 선택 검사와 전용 계정·소켓의 실제 SSH
6개가 통과했습니다.
- **확인한 것**: 실패 뒤 재연결에서 pane 소켓 접속, 터미널 제어권, 입력한 명령의 출력까지 확인했습니다.
- **확인한 것**: 최종 head의 계획된 CI lane 전체와 `verify`가 통과했습니다. 세 OS 계약, Rust,
원격 SSH, Linux/Windows 웹 및 macOS/Windows 데스크톱 E2E를 포함합니다.
- **한계**: 별도 core-move 검사 두 개는 기존 이슈와 같은 오류 뒤 CI 재시도에서 통과했습니다. 아래 기록에서
구분합니다.
- **확인하지 못한 것**: 실제 외부 기기와 네이티브 기기 행 클릭은 검증하지 않았습니다.
- 화면 파일과 문구 변경은 없습니다.

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

Base: `16f2f066b09b2ec7d95a3ede3ea7859c3447e092`.
Head: `f5274f1d278c582a7ad07786050172171a5e2bdf`.
CI checkout: `69892251f4591d0ae165c389ccc7e2d5ed866ea9`, the merge of
that head with main `c88c8c470e14a712245fa6e3cc27c2faedc7aada`.
The three original regression checks failed before production fixes.
Focused hide-host (140 unit + 67 integration) and hide-node (214 unit +
1 integration) suites passed, with existing ignored tests unchanged.
The core failed-start retry regression and platform host tests passed.
At preceding head `9df8bf1b3`, the complete platform integration rerun
passed 233 tests (2 existing ignored).
The final resolver change passed 22 platform host tests and the pinned
binary socket/session comparison; that comparison runs on every OS
contract lane.
All 6 isolated real-SSH bootstrap tests passed serially on the final
candidate, including environment socket/session selection, required
upload failure/re-send and usable terminals after failed startup.
The initial platform and parallel SSH attempts hit ENOSPC; the parent
freed space, and their final reruns above passed.
The pinned schema contract, core machine-boundary check, pin
single-source, attribution, design contract and diff whitespace checks
passed.
Full local lanes are deferred to CI at the parent's request because disk
space is shared with concurrent work.
Independent Code and Fidelity re-reviews passed the final head with no
Fix now findings; the initial Code review's environment-session gap is
resolved.
Optional follow-up: direct pin-file upload and final rename fault
injection; the current required-error propagation and preservation
checks cover their shared failure path.
Full final-head CI run
[40445618782](https://github.com/with-hide/hide/actions/runs/40445618782)
and its required `verify` passed.
Executed lanes: Rust (5,822 tests plus 7 separate checks), Windows
workspace/checks, remote mailbox/SSH, OS and SDK contracts on
macOS/Linux/Windows, Linux web E2E (383), Windows web E2E (64), macOS
desktop E2E (117) and Windows desktop E2E (19).
All 6 real SSH bootstrap tests and the pinned socket/session comparison
on every OS passed on their first attempt.
All web and desktop E2E logs reported no flaky tests.
Package and agent-journey lanes were not selected by the plan; this PR
does not claim they ran.
The remote lane also classified two core-move tests as flaky after
helper-readiness timeouts; both passed their one CI retry.
The same failures were already tracked from main in
[#1663](#1663) and
[#1428](#1428); CI appended this
run to those issues.
Issue #1428 is past its recorded expiry; this PR does not claim those
two flows are stable.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant