@prismatic-io/lux 0.0.2-preview.26 → 0.0.2-preview.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assertions/rubric/index.d.ts +5 -0
- package/lib/assertions/rubric/index.d.ts.map +1 -1
- package/lib/assertions/rubric/index.js +14 -7
- package/lib/assertions/rubric/index.js.map +1 -1
- package/lib/assertions/rubric/internal.d.ts +1 -1
- package/lib/assertions/rubric/internal.d.ts.map +1 -1
- package/lib/assertions/rubric/internal.js +7 -2
- package/lib/assertions/rubric/internal.js.map +1 -1
- package/lib/authoring.d.ts +1 -0
- package/lib/authoring.d.ts.map +1 -1
- package/lib/authoring.js +1 -0
- package/lib/authoring.js.map +1 -1
- package/lib/cli/program.js +2 -2
- package/lib/cli/program.js.map +1 -1
- package/lib/container/driver.d.ts +27 -0
- package/lib/container/driver.d.ts.map +1 -0
- package/lib/container/driver.js +197 -0
- package/lib/container/driver.js.map +1 -0
- package/lib/container/protocol.d.ts +12 -0
- package/lib/container/protocol.d.ts.map +1 -0
- package/lib/container/protocol.js +38 -0
- package/lib/container/protocol.js.map +1 -0
- package/lib/container/resources.d.ts +12 -0
- package/lib/container/resources.d.ts.map +1 -0
- package/lib/container/resources.js +133 -0
- package/lib/container/resources.js.map +1 -0
- package/lib/container/worker.d.ts +2 -0
- package/lib/container/worker.d.ts.map +1 -0
- package/lib/container/worker.js +85 -0
- package/lib/container/worker.js.map +1 -0
- package/lib/core/case.d.ts +80 -0
- package/lib/core/case.d.ts.map +1 -1
- package/lib/core/case.js +8 -1
- package/lib/core/case.js.map +1 -1
- package/lib/core/driver-execution.d.ts +83 -0
- package/lib/core/driver-execution.d.ts.map +1 -0
- package/lib/core/driver-execution.js +72 -0
- package/lib/core/driver-execution.js.map +1 -0
- package/lib/core/driver.d.ts +5 -1
- package/lib/core/driver.d.ts.map +1 -1
- package/lib/core/driver.js +5 -1
- package/lib/core/driver.js.map +1 -1
- package/lib/core/harness-matrix.d.ts +84 -0
- package/lib/core/harness-matrix.d.ts.map +1 -1
- package/lib/core/harness-matrix.js +11 -1
- package/lib/core/harness-matrix.js.map +1 -1
- package/lib/core/run.d.ts +40 -0
- package/lib/core/run.d.ts.map +1 -1
- package/lib/drivers/antigravity/artifacts.d.ts +2 -0
- package/lib/drivers/antigravity/artifacts.d.ts.map +1 -0
- package/lib/drivers/antigravity/artifacts.js +33 -0
- package/lib/drivers/antigravity/artifacts.js.map +1 -0
- package/lib/drivers/antigravity/config.d.ts +27 -0
- package/lib/drivers/antigravity/config.d.ts.map +1 -1
- package/lib/drivers/antigravity/config.js +35 -0
- package/lib/drivers/antigravity/config.js.map +1 -1
- package/lib/drivers/antigravity/index.d.ts +35 -0
- package/lib/drivers/antigravity/index.d.ts.map +1 -1
- package/lib/drivers/antigravity/index.js +42 -20
- package/lib/drivers/antigravity/index.js.map +1 -1
- package/lib/drivers/antigravity/runtime.d.ts +7 -0
- package/lib/drivers/antigravity/runtime.d.ts.map +1 -0
- package/lib/drivers/antigravity/runtime.js +78 -0
- package/lib/drivers/antigravity/runtime.js.map +1 -0
- package/lib/drivers/shared/artifacts.d.ts.map +1 -1
- package/lib/drivers/shared/artifacts.js +3 -2
- package/lib/drivers/shared/artifacts.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/orchestrator/config.d.ts +122 -1
- package/lib/orchestrator/config.d.ts.map +1 -1
- package/lib/orchestrator/config.js +2 -1
- package/lib/orchestrator/config.js.map +1 -1
- package/lib/orchestrator/doctor.d.ts.map +1 -1
- package/lib/orchestrator/doctor.js +3 -1
- package/lib/orchestrator/doctor.js.map +1 -1
- package/lib/orchestrator/driver-capabilities.d.ts +2 -1
- package/lib/orchestrator/driver-capabilities.d.ts.map +1 -1
- package/lib/orchestrator/driver-capabilities.js +5 -2
- package/lib/orchestrator/driver-capabilities.js.map +1 -1
- package/lib/orchestrator/driver-identity.d.ts.map +1 -1
- package/lib/orchestrator/driver-identity.js +11 -1
- package/lib/orchestrator/driver-identity.js.map +1 -1
- package/lib/orchestrator/experiment-context.d.ts +34 -0
- package/lib/orchestrator/experiment-context.d.ts.map +1 -1
- package/lib/orchestrator/experiment-evaluation.d.ts.map +1 -1
- package/lib/orchestrator/experiment-evaluation.js +3 -2
- package/lib/orchestrator/experiment-evaluation.js.map +1 -1
- package/lib/orchestrator/grader-experiment.d.ts.map +1 -1
- package/lib/orchestrator/grader-experiment.js +2 -2
- package/lib/orchestrator/grader-experiment.js.map +1 -1
- package/lib/orchestrator/harness-registry.d.ts +4 -0
- package/lib/orchestrator/harness-registry.d.ts.map +1 -0
- package/lib/orchestrator/harness-registry.js +5 -0
- package/lib/orchestrator/harness-registry.js.map +1 -0
- package/lib/orchestrator/orchestrator.d.ts.map +1 -1
- package/lib/orchestrator/orchestrator.js +16 -3
- package/lib/orchestrator/orchestrator.js.map +1 -1
- package/package.json +1 -1
- package/skills/lux-answerer/SKILL.md +1 -1
- package/src/assertions/rubric/index.ts +19 -7
- package/src/assertions/rubric/internal.ts +8 -2
- package/src/authoring.ts +6 -0
- package/src/cli/program.ts +2 -2
- package/src/container/driver.ts +211 -0
- package/src/container/protocol.ts +48 -0
- package/src/container/resources.ts +153 -0
- package/src/container/worker.ts +107 -0
- package/src/core/case.ts +8 -1
- package/src/core/driver-execution.ts +84 -0
- package/src/core/driver.ts +9 -1
- package/src/core/harness-matrix.ts +19 -1
- package/src/drivers/antigravity/README.md +108 -10
- package/src/drivers/antigravity/artifacts.ts +37 -0
- package/src/drivers/antigravity/config.ts +35 -0
- package/src/drivers/antigravity/index.ts +41 -22
- package/src/drivers/antigravity/runtime.ts +88 -0
- package/src/drivers/shared/artifacts.ts +6 -2
- package/src/index.ts +6 -0
- package/src/orchestrator/config.ts +4 -1
- package/src/orchestrator/doctor.ts +3 -1
- package/src/orchestrator/driver-capabilities.ts +6 -1
- package/src/orchestrator/driver-identity.ts +11 -1
- package/src/orchestrator/experiment-evaluation.ts +3 -5
- package/src/orchestrator/grader-experiment.ts +2 -5
- package/src/orchestrator/harness-registry.ts +12 -0
- package/src/orchestrator/orchestrator.ts +19 -3
|
@@ -2,10 +2,7 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { rm } from "node:fs/promises";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import {
|
|
6
|
-
createRubricAssertion,
|
|
7
|
-
RubricModelAccountingDetailSchema,
|
|
8
|
-
} from "../assertions/rubric/index.js";
|
|
5
|
+
import { RubricModelAccountingDetailSchema } from "../assertions/rubric/index.js";
|
|
9
6
|
import {
|
|
10
7
|
addUsage,
|
|
11
8
|
type Candidate,
|
|
@@ -26,6 +23,7 @@ import { profileOrThrow } from "./experiment-context.js";
|
|
|
26
23
|
import type { ExperimentEvaluation, OpenedExperimentRun } from "./experiment-runs.js";
|
|
27
24
|
import { average } from "./experiment-selection.js";
|
|
28
25
|
import { evaluateGraderCandidate } from "./grader-experiment.js";
|
|
26
|
+
import { registryWithHarness } from "./harness-registry.js";
|
|
29
27
|
import { loadEvalCase } from "./loader.js";
|
|
30
28
|
import { Orchestrator, type SuiteCaseResult, type SuiteItem } from "./orchestrator.js";
|
|
31
29
|
import { clusterCaseSamples, groupedCaseMetricSamples } from "./paired-effects.js";
|
|
@@ -496,7 +494,7 @@ export const evaluateAgentCandidate = async (options: {
|
|
|
496
494
|
const profile = profileOrThrow(execution.config, profileId);
|
|
497
495
|
const harness = profile.harness ?? execution.config.harness;
|
|
498
496
|
const defaultDriver = profile.driver ?? execution.config.defaultDriver;
|
|
499
|
-
const registry = execution.registry.
|
|
497
|
+
const registry = registryWithHarness(execution.registry, execution.config, harness);
|
|
500
498
|
const orchestrator = new Orchestrator({
|
|
501
499
|
environment: profile.environment ?? execution.config.environment,
|
|
502
500
|
registry,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import {
|
|
5
|
-
createRubricAssertion,
|
|
6
|
-
RubricModelAccountingDetailSchema,
|
|
7
|
-
} from "../assertions/rubric/index.js";
|
|
4
|
+
import { RubricModelAccountingDetailSchema } from "../assertions/rubric/index.js";
|
|
8
5
|
import {
|
|
9
6
|
type Candidate,
|
|
10
7
|
type CandidateEvaluation,
|
|
@@ -711,7 +708,7 @@ export const evaluateGraderCandidate = async (options: {
|
|
|
711
708
|
const registry = buildRegistryFromConfig({
|
|
712
709
|
...execution.config,
|
|
713
710
|
...(harness ? { harness } : {}),
|
|
714
|
-
})
|
|
711
|
+
});
|
|
715
712
|
const items: GraderEvidenceItem[] = [];
|
|
716
713
|
for (const annotation of selected) {
|
|
717
714
|
const rubric = await loadRubricDefinition(
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRubricAssertion } from "../assertions/rubric/index.js";
|
|
2
|
+
import type { HarnessModelConfig, Registry } from "../core/index.js";
|
|
3
|
+
import type { ResolvedLuxConfig } from "./config.js";
|
|
4
|
+
|
|
5
|
+
export const registryWithHarness = (
|
|
6
|
+
registry: Registry,
|
|
7
|
+
config: Pick<ResolvedLuxConfig, "assertions">,
|
|
8
|
+
harness: HarnessModelConfig | undefined,
|
|
9
|
+
): Registry =>
|
|
10
|
+
config.assertions?.some((assertion) => assertion.type === "rubric")
|
|
11
|
+
? registry
|
|
12
|
+
: registry.withAssertion(createRubricAssertion(harness));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { basename, extname, join, resolve } from "node:path";
|
|
2
|
+
import { ContainerDriver } from "../container/driver.js";
|
|
3
|
+
import { driverExecutionOf } from "../core/driver-execution.js";
|
|
2
4
|
import { type EnvironmentDeclaration, EnvironmentDeclarationSchema } from "../core/environment.js";
|
|
3
5
|
import {
|
|
4
6
|
type Answerer,
|
|
@@ -28,6 +30,7 @@ import {
|
|
|
28
30
|
registryForEvalCase,
|
|
29
31
|
valuesForFixtures,
|
|
30
32
|
} from "./case-extensions.js";
|
|
33
|
+
import { isBuiltinDriver } from "./config.js";
|
|
31
34
|
import { validateDriverCapabilities } from "./driver-capabilities.js";
|
|
32
35
|
import { evaluatorImplementationHash } from "./evaluator-identity.js";
|
|
33
36
|
import {
|
|
@@ -249,6 +252,7 @@ export const resolveDriverReference = (
|
|
|
249
252
|
return {
|
|
250
253
|
name: driverNameOf(local),
|
|
251
254
|
config: mergePluginConfig(driverConfigOf(base), driverConfigOf(local)),
|
|
255
|
+
execution: driverExecutionOf(local) ?? driverExecutionOf(base),
|
|
252
256
|
};
|
|
253
257
|
};
|
|
254
258
|
|
|
@@ -390,8 +394,20 @@ export class Orchestrator {
|
|
|
390
394
|
`answerer '${answererName}'`,
|
|
391
395
|
);
|
|
392
396
|
|
|
393
|
-
|
|
394
|
-
|
|
397
|
+
const execution = driverExecutionOf(driverRef);
|
|
398
|
+
if (execution?.kind === "container" && request.experimentId)
|
|
399
|
+
throw new Error("container execution does not yet support controlled experiments");
|
|
400
|
+
if (
|
|
401
|
+
execution?.kind === "container" &&
|
|
402
|
+
!execution.driverModule &&
|
|
403
|
+
!isBuiltinDriver(driverPlugin)
|
|
404
|
+
)
|
|
405
|
+
throw new Error("custom container drivers require execution.driverModule in the image");
|
|
406
|
+
validateDriverCapabilities(driverPlugin, driverCfg, evalCase.requires, execution);
|
|
407
|
+
const driver =
|
|
408
|
+
execution?.kind === "container"
|
|
409
|
+
? new ContainerDriver(driverName, driverCfg, execution)
|
|
410
|
+
: await driverPlugin.create(driverCfg);
|
|
395
411
|
let answerer: Answerer;
|
|
396
412
|
try {
|
|
397
413
|
answerer = await answererPlugin.create(answererCfg);
|
|
@@ -427,7 +443,7 @@ export class Orchestrator {
|
|
|
427
443
|
permutationId: request.permutationId,
|
|
428
444
|
answererName,
|
|
429
445
|
answererConfig: answererCfg,
|
|
430
|
-
driverConfigHash: valueHash(driverCfg),
|
|
446
|
+
driverConfigHash: valueHash(execution ? { config: driverCfg, execution } : driverCfg),
|
|
431
447
|
answererConfigHash: valueHash(answererCfg),
|
|
432
448
|
validatedAssertionsHash,
|
|
433
449
|
graderConfigHash: graderHash,
|