docs(mvp): align architecture and audit table design
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Diagnosis Agent 执行架构
|
||||
|
||||
**更新日期**:2026-07-22
|
||||
**更新日期**:2026-07-23
|
||||
**状态**:当前可运行架构
|
||||
|
||||
## 1. 单 Agent 原则
|
||||
@@ -32,6 +32,7 @@ sequenceDiagram
|
||||
participant Core as Harness Core
|
||||
participant Agent as Diagnosis Agent
|
||||
participant Tool as ACI Tool Boundary
|
||||
participant Audit as Audit Hook / Trace Recorder
|
||||
participant EG as EvidenceGuard
|
||||
participant SG as SemanticGuard
|
||||
participant Release as Release Policy
|
||||
@@ -40,6 +41,8 @@ sequenceDiagram
|
||||
App->>Agent: query + safe previous_turn
|
||||
Agent->>Tool: tool name + framework tool_call_id + typed args
|
||||
Tool-->>Agent: bounded agent_result
|
||||
Tool->>Audit: bounded Tool lifecycle metadata
|
||||
Agent->>Audit: step metadata + Provider reasoning availability
|
||||
Agent-->>App: DiagnosisDraft
|
||||
App->>EG: Draft + current Run canonical invocations
|
||||
EG-->>App: verified snapshot or deterministic failure
|
||||
@@ -52,3 +55,15 @@ sequenceDiagram
|
||||
## 4. PreviousTurn
|
||||
|
||||
PreviousTurn 只来自同一 Session 最近一个 `DIAGNOSIS + SUCCESS + published_result`。Fallback、失败、取消、raw evidence 和完整历史都不能进入下一轮;字段与字节上限由 Harness 配置控制。
|
||||
|
||||
## 5. Provider Reasoning 审计
|
||||
|
||||
`HarnessAgentAuditHook` 在每次模型步骤结束后检查 `AssistantMessage` metadata。当前识别 `reasoning_content`、`reasoningContent`、`reasoning` 和 `thinking`,但只接受 Provider 实际返回的非空文本:
|
||||
|
||||
- 有内容时写入 `agent_reasoning_audit`,单条最多保留 32000 个字符,并记录 UTF-8 `content_bytes`。
|
||||
- 无内容时写入 `reasoning_available=false`、`reasoning_content=NULL`、`content_bytes=0`,不得根据最终回答反推或生成 reasoning。
|
||||
- `agent_step.thought` 始终为空;步骤表只记录 message count、roles、是否有文本、Tool names、reasoning availability 和字节数等 metadata。
|
||||
- 普通 `diagnosis_trace_event` 的 `AGENT_MODEL_STEP` 只记录 reasoning availability/bytes,不保存 reasoning 原文。
|
||||
- Reasoning 只用于受限审计,不进入 Agent 后续上下文,不参与 EvidenceGuard、SemanticGuard 或 Release Policy 的事实判断。
|
||||
|
||||
当前查询隔离已经实现,完整访问治理和真实 Provider 行为验证仍属于 ISS-015。
|
||||
|
||||
Reference in New Issue
Block a user