Member Junction
    Preparing search index...

    Runs ONE prompt and evaluates the single decision it produced.

    This is the corpus workhorse (test plan §3.1). Given frozen mid-loop state — a payload, a conversation, a system prompt — it asks the model for exactly one decision and hands the raw turn to the decision oracles. No action ever executes. AIPromptRunner.ExecutePrompt returns the model's reply and nothing is dispatched, which is what makes the evaluation a plain data assertion rather than a side-effecting integration test.

    Why a separate driver rather than reusing AgentEvalDriver: an agent run is a loop, and a loop confounds the measurement. If the corpus is asking "does this model, in this state, choose action B", then a run that recovered on iteration three answers a different question. Loop-level cases still go through AgentEvalDriver; this driver isolates the single decision.

    Three execution details are load-bearing and easy to get wrong:

    • explicit contextUser — the CLI provider's CurrentUser is null (#3251), so an omitted context user fails deep inside template rendering with an unrelated-looking error;
    • AIEngine.Config() before the first run — otherwise prompt/model metadata is empty;
    • WaitForPendingPromptRunSaves() before oracles read back — prompt-run persistence is fire-and-forget, so an oracle asserting on AIPromptRun would race it.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _provider: IMetadataProvider | null = null

    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.

    Accessors

    Methods

    • Protected

      Get the effective timeout for a test.

      Priority (highest to lowest):

      1. Configuration JSON maxExecutionTime field (backward compatibility)
      2. Test.MaxExecutionTimeMS column
      3. DEFAULT_TEST_TIMEOUT_MS constant (5 minutes)

      Parameters

      • test: MJTestEntity

        The test entity

      • Optionalconfig: { maxExecutionTime?: number }

        Parsed configuration object (optional)

      Returns number

      Timeout in milliseconds

    • 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).

      Parameters

      Returns Promise<void>

    • Whether this driver supports cancellation via AbortSignal.

      Drivers should override this to return true if they properly handle cancellation tokens. When a driver doesn't support cancellation, timeout will still mark the test as failed but the underlying execution may continue in the background.

      Returns boolean

      true if driver supports cancellation, false otherwise

    • 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.

      Parameters

      Returns Promise<void>