Skip to content

[AI Integration] AiRuntimeClient·계약 검증·장애 격리 구현 #8

Description

@hywznn

목표

Server가 Prompt·Provider를 직접 소유하지 않고, 검증한 최소 요청을 AI Runtime에 전달한 뒤 응답을 다시 검증합니다.

AiRunWorker (#24)
→ AiRuntimeClient (#8/#56)
→ POST /internal/v1/analyses (fowoco/ai)

최소 전송 계약

{
  "requestId": "10000000-0000-0000-0000-000000000001",
  "phase": "PLAN",
  "analysisInput": {
    "instruction": "응웬반안 체류연장 준비해줘, EXPIRY_RENEWAL"
  }
}
  • requestId: PLAN과 ANALYZE 응답을 같은 실행으로 연결
  • phase: PLAN 또는 ANALYZE
  • analysisInput: 실제 분석 데이터만 포함
  • attemptId, version, deadline: AI JSON에 넣지 않고 Server 내부에서 관리
  • PLAN의 빈 context field와 별도 intentHint는 전송하지 않음

ANALYZE에는 같은 requestId·instruction과 #74가 실제로 해결한 requestedFields만 추가합니다.

Server 책임

  • Bearer service 인증과 request/trace 전달
  • timeout·bulkhead·circuit breaker·응답 크기 제한
  • strict JSON parsing과 requestId·version·핵심값 재검증
  • Runtime 호출 1회당 Server 내부 AiAttempt 1개
  • 자동 HTTP retry 금지

Agent는 SQL을 만들거나 Server DB에 직접 접근하지 않습니다.

데이터 경계

현황

  • Provider-neutral AiRuntimeClient
  • Fake·Remote Adapter
  • PLAN/ANALYZE와 세 가지 정상 outcome
  • 인증·timeout·장애 격리·strict response 검증
  • WireMock과 전체 Server 테스트
  • #56의 실제 outbound JSON을 최소 계약과 일치시킴
  • [Agent Contract][P0] PLAN·ANALYZE와 Slot 요청 계약 ai#6 versioned fixture 확인
  • staging smoke test

관계

Metadata

Metadata

Assignees

Labels

area:ai-integrationServer ↔ AI Runtime 내부 계약·Client·검증·trace 연동 영역; Prompt·모델·Provider 구현은 ai 저장소 소유area:serverSpring Boot API·도메인·DB·tenant·Task Workflow 영역; Prompt·모델·Provider 구현 제외priority:P0MVP 진행을 막는 최우선 핵심 작업security:privacy개인정보·접근권한·토큰·보안 영향이 있는 작업status:blocked선행 작업이나 외부 조건 때문에 현재 진행할 수 없는 작업type:integration외부 LLM·DB·스토리지 등 시스템 간 연동 작업

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions