跳转至

Protocol Documentation

Table of Contents

Top

health.proto

HealthRequest

HealthResponse

Field Type Label Description
status HealthResponse.Status
version string
tenant_id string

HealthResponse.Status

Name Number Description
STATUS_UNSPECIFIED 0
SERVING 1
NOT_SERVING 2

HealthService

Method Name Request Type Response Type Description
Check HealthRequest HealthResponse Check returns SERVING if the common platform is ready to accept traffic for the caller's tenant. Also echoes tenant_id for trust-boundary debug.

Check 在通用 platform 能为调用方租户服务时返回 SERVING, 同时回显 tenant_id 便于调试信任边界. |

Top

safetychain.proto

BreakerState

BreakerState is one row of the breaker registry snapshot. State is a string ("closed" / "open" / "half-open") for the same reason as Verdict.severity -- readability in logs / dashboards and forward compatibility with any future state additions.

BreakerState 是 breaker registry snapshot 的一行. State 用 string ("closed" / "open" / "half-open") 理由同 Verdict.severity -- 日志 / dashboard 可读且对未来新增状态前向兼容.

Field Type Label Description
name string
state string

ListBreakerStatesRequest

ListBreakerStatesResponse

Field Type Label Description
states BreakerState repeated

ListVerdictsRequest

ListVerdictsRequest currently has no filters. Future revisions may add tool_name / since_timestamp / severity once a consumer needs them -- kept empty now to avoid speculative API surface.

ListVerdictsRequest 当前无过滤字段. 未来消费方有需求时再加 tool_name / since_timestamp / severity, 现在留空避免投机 API 面.

ListVerdictsResponse

Field Type Label Description
verdicts VerdictRecord repeated

Verdict

Verdict mirrors validator.Verdict. Details map is deliberately omitted -- proto3 has no direct equivalent of map<string, any>, and no current consumer reads per-rule breakdown. If a consumer needs it, add repeated DetailEntry { string key = 1; string json_value = 2; }.

Verdict 对齐 validator.Verdict. 刻意省略 Details map -- proto3 没有 map<string, any> 的直接等价, 也没有当前消费者读 per-rule breakdown. 若有消费者需要, 加 repeated DetailEntry { string key = 1; string json_value = 2; }.

Field Type Label Description
approved bool
score double
reason string
severity string Severity mirrors validator.Severity ("" / "warn" / "block"). Kept as string rather than enum so legacy or future severity values from third-party Validators do not force proto schema bumps.

Severity 对齐 validator.Severity ("" / "warn" / "block"). 用 string 不用 enum, 让第三方 Validator 出的旧 / 新 severity 不强迫 proto schema 升级. | | validator_name | string | | | | policy_version | string | | |

VerdictRecord

VerdictRecord mirrors safetychain.VerdictRecord. Fields are ordered for on-wire efficiency (timestamp / tool_name always populated; verdict subfields vary).

VerdictRecord 对齐 safetychain.VerdictRecord. 字段顺序按 on-wire 效率排 (timestamp / tool_name 常填; verdict 子字段变化).

Field Type Label Description
timestamp google.protobuf.Timestamp
tool_name string
verdict Verdict

SafetyChainService

SafetyChainService is the gRPC surface for safety-chain observation. SafetyChainService 是安全链观测的 gRPC 接口.

Method Name Request Type Response Type Description
ListVerdicts ListVerdictsRequest ListVerdictsResponse ListVerdicts returns the current Verdict flow window (oldest first, bounded by the server's RingStore capacity). An empty window returns an empty list, not an error.

ListVerdicts 返回当前 Verdict 流水窗口 (老的在前, 受 server RingStore 容量限制). 窗口为空返回空列表, 不是错误. | | ListBreakerStates | ListBreakerStatesRequest | ListBreakerStatesResponse | ListBreakerStates returns every registered breaker's current State, sorted by Name so repeated polls diff stably.

ListBreakerStates 返回每个已注册 breaker 的当前 State, 按 Name 排序 让轮询间 diff 稳定. |

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)