Files
resolutionflow/backend/tests/test_l1_ai_build_model.py
Michael Chihlas 16b9abf2e2 feat(l1): add ai_build session kind (model + migration)
Teaches l1_walk_sessions a new session_kind='ai_build' for AI-generated
decision-tree walks. FK shape matches adhoc: both flow_id and
flow_proposal_id must be NULL. Drops and recreates the two affected CHECK
constraints (session_kind allowlist + target_consistency). Migration
beca7464b6b4 chains from b3358ba0e48c.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:46:19 -04:00

17 lines
505 B
Python

import uuid
from app.models.l1_walk_session import L1WalkSession
def test_ai_build_session_kind_allowed_by_model_constraint():
"""ai_build is a valid session_kind with both target FKs null (like adhoc)."""
s = L1WalkSession(
account_id=uuid.uuid4(),
created_by_user_id=uuid.uuid4(),
ticket_id="t1",
ticket_kind="internal",
session_kind="ai_build",
)
assert s.session_kind == "ai_build"
assert s.flow_id is None and s.flow_proposal_id is None