Commit Graph

12 Commits

Author SHA1 Message Date
MerCry 43ce9837a1 feat(ai-service): add contract validation tests for T3.5 [AC-AISVC-02]
- Verify ChatResponse fields match OpenAPI contract
- Test required fields: reply, confidence, shouldTransfer
- Test optional fields: transferReason, metadata
- Test JSON serialization uses camelCase (by_alias=True)
- Test confidence range validation [0.0, 1.0]
- Test ChatRequest contract compliance
- Test ErrorResponse contract compliance
- Test SSEFinalEvent matches ChatResponse structure
- Test SSEErrorEvent matches ErrorResponse structure
- Add end-to-end contract validation with OrchestratorService
- All 184 tests passing
2026-02-24 13:55:17 +08:00
MerCry e4dc3d97e2 feat(ai-service): add Phase 5 integration and contract tests [AC-AISVC-10,11,17,18]
- Add multi-tenant integration tests (test_integration_tenant.py)
- Add RAG smoke tests (test_rag_smoke.py)
- Add API contract tests (test_contract.py)
- 184 tests passing
- Phase 4 & 5 complete
2026-02-24 13:53:55 +08:00
MerCry 6d54030e0d feat(ai-service): implement complete Orchestrator generation pipeline for T3.4 [AC-AISVC-01, AC-AISVC-02]
- Integrate Memory, ContextMerger, Retriever, LLMClient, ConfidenceCalculator
- Implement 8-step generation pipeline:
  1. Load local history from Memory
  2. Merge with external history (dedup + truncate)
  3. RAG retrieval (optional)
  4. Build prompt with context and evidence
  5. LLM generation
  6. Calculate confidence
  7. Save messages to Memory
  8. Return ChatResponse
- Add GenerationContext dataclass for tracking intermediate results
- Implement fallback response mechanism for error handling
- Add 21 unit tests for OrchestratorService
- All 138 tests passing
2026-02-24 13:47:12 +08:00
MerCry 00953196c9 feat(ai-service): implement SSE state machine and error handling [AC-AISVC-08, AC-AISVC-09]
- Integrate state machine in API layer for proper event sequencing
- Ensure message* -> final/error -> close sequence
- Prevent events after final/error
- Convert streaming exceptions to error events
- Add comprehensive state machine tests
- 117 tests passing
2026-02-24 13:32:59 +08:00
MerCry c9f2c1eb3a feat(ai-service): implement SSE event generator for message events [AC-AISVC-07]
- Optimize Orchestrator streaming output with LLM client integration
- Implement _stream_from_llm() to wrap LLM chunks as message events
- Implement _stream_mock_response() for demo/testing
- Add SSE event format tests (message/final/error)
- Fix by_alias=True for final event JSON output
- 79 tests passing
2026-02-24 13:28:10 +08:00
MerCry 4cee28e9f4 docs: mark Phase 1 and Phase 2 tasks as completed [AC-AISVC-01~AC-AISVC-20] 2026-02-24 13:22:56 +08:00
MerCry e99d324398 docs: add ai-service progress tracking [AC-AISVC-06] 2026-02-24 13:20:11 +08:00
MerCry cc70ffeca6 docs: confirm open questions and update design [AC-AISVC-01] 2026-02-24 13:00:08 +08:00
MerCry 1b73706574 docs: add ai-service design [AC-AISVC-01] 2026-02-24 12:54:59 +08:00
MerCry 2fdc91a54c docs: add ai-service provider openapi [AC-AISVC-01] 2026-02-24 12:43:57 +08:00
MerCry 78fec1fc8e docs: add ai-service requirements [AC-AISVC-01] 2026-02-24 12:35:28 +08:00
MerCry 2594652cc3 初始化初始文档 2026-02-24 12:08:24 +08:00