feat(l1): start_ai_build_session

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 17:03:05 -04:00
parent e1112a9a36
commit 0facf2f8c9
2 changed files with 40 additions and 0 deletions

View File

@@ -778,6 +778,24 @@ async def test_escalate_without_walk_reason_is_optional(test_db: AsyncSession):
assert session.escalation_reason_category == "no_kb_content"
# ---------------------------------------------------------------------------
# T7: start_ai_build_session
# ---------------------------------------------------------------------------
@pytest.mark.asyncio
async def test_start_ai_build_session(test_db: AsyncSession):
from app.services import l1_session_service as svc
account = await _make_account(test_db)
l1_user = await _make_user(test_db, account_id=account.id)
s = await svc.start_ai_build_session(
test_db, account_id=account.id, user=l1_user,
ticket_id="t-ai", ticket_kind="internal",
)
assert s.session_kind == "ai_build"
assert s.flow_id is None and s.flow_proposal_id is None
assert s.status == "active"
# ---------------------------------------------------------------------------
# T14 audit log tests (spec §5.6.1)
# ---------------------------------------------------------------------------