Files
go-sip/proto/README.md
T

41 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Agent Unary gRPC contract
This directory is the project-owned W02 protocol baseline, created from the
confirmed R01–R03/R05/R07–R13 responsibilities in `docs/contracts/通信与事件数据交互_v0.1.md`
and the crash/authorization rules in `docs/architecture/G0开发准备与契约冻结提案_v0.1.md`.
- Transport is Unary gRPC over mTLS; no internal MQ, bidirectional audio stream,
or HTTP call-execution callback is introduced.
- The protocol carries control, authorization, facts, metadata and restricted
upload grants. It never carries recording/audio bytes.
- `call_execute_json` and `payload_json` preserve the approved external JSON
bytes; this Proto does not create a second external SaaS Schema.
- `ExecuteAuthorized` carries the project-local
`agent-authorized-origination.v0.1` decision. The Dispatcher persists a
one-shot issued/refused decision after checking task × selected-line policy;
the Agent checks only active session identity and the Dispatcher-issued
exclusive deadline. This method is enabled only with an explicit isolated Mock
adapter, which sends **no SIP**. Dispatcher V3 mixed/real startup rejects this
path; neither the existing `Execute` method nor MQ provides a fallback.
- `accepted` is durable receipt only; `applied`, terminal state and verified
asset facts require later evidence.
- IDs, epochs, boot/session generations, operation IDs and explicit idempotency
keys are retained for idempotency, fencing and unknown-result reconciliation.
- `ERRORS.md` is the companion error/CAS/fencing contract; it defines when a
response is only accepted and when a caller must reconcile instead of retrying.
Generation is deterministic with the pinned local tools:
```sh
buf lint
buf breaking --against '.git#branch=HEAD'
buf generate
```
The Proto/Go package has no implementation-generation suffix. The existing
`protocol_version` metadata (`agent.v1`) remains the meaningful wire-protocol
version; field numbers are never reused. Production mTLS credentials and
endpoints are deployment inputs, not repository contents. `ERRORS.md` and the
Proto are released together; a field or semantic change requires a new
compatibility review.