Protected_Metadata provider used by the driver for entity access. Set explicitly via the
Provider setter; falls back to the global Metadata.Provider when not set.
The engine (or test harness) should set this to thread a transaction-scoped provider.
Protected_The metadata provider this driver uses. Falls back to the global Metadata.Provider
when the engine hasn't injected an explicit provider — multi-tenant servers should
always set this so each driver run binds to the right database connection.
ProtectedcalculateProtectedCalculate overall score from oracle results.
If weights are provided, calculates weighted average. Otherwise, calculates simple average.
Results from oracle evaluations
Optionalweights: ScoringWeightsOptional scoring weights by oracle type
Overall score from 0.0 to 1.0
ProtectedcreateProtectedCreate a log message for the test execution log.
Log level
Log message
Optionalmetadata: Record<string, unknown>Optional metadata
TestLogMessage object
ProtecteddetermineProtectedDetermine overall test status from oracle results.
Test passes only if ALL oracles pass.
Results from oracle evaluations
'Passed' if all oracles passed, 'Failed' otherwise
Execute agent evaluation test.
Steps:
Execution context
Execution result
ProtectedgetProtectedGet the effective timeout for a test.
Priority (highest to lowest):
The test entity
Optionalconfig: { maxExecutionTime?: number }Parsed configuration object (optional)
Timeout in milliseconds
ProtectedlogProtectedLog execution progress.
Log message
Whether to only log in verbose mode (default: false)
ProtectedlogProtectedLog errors.
Error message
Optionalerror: ErrorOptional error object
ProtectedlogProtectedLog a message to both the console (if verbose) and accumulate for test run log.
Driver execution context
Log level
Log message
Optionalmetadata: Record<string, unknown>Optional metadata
ProtectedparseProtectedParse and validate Configuration JSON.
Helper method for drivers to parse their configuration with type safety. Throws if configuration is invalid.
The configuration type
The test containing the configuration
Parsed configuration
ProtectedparseProtectedParse and validate ExpectedOutcomes JSON.
The expected outcomes type
The test containing the expected outcomes
Parsed expected outcomes
ProtectedparseProtectedParse and validate InputDefinition JSON.
The input definition type
The test containing the input definition
Parsed input definition
Suite-scoped setup. Runs ONCE after the suite run is created and before the
first test's Execute, when the test runs inside a suite (mj test suite).
Provision suite-shared fixtures here — discover/create users, create
Query/Category rows, refresh engine caches — and stash them on
context.Data / context.CreatedRecords so every Execute of the suite
(which receives this same context via DriverExecutionContext.fixtures) can
read them, and TeardownSuite can clean them up.
Default is a no-op, so existing drivers (AgentEval, Computer Use) are
unaffected. Does NOT fire for the standalone mj test run path (no suite).
Per-suite-run fixture bag, keyed by SuiteRunID
User context for data access
Returns true as this driver supports cancellation via AbortSignal. When timeout occurs, the AbortController signals the agent to stop execution.
Suite-scoped teardown. GUARANTEED by TestEngine.RunSuite via a finally, so
it runs on pass, fail, a thrown Execute, and after a 'Timeout' result.
MUST be best-effort: never throw (the engine logs and ignores any throw),
only clean up. Delete what SetupSuite created (the context.CreatedRecords
list and any driver-specific payload under context.Data).
Default is a no-op. Does NOT fire for the standalone mj test run path.
The same per-suite-run fixture bag passed to SetupSuite
User context for data access
Validate agent evaluation test configuration.
Checks:
Test entity to validate
Validation result
Test driver for AI Agent evaluation.
Executes an AI agent with test input, runs configured oracles, and creates bidirectional link between TestRun and AgentRun.
Example