2.4 KiB
2.4 KiB
Evidence: single-react-chat-sse-cutover
Code and Contract Evidence
ChatApplicationUseCase已提供 typed result、observer 和 exactChatRunControl,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。