Repository navigation
feat(helpdesk): make AI triage, ticket creation & SLA work at runtime - #35
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_numberwasrequired+uniquewith no generator → inserts failed.first_response_due_at/resolution_due_atwere only ever set in seed → SLA dashboards/views/breach flows were dead for real tickets.helpdesk.aiTriageStub, a function defined nowhere →ai_*stayed blank.What changed (within the 6-object / 5-flow / 2-dashboard caps)
Ticket hook (
beforeInsert, payload-only — no nested writes):ticket_number(TIC-YYYYMMDD-NNNN).first_response_due_at/resolution_due_atfrom priority using the SLA-policy default minutes.Flow:
ai_triage_on_createreconciled — removed the deadinvoke_functionnode, kept the status advance, and documented exactly where to drop a real LLM call.Portal: added a customer-scoped
my_ticketslist view and repointed the KB nav to the realpublished_articlesview, 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 repopnpm format:checkall clean. Build: 6 Objects / 6 Views / 2 Dashboards / 5 Flows / 4 Roles / 3 Permissions.🤖 Generated with Claude Code