Skip to content

feat(helpdesk): make AI triage, ticket creation & SLA work at runtime - #35

Merged
xuyushun441-sys merged 1 commit into
mainfrom
optimize/helpdesk
Jun 14, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
optimize/helpdesk

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Why

The charter's mission is "AI is the product, not an add-on" — but it was only true in seed data. A ticket created by an agent or portal customer produced no AI fields, no SLA dates, and often failed outright:

  • ticket_number was required + unique with no generator → inserts failed.
  • first_response_due_at / resolution_due_at were only ever set in seed → SLA dashboards/views/breach flows were dead for real tickets.
  • AI triage called helpdesk.aiTriageStub, a function defined nowhere → ai_* stayed blank.
  • The customer portal pointed at non-existent view names.

What changed (within the 6-object / 5-flow / 2-dashboard caps)

Ticket hook (beforeInsert, payload-only — no nested writes):

  • Auto-assigns ticket_number (TIC-YYYYMMDD-NNNN).
  • Derives first_response_due_at / resolution_due_at from priority using the SLA-policy default minutes.
  • Sets the deterministic AI triage baseline (summary, category, sentiment, suggested priority, language, confidence, triage timestamp) on every ticket — so the schema-as-contract is live, not decorative.

Flow: ai_triage_on_create reconciled — removed the dead invoke_function node, kept the status advance, and documented exactly where to drop a real LLM call.

Portal: added a customer-scoped my_tickets list view and repointed the KB nav to the real published_articles view, so the help center renders instead of 404-ing.

Docs/i18n: corrected the SLA-policy docstring; checked off the now-met CHARTER DoD items; en + zh-CN updated.

Verification

pnpm --filter @objectlab/helpdesk typecheck, objectstack build, and repo pnpm format:check all clean. Build: 6 Objects / 6 Views / 2 Dashboards / 5 Flows / 4 Roles / 3 Permissions.

🤖 Generated with Claude Code

…t runtime

"AI is the product" was true only in seed data: a fresh ticket created
nothing. Three runtime gaps fixed via the proven payload-only hook pattern
(no nested writes) — staying within the 6-object / 5-flow / 2-dashboard caps:

- ticket_number was required + unique with no generator → creating a ticket
  from the agent UI or portal failed. The ticket hook now auto-assigns
  TIC-YYYYMMDD-NNNN on insert.
- SLA was dead for organically-created tickets (first_response_due_at /
  resolution_due_at were only ever set in seed). The hook now derives both
  from priority using the SLA-policy default minutes, so the SLA dashboards,
  views, and breach flows light up for real tickets.
- AI triage referenced helpdesk.aiTriageStub, a function defined nowhere, so
  ai_* fields stayed blank at runtime. The hook now sets the deterministic AI
  baseline (summary, category, sentiment, suggested priority, language,
  confidence, triage timestamp) on every ticket; ai_triage_on_create.flow.ts
  is reconciled to advance status and documents where to plug in a real LLM.

Portal: the customer help center pointed at view names that don't exist
(helpdesk_ticket.my_tickets, helpdesk_kb_article.published_list). Added a
customer-scoped my_tickets list view and repointed the KB ref to the real
published_articles view, so the portal renders instead of breaking.

Docs: corrected the SLA-policy docstring (hook, not flow, stamps due dates);
checked off the now-met CHARTER DoD items and documented the triage model.
en + zh-CN translations updated.

typecheck + objectstack build + format:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xuyushun441-sys
xuyushun441-sys merged commit aecf331 into main Jun 14, 2026
3 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the optimize/helpdesk branch June 14, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants