Pablo Cardozo

Failure-Focused LLM-as-a-Judge Evaluation for a Transactional Conversational Agent: A 46-Case Repository Study

Pablo CardozoIndependent researcherBuenos Aires, Argentina

Abstract

An aggregate score can hide the defect that matters. In a saved 46-case run for a transactional restaurant assistant, 40 cases pass at a threshold of 75/100 and the mean score is 80. Yet all five payment cases fail; only one failure appears elsewhere. That concentration localizes the symptom at the payment boundary, though the artifact cannot prove which branch or persistence layer caused it. This report reconstructs the model-judge harness and audits what its scores can support. Cases labelled as security or resilience checks are only sent to the chatbot and judged for conversational plausibility; they never exercise the HTTP, rate-limit, retry, or circuit-breaker behavior named by the cases. The checked-in battery also contains cases absent from the saved output, and the result has no human calibration, repeated seeds, or independent end-to-end rerun. A partial local check on 4 August 2026 confirmed 79 assertions, but Vitest retained open handles and did not terminate cleanly. The saved scores are therefore treated as repository observations, not ground truth. A defensible next version would use deterministic assertions for state and security, reserve model review for open-ended dialogue, and calibrate that review against blinded human ratings.

Keywords: LLM-as-a-Judge; conversational agents; transactional dialogue; failure analysis; evaluation validity; observability

Evidence status
Saved 46-case run inspected; provenance gaps and test-design limits documented
Evidence grade
Grade R — repository result, not independently rerun end to end
Source revision
8467633188cd
Reproduced / audited
2026-08-04

Saved run40/46 pass · mean 80/100

Failure cluster5 payment · 1 FAQ

Runtime671.3 s · 28,010 judge tokens

Local check79 assertions passed; process hung

1. The failure cluster hidden by the headline

Transactional agents are harder to evaluate than single-turn question answering because correctness depends on state. A payment response can be linguistically fluent yet wrong because the cart total was lost; a handoff can sound empathetic yet fail to persist the transfer; a menu answer can be accurate for the catalog but irrelevant to the user's current step. Reference-string metrics are weak for these open-ended responses, while manual review is expensive and difficult to run after each change.

The audited repository implements a separate model judge, a dynamically generated battery, a stateful system-under-test runner, and Langfuse tracing [1,3–5]. A saved run from 8 March 2026 contains case-level outputs, five criterion scores, latency, token counts, and textual reasons in addition to the aggregate [2]. This report reconstructs that experiment and tests the validity of the conclusions one may draw from it.

  • Describe the battery, execution path, judge rubric, and aggregation logic from source.
  • Report the complete category-level result and analyze the six failures rather than presenting only the 87% headline.
  • Audit whether the named test categories actually exercise the properties they claim to measure.
  • Document provenance drift between the saved 46-case run and the larger battery in the recorded source revision.
  • Propose a calibrated evaluation architecture that separates deterministic properties, open-ended quality, and human judgment.

3. System under test and evaluation architecture

The system under test is a restaurant assistant with catalog-backed answers, ordering, payment handling, persistent conversation state, human handoff, and resilience logic [1]. The test runner first obtains an authenticated catalog snapshot. It then generates cases using available product names and FAQ entries, creates a unique chat identifier per case, sends every user message in sequence to the /message endpoint, and accumulates the observed responses [3,5]. Only the final response is scored, while earlier turns are embedded in the judge's conversation context.

  1. Fetch the live catalog using an admin token.
  2. Generate a battery whose product references are grounded in that catalog.
  3. Create a new conversation identifier for each test to reduce state contamination.
  4. Execute all messages of a test sequentially against the system endpoint.
  5. Construct context from user turns and non-final bot replies; pass the final reply separately.
  6. Invoke the judge, apply the threshold, attach SUT and judge traces, and aggregate by category.
LevelFields
CaseID, category, messages, expected behavior, replies, pass/fail, reasoning
JudgeOverall, relevance, accuracy, completeness, tone, actionability
OperationsSUT latency, judge latency, SUT tokens, judge tokens, trace identifiers
CategoryCount, passes, mean score, mean latency, p95 latency, token totals
RunTimestamp, totals, pass rate, mean score, duration, p95, token totals
Table 2. Recorded result fields.

4. Battery design and task coverage

The saved artifact contains 46 cases across eleven categories [2]. Greeting, FAQ, menu, and ordering cases assess ordinary dialogue. Workflow cases carry a transaction across several turns. Payment cases probe exact payment, change, insufficient funds, method selection, and a large bill. Handoff cases ask for a supervisor or express frustration. Security and resilience cases use synthetic messages prefixed with [META:] for behaviors that the chatbot endpoint cannot directly observe.

CategoryCasesPrimary intent
Greeting3Open conversation appropriately
FAQ5Answer hours, payment, location, delivery
Menu4List, filter, recommend available products
Single order4Resolve item and quantity
Multi-order3Combine or update multiple items
Workflow3Maintain state through complete order flows
Edge case5Cancel, clarify, reject unknown input
Payment5Interpret amount, method, sufficiency, change
Handoff4Escalate complaints and explicit requests
Security5Safe conversational response to meta or malicious text
Resilience5Conversational fallback to meta failure prompts
Table 3. Distribution in the saved 46-case run.

Dynamic grounding avoids hard-coding a product that is absent from the current catalog. It also reduces repeatability: if product order, availability, prices, or FAQ text changes, the generated cases and judge context change. A publishable benchmark should serialize the resolved battery and catalog fixture before execution. Without that snapshot, the source generator is reproducible in form but not necessarily in content.

The recorded source revision adds two multi-order cases, two active-order edge cases, and an automatic-handoff case relative to the saved output, producing a larger conceptual battery than the 46-case artifact [3]. This is not a problem for ongoing engineering; it is a provenance problem for research reporting. The saved run must be cited as its own dated artifact rather than as a result of every later test definition present in the same repository tree.

5. Judge model, rubric, and pass rule

The judge uses gemma-3-27b-it at temperature 0.3 [4]. Its system prompt requests five 0–100 criteria: relevance, accuracy against supplied context, completeness, tone, and actionability. It adds category-specific reminders for payment, handoff, security, resilience, and meta tests. The model returns JSON containing an overall score, reasoning, and criteria. Values are clamped to [0,100]; malformed output becomes a zero-score failure.

passᵢ = 1[overall_scoreᵢ ≥ 75]
The pass threshold is inclusive. The judge may provide an overall score that is not the arithmetic mean of the five criteria.
pass_rate = (Σᵢ passᵢ) / N
A micro-average over cases. Categories with more cases receive more weight.

Catalog context is filtered by category. Menu entries are included for order-related cases; selected FAQ entries are ranked by keyword overlap, with extra weight for payment topics [4]. This improves relevance and lowers prompt size, but it can also make the judge more informed than the system under test. Accuracy scores should therefore be interpreted as consistency with supplied catalog context, not independently verified real-world correctness.

CriterionIntended constructAmbiguity
RelevanceResponds to current user intentMay reward verbosity that mentions more intents
AccuracyConsistent with supplied catalogJudge sees curated context and may overlook state errors
CompletenessCovers necessary next stepLonger answers may receive an advantage
ToneAppropriate conversational styleLocale and brand preference are subjective
ActionabilityMoves transaction forwardCan conflict with answering the immediate question first
Table 4. Rubric interpretation and principal ambiguity.

6. Saved-run results

The saved console artifact is timestamped 2026-03-08T01:04:26.009Z [2]. It reports 40 passing cases out of 46, an 87% rounded pass rate, a mean overall score of 80, and 671.3 seconds of total duration. Judge usage is 28,010 tokens: 23,038 prompt and 4,972 completion. SUT token usage is recorded as unavailable. The artifact does not contain the run-level p95 later supported by the checked-in report type and generator [5].

CategoryPassedMean scoreMean latency
Edge cases5/5 (100%)7510.1 s
FAQ4/5 (80%)839.2 s
Greetings3/3 (100%)889.6 s
Human handoff4/4 (100%)957.7 s
Menu4/4 (100%)9013.0 s
Multi-item orders3/3 (100%)9512.0 s
Payment0/5 (0%)3816.3 s
Resilience5/5 (100%)7711.6 s
Security5/5 (100%)8511.5 s
Single orders4/4 (100%)9411.1 s
Workflows3/3 (100%)8229.3 s
Table 5. Complete category breakdown from the saved artifact.

The macro-average of the eleven displayed category means is 82.0, while the weighted average reconstructed from rounded category means is approximately 80.5, consistent with the reported case-level mean of 80 after rounding. The weighted mean of displayed category latencies is approximately 12.5 seconds. These derived values are diagnostic only because category means are rounded and the raw JSON report is not checked in.

7. Failure analysis

CaseScoreObserved failure
F1 — hours35Answered with a menu listing instead of operating hours
PAY-01 — exact payment30Ignored payment statement and repeated delivery/pickup question
PAY-02 — change30Ignored amount and failed to calculate change
PAY-03 — insufficient amount65Acknowledged constraint poorly and did not offer a useful adjustment
PAY-04 — methods35Treated payment question as an unidentified product
PAY-05 — large bill30Ignored amount and repeated an earlier state prompt
Table 6. Failed cases and observed behavior.

The payment failures share one pattern: a valid payment intent is routed through product or order-state logic that repeats a previous question. This is stronger evidence for a routing or state-priority defect than for a language-generation defect. Four failed responses leave the current turn unconsumed, which makes tone secondary. PAY-03 reaches 65 because it partially recognizes the constraint, suggesting the category contains more than one failure mode.

F1 is a separate intent-selection failure. The answer states that the restaurant is open but substitutes a menu for the actual hours. The judge assigns accuracy 100 in the stored trace because the listed products match catalog context, while relevance and completeness collapse. This illustrates why an overall score is not enough: a criterion can be locally high even when the response fails the user's task.

  • Candidate cause A: payment intent is evaluated after an order-state branch that short-circuits the current message.
  • Candidate cause B: payment handling requires fields not yet committed to persistent state.
  • Candidate cause C: FAQ and payment routes use overlapping keywords but different precedence.
  • Candidate cause D: the judge evaluates only the final turn, so the exact state transition causing the failure remains implicit.

8. Validity audit of security, resilience, and provenance

The security category includes meta descriptions for webhook signature validation, JWT authentication, and rate limiting. In the battery source, comments acknowledge that these properties belong at the HTTP layer [3]. The generic runner nevertheless sends the bracketed meta text to /message and asks the judge whether the conversational reply is safe. A polite fallback cannot establish that an unauthenticated admin request returns 401, that a webhook signature is rejected, or that a rate limiter returns 429. Only the XSS-like and SQL-like text cases exercise user-message handling, and even those do not prove database or browser safety without side-effect assertions.

The same problem affects resilience. A message saying that a circuit breaker or retry should be validated does not induce a provider failure, advance a failure counter, observe an open state, or measure backoff. The reported 5/5 resilience and 5/5 security results are scores for conversational handling of synthetic prompts. They must not be presented as security or fault-tolerance validation.

ClaimAssessmentReason
The saved run scored 40/46Supported as repository evidenceDated output contains case-level results
Payment is the dominant observed weaknessSupportedFive of six failures are payment cases
Security controls passed 5/5Not supportedMeta prompts did not exercise controls
Resilience mechanisms passed 5/5Not supportedNo faults or state transitions were injected
The current source tree yields the saved 46 casesNot establishedBattery definitions have since expanded
Judge scores match human judgmentNot establishedNo calibration or agreement study
Table 7. Claim ledger for the 46-case artifact.

9. Partial local verification on 4 August 2026

The public repository was cloned, detached at revision 8467633188cd89e4708b8011ee2a0fb39b7f1a24, and installed with npm ci under Node 24.14.0 and npm 11.9.0. The Cuqui repository is not part of this report; all counts below refer to restaurantes. Running the full Vitest suite produced many passing files but did not terminate within the bounded observation window. A narrower command confirmed that all 36 assertions in test-battery.test.ts and all 43 assertions in conversation-assistant.test.ts reported pass. The process again remained alive after test completion and was interrupted.

Listing 1. Bounded local check.
git checkout --detach 8467633188cd89e4708b8011ee2a0fb39b7f1a24
npm ci
npx vitest run \
+  src/judge/test-battery.test.ts \
+  src/services/conversation-assistant.test.ts
ObservationResultInterpretation
Battery unit assertions36 reported passGenerator invariants exercised locally
Assistant assertions43 reported passMocked/state behavior exercised locally
Clean process exitNoOpen handles or teardown defect remains
End-to-end judge runNot executedWould require live services, credentials, cost, and a pinned environment
Saved 40/46 scoreNot reproducedRemains repository-reported
Table 8. Local observations.

10. Corrected evaluation protocol

A defensible rerun should split the battery by observable property. Layer A contains deterministic integration tests for arithmetic, cart mutations, auth responses, webhook signatures, rate limiting, circuit-breaker state, retry timing, persistence, and handoff side effects. Layer B contains model-judge cases for relevance, completeness, tone, and natural multi-turn behavior. Layer C contains blinded human ratings used to calibrate Layer B and review disagreements.

LayerExamplesOutput
A — deterministicPayment math, 401/403/429, cart state, circuit stateExact pass/fail plus side-effect log
B — model judgeFAQ relevance, clarification, tone, recovery wordingCriteria scores and explanations
C — human calibrationStratified sample of pass, fail, and borderline casesAgreement, adjudicated label, comments
OperationsLatency, tokens, provider errors, retriesPer-stage distributions and cost
Table 9. Proposed experiment matrix.
  1. Freeze the catalog fixture and resolved test battery as versioned JSON.
  2. Pin SUT revision, judge model, prompt, temperature, dependencies, deployment, and environment.
  3. Run deterministic tests once per revision and fix teardown until the command exits zero cleanly.
  4. Run the model-judge layer at least three times; report mean, range, and label stability per case.
  5. Blind at least two human raters to the automatic score on a stratified subset.
  6. Report agreement, adjudicate disagreements, and choose thresholds from calibration rather than convention.
  7. Publish raw redacted outputs, test definitions, configuration, and failure taxonomy.
stabilityᵢ = modal_label_countᵢ / repeated_runs
A case that crosses the 75 threshold across repeated model-judge runs should be marked unstable, not summarized by one label.

11. Threats to validity and disclosure

  • Construct validity: an LLM score approximates conversational quality but cannot observe hidden state or infrastructure controls from text alone.
  • Internal validity: catalog changes, provider drift, temperature 0.3, and shared services can change responses across runs.
  • External validity: one Spanish-language restaurant fixture does not generalize to other transactional domains or risk levels.
  • Conclusion validity: one run provides no estimate of judge variance and no confidence interval for category performance.
  • Provenance validity: saved output, sprint summary, and current battery represent different points in an evolving repository.

AI systems contributed to the application code, judge outputs, and editorial preparation of this report. Pablo Cardozo is responsible for the source selection, interpretation, claim boundaries, and corrections. The repository output is quoted through aggregate numbers and short failure descriptions; no client or private user conversation is used.

12. Conclusion

The 46-case artifact is useful because it turns a vague impression of chatbot quality into a concrete failure map. Its most defensible result is not that the assistant is 87% good; it is that five payment cases fail in a coherent way while most ordinary ordering and handoff cases receive high judge scores. That pattern justifies targeted investigation of intent routing and transaction state.

The audit applies the same standard to the harness itself. Meta prompts cannot validate security controls, a moving battery cannot be silently attached to an older run, and an uncalibrated judge cannot substitute for humans. Deterministic control tests, frozen fixtures, repeated judge runs, and blinded calibration would turn the existing harness into a regression instrument whose limits are known.

13. References and reproducibility

  1. Cardozo, P. restaurantes, revision 8467633188cd89e4708b8011ee2a0fb39b7f1a24, 2026. Public implementation repository
  2. Cardozo, P. test_output.txt, run timestamp 2026-03-08T01:04:26.009Z. Saved 46-case judge output
  3. Cardozo, P. apps/restaurant-hours-api/src/judge/test-battery.ts, revision 8467633188cd, 2026. Dynamic test-battery source
  4. Cardozo, P. judge-agent.ts and judge-types.ts, revision 8467633188cd, 2026. Judge model and rubric implementation
  5. Cardozo, P. test-runner.ts and report-generator.ts, revision 8467633188cd, 2026. Test runner and report generator
  6. Cardozo, P. Sprint 1 Summary — SRS v4, 6 March 2026. Dated Sprint 1 implementation summary
  7. Zheng, L. et al. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. arXiv:2306.05685, 2023. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena
  8. Liu, Y. et al. G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment. arXiv:2303.16634, 2023. G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment
  9. Kim, S. et al. Prometheus 2. arXiv:2405.01535, 2024. Prometheus 2: An Open Source Language Model Specialized in Evaluating Other Language Models

Source revision: 8467633188cd89e4708b8011ee2a0fb39b7f1a24

Appendices

A. Artifact timeline

ArtifactReported stateUse in this report
Sprint summary, 6 March 202619/46 baseline; 31/46 partialDevelopment history only [6]
Saved test output, 8 March 202640/46; mean 80; six listed failuresPrimary repository result [2]
Recorded source revisionExpanded battery and newer report fieldsImplementation audit [1,3–5]
Local check, 4 August 202679 assertions reported pass; no clean exitPartial independent verification
Table A1. Distinct evidence snapshots that must not be conflated.

B. Minimum reproducibility release

  • Frozen catalog fixture and resolved case JSON.
  • Exact SUT and judge revisions, models, prompts, temperature, and dependency lockfile.
  • Raw per-turn SUT responses and per-case judge JSON.
  • Deterministic side-effect assertions for state, security, and resilience.
  • Repeated-run labels and human calibration annotations.
  • A command that exits cleanly and a machine-readable summary with hashes.

Suggested citation

Cardozo, Pablo. “Failure-Focused LLM-as-a-Judge Evaluation for a Transactional Conversational Agent: A 46-Case Repository Study.” Technical report, version 0.2, 2026. pablo.cardozo.com.ar/research/conversational-agent-evaluation.