feat(pilot): add outcome tracking columns to session_suggested_fixes
Phase 8 prep for the fix outcome banner. Adds: - status (proposed|applied_success|applied_failed|applied_partial|dismissed) - applied_at, verified_at (timestamps) - partial_notes, failure_reason (engineer-provided context) - ai_outcome_proposal (JSONB for AI [FIX_OUTCOME] marker payloads) Backfills status='dismissed' from user_decision='dismissed'. status is orthogonal to user_decision — outcome (did the fix work?) vs script-path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,11 @@ class SessionSuggestedFix(Base):
|
||||
"'one_off', 'draft_template', 'build_template', 'dismissed')",
|
||||
name="ck_session_suggested_fixes_user_decision",
|
||||
),
|
||||
CheckConstraint(
|
||||
"status IN ('proposed', 'applied_success', 'applied_failed', "
|
||||
"'applied_partial', 'dismissed')",
|
||||
name="ck_session_suggested_fixes_status",
|
||||
),
|
||||
)
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(
|
||||
@@ -65,6 +70,21 @@ class SessionSuggestedFix(Base):
|
||||
JSONB, nullable=True
|
||||
)
|
||||
user_decision: Mapped[str | None] = mapped_column(String(32), nullable=True)
|
||||
# Outcome dimension — did the fix work? Orthogonal to user_decision.
|
||||
status: Mapped[str] = mapped_column(
|
||||
String(20), nullable=False, default="proposed"
|
||||
)
|
||||
applied_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True), nullable=True
|
||||
)
|
||||
verified_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True), nullable=True
|
||||
)
|
||||
partial_notes: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
failure_reason: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
ai_outcome_proposal: Mapped[dict[str, Any] | None] = mapped_column(
|
||||
JSONB, nullable=True
|
||||
)
|
||||
# Set when a newer suggested fix supersedes this one.
|
||||
superseded_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True), nullable=True
|
||||
|
||||
Reference in New Issue
Block a user