refactor(harness): remove legacy agent architecture
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
## Why
|
||||
|
||||
阶段 0-6B 已把公开 Chat 切换到单一 Diagnosis ReAct Agent + Harness,但仓库仍保留可达的 `/api/ai_ops` Supervisor/Planner/Executor 多 Agent 链、无生产调用方的旧 `ChatService`、Redis Session endpoint、ThreadLocal、Verifier/Gatekeeper Hook、旧 Agent-facing Tool annotations 和过时文档。新 Harness 的 ToolBoundary 也只写 Redis canonical invocation,尚缺最终 E2E 所需的脱敏 `tool_invocation` durable audit。
|
||||
|
||||
## What Changes
|
||||
|
||||
- 删除 `/api/ai_ops`、bundled frontend AI Ops 按钮/consumer,以及对应 AiOps service、DTO、prompt、rule evaluation 和测试;公开诊断只保留 `/api/chat`。
|
||||
- 删除无生产调用方的旧 `ChatService`、Planner/Executor/Verifier/Composer prompts、Gatekeeper/Verifier helpers、旧 session controller/manager/context 和过时测试。
|
||||
- 保留 RAG 与 Mock logs 的底层查询能力,但移除旧 `@Tool` contract、Session ThreadLocal、session dedup 和 `ToolInvocationRecorder` 副作用;Diagnosis Agent 只能看到 `HarnessEvidenceTools` 的三项 ACI contract。
|
||||
- 用 Harness-native、metadata-only Agent trace hook 替代旧 `AgentLoggingHook`,禁止持久化 Thought、Prompt、Tool arguments 或模型正文。
|
||||
- 为 ToolBoundary 增加 fail-open durable audit port 与 JPA adapter,只保存 exact session/run/tool_call identity、工具名、状态、耗时和有界脱敏摘要,不保存 raw response 或完整请求。
|
||||
- 删除不再使用的配置、logback logger、资源和测试,修正阶段 3B/3C 已知 OpenSpec strict 格式问题。
|
||||
- 更新当前架构、Agent/Harness、Trace、Demo 和 API 文档;将已被 ISS-014 吸收的 ISS-012/ISS-013 归档。
|
||||
- 启动真实 Spring Boot 应用,执行最终 Chat SSE E2E,并用 `logs/` 与 `scripts/query_mysql.py` 核对 exact sessionId/runId、Run、AgentStep、ToolInvocation 和安全发布结果。
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
- `single-react-cleanup-e2e`: 定义旧链物理删除、唯一公开 Chat surface、Harness durable audit、安全 Trace 和最终 live E2E 验收。
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
- `single-react-chat-sse-cutover`: 删除阶段 6B 暂时保留的 legacy AiOps 与 Session endpoints,使唯一 Chat surface 成为最终状态。
|
||||
|
||||
## Scope
|
||||
|
||||
- Controller/service/hook/util/tool/resource/test 的旧架构删除与 Harness-native audit replacement。
|
||||
- bundled frontend AI Ops 路径清理。
|
||||
- MVP architecture/demo/API/issue 文档收口。
|
||||
- OpenSpec strict validation cleanup。
|
||||
- Spring Boot live Chat SSE、日志和 MySQL exact-run 验收。
|
||||
|
||||
## Non-goals
|
||||
|
||||
- 不修改三类 Intent、Diagnosis Agent Draft、EvidenceGuard、SemanticGuard 或 Release Policy 业务语义。
|
||||
- 不新增 Graph、工作流 DSL、兼容 endpoint、双轨开关或 Token streaming。
|
||||
- 不删除历史数据库表或历史数据,不迁移生产数据。
|
||||
- 不声称完成真实 CLS 或生产业务 MySQL datasource live E2E;query_logs 和 query_mysql 继续按 ISS-014 使用 Mock/隔离契约验收。
|
||||
- 不重新设计 RAG 检索算法、Trace API 或前端视觉体验。
|
||||
|
||||
## Context Constraints
|
||||
|
||||
- Diagnosis Agent 是唯一拥有 Tool loop 的业务 Agent;项目业务代码不得保留 Supervisor/Sequential/Planner/Executor/Verifier/Composer 编排。
|
||||
- Agent-facing Tools 只能来自 `HarnessEvidenceTools`,底层 RAG/log 实现不是 Agent contract。
|
||||
- Durable audit 只能保存有界脱敏元数据;Redis canonical invocation 仍是当前 Run 完整调用记录真理源。
|
||||
- live E2E 必须对齐 SSE metadata 的 exact sessionId/runId,不能用“最新一条”替代。
|
||||
- L4 endpoint 删除不提供兼容分支;回滚只能整体回滚阶段 7 commit。
|
||||
|
||||
## Risks
|
||||
|
||||
- 旧类存在隐式 Spring bean 或动态 Tool discovery,删除不完整会继续把旧 Tools 暴露给模型。
|
||||
- 旧 Tool recorder 与新 canonical store 并存会产生双写或缺少 exact run 的数据库审计。
|
||||
- Agent trace hook 若保存模型正文或 Tool arguments,会违反不持久化 Thought/Prompt/raw payload 的边界。
|
||||
- live 环境依赖模型、Redis、Milvus 和 MySQL;必须区分环境失败、实现失败与验收限制。
|
||||
Reference in New Issue
Block a user