feat(sprint6b-D): soft-insertion counter + message meta_json
- thread_state.soft_insertion_count: растёт при боковом ответе (soft_insertion=true
в STATE_JSON без смены шага/слотов), сбрасывается при продвижении или handoff
- При soft_insertion_count >= 3 в системный промпт ветки добавляется SOFT_INSERTION_NUDGE
— явная инструкция вернуть пациента к вопросу текущего шага
- state_machine.parse_branch_response читает флаг soft_insertion из STATE_JSON
- Новая колонка message.meta_json: {router_intent_code, served_intent_code, step_code, events}
— хранит снимок маршрутизации каждой реплики ассистента
- «Песочница»: бейджи событий (sticky / soft_insertion / hard_handoff / resumed /
routing_loop / validation_blocked) над каждым ответом ассистента
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -88,6 +88,7 @@ class MessageInfo(BaseModel):
|
||||
assembled_prompt: str = ""
|
||||
intent_code: str = ""
|
||||
intent_name: str = ""
|
||||
meta: dict | None = None
|
||||
|
||||
|
||||
class ThreadInfo(BaseModel):
|
||||
@@ -110,6 +111,7 @@ class ThreadStateInfo(BaseModel):
|
||||
current_step_code: str | None = None
|
||||
slots: dict = Field(default_factory=dict)
|
||||
handoff_count: int = 0
|
||||
soft_insertion_count: int = 0
|
||||
suspended_intent: str | None = None
|
||||
resumable_step_code: str | None = None
|
||||
resumable_slots: dict = Field(default_factory=dict)
|
||||
@@ -157,6 +159,7 @@ class ChatResponse(BaseModel):
|
||||
parse_error: str | None = None
|
||||
routing_loop_triggered: bool = False
|
||||
resumed_from_suspended: bool = False
|
||||
message_meta: dict | None = None
|
||||
|
||||
|
||||
class ThreadDeleteResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user