Skip to content

fix(journey): 다중 턴 상태·Lookup 필터·CLARIFY_OR_SCOPE 계약 및 AI Compose 배선 정비 (#811) - #862

Merged
SHcommit merged 1 commit into
developfrom
fix/811-plan-execute-multi-turn-runtime-alignment
Nov 18, 2026
Merged

SHcommit merged 1 commit into
developfrom
fix/811-plan-execute-multi-turn-runtime-alignment

Conversation

@SHcommit

Copy link
Copy Markdown
Member

배경

onmaru-ai-engine과의 Plan/Execute 다중 턴 연동 및 스테이징/운영 배포 준비 과정에서 확인된 Spring BE 측 누락 사항과 계약·인프라 배선을 정비합니다.
(onmaru.ai.plan-execute-enabled 및 ONMARU_AI_PLAN_EXECUTE_ENABLED 기본값은 스테이징 합동 E2E 및 AI Engine 사전조건 충족 전까지 계속 false를 유지합니다.)

변경 사항

  • 다중 턴 낙관적 잠금 및 Pin/Exclude 영속화
    • JdbcExplorationStore / ExplorationService / ExplorationState / InMemoryExplorationStore: base_version을 현재 탐색의 state_version으로 기록하고 pinned_refs/excluded_refs를 JSONB로 저장·복원하도록 수정해 2번째 이상 턴 및 Pin/Exclude가 영속화되도록 보완했습니다.
    • JdbcJourneyCandidateProvider: AI 실패 시 Baseline 폴백 경로에서도 excludedPlaceIds를 제외하도록 반영했습니다.
  • CLARIFY_OR_SCOPE 경로 및 재질문 전달
    • PlanExecuteAiProposalClient, JourneyWorkerPlan, JourneyWorkerService, FinishRunCommand, JdbcJourneyRunStore: Route.CLARIFY_OR_SCOPE 수신 시 QueryGrant//execute 호출을 생략하고 CLARIFICATION_REQUIRED를 반환하며, resultStore.persist를 건너뛰어 기존 board와 state_version을 보존합니다.
  • Approved Lookup 응답 계약 및 SQL 선필터링
    • JourneyQueryToolResponse: status: "OK" | "NO_MATCH" 필드를 포함하도록 확장했습니다.
    • JourneyQueryToolController, PlaceQueryPort, JdbcPlaceQueryAdapter, ApprovedPlaceReader: placeIds(null=무제한, []=0건, [...]=허용 목록)와 excludedPlaceIds를 LIMIT 이전에 SQL에서 필터링하고 PUBLISHED 리비전을 함께 검사합니다.
  • 계약 테스트 보강
    • PlanAuthorityGateTests: pinnedPlaceIds 존재 + proposedFilters.placeIds == null + 5개 Retrieval Route + CLARIFY_OR_SCOPE 게이트 승인 검증 추가
    • ExecutionResultMapperCrossRepoTests: SQL_ONLY + NOT_RUN + 빈 places → NO_RESULTS 매핑 검증 추가
    • PlanExecuteAiProposalClientTests, JourneyWorkerServiceTests, JourneyQueryToolControllerTests, JdbcApprovedPlaceReadTests, JdbcDurableExplorationWorkerTests 보강
  • Lightsail AI Compose 배선 정비
    • infra/lightsail/staging/compose.yaml (staging-ai-engine) 및 infra/lightsail/compose.yaml (ai-engine)에 ONMARU_AI_DB_DSN(ONMARU_DB_AI_RUNTIME_USER 기반), database 네트워크, depends_on: postgres를 연결했습니다.
    • infra/lightsail/compose.yaml (ai-engine)에 ONMARU_SPRING_BASE_URL을 추가했습니다.
    • infra/lightsail/staging/compose.yaml의 postgres 이미지를 pgvector 포함 기본값(${ONMARU_POSTGRES_IMAGE:-onmaru/postgres:17-postgis-pgvector})으로 맞췄습니다.

관련 이슈

검증

  • ./gradlew :modules:journey:test :modules:catalog:test :apps:spring-api:test --tests "*PlanAuthorityGate*" --tests "*ExecutionResultMapperCrossRepo*" --tests "*PlanExecute*" --tests "*HttpAiPlanExecute*" --tests "*JourneyQueryTool*" --tests "*JdbcApprovedPlaceReadTests*" --tests "*JdbcDurableExplorationWorkerTests*" --tests "*JdbcExplorationStoreIntegrationTests*" --tests "*JdbcJourneyRunStoreTests*" --tests "*JourneyWorkerServiceTests*" 통과
  • ./gradlew :apps:spring-api:test --tests "*JourneyContractE2ETests*" --tests "*ExplorationWebBoundaryTests*" --tests "*ExplorationSnapshotHydratorTests*" --tests "*ModuleBoundaryArchUnitTests*" 통과
  • ./gradlew :modules:journey:test :modules:catalog:test :apps:spring-api:bootJar --no-daemon 및 git diff --check 통과
  • docker compose --env-file infra/lightsail/.env.example -f infra/lightsail/compose.yaml --profile ai-engine config --quiet 및 docker compose --env-file infra/lightsail/staging/.env.example -f infra/lightsail/staging/compose.yaml config --quiet 통과
  • node --test scripts/test/deploy-pipeline.test.mjs scripts/test/production-blue-green-deploy.test.mjs scripts/test/staging-release-gate.test.mjs (29 passed, 0 failed)

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@SHcommit

Copy link
Copy Markdown
Member Author

연관 AI Engine PR 확인 완료: YRootLab/onmaru-ai-engine#84 (Plan/Execute staging runbook 기준 ONMARU_AI_DB_DSN, ONMARU_SPRING_BASE_URL, database 네트워크 배선 일치 확인). 스테이징/운영 flag(onmaru.ai.plan-execute-enabled)는 합동 E2E 및 runbook 선행조건 완료 전까지 false를 유지합니다.

@SHcommit
SHcommit merged commit ccefb5c into develop Nov 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant