47 lines
1.8 KiB
Markdown
47 lines
1.8 KiB
Markdown
---
|
|
domain: contracts
|
|
last_rule_review_commit: no-commit-yet
|
|
last_rule_updated_at: 2026-05-24
|
|
---
|
|
|
|
# contracts
|
|
|
|
## 목적 / 책임
|
|
|
|
ALT 애플리케이션 레벨 protobuf 계약을 정의한다. proto-socket은 전송 계층으로 두고, ALT 메시지는 `PacketBase.data`에 실릴 payload schema로 관리한다.
|
|
|
|
## 포함 경로
|
|
|
|
- `packages/contracts/README.md` - contract direction and compatibility notes
|
|
- `packages/contracts/proto/alt/v1/` - versioned protobuf schema source
|
|
|
|
## 제외 경로
|
|
|
|
- `packages/domain/` - internal Go domain types
|
|
- `services/api/` - runtime socket server implementation
|
|
- `apps/client/` - generated or consumed client-side integration
|
|
|
|
## 주요 구성 요소
|
|
|
|
- `common.proto` - shared enums, decimal, handshake, and error messages
|
|
- `market.proto` - instrument, price, quantity, bar, and market query messages
|
|
- `backtest.proto` - backtest run spec, lifecycle, requests, responses, and result messages
|
|
|
|
## 유지할 패턴
|
|
|
|
- Prefer additive protobuf changes and reserve removal/renaming for explicit compatibility work.
|
|
- Keep schema package under `alt.v1` until a deliberate version bump is planned.
|
|
- Keep `option go_package` aligned with the generated Go package path.
|
|
- Use explicit version/handshake messages because proto-socket protocol `0.1` does not carry an ALT application version field.
|
|
|
|
## 다른 도메인과의 경계
|
|
|
|
- **api**: contracts define payload shape; API decides transport/session behavior.
|
|
- **domain-model**: contracts are wire format; domain-model is internal business vocabulary.
|
|
- **client**: client consumes generated or mapped contracts; schema source remains here.
|
|
|
|
## 금지 사항
|
|
|
|
- Do not hand-edit generated outputs.
|
|
- Do not encode runtime server behavior or database concerns in `.proto` comments or fields.
|
|
- Do not change field numbers for existing protobuf fields.
|