Skip to content

v0.2.9 Structured Escalation & Triage

Choose a tag to compare

@Rcloudso Rcloudso released this 26 Jul 11:34
fac2d58

v0.2.9 — Structured Escalation & Triage

v0.2.9 upgrades free-text escalation records into traceable handoff packets and
adds a read-only bilingual triage console. The release preserves the public chat
request and SSE contracts, anonymous conversation ownership, SQLite deployment,
and the no-key local path.

Product outcome

When chat requires a human, the system now persists:

  • a concise summary and reason code;
  • a deterministic category, priority, risk set, recommended queue, and next
    step;
  • facts tied to existing message IDs and verbatim excerpts;
  • missing-information prompts and retrieval evidence;
  • the extraction mode and versioned rule/schema identifiers.

Admins can filter the latest escalation per conversation by status, category,
priority, queue, and keyword, then open the packet to locate cited messages and
retrieval evidence.

Deterministic safety boundary

triage_v1 gives account security, unauthorized transactions, and immediate
safety risk urgent priority. Knowledge conflicts, private-state business
operations, and material complaints are high priority. All other supported
handoffs remain normal priority.

Optional model extraction shares a two-second total budget and negotiates
json_schema, json_object, then plain-text JSON without retrying a format.
The model can propose only the summary, cited facts, and missing information.
Invalid JSON, protected fields, timeouts, or missing credentials return the
complete deterministic packet. The extractor receives only the latest 12
messages; facts with unknown message IDs or non-verbatim excerpts are discarded
individually without weakening deterministic routing.

Conversation and retrieval text is placed in the prompt as untrusted data and
cannot override deterministic routing.

Persistence and compatibility

The additive escalation_packets table is one-to-one with escalation_log and
keeps filterable scalar fields separate from validated JSON collections. Startup
backfills historical rows idempotently as:

category = unknown
priority = normal
recommended_queue = manual_triage
extraction_mode = legacy_unstructured

Historical rows do not receive invented facts. New chat escalations save the
assistant message, escalation log, packet, and escalated session state in one
SQLite transaction. A packet failure rolls the whole state change back.

Existing intent, faq, token, escalate, done, and error SSE events are
unchanged. ConversationDetail.escalation.packet is optional, so old clients can
continue reading the legacy escalation fields.

New read-only APIs

GET /api/admin/escalations
GET /api/admin/escalations/:escalationId

Both routes require the existing administrator authentication and response
envelope. The list supports bounded pagination plus status, category, priority,
queue, and escaped keyword filters. No assignment, notes, takeover, resolution,
or other mutation endpoint is included.

Known limits

  • The triage console is read-only; human collaboration remains planned for
    v0.3.1.
  • Routing is a versioned deterministic keyword/risk policy, not a replacement
    for organization-specific incident procedures.
  • Model extraction runs synchronously inside the request with a hard two-second
    total budget; it has no worker or background retry.
  • Historical records preserve only their original reason because earlier
    versions did not capture facts or retrieval evidence.
  • This release does not add order tools, refunds, live agent replies, assignment,
    notes, or resolution actions.

中文摘要

v0.2.9 将原有自由文本转人工记录升级为可追溯的结构化交接包,并新增独立的双语只读
分流页面。账户安全、未授权交易和即时安全风险固定为紧急;知识冲突、私有业务操作和重大
投诉固定为高优先级。可选模型只能在 2 秒总预算内改进摘要、带消息原文引用的事实和缺失
信息,不能修改类别、优先级、风险、队列或下一步。旧记录会幂等回填到人工分流队列,不会
补造历史事实;新记录通过事务保证助手消息、转人工日志、交接包和会话状态要么全部成功,
要么全部回滚。