Skip to content

[BE][Budget/Memory] Public Conversation Workflow 월 예산 이중 fence 및 차단 audit #647

Description

@HyungminYoon1

배경

nodease/mbased#521은 Public Chatbot을 client-held history 방식으로 전환하지만 익명 사용자의 LLM 호출 비용 위험은 남는다. 대화 원문이나 durable Session 없이도 기존 Workflow 월 예산을 Gateway pre-dispatch와 Worker provider 직전에서 동일하게 강제해야 한다.

이 기능은 Public 실행 비용 안전성이며 authenticated durable Memory 체인인 #649~321과 독립적으로 진행한다.

목표

Public Chatbot 실행에 Workflow 월 예산의 이중 fence와 canonical 차단 audit을 적용해 concurrent request, stale precheck와 retry에서도 한도를 초과한 provider 호출을 fail-closed한다.

선행 조건

구현 범위

  • Gateway dispatch 전 Workflow 월 예산 admission
  • Worker의 실제 provider 호출 직전 authoritative budget fence
  • provider attempt/usage identity에 고정된 reservation·commit·release·reconcile
  • concurrent request와 stale Gateway precheck의 초과 호출 차단
  • public actor를 App owner, execution subject 또는 billing principal로 합성하지 않는 attribution
  • budget block의 canonical policy audit와 retry 중복 방지
  • history, prompt, completion, credential과 raw provider error 비저장
  • 비용/한도 조회 실패의 safe typed error와 provider I/O 전 fail-closed

TDD 및 검증

  • 한도 미만/정확한 경계/초과 요청
  • 동시에 들어온 Public request의 단일 remaining-budget 승자
  • Gateway 통과 후 Worker 시점 예산 소진
  • provider 시작 전 reservation 실패와 provider 성공 후 usage commit 실패
  • retry/redelivery에서 중복 reservation·usage·audit 방지
  • Public history content가 budget key, audit, log와 metric label에 포함되지 않음

완료 기준

비범위

  • Conversation Session/Turn/Entry 저장
  • authenticated internal Memory Summary·purge·UI
  • 별도 conversation execution journal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions