You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
생성된 Herdr wire 타입을 wire.rs 밖에서 쓰면 컴파일이 실패하게 한다 #452
Herdr 응답이나 이벤트를 다루는 core 코드를 바꿀 때, 생성된 wire 타입이 herdr-core/src/wire.rs 밖으로 새지 않게 하고 싶다.
AGENTS.md는 "herdr-core/src/wire.rs is the only place generated wire types are converted into the core's inputs"라고 규칙을 적고 있다.
What hide does today
이 규칙을 기계로 확인하던 scripts/check-typed-contract-structure.py는 #435에서 지웠다.
그 검사는 CI가 실제 트리에 돌린 적이 없고(fixture 테스트만 돌았다), 7adb5bf(2026-09-20) 이후 계속 실패 상태였다.
실패 원인은 regex 오탐이다. session_sync/replica.rs가 typed map인 workspace.tokens에서 purpose를 읽는 것까지 "replica owns wire parsing"으로 잡았다.
지금 규칙은 AGENTS.md와 docs/ARCHITECTURE.md의 문장으로만 남아 있다.
생성 타입은 hide-herdr-client crate의 wire module(request, 응답, 이벤트)에 있고 공개돼 있다. herdr-core의 여러 module이 이 crate를 쓰는데, 대부분은 transport와 오류 타입(ApiConnector, ApiError, LocalSocketConnector)이고 이것은 규칙 위반이 아니다.
generated 응답/이벤트 타입을 wire.rs 밖에서 직접 쓰는 곳이 지금 있는지는 확인하지 않았다.
What it should do instead
생성된 응답/이벤트 타입을 wire.rs(또는 그것을 담는 crate) 밖에서 쓰면 컴파일이 실패한다.
예: 변환 코드를 생성 타입과 같은 crate로 옮기고 생성 타입을 그 crate 밖에 공개하지 않거나, 같은 효과를 내는 다른 컴파일러 수준의 방법.
문장이나 regex 스크립트로 지키는 규칙은 남기지 않는다.
완료 조건:
runtime, domain, sidebar, session_sync의 module에서 생성된 응답/이벤트 타입을 import하는 코드를 추가하면 cargo build가 실패한다.
transport와 오류 타입(ApiConnector, ApiError 등)과 typed map 읽기(workspace.tokens)는 지금처럼 쓸 수 있다.
이 규칙을 위한 스크립트 검사는 없다.
AGENTS.md의 Herdr API Contract 절과 docs/ARCHITECTURE.md가 새 강제 방식을 가리킨다.
Where the authority for it lives
hide 안의 구조 변경이다. Herdr 쪽 변경은 필요 없다.
관련: #435(검사 삭제), 7adb5bf(오탐이 시작된 커밋).
Activity
Keep generated Herdr wire types behind a compile-time boundary (#459)