Skip to content

feat: connect phones through the encrypted mobile relay - #2018

Merged
yansfil merged 18 commits into
mainfrom
feat/hided-relay
Nov 2, 2026
Merged

yansfil merged 18 commits into
mainfrom
feat/hided-relay

Conversation

@yansfil

@yansfil yansfil commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Related: #2011

Summary

폰이 기본으로 Hide 중계를 통해 연결되고, 설정의 한 연결 줄에서 연결 상태와 다시 시도·업데이트·상한 거부를 확인합니다.
QR은 app.withhide.dev를 열며 5분 뒤 만료됩니다. Tailscale 직접 연결은 고급에서 고릅니다.
방법마다 페어링한 폰을 따로 유지하고, 끄기·해제 시 연결을 닫습니다.
폰 내용은 기기와 폰 사이에서 암호화합니다.
기존 Tailscale 설정은 그대로 이어 쓰고 새 설정은 중계로 시작합니다.

Settings Mobile: encrypted relay connection, five-minute QR and advanced Tailscale

실제 Settings 컴포넌트의 격리 갤러리입니다.
연결 줄, QR 만료 안내, 접힌 고급 영역을 확인해 주세요.

Settings Mobile: relay stays available when the old Tailscale setup cannot be removed

이전 Tailscale 연결을 정리할 CLI가 없어도 중계는 연결되고, 같은 한 줄에 정리 실패가 남습니다.

Review

  • 판단해 주세요: 연결 상태와 암호화 설명의 길이, 고급 Tailscale의 발견성.
  • 조심해서 볼 파일: hided/src/mobile/relay.rs, phone.rs - 암호화 경계, 종료 순서, 취소와 큐 상한.
  • 조심해서 볼 파일: mobile/mod.rs, phones.rs, store.rs - 키 저장, 방식 전환과 기존 폰 보존, 재연결 후 요청 기록.
  • 비용 검토: 연결 1개, 폰 작업 8개, 폰당 수신 8프레임·공유 송신 32프레임; 상태 전환만 발행하며 core 잠금 안에서 네트워크 작업을 하지 않습니다.

Evidence

  • 확인한 것: 실제 hided 중계 통합 6개가 macOS·Linux·Windows에서 암호화·재연결·방법별 폰 보존·해제·끄기·미인증 제한 시간을 확인합니다.
  • 확인한 것: 입력 중단 테스트가 연결을 끊고 같은 요청을 재시도할 때 영구 대기에 남지 않음을 확인합니다.
  • 확인한 것: Mobile UI 24개, 직접 연결 브라우저 5개와 격리 갤러리의 한글·영문·큰 글씨·dark/light·QR·고급 상태를 확인했습니다.
  • 확인한 것: 최신 커밋에서 로컬 lint·Rust 7,357개·web 2,471개·desktop 307개·빌드·디자인 계약과 GitHub CI가 통과했습니다.
  • 재시도 이력: 기존 기기 테스트 Add Playwright and Rust practice guides to the testing guide #430·#439는 최초 실패 후 로컬 단독 1회와 CI 작업 1회 재실행에서 통과했습니다. CI에는 기존 세션 복원 #419의 자동 재시도도 있습니다.
  • 확인하지 못한 것: 실제 폰·native 앱·운영 TLS와 실제 PTY 답장 재전송은 통합·배포 검증에 남아 있습니다.
Verification record

Head: d75b9db7d9ef0287392452ad5fc77bfce605f26c.
Base: b1b25cde4, including protocol #2011, Memory correction #2020, relay server #2014 and hosted phone #2019.
Scope: mobile-relay B1-B10, hided B24, B28; hided transport, Settings Mobile, owning architecture/UI guides.
The architecture merge preserves both the hosted phone WASM initiator and the device responder/admission/authentication contract.
Cargo.lock and workspace-hack did not change in that merge; their shared feature union was generated at 92620a992 and passes CI.
Caller tests use shared admission/routing types and real Noise sessions without implementing a second relay service.
The interrupted-input test uses the real phone/Noise path and node permission boundary; it does not claim an actual PTY write.
The original socket handler already detached its input task on disconnect, so the original cancellation premise was not reproduced.
The follow-up additionally settles from the blocking operation with an Uncertain drop guard; the caller test verifies disconnect/retry lifetime rather than isolating that guard.
Independent re-review passed at 5eeb73668; the additional live-peer and unreaped-task bound at 744506a3e was reviewed and accepted.
The QR screenshot was captured at e8fa80774; the cleanup screenshot was captured at 5eeb73668; the Settings product changes are unchanged since that follow-up.
The five direct-mobile browser journeys passed at 6c2a6e338 without weaker assertions or timeouts.
The Cursor fixture now explicitly selects Advanced > Use Tailscale before enabling Mobile.

Current-head local verification ran on macOS under the shared mission lock:

  • bash scripts/verify-cargo.sh lint: PASS, 1m 10s.
  • bash scripts/verify-cargo.sh test-scoped: core 3,929 passed, 1 failed, 20 ignored; stopped at the existing own_devices assertion in herdr-core/src/runtime/tests/own_devices.rs:158.
  • The only exact-test rerun on the same SHA passed in 0.27s; the initial Kit/GuardrailPolicy assertion failure remains recorded, matching #430 and #439.
  • bash scripts/verify-cargo.sh test-scoped --workspace --exclude herdr-core then ran the crates the initial command had not reached: 3,427 passed, 149 ignored.
  • Combined Rust coverage: 7,357 passed, 169 ignored, including the one separately rerun test; this is a split completion after an initial failure, not an uninterrupted green run.
  • bash scripts/verify-web.sh: PASS; web 2,471 passed / 3 skipped, desktop 307 passed / 4 skipped; type checks, lint and builds passed.
  • node scripts/check-design-contract.mjs: PASS.

GitHub CI run 41456834038 passed on attempt 2 after exactly one failed-job rerun:

Real phone/native-app interaction, production TLS and actual PTY replay remain outside this PR's verified evidence.

@yansfil
yansfil marked this pull request as ready for review November 2, 2026 09:38
@yansfil
yansfil merged commit c90eb37 into main Nov 2, 2026
135 of 178 checks passed
@yansfil
yansfil deleted the feat/hided-relay branch November 2, 2026 15:02
yansfil added a commit that referenced this pull request Nov 2, 2026
Related: #2019, #2018

## Summary

폰의 연결 안내가 길고, 기기 선택 메뉴가 화면 내용과 겹쳤습니다.
선택한 B1 안으로 기기 중심의 QR 화면과 아래에서 열리는 기기 선택창을 적용하고, 알림·홈 화면 안내를 간결하게 정리했습니다.
한국어·영어 문구를 기존 언어 설정에 맞추고, 상세 제목은 줄바꿈하며 답장과 빠른 키는 공용 부품으로 맞췄습니다.

![QR 연결 화면: 왼쪽 변경 전, 오른쪽 B1 적용 후 (각
390px)](https://github.com/yansfil/pr-assets/blob/main/hide/feat-phone-design/0d2bb7d/phone-qr-before-after-390.png?raw=true)

![기기 선택: 왼쪽 변경 전, 오른쪽 아래 선택창 (각
390px)](https://github.com/yansfil/pr-assets/blob/main/hide/feat-phone-design/0d2bb7d/phone-picker-before-after-390.png?raw=true)

![버전 안내: 왼쪽 변경 전, 오른쪽 짧은 안내와 버전 비교 (각
390px)](https://github.com/yansfil/pr-assets/blob/main/hide/feat-phone-design/0d2bb7d/phone-version-before-after-390.png?raw=true)

## Review

- **판단해 주세요**: 390px 화면의 여백, 한글 줄바꿈, 기기 선택창의 정보 밀도가 적절한지 확인해 주세요.
- **조심해서 볼 파일**: `HostPicker.tsx`, `ui/sheet.tsx`는 선택창을 닫은 뒤 기기 버튼으로 초점을
돌려줍니다.
- 연결·전송·서비스 워커·프로토콜 동작은 기존 계약을 유지합니다.

## Evidence

- 최종 커밋에서 폰 E2E 전체 20개, 웹 2,481개, 데스크톱 307개 테스트와 빌드·린트·디자인 계약 검사를
통과했습니다.
- 이전 커밋의 Rust 검사에서 변경 밖 테스트가 실패 후 단일 재실행으로 통과했습니다. 원본 결과는 아래 기록에 보존했습니다.
- 390px 실제 브라우저에서 밝은·어두운 화면, 긴 기기명, 한국어 글꼴, 오프라인·연결 거절, 상세 대화·터미널을
확인했습니다.
- 캡처는 실제 폰 번들과 테스트 중계 픽스처를 사용했습니다. 실제 iPhone의 설치·카메라·OS 알림은 이번 검증에 포함하지
않았습니다.

**후속**: 도구 호출 요약은 [별도
이슈](https://github.com/with-hide/hide-private/issues/451)로 분리했습니다.
정규화된 도구 호출에는 원본 파일 위치가 없어 기존 대화 페이지 기준에 바로 넣을 수 없습니다.
파일 대화, 그래프 대화, 데이터베이스 대화의 세 경로에서 페이지·소유권·증분 갱신을 함께 설계해야 합니다.
이번 변경에는 도구 요약이나 wire 변경이 없습니다.

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

- Head: `a36833ebb53489507e74735270409825efcc0430`
- Base ancestry: `97bbc867b69f64184ad0391373e4c9b761a231fd` (`#2019` and
`#2018` merged).
- Baseline visual source: `1205d9d4b21f1757f99a902e7664f2ecacde9b2c`;
saved real build with realistic fixture name.
- Follow-up review: direct pairing heading/expiry assertions match the
chosen B1 screen; stale hosted-layout documentation updated;
push-removal assertions wait for the home URL before reading
service-worker registrations. No product-code change after the captures.
The 15-file final diff retains transport and ownership boundaries.
- No independent review was requested in this task.
- All verification commands ran under `lockf -k
/tmp/mission-27-gate.lock`, with pnpm 10 for web commands.
- Final head: `verify-web.sh web e2e mobile.spec.ts
mobile-settings.spec.ts phone-relay.spec.ts` passed 20/20 without retry;
`verify-web.sh` exit 0 (web 2,481 passed / 3 skipped, desktop 307 passed
/ 4 skipped); design contract exit 0.
- E2E used fresh hided and hook binaries built after merging main; the
later commits change only tests and documentation. Full native
lint/tests were not repeated for this test-only follow-up; the previous
local record is below, and the final head runs CI.
- Previous validation head: `0d2bb7d7c919a0c1b49b04becd6484a18715d2f6`;
the following Rust/web results belong to that head.
- `bash scripts/verify-cargo.sh lint`: exit 0.
- `bash scripts/verify-web.sh`: exit 0; web 2,465 passed / 3 skipped,
desktop 307 passed / 4 skipped, typecheck/lint/build passed.
- Mobile relay E2E: 15 passed; `node scripts/check-design-contract.mjs`:
exit 0.
- `bash scripts/verify-cargo.sh test-scoped`: core 3,929 passed / 1
failed / 20 ignored.
`runtime::tests::inbound::a_linked_node_s_sessions_are_read_through_its_link`
expected no pane registration but saw `Unregistered`; its one exact-test
rerun at that previous validation head passed. Original failure
retained.
- Remaining workspace tests, run once after fail-fast with `test-scoped
--workspace --exclude herdr-core`: exit 0, 3,419 passed / 149 ignored
across 62 suites. Core doc-tests also exit 0 (0 tests). Including the
successful focused rerun, 7,349 Rust tests passed / 169 ignored; the
original failed full-run result remains recorded above.
- At intermediate head `5c0f835711e768097437237c0f4c8371e1c12bdb`,
`lifecycle::a_holder_runs_its_shell_and_carries_input_and_output_across_connections`
exited before its expected terminal output. Its one exact-test rerun at
that same head passed. Both native test failures are outside this diff;
their causes were not changed or claimed resolved.
- Captures at `0d2bb7d7c` remain applicable: phone components, their
translations and shared sheet have no changes at the final head.
Captures use a loopback relay endpoint override and a real encrypted
peer with fixture application data; viewport measured as 390 × 844 CSS
pixels.
- Terminal keeps the existing body token (`13px × 1.25` on phone); no
terminal parsing or input behavior changes.
- Local follow-up at `80528c5f9` passed 19/20 mobile E2E cases; the
push-removal test read service-worker registrations during navigation.
It had waited for an action present on both the old picker and the
destination. The final test waits for the destination URL first, without
retries, sleeps or product changes.
- Original CI `41469753615` failed the direct-pairing journey because
main added an expectation for the former heading and expiry sentence.
The final test asserts the chosen device-name heading exactly and the
approved short expiry copy, with all post-pairing assertions preserved.
- Physical iPhone installation, QR camera permissions, OS push delivery
and Windows/Linux native runtime are not established by these local
macOS checks.

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