AI Support Ticket Automation
Project details ↗Selected actual test cases from each recorded suite. Outcomes below are previously reported PASS, not fresh automation runs or a complete case listing. Current source was inspected to identify the inputs and assertions; there is no public raw-results archive.
Backend checks
34 checks in the recorded suite · 2026-11-11
Actual local Node HTTP server; injected upstream fixtures. No n8n, MySQL or model execution.
Source: tests/demo-api.test.mjs in the automation repository. Public source excludes private runtime configuration and raw execution evidence.
Valid fictional ticket
Previously reported PASS- Test input
- A unique requestId, fictional=true and “For a fictional order I was charged twice. Please investigate.”
- Expected
- Accept the request and return only safe result fields.
- Recorded result
- Response keys matched category, reason, status and ticketRef.
- How checked
- assert.deepEqual(Object.keys(out).sort(), [category, reason, status, ticketRef])
- Why it matters
- Prevents private customer or infrastructure fields leaking to the browser.
Reject personal information and invalid input
Previously reported PASS- Test input
- Messages containing an email, URL or phone; short/1,501-character text; client ticketId; missing fictional acknowledgement.
- Expected
- Validation rejects each input.
- Recorded result
- validateBody returned false for each listed fixture.
- How checked
- assert.equal(validateBody(changedBody), false)
- Why it matters
- Keeps the demo fictional and bounds submitted data.
Block foreign requests
Previously reported PASS- Test input
- Foreign Origin, missing session cookie or invalid CSRF token.
- Expected
- HTTP 403 before accepting a ticket.
- Recorded result
- Each blocked request returned 403.
- How checked
- assert.equal(response.status, 403)
- Why it matters
- Prevents other sites from submitting requests through a visitor’s session.
Duplicate and conflicting requests
Previously reported PASS- Test input
- Repeat one requestId/message; then reuse the ID with changed text.
- Expected
- Same request succeeds; changed content returns 409.
- Recorded result
- Identical retry returned 200; changed message returned 409.
- How checked
- HTTP status assertions; upstream persistence is a Map fixture, not MySQL.
- Why it matters
- Avoids changing an existing ticket through a retry.
Concurrent duplicate requests
Previously reported PASS- Test input
- Two simultaneous identical POST requests using Promise.all.
- Expected
- One upstream call; both requests succeed.
- Recorded result
- Call counter increased by one; both responses were 200.
- How checked
- assert.equal(calls - before, 1); pair.every(x => x.status === 200)
- Why it matters
- Avoids duplicate model work when a visitor double-clicks.
Timeout and rate limit
Previously reported PASS- Test input
- A slow local HTTP upstream with a short deadline; separately, two requests against a one-request limit.
- Expected
- Timeout 504 promptly; excess request 429.
- Recorded result
- 504 within one second; 429 with Retry-After: 60.
- How checked
- Elapsed-time/status assertions and Retry-After header assertion.
- Why it matters
- Bounds waiting time and protects limited compute capacity.
Demo integration checks
14 checks in the recorded suite · 2026-11-11
Actual local demo backend, complete DEMO n8n workflow and MySQL. Real Ollama on normal classification; fault cases explicitly substituted.
Source: tests/demo-integration.test.mjs in the automation repository. Public source excludes private runtime configuration and raw execution evidence.
Real classification and durable audit
Previously reported PASS- Test input
- Fresh fictional duplicate-billing ticket through the protected demo API.
- Expected
- 200, BILLING, AUTO_ROUTED and exactly two matching audit events.
- Recorded result
- Recorded 200/BILLING; saved message matched input; TICKET_CREATED and AI_CLASSIFICATION_ACCEPTED were present.
- How checked
- Real SELECT checked status, category, synthetic email, message bytes, auditCount=2 and ordered event types.
- Why it matters
- Proves classification is connected to durable storage rather than a frontend simulation.
Database isolation and private webhook
Previously reported PASS- Test input
- Attempt original-schema table reads using demo account; POST directly without webhook authentication.
- Expected
- Original table access denied; unauthenticated webhook 403.
- Recorded result
- Both original tables were denied; direct webhook returned 403.
- How checked
- Permission probes plus assert.equal(response.status, 403).
- Why it matters
- Keeps a demo visitor away from unrelated records and private automation access.
Replay and conflict preserve stored data
Previously reported PASS- Test input
- Repeat successful request; then same request ID with a different fictional message.
- Expected
- Replay returns original result without audits; changed content 409.
- Recorded result
- Replay deeply equaled first response; stored row unchanged after both requests.
- How checked
- assert.deepEqual(response, first); assert.deepEqual(row(ticketRef), saved).
- Why it matters
- Prevents retries or collisions from rewriting the original ticket.
Concurrent demo submission
Previously reported PASS- Test input
- Submit the same new request twice simultaneously.
- Expected
- Both replies 200 with one persisted outcome.
- Recorded result
- Replies matched and the saved ticket still had only two audits.
- How checked
- Promise.all; response equality; independent MySQL auditCount=2 assertion.
- Why it matters
- Checks duplicate protection across the real backend/workflow/database boundary.
Uncertain classification goes to review
Previously reported PASS- Test input
- Controlled classifier output: {"category":"UNKNOWN","reason":"Controlled synthetic model output"}.
- Expected
- 202, PENDING_REVIEW and review-request audit.
- Recorded result
- Recorded 202/PENDING_REVIEW; TICKET_CREATED and HUMAN_REVIEW_REQUESTED saved.
- How checked
- HTTP assertions plus real MySQL status/event SELECT. Classifier node was temporarily substituted during the historical test.
- Why it matters
- An unusable classification must wait for human review instead of routing confidently.
Model failure is persisted and sanitized
Previously reported PASS- Test input
- Controlled classifier error fixture, followed by repeating that failed request.
- Expected
- 503 with safe error; FAILED and MODEL_UNAVAILABLE saved; replay does not retry AI.
- Recorded result
- Recorded 503/AUTOMATION_UNAVAILABLE; failed row/event sequence unchanged on replay.
- How checked
- Exact response comparison and before/after MySQL row comparison. This was not a real Ollama outage.
- Why it matters
- Reports dependency failure without leaking internal errors or silently repeating failed work.
Human-review logic checks
33 checks in the recorded suite · 2026-11-08
JavaScript executed with fabricated n8n inputs in a local VM. No workflow, SQL transaction or authentication endpoint execution.
Source: tests/review-decision.test.mjs in the automation repository. Public source excludes private runtime configuration and raw execution evidence.
Approval uses server identity
Previously reported PASS- Test input
- Valid APPROVE request with BILLING and a reason.
- Expected
- Prepared status APPROVED with fixed server-side reviewer identity.
- Recorded result
- The isolated validator returned the expected status and server identity.
- How checked
- Assertions in “approval and fixed server identity”; this does not test Header Auth.
- Why it matters
- Stops the application from trusting a client-selected reviewer identity.
Reject invalid decisions
Previously reported PASS- Test input
- UNKNOWN approval category, invalid/missing fields, malformed body fixtures.
- Expected
- 400 for invalid decision input.
- Recorded result
- Recorded validation assertions returned 400 for the invalid fixtures.
- How checked
- assert.equal(validate(changedBody).httpStatus, 400)
- Why it matters
- Prevents incomplete decisions from reaching persistence logic.
Fail closed on inconsistent persistence output
Previously reported PASS- Test input
- Fabricated database result with ticket update present but audit_rows=0.
- Expected
- Resolver returns 503 rather than claiming success.
- Recorded result
- Resolver returned 503.
- How checked
- assert.equal(run(resolveDecision, inconsistentRow, prepared).httpStatus, 503)
- Why it matters
- Avoids telling a reviewer that an unaudited decision succeeded; real rollback is tested separately.
Sanitize SQL error
Previously reported PASS- Test input
- Fabricated error containing private driver detail.
- Expected
- Only safe REVIEW_UNAVAILABLE error and 503.
- Recorded result
- Returned exactly {httpStatus:503,errorCode:REVIEW_UNAVAILABLE}.
- How checked
- Deep equality of the entire returned object.
- Why it matters
- Keeps internal database details out of public responses.
Reviewer integration checks
20 checks in the recorded suite · 2026-11-08
Actual reviewer DEV webhook and MySQL with synthetic PENDING_REVIEW fixtures. Historical runs, not executed for this website change.
Source: tests/review-integration.test.mjs; docs/TESTING_GUIDE.md §3 in the automation repository. Public source excludes private runtime configuration and raw execution evidence.
Missing or wrong authentication
Previously reported PASS- Test input
- APPROVE body with missing authentication, then intentionally invalid authentication.
- Expected
- 403; ticket and terminal-audit count unchanged.
- Recorded result
- Recorded 403 for both; ticket remained PENDING_REVIEW, requires_review=1, UNKNOWN and zero terminal audits.
- How checked
- HTTP status assertions plus independent DB SELECT. Empty execution history alone is not proof of unchanged data.
- Why it matters
- Prevents unauthenticated ticket decisions.
Approval commits ticket and audit together
Previously reported PASS- Test input
- Synthetic pending ticket, decisionId=decision-1, APPROVE, BILLING and a synthetic reason.
- Expected
- 200; APPROVED, review flag cleared and one terminal audit.
- Recorded result
- Recorded 200/replayed=false; APPROVED,0,BILLING,1. Durable audit reference 11282.
- How checked
- DB SELECT and auditDetails checked fixed reviewer, previous/new status and matching reason.
- Why it matters
- Makes the accepted decision accountable and durable.
Identical decision is replayed
Previously reported PASS- Test input
- Repeat exactly the committed approval.
- Expected
- 200/replayed=true without a second terminal audit.
- Recorded result
- Recorded replay=true and exactly one terminal audit.
- How checked
- HTTP replay flag assertion and DB count.
- Why it matters
- Makes browser/network retries safe.
Two competing decisions
Previously reported PASS- Test input
- Two simultaneous decisions for one pending ticket with different IDs/categories.
- Expected
- One 200 and one 409; exactly one terminal audit.
- Recorded result
- Recorded status set [200,409] with one terminal audit.
- How checked
- Promise.all; sorted status assertions; real DB count.
- Why it matters
- Ensures only one decision wins a race.
Audit insertion failure rolls back the ticket
Previously reported PASS- Test input
- Synthetic pending fixture; historical test temporarily made the required audit event invalid with SQL NULL.
- Expected
- 503; ticket remains pending with no terminal audit.
- Recorded result
- Recorded PENDING_REVIEW,1,UNKNOWN,0 after 503. Restored SQL then accepted the same decision with 200.
- How checked
- Independent SELECT after failure and recovery request. Final audit rows alone cannot reconstruct the transient rollback observation.
- Why it matters
- Prevents an approved ticket existing without its mandatory audit trail.
Reviewed tickets replay through intake
Previously reported PASS- Test input
- Replay original synthetic ticket fields after APPROVED and REJECTED decisions.
- Expected
- 200 with terminal status; no new classification or outcome write.
- Recorded result
- Recorded APPROVED and REJECTED replies; execution references 11297 and 11298.
- How checked
- Saved intake node data checked fields, no Classify Ticket/Save Ticket Outcome, and zero claim audit insertion.
- Why it matters
- Prevents a customer retry from reclassifying a completed human decision.
Project README, root handoff and Milestone A testing guide · source reviewed 2026-11-12. Private receipts and logs are excluded.