feat(langfuse): evaluate existing traces and return ASSERT scores - #308
feat(langfuse): evaluate existing traces and return ASSERT scores#308Chang Liu (changliu2) wants to merge 7 commits into
Conversation
Add a judge-only customer example that converts existing Langfuse traces into ASSERT conversations, inspects reconstructed tool evidence, and evaluates explicit permissible and impermissible behaviors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jake Present (jakepresent)
left a comment
There was a problem hiding this comment.
The deterministic fixture passes, but the converter drops real conversation turns in a supported/default input shape.
trace_to_spans() tracks seen (role, content) counts across the whole Langfuse session, while each trace recomputes occurrence counts from zero (langfuse_to_assert.py:581-592, shared at :659-677). If a Langfuse session stores one user message per trace and the user sends the same text twice, such as two separate “yes” messages, the second trace’s user turn is treated as already seen and omitted. I reproduced this with two traces in one session, each containing only its current [{role: user, content: yes}] input: the emitted transcript roles are user, assistant, assistant instead of user, assistant, user, assistant. The README explicitly says each user message can be one Langfuse trace, so this corrupts the judge input on the advertised path.
The checked-in verifier only covers fixture traces that replay growing history, and it is not run by any current required check; this PR’s check rollup is CodeQL-only. Please fix the cross-trace deduplication and add the repeated-identical-turn case to an automated test surface that CI executes. The existing fixture verification itself is green: 20 traces become 8 conversations with the expected taxonomy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Fixed in |
Preserve current regression coverage and example indexes while retaining the existing Langfuse trace-import walkthrough. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 313f00c0-362c-4152-bcde-17cadaf0ac3a
Add a dependency-free Tier 1 bridge that validates completed ASSERT artifacts, exports OTLP traces and ASSERT-produced scores, and fails closed on malformed rows or redirects. Include offline contract tests, a synthetic sample, and customer-facing integration guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 313f00c0-362c-4152-bcde-17cadaf0ac3a
Remove extra trailing blank lines from the new integration and guide files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 313f00c0-362c-4152-bcde-17cadaf0ac3a
Use the current Langfuse base-URL setting across trace import and result export, reject redirects before Basic Auth can leave the configured origin, and document the complete import-judge-export customer path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 313f00c0-362c-4152-bcde-17cadaf0ac3a
Require HTTPS outside loopback, fail closed on incomplete trace imports, prevent imported session ID collisions, bind each judge result to the exact inference row, and report skipped or failed judgments without exporting invalid scores. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 313f00c0-362c-4152-bcde-17cadaf0ac3a
Customer need
Teams already using Langfuse should be able to apply ASSERT behavior specs to existing conversations without moving to a second inspection workflow or re-running the agent. This PR completes that round trip:
What this PR adds
Customer flow
Data and integrity contract
Validation
Scope boundary
Direct API import uses Langfuse's public v1 trace list/detail shape; deployments that no longer expose that shape can export through the Langfuse SDK and use file import. This PR does not add automatic online judging, Langfuse evaluation-rule registration, dashboard creation, retries, or a new dependency.