> For the complete documentation index, see [llms.txt](https://docs.goassay.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.goassay.ai/developers/zh/di-ceng-yuan-li/verification.md).

# 调用如何被验证

了解结果检查、判定，以及它们对收费和提供方质量的影响。

Assay 将提供方数据映射为工具输出结构后，会按工具承诺检查响应。收据说明运行了哪些检查，以及什么决定了调用结果。仅有提供方请求成功，不代表数据通过了这些检查。

## 检查什么

请求身份认证和结果验证回答不同问题。提供方的[请求验证器](/developers/zh/shang-jia-ni-de-api-ru-men/verify-in-your-code.md)确认谁发送了请求。Assay 的结果检查决定返回数据是否符合配置的策略。

| 检查项    | 能确认什么                                          | 当前行为                                         |
| ------ | ---------------------------------------------- | -------------------------------------------- |
| 响应结构   | 必填字段、类型及其他声明的输出 schema 约束。schema 描述预期 JSON 结构。 | 在响应映射边界和配置的 schema 阶段检查。未声明 schema 时，该阶段不适用。 |
| 质量规则   | 最少结果数、必需值、时效性、数值范围、有效 URL 和无重复。                | 配置的规则评判映射响应。可通过条件限制规则何时适用。                   |
| 含义和相关性 | 回答是否符合请求和工具范围。                                 | 配置后且被选中采样时运行。收据会区分跳过采样和检查不可用。                |

收据会列出该调用运行过的每项检查；未运行的检查绝不会显示为通过。

对于有验证策略的调用，schema 和质量规则阶段不采样。没有策略的调用仍可能收费，并记为 `UNVERIFIED`。请阅读实际检查行；不要从收费推断“所有检查都通过”。

## 如何作出决定

质量规则可能通过、失败、不适用，或指向它无法判断的数据。例如，将数值范围规则指向字符串，可能表示策略有误。Assay 会记录为误用检查，而非归咎于提供方。

质量规则得分是通过规则的权重除以适用规则的权重。该阶段将得分与策略通过阈值比较。被条件排除的规则不贡献权重。空结果有单独策略：如实返回空响应不会自动判为失败。

带版本的决策策略会综合已声明检查。其有序条款可要求失败数量或比例、赋予指定检查否决权，或规定检查运行过少时的处理。首条匹配条款决定判定。不可用或不适用的检查既不投通过票，也不投失败票。只有策略中声明的检查计入。

## 判定的含义

以下影响适用于处于活动状态且启用执行的策略。“结算”表示调用可以收费并进入收款流程，不代表提供方已经收到资金。

| 判定                 | 含义                      | 付款决定              | 提供方违规记录 |
| ------------------ | ----------------------- | ----------------- | ------- |
| `PASS`             | 符合策略。                   | 结算。               | 无       |
| `FAIL`             | 证据显示提供方违反工具契约。          | 退还预留金额。           | 有       |
| `EMPTY_CONFIRMED`  | 空响应已被佐证为正确答案。           | 结算。               | 无       |
| `EMPTY_UNVERIFIED` | 空响应缺少独立佐证。              | 结算。               | 无       |
| `MISAPPLIED`       | 检查不适合该响应或请求。            | 作废；不收费，也不记入提供方收入。 | 无       |
| `DEGRADED`         | 其他检查后，某项所需检查不可用，或策略已撤回。 | 结算。               | 无       |
| `SKIPPED`          | 采样检查未被选中。               | 结算。               | 无       |

`UNVERIFIED` 是无决策策略调用的独立记录。它会结算，但不声称验证通过。在影子模式下评估的策略不会按判定退款或记录违规；已撤回策略也不能处罚提供方。

## 如何影响失败率

只有 `PASS` 和 `FAIL` 计入提供方的质量衡量窗口。实际失败率为：

```
FAIL calls / (PASS calls + FAIL calls)
```

没有观测就没有测得的失败率。请求和系统错误与数据质量失败分别跟踪。

`FAIL` 会记录违规，但是否罚没质押，取决于提供方质量窗口、样本门槛和声明失败率。该计算和链上提议与单次调用退款分开。见[链上质押与处罚](/developers/zh/shang-jia-ni-de-api-jin-jie/staking-and-penalties.md)。

## 示例：如实解读结果

收据可能显示 schema 和规则通过，但含义检查未被采样。这描述了本次调用可用的证据，不能证明已作相关性判断。如果结果在这些检查后仍有问题，请使用该调用的问题报告操作，并留意提交截止时间。

## 延伸阅读

* [将你的 API 映射到工具契约](/developers/zh/shang-jia-ni-de-api-jin-jie/map-your-api.md)
* [在链上申诉质押处罚](/developers/zh/shang-jia-ni-de-api-jin-jie/dispute-a-stake-penalty.md)

## 下一步

* [结算与保留期](/developers/zh/di-ceng-yuan-li/settlement.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.goassay.ai/developers/zh/di-ceng-yuan-li/verification.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
