Skip to content

feat(observe): run code evaluators on new traces - #759

Merged
LinuxDevil merged 4 commits into
mainfrom
obs/o24-code-evaluators
Oct 28, 2026
Merged

LinuxDevil merged 4 commits into
mainfrom
obs/o24-code-evaluators

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Online code evaluators: enabled code rules run in the isolate sandbox on each new trace's root end (off the ingest path, bounded queue), writing source:'online' scores; adds POST /api/v1/evaluators/:id/test as a dry run for Studio's test-on-trace.

Ticket: O24 (Forge Observe vs LangSmith evaluation follow-up)

Changes

  • fix(observe): serialize evaluator dry runs, 404 a rootless trace
  • feat(observe): run code evaluators on new traces

Verification: focused vitest, tsc --noEmit, eslint on changed files (details in the review package); full suite and fallow run in CI.

🤖 Generated with Claude Code

LinuxDevil and others added 3 commits October 29, 2026 01:33
The daemon now runs enabled `code` evaluator rules on each trace whose root
observation ends: filter + sample_rate decide, the rule source runs in the
isolate sandbox (timeoutMs 2000), and the result is written as a
`source: 'online'` score named after the rule. Ingest only hands the worker
the ended roots' trace ids; matching and runs happen off the request, one at
a time, with a bounded in-memory queue (drops are counted). Without
isolated-vm, code rules are skipped with one warning.

Adds POST /api/v1/evaluators/:id/test, a dry run on one trace that writes no
score, and 'online' to the score sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- runOnce now returns undefined for a trace with no root observation (read
  once); POST /api/v1/evaluators/:id/test answers 404 for it.
- Dry runs share one promise chain, so parallel /test calls never start
  parallel isolates.
- The daemon ack test's fake sandbox waits 1000 ms, well past its 200 ms bound.
- Studio's Scores screen lists the 'online' source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The daemon always hands routes its worker, so the optional field only
created an unreachable `throw new Error(...)` in the /test route (flagged by
plainErrors.test.ts). RouteContext.evaluators is now required; route tests
pass a real worker over their db.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LinuxDevil
LinuxDevil force-pushed the obs/o24-code-evaluators branch from 85b5674 to 1c284f8 Compare October 28, 2026 22:33
CI counted 853 entries with the online evaluator modules; keep ~10% headroom.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LinuxDevil
LinuxDevil merged commit 4886c74 into main Oct 28, 2026
2 checks passed
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.

1 participant