Problem
createTraceAnalyst emits non-canonical AnalystFinding objects when valid optional fields are absent.
AnalystRegistry.runExact then rejects those findings after paid analysis completes.
A minimal direct call returned these undefined paths:
{"undefinedPaths":["$.subject","$.rationale","$.evidence_refs[0].excerpt","$.recommended_action"]}
The values originate from two mappings.
evidenceRefsFromRawFinding always adds excerpt, including undefined.
toAnalystFinding always passes subject, rationale, and recommended_action, including undefined.
makeFinding preserves those keys.
The exact registry later throws:
AnalystRegistry.runExact analyst "question" findings finding 0 must have a canonical JSON representation
Observed environment
@tangle-network/agent-eval 0.144.6
agent-eval-rpc[dspy] 0.144.6
- DSPy 3.2.1
The failure occurred after three successful model calls and accepted evidence.
Expected
Valid optional omissions must remain omitted in the public finding.
Every createTraceAnalyst result must satisfy the exact registry's canonical JSON contract.
Suggested fix
Build optional properties conditionally in evidenceRefsFromRawFinding and toAnalystFinding.
Add an exact-run regression with a valid finding that omits subject, rationale, recommended action, and evidence excerpt.
Problem
createTraceAnalystemits non-canonicalAnalystFindingobjects when valid optional fields are absent.AnalystRegistry.runExactthen rejects those findings after paid analysis completes.A minimal direct call returned these undefined paths:
{"undefinedPaths":["$.subject","$.rationale","$.evidence_refs[0].excerpt","$.recommended_action"]}The values originate from two mappings.
evidenceRefsFromRawFindingalways addsexcerpt, includingundefined.toAnalystFindingalways passessubject,rationale, andrecommended_action, includingundefined.makeFindingpreserves those keys.The exact registry later throws:
Observed environment
@tangle-network/agent-eval0.144.6agent-eval-rpc[dspy]0.144.6The failure occurred after three successful model calls and accepted evidence.
Expected
Valid optional omissions must remain omitted in the public finding.
Every
createTraceAnalystresult must satisfy the exact registry's canonical JSON contract.Suggested fix
Build optional properties conditionally in
evidenceRefsFromRawFindingandtoAnalystFinding.Add an exact-run regression with a valid finding that omits subject, rationale, recommended action, and evidence excerpt.