Protocol Documentation¶
Table of Contents¶
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 便于调试信任边界. |
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 稳定. |