refactor(harness): remove legacy agent architecture

This commit is contained in:
zhuyongxin
2026-07-22 18:02:01 +08:00
parent bc36248cd8
commit 8ee7cc0b70
148 changed files with 3091 additions and 13889 deletions
@@ -0,0 +1,28 @@
## 1. Remove legacy public and orchestration paths
- [x] 1.1 Remove `/api/ai_ops`, bundled frontend AiOps controls/consumer, AiOps DTO/config/service/rule evaluation/prompts/tests and obsolete logger/config references.
- [x] 1.2 Remove legacy `ChatService`, Sequential Planner/Executor/Verifier/Composer prompts, Gatekeeper/Verifier/Skill/Token helpers, ThreadLocals and self-only tests/resources.
- [x] 1.3 Remove legacy Chat Session controller, Redis SessionManager/SessionContext and tests while retaining current JPA `chat_session` Run metadata.
- [x] 1.4 Compile and run reference/static scans proving no production Supervisor/Sequential legacy orchestration or removed endpoint remains.
## 2. Make Tool and audit boundaries Harness-native
- [x] 2.1 Refactor `LookupKnowledgeTool` into a Harness-only backend by removing old Tool annotation, Session ThreadLocal, session dedup and legacy ToolInvocation recording while preserving retrieval behavior tests.
- [x] 2.2 Refactor `QueryLogsTools` into a Harness-only Mock/log backend by removing old Tool annotations, topic-discovery-first contract and legacy recorder side effects while preserving adapter contract tests.
- [x] 2.3 Replace `AgentLoggingHook` with a metadata-only Harness audit hook that requires exact RunnableConfig IDs and persists no Prompt, message/model content, Tool arguments or Thought.
- [x] 2.4 Add ToolBoundary audit event/sink and a fail-open JPA adapter that persists one bounded metadata-only ToolInvocation row per accepted Harness call.
- [x] 2.5 Add focused negative/safety tests for exact audit identity, no sensitive payload persistence, audit failure isolation and exclusive Harness Tool discovery.
## 3. Close documentation and repository contracts
- [x] 3.1 Update current MVP architecture, Agent/Harness, Trace/API and demo documents to the single Diagnosis Agent, ACI Tool and named SSE architecture.
- [x] 3.2 Mark ISS-012 and ISS-013 absorbed by ISS-014 and archive them; update ISS-014 stage/completion state only after final acceptance.
- [x] 3.3 Fix known `mysql-readonly-tool` and `rag-log-projections` main spec strict-validation defects without changing their behavior.
## 4. Final verification and live acceptance
- [x] 4.1 Run focused stage 7 tests, relevant stage 1-6B regressions, Maven compile/package, JavaScript syntax, static legacy/sensitive scans and strict OpenSpec validation.
- [x] 4.2 Start the Spring Boot application with Maven and verify clean context startup plus bounded Harness/Audit bean wiring in `logs/`.
- [x] 4.3 Execute a real `/api/chat` diagnosis, strictly validate named SSE order/outcome and capture exact metadata sessionId/runId.
- [x] 4.4 Use `logs/` and `scripts/query_mysql.py` to verify exact diagnosis_run, Diagnosis AgentStep, ToolInvocation identity/count/status/safe fields and released content/fallback; record Mock/isolated external Tool limits.
- [x] 4.5 Record final cleanup inventory, validation outputs, live E2E evidence, remaining risks and L4 migration/rollback in devflow acceptance before archive.