Skip to content

Keep generated Herdr wire types behind a compile-time boundary - #459

Merged
yansfil merged 4 commits into
mainfrom
refactor/wire-boundary-compile-time
Oct 5, 2026
Merged

yansfil merged 4 commits into
mainfrom
refactor/wire-boundary-compile-time

Conversation

@yansfil

@yansfil yansfil commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Closes #452

Summary

Herdr's generated wire types were pub in hide-herdr-client, so only a review comment kept runtime, domain, sidebar and session_sync from naming them.
They are now generated by herdr-core/build.rs into a private generated module of wire.rs, so any other file that imports one fails to compile.
hide-herdr-client is transport plus one hand-written plugin registry entry. hided's phone routes use plain-value pub functions of herdr_core::wire. hide-kit (which the core depends on) reads the plugin registry through hide_herdr_client::plugin.
No behavior change intended; the moves are mechanical and the existing suites pass.

Compile failure with a probe import (not committed):

error[E0603]: module `generated` is private
   --> herdr-core/src/{domain,runtime,session_sync,sidebar}.rs   (one probe line in each)
error[E0433]: cannot find `wire` in `hide_herdr_client`
   --> hided/src/mobile/pane.rs

Review

  • 판단해 주세요: hide_herdr_client::plugin is hand-written (six required fields + source.kind), looser than the old generated struct. A registry entry with a malformed nested field (actions, events, ...) now parses. A test pins the required fields and kinds to the schema.
  • 조심해서 볼 파일: herdr-core/src/wire.rs - the generated module and the pub block for hided; hided/src/mobile/{pane,conversation}.rs - phone routes, now via wire; hide-herdr-client/src/lib.rs - subscribe* take a ready params value; subscription_params moved to wire.rs.
  • Deleted: unused subscribe_with_connector_for_panes and subscription_params_for_panes (no callers), the unused subscription_event generation.
  • Small differences: a phone pane.read answer without a read key now says pane.read returned no read section (was malformed); pane.agent_status_changed is refused by subscription_params instead of silently dropped (never requested).

Evidence

  • 확인한 것: cargo clippy --locked --workspace --all-targets -- -D warnings and cargo fmt --check clean; cargo test for hide-herdr-client, hide-kit, herdr-core and hided (all targets) pass: core lib 1372, kit 68, hided lib 168 + handshake 26 + mobile 11 + connect_build 8.
  • 확인하지 못한 것: real_herdr tests (ignored without HIDE_E2E_HERDR_BIN) compile but were not run, so subscribe against the pinned Herdr is unverified; the other workspace crates' tests and CI lanes were not run locally.
  • Review: one independent code review; its Fix now (doc wording) and cheap follow-ups are applied.

…e boundary

The types were generated into a public module of hide-herdr-client, so any
crate or any module of the core could name them. They are now generated by
herdr-core/build.rs into a private module of wire.rs: an import anywhere else
fails to compile. hide-herdr-client is transport only; hided's phone routes use
plain-value functions of herdr_core::wire, and hide-kit reads the plugin
registry entry through a small typed helper pinned to the schema by a test.
…s a set and stop generating the unused subscription event types
@yansfil
yansfil merged commit 4f43fff into main Oct 5, 2026
31 checks passed
@yansfil
yansfil deleted the refactor/wire-boundary-compile-time branch October 5, 2026 04:23
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 9, 2026
…ore (with-hide#2149)

Closes with-hide/hide-private#561
Closes with-hide/hide-private#495
Closes with-hide/hide-private#564
Closes with-hide/hide-private#605

## Summary

e2e 픽스처가 두 번째 에이전트를 너무 일찍 시작해서, 코어가 "다른 시작이 아직 진행 중"이라며 거절하고 픽스처는 30초를
기다리다 실패했습니다.
코어는 시작 하나가 끝나기 전에는 새 시작을 받지 않는데, 첫 에이전트의 행은 그 시작이 끝나기 전에 먼저 보입니다.
이제 테스트는 행이 아니라 코어가 그 시작에 준 답(시작 패널이 읽는 것과 같은 영수증, `task_operation`)을
기다렸다가 다음 시작을 보냅니다. 거절되면 30초를 기다리지 않고 코어의 이유로 바로 실패합니다.

화면 변경 없음: 테스트 코드와 문서만 바뀝니다.

## Review

- **조심해서 볼 파일**: `web/e2e/daemon-actions.ts` `startAgentInCheckout` -
코어의 task slot 규칙(`herdr-core/src/runtime/session.rs:3994-4003`)을 그대로
읽는지, `started` 외의 답은 모두 실패로 끝나는지.
- **조심해서 볼 파일**: `web/e2e/engine-fixture.ts` - 첫 시작이 끝난 뒤에야 두 번째 시작(또는
family의 spawn)이 나갑니다. 기다림은 코어 신호뿐이고 timeout·sleep·retry는 늘리지 않았습니다.
- **원인이 다른 것**: with-hide#444 with-hide#445 with-hide#459 with-hide#479 with-hide#496 은 픽스처가 아니라 spec 안의 기다림에서 실패하고
로그에 거절이 없어 이 PR에서 다루지 않습니다.
- **Herdr 레인에서만 난 것**: with-hide#260 with-hide#489 with-hide#502 with-hide#510 with-hide#511 with-hide#519 with-hide#533 은 `*-herdr-*`
레인에서만 났고 그 레인은 #2069로 지워졌습니다. #2069와 아래 반복 run을 적은 댓글로 닫습니다.
- **열어 두는 것**: with-hide#490 with-hide#492 with-hide#523 with-hide#529 with-hide#532(`agent_pane_required`)는 이 PR이
끝내지 않습니다. 원인은 with-hide/hide-private#630에서 따로 다룹니다.

## Evidence

- **확인한 것**: own engine으로 바뀐 뒤 "second fixture agent" 실패 6건 중 5건(#561
x2, with-hide#495, with-hide#564, with-hide#605; Linux·Windows)의 setup snapshot과 hided 로그를 봤습니다. 모두
두 번째 시작의 request id로 `task_operation.busy` 거절이 남아 있습니다. 나머지 1건(#561, run
42076071271)은 로그를 받지 않았고 오류 줄만 같습니다.
- **확인한 것**: 실패 로그 순서는 tab.create 완료 -> busy 거절 -> 첫 시작의
`agent.started`, 통과한 실행은 tab.create 몇 ms 뒤 `agent.started` -> 두 번째
시작입니다.
- **확인한 것**: `web`·`desktop` typecheck, lint(e2e 크기 검사 포함) 통과.
- **확인한 것**: a79a97b, run 42202678411의 Linux 전체 e2e(6 shard)와 Windows
`@platform` e2e를 3번 돌렸습니다. 닫는 11개 제목은 매번 통과했고 재시도도 없었습니다.
- attempt 1: Linux 6/6, Windows 1/1 통과. 재시도 후 통과: `desk-lane` "Desk is
off on a new install"(Linux 4/6), with-hide#444 close-subtree(Linux 6/6)
  - attempt 2: Linux 6/6, Windows 1/1 통과, 재시도 없음
- attempt 3: Linux 6/6, Windows 1/1 통과. 재시도 후 통과: `desk-lane` 같은
테스트(Linux 4/6)
- **범위 밖**: #444가 attempt 1에서 재시도 후 통과한 것과 `desk-lane`이 두 번 재시도 후 통과한 것은
픽스처 원인이 아닙니다. 이 노드 범위 밖이고 따로 묶여 있습니다.
- **확인하지 못한 것**: 로컬 e2e는 돌리지 않았습니다(Rust debug 빌드 디스크 부족). macOS 웹 e2e는
PR CI에 없어 반복하지 않았고, 이 묶음의 21개 이슈 중 macOS에서 난 것은 없습니다.
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.

생성된 Herdr wire 타입을 wire.rs 밖에서 쓰면 컴파일이 실패하게 한다

1 participant