Files

33 lines
2.4 KiB
Markdown
Raw Permalink 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.
# Evidence: single-react-chat-sse-cutover
## Code and Contract Evidence
- `ChatApplicationUseCase` 已提供 typed result、observer 和 exact `ChatRunControl`,Controller 无需拥有模型、Tool 或业务路由。
- `ChatSseSession` 使用 first-terminal-wins 状态和 pending disconnect,覆盖断开早于 `onStarted`、send failure、late terminal 与正常 completion 竞态。
- `ChatSseEvent` 固定 metadata/status/content/failure/done payload;content 引用阶段 6A typed public content,failure 只公开 stable code/message。
- `HarnessChatConfiguration` 组装同一个 Core、model boundary、canonical store、ToolBoundary、Diagnosis Agent、Guards、Router、executors 和 application use case。
- `ChatHarnessProperties` 集中 worker/model queue、Run、SSE、canonical store、Agent、Router、Guard 和 single-turn limits;executors 使用有限队列与 `AbortPolicy`。
- bundled frontend 只向 `/api/chat` 发起 streaming POST,按完整 named SSE frame 严格解析并 fail closed。
## Ownership Review
- Apply review 将原 Controller 拆为 `ChatController`、`AiOpsController` 和 `ChatSessionController`。
- `ChatController` 只注入 `ChatApplicationUseCase`、bounded worker 和 Chat properties;禁止依赖扫描为 0。
- `/api/ai_ops`、`/api/chat/clear`、session info 和 run list 的 URL 与 payload 字段保持不变。
- mode selector/dropdown DOM、JS state 和 CSS 已全部移除,不保留双轨开关。
## Safety and Lifecycle Evidence
- success 测试验证 `metadata,status,content,done` 严格顺序和 typed content。
- failure 测试验证内部 provider detail 不进入 failure payload,且 content/failure 互斥。
- disconnect-before-start 与 send-failure 测试验证 exact Run 取消和 late terminal 阻断。
- frontend contract test 验证唯一 request target、五类 event branch 与旧 consumer token 删除。
- static scan:生产 Controller/前端 legacy Chat token 0;Chat Controller forbidden dependency 0。
## Verification Evidence
- Stage 2-6B + AiOps regression:24 suites / 101 tests,0 failure/error/skipped。
- `HarnessChatConfigurationTest` 覆盖 bounded queues、共享依赖、空 MySQL fail-closed 和 Spring context wiring。
- Maven compile、strict OpenSpec validation 和 JavaScript syntax check 通过。
- 真实模型、Redis、日志和 MySQL live E2E 按 ISS-014 串行门禁留到阶段 7。