Files
val-blog/org/verification/anvil_v1/README.md
T

90 lines
2.0 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.
# Anvil 执行验证包 v1
本验证包用于验证 AnvilWorks/Execution)角色的执行结果,确保任务可复验、可回滚、可审计。
## 验证目标
- **核心功能**:验证 Anvil 执行任务的结果是否符合 acceptance_criteria
- **可复验性**:基于相同输入应产生相同输出
- **可回滚性**:失败时可恢复到初始状态
- **可审计性**:执行过程产生完整日志和 artifacts
## 执行步骤
### 1. 前置检查
```bash
# 进入验证包目录
cd org/verification/anvil_v1
# 检查必要文件是否存在
ls -la
```
### 2. 执行验证
```bash
# 运行验证脚本(幂等)
./run.sh
```
脚本将:
- 读取 `sample_input.json`
- 验证输入格式
- 执行验证逻辑
- 生成 `sample_output.json`
### 3. 查看结果
```bash
# 查看生成的输出
cat sample_output.json
```
## 预期结果
执行成功后:
- `sample_output.json` 包含:
- `status`: "success" | "failure"
- `artifacts`: 生成的产物列表
- `metrics`: 验证指标
- `errors`: 错误列表(空数组表示无错误)
## 失败回滚方式
如果验证失败,执行以下命令回滚:
```bash
# 删除生成的输出文件,恢复初始状态
rm -f sample_output.json && echo "Rollback complete"
```
## 目录结构
```
org/verification/anvil_v1/
├── README.md # 本文件
├── checklist.md # 验证检查清单
├── run.sh # 可执行验证脚本
├── sample_input.json # 示例输入
└── sample_output.json # 示例输出(运行后生成)
```
## 验证流程图
```
┌─────────────┐
│ 前置检查 │ ← 检查文件完整性
└──────┬──────┘
┌─────────────┐
│ 执行检查 │ ← 验证任务执行结果
└──────┬──────┘
┌─────────────┐
│ 收尾检查 │ ← 清理和记录
└─────────────┘
```