feat: add cockpit triage backend foundation (Phase 1)
- Migration 071: add client_name, asset_name, issue_category,
triage_hypothesis, evidence_items columns to ai_sessions
- TriageUpdate schema for AI-inferred header updates in chat responses
- QuestionItem.options field for quick-reply buttons
- PATCH /ai-sessions/{id}/triage endpoint for manual header edits
- POST /ai-sessions/{id}/handoff-draft streaming endpoint for conclude modal
- Structured handoff fields (root_cause, steps_taken, recommendations)
on resolve/escalate requests, passed through to ResolutionOutputGenerator
- Triage fields exposed in AISessionDetail response for session resume
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""add triage fields to ai_sessions for cockpit harness
|
||||
|
||||
Revision ID: 071
|
||||
Revises: 070
|
||||
Create Date: 2026-04-01
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
|
||||
|
||||
revision = "071"
|
||||
down_revision = "070"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("ai_sessions", sa.Column("client_name", sa.String(255), nullable=True))
|
||||
op.add_column("ai_sessions", sa.Column("asset_name", sa.String(255), nullable=True))
|
||||
op.add_column("ai_sessions", sa.Column("issue_category", sa.String(100), nullable=True))
|
||||
op.add_column("ai_sessions", sa.Column("triage_hypothesis", sa.Text(), nullable=True))
|
||||
op.add_column("ai_sessions", sa.Column("evidence_items", JSONB(), nullable=True))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("ai_sessions", "evidence_items")
|
||||
op.drop_column("ai_sessions", "triage_hypothesis")
|
||||
op.drop_column("ai_sessions", "issue_category")
|
||||
op.drop_column("ai_sessions", "asset_name")
|
||||
op.drop_column("ai_sessions", "client_name")
|
||||
Reference in New Issue
Block a user