@prismatic-io/lux 0.0.2-preview.27 → 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.
Files changed (99) hide show
  1. package/lib/authoring.d.ts +1 -0
  2. package/lib/authoring.d.ts.map +1 -1
  3. package/lib/authoring.js +1 -0
  4. package/lib/authoring.js.map +1 -1
  5. package/lib/container/driver.d.ts +27 -0
  6. package/lib/container/driver.d.ts.map +1 -0
  7. package/lib/container/driver.js +197 -0
  8. package/lib/container/driver.js.map +1 -0
  9. package/lib/container/protocol.d.ts +12 -0
  10. package/lib/container/protocol.d.ts.map +1 -0
  11. package/lib/container/protocol.js +38 -0
  12. package/lib/container/protocol.js.map +1 -0
  13. package/lib/container/resources.d.ts +12 -0
  14. package/lib/container/resources.d.ts.map +1 -0
  15. package/lib/container/resources.js +133 -0
  16. package/lib/container/resources.js.map +1 -0
  17. package/lib/container/worker.d.ts +2 -0
  18. package/lib/container/worker.d.ts.map +1 -0
  19. package/lib/container/worker.js +85 -0
  20. package/lib/container/worker.js.map +1 -0
  21. package/lib/core/case.d.ts +80 -0
  22. package/lib/core/case.d.ts.map +1 -1
  23. package/lib/core/case.js +8 -1
  24. package/lib/core/case.js.map +1 -1
  25. package/lib/core/driver-execution.d.ts +83 -0
  26. package/lib/core/driver-execution.d.ts.map +1 -0
  27. package/lib/core/driver-execution.js +72 -0
  28. package/lib/core/driver-execution.js.map +1 -0
  29. package/lib/core/driver.d.ts +5 -1
  30. package/lib/core/driver.d.ts.map +1 -1
  31. package/lib/core/driver.js +5 -1
  32. package/lib/core/driver.js.map +1 -1
  33. package/lib/core/harness-matrix.d.ts +84 -0
  34. package/lib/core/harness-matrix.d.ts.map +1 -1
  35. package/lib/core/harness-matrix.js +11 -1
  36. package/lib/core/harness-matrix.js.map +1 -1
  37. package/lib/core/run.d.ts +40 -0
  38. package/lib/core/run.d.ts.map +1 -1
  39. package/lib/drivers/antigravity/artifacts.d.ts +2 -0
  40. package/lib/drivers/antigravity/artifacts.d.ts.map +1 -0
  41. package/lib/drivers/antigravity/artifacts.js +33 -0
  42. package/lib/drivers/antigravity/artifacts.js.map +1 -0
  43. package/lib/drivers/antigravity/config.d.ts +27 -0
  44. package/lib/drivers/antigravity/config.d.ts.map +1 -1
  45. package/lib/drivers/antigravity/config.js +35 -0
  46. package/lib/drivers/antigravity/config.js.map +1 -1
  47. package/lib/drivers/antigravity/index.d.ts +35 -0
  48. package/lib/drivers/antigravity/index.d.ts.map +1 -1
  49. package/lib/drivers/antigravity/index.js +42 -20
  50. package/lib/drivers/antigravity/index.js.map +1 -1
  51. package/lib/drivers/antigravity/runtime.d.ts +7 -0
  52. package/lib/drivers/antigravity/runtime.d.ts.map +1 -0
  53. package/lib/drivers/antigravity/runtime.js +78 -0
  54. package/lib/drivers/antigravity/runtime.js.map +1 -0
  55. package/lib/index.d.ts +1 -0
  56. package/lib/index.d.ts.map +1 -1
  57. package/lib/index.js +1 -0
  58. package/lib/index.js.map +1 -1
  59. package/lib/orchestrator/config.d.ts +122 -1
  60. package/lib/orchestrator/config.d.ts.map +1 -1
  61. package/lib/orchestrator/config.js +2 -1
  62. package/lib/orchestrator/config.js.map +1 -1
  63. package/lib/orchestrator/doctor.d.ts.map +1 -1
  64. package/lib/orchestrator/doctor.js +3 -1
  65. package/lib/orchestrator/doctor.js.map +1 -1
  66. package/lib/orchestrator/driver-capabilities.d.ts +2 -1
  67. package/lib/orchestrator/driver-capabilities.d.ts.map +1 -1
  68. package/lib/orchestrator/driver-capabilities.js +5 -2
  69. package/lib/orchestrator/driver-capabilities.js.map +1 -1
  70. package/lib/orchestrator/driver-identity.d.ts.map +1 -1
  71. package/lib/orchestrator/driver-identity.js +11 -1
  72. package/lib/orchestrator/driver-identity.js.map +1 -1
  73. package/lib/orchestrator/experiment-context.d.ts +34 -0
  74. package/lib/orchestrator/experiment-context.d.ts.map +1 -1
  75. package/lib/orchestrator/orchestrator.d.ts.map +1 -1
  76. package/lib/orchestrator/orchestrator.js +16 -3
  77. package/lib/orchestrator/orchestrator.js.map +1 -1
  78. package/package.json +1 -1
  79. package/skills/lux-answerer/SKILL.md +1 -1
  80. package/src/authoring.ts +6 -0
  81. package/src/container/driver.ts +211 -0
  82. package/src/container/protocol.ts +48 -0
  83. package/src/container/resources.ts +153 -0
  84. package/src/container/worker.ts +107 -0
  85. package/src/core/case.ts +8 -1
  86. package/src/core/driver-execution.ts +84 -0
  87. package/src/core/driver.ts +9 -1
  88. package/src/core/harness-matrix.ts +19 -1
  89. package/src/drivers/antigravity/README.md +108 -10
  90. package/src/drivers/antigravity/artifacts.ts +37 -0
  91. package/src/drivers/antigravity/config.ts +35 -0
  92. package/src/drivers/antigravity/index.ts +41 -22
  93. package/src/drivers/antigravity/runtime.ts +88 -0
  94. package/src/index.ts +6 -0
  95. package/src/orchestrator/config.ts +4 -1
  96. package/src/orchestrator/doctor.ts +3 -1
  97. package/src/orchestrator/driver-capabilities.ts +6 -1
  98. package/src/orchestrator/driver-identity.ts +11 -1
  99. package/src/orchestrator/orchestrator.ts +19 -3
@@ -4,6 +4,7 @@ import { resolve } from "node:path";
4
4
  import { glob } from "tinyglobby";
5
5
  import { z } from "zod";
6
6
  import { RubricConfigSchema } from "../assertions/rubric/index.js";
7
+ import { driverExecutionOf } from "../core/driver-execution.js";
7
8
  import {
8
9
  casePermutations,
9
10
  type EvalCase,
@@ -143,6 +144,7 @@ const effectiveDriverReference = (local: unknown, fallback: unknown): unknown =>
143
144
  return {
144
145
  name: refName(local),
145
146
  config: mergeRecords(rawRefConfig(fallback), rawRefConfig(local)),
147
+ execution: driverExecutionOf(local) ?? driverExecutionOf(fallback),
146
148
  };
147
149
  };
148
150
 
@@ -511,7 +513,7 @@ const caseDriverFailure = (
511
513
  rawRefConfig(reference),
512
514
  `case '${caseId}' driver '${name}'`,
513
515
  );
514
- validateDriverCapabilities(plugin, config, required);
516
+ validateDriverCapabilities(plugin, config, required, driverExecutionOf(reference));
515
517
  return null;
516
518
  } catch (error) {
517
519
  return firstLine(error);
@@ -1,12 +1,17 @@
1
1
  import type { DriverCapability, DriverPlugin } from "../core/driver.js";
2
+ import type { DriverExecution } from "../core/driver-execution.js";
2
3
 
3
4
  export const validateDriverCapabilities = (
4
5
  plugin: DriverPlugin,
5
6
  config: unknown,
6
7
  required: readonly DriverCapability[] = [],
8
+ execution?: DriverExecution,
7
9
  ): void => {
8
10
  if (required.length === 0) return;
9
- const capabilities = plugin.runtime?.(config).capabilities;
11
+ const capabilities = {
12
+ ...plugin.runtime?.(config).capabilities,
13
+ ...(execution?.kind === "container" ? { isolation: true } : {}),
14
+ };
10
15
  const missing = required.filter((capability) => capabilities?.[capability] !== true);
11
16
  if (missing.length > 0) {
12
17
  throw new Error(
@@ -1,4 +1,5 @@
1
1
  import type { DriverPlugin, DriverRuntime } from "../core/driver.js";
2
+ import { driverExecutionOf } from "../core/driver-execution.js";
2
3
  import type { Registry } from "../core/registry.js";
3
4
  import { cliIdentity } from "./experiment-runtime-identity.js";
4
5
  import { validatePluginConfig } from "./validate-plugin-config.js";
@@ -21,7 +22,14 @@ const resolvedDriver = (
21
22
 
22
23
  export const referencedDriverRuntime = (reference: unknown, registry: Registry): DriverRuntime => {
23
24
  const resolved = resolvedDriver(reference, registry);
24
- return resolved?.plugin.runtime?.(resolved.config) ?? { commands: [], capabilities: {} };
25
+ const runtime = resolved?.plugin.runtime?.(resolved.config) ?? { commands: [], capabilities: {} };
26
+ const execution = driverExecutionOf(reference);
27
+ return execution?.kind === "container"
28
+ ? {
29
+ commands: [execution.command ?? "docker"],
30
+ capabilities: { ...runtime.capabilities, isolation: true },
31
+ }
32
+ : runtime;
25
33
  };
26
34
 
27
35
  export const experimentDriverIdentity = async (
@@ -29,6 +37,8 @@ export const experimentDriverIdentity = async (
29
37
  registry: Registry,
30
38
  rootDir: string,
31
39
  ): Promise<unknown> => {
40
+ if (driverExecutionOf(reference)?.kind === "container")
41
+ throw new Error("container execution does not yet support controlled experiments");
32
42
  const resolved = resolvedDriver(reference, registry);
33
43
  if (!resolved) return null;
34
44
  const { plugin, config } = resolved;
@@ -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
- validateDriverCapabilities(driverPlugin, driverCfg, evalCase.requires);
394
- const driver = await driverPlugin.create(driverCfg);
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,