Skip to content

[codex] Harden observability evaluation validators - #391

Merged
github-actions[bot] merged 3 commits into
mainfrom
codex/fix-observability-eval-edge-cases
Jun 10, 2026
Merged

[codex] Harden observability evaluation validators#391
github-actions[bot] merged 3 commits into
mainfrom
codex/fix-observability-eval-edge-cases

Conversation

@ANcpLua

@ANcpLua ANcpLua commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • replaces stringified JsonElement comparison with semantic JsonElement.DeepEquals for tool-call argument subset matching
  • hardens trace correlation by failing missing traceId, missing spanId, duplicate (traceId, spanId) keys, and unresolved parent spans
  • adds xUnit/MTP tests for observability evaluator edge cases and runner/loader mismatch behavior
  • adds an explicit evaluation namespace import in RunnerAndLoaderTests to avoid review/tooling ambiguity around parent-namespace lookup

Why

PR #390 added the first deterministic observability evaluation harness, but two validator paths could hide real mistakes:

  • tool-call argument comparison used JsonElement.ToString(), which is presentation-based rather than semantic
  • trace correlation converted missing trace IDs into empty key components, which could let malformed spans accidentally validate

A validation engine cannot carry fallbacks that reinterpret malformed telemetry into valid-looking keys. These changes make missing identifiers explicit failures instead of silent correlation inputs.

Validation

  • dotnet restore evals/Qyl.Observability.Evaluation.Tests/Qyl.Observability.Evaluation.Tests.csproj
  • dotnet build evals/Qyl.Observability.Evaluation.Tests/Qyl.Observability.Evaluation.Tests.csproj --configuration Release --no-restore -v:minimal
  • dotnet test evals/Qyl.Observability.Evaluation.Tests/Qyl.Observability.Evaluation.Tests.csproj --configuration Release --no-restore --no-build -v:minimal
  • dotnet run --project evals/Qyl.Observability.Evaluation/Qyl.Observability.Evaluation.csproj --configuration Release --no-build
  • dotnet restore qyl.slnx
  • dotnet build qyl.slnx --configuration Release --no-restore -v:minimal
  • dotnet test qyl.slnx --configuration Release --no-restore --no-build -v:minimal
  • dotnet-coverage collect "dotnet test evals/Qyl.Observability.Evaluation.Tests/Qyl.Observability.Evaluation.Tests.csproj --configuration Release --no-restore --no-build -v:minimal" -f cobertura -o artifacts/coverage/qyl-observability-evaluation.cobertura.xml

Notes:

  • dotnet test --collect:"XPlat Code Coverage" is not supported by the current xUnit v3 Microsoft.Testing.Platform runner in this repo; it exits with Unknown option '--collect'.
  • Local dotnet-coverage also executes the tests successfully, but reports No code coverage data available. Profiler was not initialized. for this net10/xUnit-MTP path. The added tests are branch-focused semantic coverage for the evaluator failure modes; this PR does not claim a formal measured coverage percentage.

Copilot AI review requested due to automatic review settings June 10, 2026 15:20
@railway-app

railway-app Bot commented Jun 10, 2026

Copy link
Copy Markdown

🚅 Deployed to the qyl-pr-391 environment in qyl

Service Status Web Updated (UTC)
qyl-collector 🕛 Waiting for status checks (View Logs) Web Jun 10, 2026 at 3:31 pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Risk: Low-to-moderate (mostly validator hardening + tests), but there is a compile-breaking issue in the new test project.

This PR hardens the observability evaluation harness by making trace/span identifier problems explicit failures and by switching tool-call argument equality from presentation-based string comparison to semantic JSON equality, backed by new evaluator/runner/loader tests.

Changes:

  • Replace JsonElement.ToString()-based tool-call argument comparisons with JsonElement.DeepEquals.
  • Harden trace correlation validation to fail on missing traceId/spanId, duplicate (traceId, spanId) keys, and unresolved parent spans.
  • Add a new Qyl.Observability.Evaluation.Tests project with focused xUnit/MTP coverage for evaluator and runner/loader edge cases.

Blockers

  • evals/Qyl.Observability.Evaluation.Tests/RunnerAndLoaderTests.cs: missing using Qyl.Observability.Evaluation; causes unresolved identifiers (ScenarioRunResult, EvaluationRunner, ScenarioLoader) and will fail compilation.

Important issues

  • None found.

Minor / optional

  • None found.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
qyl.slnx Adds the new evaluation test project to the solution.
evals/Qyl.Observability.Evaluation/Properties/AssemblyInfo.cs Exposes internals to the new test assembly.
evals/Qyl.Observability.Evaluation/Evaluators/TraceCorrelationEvaluator.cs Makes trace/span ID validation strict and reports duplicates/unresolved parents.
evals/Qyl.Observability.Evaluation/Evaluators/ToolCallAccuracyEvaluator.cs Switches JSON value equality to semantic JsonElement.DeepEquals.
evals/Qyl.Observability.Evaluation.Tests/Qyl.Observability.Evaluation.Tests.csproj Introduces the new test project for the eval harness.
evals/Qyl.Observability.Evaluation.Tests/EvaluatorTestData.cs Adds shared record/tool/telemetry builders for tests.
evals/Qyl.Observability.Evaluation.Tests/TraceCorrelationEvaluatorTests.cs Adds coverage for missing IDs, duplicates, and missing parents.
evals/Qyl.Observability.Evaluation.Tests/ToolCallAccuracyEvaluatorTests.cs Adds coverage for semantic JSON matching + mismatch behavior.
evals/Qyl.Observability.Evaluation.Tests/TelemetryEvidenceEvaluatorTests.cs Adds coverage for evidence existence/citation/forbidden-claim checks.
evals/Qyl.Observability.Evaluation.Tests/RunnerAndLoaderTests.cs Adds coverage for runner/loader mismatch handling (currently missing a namespace import).
evals/Qyl.Observability.Evaluation.Tests/CardinalitySafetyEvaluatorTests.cs Adds coverage for cardinality/sensitive-attribute safety checks.

Comment on lines +1 to +3
using Microsoft.Extensions.AI.Evaluation;
using Qyl.Observability.Evaluation.Evaluators;

[Fact]
public void ScenarioLoader_LoadsJsonlAndSkipsBlankLines()
{
string path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid():N}.jsonl");
Railway is only used in qyl, so it moved out of the global enabledPlugins
into the repo's tracked .claude/settings.json (real path .agents/ via the
symlink) — portable across machines and immune to untracked-file cleanup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 10, 2026 15:31
@ANcpLua
ANcpLua marked this pull request as ready for review June 10, 2026 15:34
@github-actions
github-actions Bot merged commit 0503ef8 into main Jun 10, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread .agents/settings.json
Comment on lines +1 to +5
{
"enabledPlugins": {
"railway@claude-plugins-official": true
}
}
Comment thread qyl.slnx
Comment on lines 37 to 40
<Folder Name="/evals/">
<Project Path="evals/Qyl.Observability.Evaluation/Qyl.Observability.Evaluation.csproj" />
<Project Path="evals/Qyl.Observability.Evaluation.Tests/Qyl.Observability.Evaluation.Tests.csproj" />
</Folder>
@ANcpLua
ANcpLua deleted the codex/fix-observability-eval-edge-cases branch June 11, 2026 13:54
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