日期:2026-09-24 状态:R1 首批落地 · 全部本地测试通过(1307 passed / 4 legacy fails) 对应方向:docs/aishield-direction-2026-09-research.md(研发导向开源 agent 生态统一服务平台)
| 层 | 支柱 | 新增/修改文件 | 状态 |
|---|---|---|---|
| L1 信任认证 | 签名 Agent Card | eco/agent_card.py(既有)+ api/ecosystem_api.py + MCP 新工具 |
✅ |
| L2 专业注册 | Specialist Registry(8 域) | eco/specialist_registry.py + API + 种子数据 |
✅ |
| L3 中立身份 | KYA SD-JWT + Web Bot Auth + ERC-8004 | eco/kyad_compat.py + API |
✅ |
| L4 责任链 | Responsibility Chain | eco/responsibility_chain.py(既有)+ API 接入 |
✅ |
| L5 协议翻译 | MCP ⇄ A2A ⇄ ACP ⇄ AP2 | eco/protocol_bridge.py(既有)+ API 接入 |
✅ |
| 发布门禁 | aishield ship CLI |
scripts/ship_gate.py |
✅ |
| 分发 | MCP 6 个新工具 | mcp-server/mcp.json → v4.5.0 |
✅ |
| 测试 | 28 项新增自证 | tests/test_ecosystem_activation.py |
✅ 28/28 |
所有端点走 api/server.py 路由分发到 api/ecosystem_api.py。
GET /api/v1/agent-card/pubkey → 获取签发公钥
POST /api/v1/agent-card/sign → 对 Agent Card 签名
POST /api/v1/agent-card/verify → 验证签名(篡改即拒)
POST /api/v1/agent-card/identity → 一站式导出 KYA + Web Bot Auth 身份
GET /api/v1/specialist/domains → 8 域目录 + 每域 agent 计数
GET /api/v1/specialist/agents?domain=… → 按域列出(含 lapsed)
GET /api/v1/specialist/agents/{agent_id} → 查询单个 agent
POST /api/v1/specialist/agents → 注册 agent
POST /api/v1/specialist/agents/{id}/renew → 续期 90 天
POST /api/v1/specialist/agents/{id}/revoke → 吊销
8 专业域(对齐 OWASP AIUC-1 场景 + 2026 生态主流赛道):
| 域 | 典型能力标签 |
|---|---|
| legal | contract / compliance / dispute / review |
| medical | diagnosis / drug / imaging / genomics |
| finance | risk / trading / audit / payment |
| education | tutor / assessment / curriculum / mentor |
| engineering | coding / devops / debugging / architecture |
| design | writing / art / video / branding |
| research | analysis / literature / simulation / visualization |
| civic | public-service / social-welfare / urban / tax |
POST /api/v1/identity/kyad/export → Agent Card → KYA SD-JWT claims
POST /api/v1/identity/erc8004/wrap → Wallet 地址 → DID:ERC-8004
GET /api/v1/identity/wallets → 文档指引
POST /api/v1/chain → 创建链(或指定 chain_id)
POST /api/v1/chain/{id}/append → 追加一条调用证据
GET /api/v1/chain/{id} → 导出链
GET /api/v1/chain/{id}/entries → 同上(别名)
GET /api/v1/chain/{id}/verify → 校验完整性
GET /api/v1/chain/{id}/trace?output_ref=…→ 溯源 + 定位首因
POST /api/v1/protocol/normalize → 任意协议 → UniversalAgent
POST /api/v1/protocol/translate → from_protocol → target 协议
# 单文件扫描
python scripts/ship_gate.py --file ./mcp-server/mcp.json --json
# 目录扫描 + 生成 Trust Attestation
python scripts/ship_gate.py --path ./eco/my_skill/ \
--json --fail-on-warn \
--emit-attestation dist/attestation.json
# CI 集成(GitHub Action)
- run: python scripts/ship_gate.py --path . --json --fail-on-warn
判定规则:
| 条件 | verdict | 退出码 |
|---|---|---|
| trust_score ≥ 70 且无 critical | ship | 0 |
| 有 critical 或 score < 40 | break | 1 |
| 其他 | hold | 0 / 2(--fail-on-warn 时) |
在 mcp-server/mcp.json 的 capabilities.tools 添加 8 个新工具:
| 工具 | 对应端点 | 用途 |
|---|---|---|
aishield_sign_agent_card |
POST /agent-card/sign | 对 Agent Card 签名 |
aishield_verify_agent_card |
POST /agent-card/verify | 验证签名(防篡改) |
aishield_export_identity |
POST /agent-card/identity | 导出 KYA + Web Bot Auth |
aishield_register_specialist |
POST /specialist/agents | 注册专业 agent |
aishield_list_specialist_domains |
GET /specialist/domains | 查询 8 域 |
aishield_chain_append |
POST /chain/{id}/append | 追加责任链 |
aishield_chain_trace |
GET /chain/{id}/trace | 责任链溯源 |
aishield_protocol_translate |
POST /protocol/translate | 协议翻译 |
tests/test_ecosystem_activation.py 分 4 个测试类:
全量回归:1307 passed / 4 legacy fails(均为老 CI 契约问题,与本次改动无关) 隔离不变量:scripts/prove_isolation.py ✅ PASS
cd aishield
# 1. 跑 5 支柱 API 自证
python api/ecosystem_api.py
# 2. 跑 28 项新测试
python tests/test_ecosystem_activation.py
# 3. 试 ship CLI(对某个目录做发布门禁)
python scripts/ship_gate.py --path . --json
scripts/_push_batch.py 走 GitHub Contents API 推上去才能进 CItest_arena_join_gate 未登记、memory 有 credentials、gate 阈值缺失等 —— 与本轮无关但会影响 CI 绿灯api/data/agent_card_key.json 首次运行自动生成,HMAC 模式服务端持有私钥;部署到 CF Pages 需换 Ed25519 + 持久化卷to_sd_jwt_compact 生成的是结构骨架(未做 ES256 签名),消费方接入 KYA 完整生态时需自己补签名或走 Web Bot Auth