@zgeoff/rig 0.2.4 → 0.2.6

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 (144) hide show
  1. package/README.md +1 -1
  2. package/dist/bench/pick-unremoved-checkout-state.d.ts +1 -1
  3. package/dist/{run-bench.d.ts → bench/run-bench.d.ts} +3 -3
  4. package/dist/browser/make-browser-lane-hooks.d.ts +1 -1
  5. package/dist/browser/process-runtime.d.ts +1 -1
  6. package/dist/browser/stop-descendant-processes.d.ts +1 -1
  7. package/dist/browser/wire-browser-lane-hooks.d.ts +1 -1
  8. package/dist/cli/run-cli.d.ts +10 -0
  9. package/dist/{read-command-output.d.ts → command/read-command-output.d.ts} +1 -1
  10. package/dist/{define-rig.d.ts → config/define-rig.d.ts} +1 -1
  11. package/dist/{parse-rig-config.d.ts → config/parse-rig-config.d.ts} +1 -1
  12. package/dist/{read-rig-config.d.ts → config/read-rig-config.d.ts} +1 -1
  13. package/dist/{run-eval.d.ts → eval/run-eval.d.ts} +2 -2
  14. package/dist/index.d.ts +3 -3
  15. package/dist/index.js +23 -23
  16. package/dist/{build-init-scripts.d.ts → init/build-init-scripts.d.ts} +1 -1
  17. package/dist/{run-init.d.ts → init/run-init.d.ts} +1 -1
  18. package/dist/{build-program-lane-hooks.d.ts → lanes/build-program-lane-hooks.d.ts} +1 -1
  19. package/dist/{make-repo-lane-hooks.d.ts → lanes/make-repo-lane-hooks.d.ts} +2 -2
  20. package/dist/{parse-lane-hook.d.ts → lanes/parse-lane-hook.d.ts} +1 -1
  21. package/dist/{parse-lane-start.d.ts → lanes/parse-lane-start.d.ts} +1 -1
  22. package/dist/{pick-lane-selection.d.ts → lanes/pick-lane-selection.d.ts} +1 -1
  23. package/dist/{run-lane.d.ts → lanes/run-lane.d.ts} +3 -3
  24. package/dist/{standard-lanes.d.ts → lanes/standard-lanes.d.ts} +1 -1
  25. package/dist/{build-program-environment.d.ts → programs/build-program-environment.d.ts} +1 -1
  26. package/dist/{collect-unprogrammed-e2e-dirs.d.ts → programs/collect-unprogrammed-e2e-dirs.d.ts} +1 -1
  27. package/dist/{run-program-builds.d.ts → programs/run-program-builds.d.ts} +2 -2
  28. package/dist/{build-test-selection.d.ts → unit/build-test-selection.d.ts} +1 -1
  29. package/dist/{build-unit-command.d.ts → unit/build-unit-command.d.ts} +1 -1
  30. package/dist/{collect-test-runs.d.ts → unit/collect-test-runs.d.ts} +1 -1
  31. package/dist/{pick-unit-run-plan.d.ts → unit/pick-unit-run-plan.d.ts} +1 -1
  32. package/dist/{resolve-related-tests.d.ts → unit/resolve-related-tests.d.ts} +1 -1
  33. package/dist/{run-related-tests.d.ts → unit/run-related-tests.d.ts} +1 -1
  34. package/dist/{run-unit-tests.d.ts → unit/run-unit-tests.d.ts} +2 -2
  35. package/dist/{run-unit.d.ts → unit/run-unit.d.ts} +1 -1
  36. package/dist/{read-git-common-dir.d.ts → workspace/read-git-common-dir.d.ts} +2 -2
  37. package/dist/{read-git-prefix.d.ts → workspace/read-git-prefix.d.ts} +2 -2
  38. package/package.json +7 -7
  39. package/src/bench/define-bench.ts +1 -1
  40. package/src/bench/pick-unremoved-checkout-state.ts +1 -1
  41. package/src/bench/read-bench-args.ts +1 -1
  42. package/src/bench/read-bench-file-args.ts +1 -1
  43. package/src/{run-bench-file.ts → bench/run-bench-file.ts} +5 -5
  44. package/src/{run-bench.ts → bench/run-bench.ts} +26 -26
  45. package/src/browser/browser-preload.ts +1 -1
  46. package/src/browser/make-browser-lane-hooks.ts +2 -2
  47. package/src/browser/process-runtime.ts +2 -2
  48. package/src/browser/stop-descendant-processes.ts +1 -1
  49. package/src/browser/wire-browser-lane-hooks.ts +2 -2
  50. package/src/{read-cli-args.ts → cli/read-cli-args.ts} +1 -1
  51. package/src/{run-cli.ts → cli/run-cli.ts} +14 -14
  52. package/src/cli.ts +13 -13
  53. package/src/{read-command-output.ts → command/read-command-output.ts} +1 -1
  54. package/src/{run-command.ts → command/run-command.ts} +3 -3
  55. package/src/{define-rig.ts → config/define-rig.ts} +7 -7
  56. package/src/{parse-rig-config.ts → config/parse-rig-config.ts} +3 -3
  57. package/src/{read-rig-config.ts → config/read-rig-config.ts} +1 -1
  58. package/src/{run-eval.ts → eval/run-eval.ts} +2 -2
  59. package/src/index.ts +3 -3
  60. package/src/{build-init-scripts.ts → init/build-init-scripts.ts} +7 -6
  61. package/src/{run-init.ts → init/run-init.ts} +1 -1
  62. package/src/{build-program-lane-hooks.ts → lanes/build-program-lane-hooks.ts} +2 -2
  63. package/src/{make-repo-lane-hooks.ts → lanes/make-repo-lane-hooks.ts} +4 -4
  64. package/src/{parse-lane-hook.ts → lanes/parse-lane-hook.ts} +1 -1
  65. package/src/{parse-lane-start.ts → lanes/parse-lane-start.ts} +1 -1
  66. package/src/{pick-lane-selection.ts → lanes/pick-lane-selection.ts} +1 -1
  67. package/src/{run-lane.ts → lanes/run-lane.ts} +14 -14
  68. package/src/{standard-lanes.ts → lanes/standard-lanes.ts} +1 -1
  69. package/src/{build-program-environment.ts → programs/build-program-environment.ts} +1 -1
  70. package/src/{collect-unprogrammed-e2e-dirs.ts → programs/collect-unprogrammed-e2e-dirs.ts} +1 -1
  71. package/src/programs/resolve-program.ts +2 -2
  72. package/src/{run-program-builds.ts → programs/run-program-builds.ts} +2 -2
  73. package/src/{build-test-selection.ts → unit/build-test-selection.ts} +4 -4
  74. package/src/{build-unit-command.ts → unit/build-unit-command.ts} +1 -1
  75. package/src/{collect-test-runs.ts → unit/collect-test-runs.ts} +2 -2
  76. package/src/{pick-unit-run-plan.ts → unit/pick-unit-run-plan.ts} +1 -1
  77. package/src/{resolve-related-tests.ts → unit/resolve-related-tests.ts} +2 -2
  78. package/src/{run-related-tests.ts → unit/run-related-tests.ts} +1 -1
  79. package/src/{run-unit-tests.ts → unit/run-unit-tests.ts} +3 -3
  80. package/src/{run-unit.ts → unit/run-unit.ts} +1 -1
  81. package/src/{read-git-common-dir.ts → workspace/read-git-common-dir.ts} +2 -2
  82. package/src/{read-git-prefix.ts → workspace/read-git-prefix.ts} +2 -2
  83. package/dist/run-cli.d.ts +0 -10
  84. /package/dist/{build-bench-folder-path.d.ts → bench/build-bench-folder-path.d.ts} +0 -0
  85. /package/dist/{collect-bench-files.d.ts → bench/collect-bench-files.d.ts} +0 -0
  86. /package/dist/{create-bench-work-folder.d.ts → bench/create-bench-work-folder.d.ts} +0 -0
  87. /package/dist/{run-bench-file.d.ts → bench/run-bench-file.d.ts} +0 -0
  88. /package/dist/{is-command-name.d.ts → cli/is-command-name.d.ts} +0 -0
  89. /package/dist/{read-cli-args.d.ts → cli/read-cli-args.d.ts} +0 -0
  90. /package/dist/{run-command.d.ts → command/run-command.d.ts} +0 -0
  91. /package/dist/{system-clock.d.ts → command/system-clock.d.ts} +0 -0
  92. /package/dist/{bunfig-declaration-schema.d.ts → config/bunfig-declaration-schema.d.ts} +0 -0
  93. /package/dist/{format-parse-error.d.ts → config/format-parse-error.d.ts} +0 -0
  94. /package/dist/{make-ignore-check.d.ts → config/make-ignore-check.d.ts} +0 -0
  95. /package/dist/{parse-duration.d.ts → config/parse-duration.d.ts} +0 -0
  96. /package/dist/{repo-glob-schema.d.ts → config/repo-glob-schema.d.ts} +0 -0
  97. /package/dist/{collect-eval-files.d.ts → eval/collect-eval-files.d.ts} +0 -0
  98. /package/dist/{init-files.d.ts → init/init-files.d.ts} +0 -0
  99. /package/dist/{has-lane-suffix.d.ts → lanes/has-lane-suffix.d.ts} +0 -0
  100. /package/dist/{lane-hooks.d.ts → lanes/lane-hooks.d.ts} +0 -0
  101. /package/dist/{run-lane-hooks.d.ts → lanes/run-lane-hooks.d.ts} +0 -0
  102. /package/dist/{pick-e2e-dirs.d.ts → programs/pick-e2e-dirs.d.ts} +0 -0
  103. /package/dist/{build-diet-command.d.ts → unit/build-diet-command.d.ts} +0 -0
  104. /package/dist/{find-single-run-flag.d.ts → unit/find-single-run-flag.d.ts} +0 -0
  105. /package/dist/{find-timeout-arg.d.ts → unit/find-timeout-arg.d.ts} +0 -0
  106. /package/dist/{format-no-match-message.d.ts → unit/format-no-match-message.d.ts} +0 -0
  107. /package/dist/{format-no-tests-message.d.ts → unit/format-no-tests-message.d.ts} +0 -0
  108. /package/dist/{is-test-file.d.ts → unit/is-test-file.d.ts} +0 -0
  109. /package/dist/{parse-test-args.d.ts → unit/parse-test-args.d.ts} +0 -0
  110. /package/dist/{read-memory-budget.d.ts → unit/read-memory-budget.d.ts} +0 -0
  111. /package/dist/{read-worker-count.d.ts → unit/read-worker-count.d.ts} +0 -0
  112. /package/dist/{resolve-diet-script.d.ts → unit/resolve-diet-script.d.ts} +0 -0
  113. /package/dist/{test-run-args.d.ts → unit/test-run-args.d.ts} +0 -0
  114. /package/dist/{probe-workspace-repo.d.ts → workspace/probe-workspace-repo.d.ts} +0 -0
  115. /package/dist/{read-tracked-files.d.ts → workspace/read-tracked-files.d.ts} +0 -0
  116. /package/src/{build-bench-folder-path.ts → bench/build-bench-folder-path.ts} +0 -0
  117. /package/src/{collect-bench-files.ts → bench/collect-bench-files.ts} +0 -0
  118. /package/src/{create-bench-work-folder.ts → bench/create-bench-work-folder.ts} +0 -0
  119. /package/src/{is-command-name.ts → cli/is-command-name.ts} +0 -0
  120. /package/src/{system-clock.ts → command/system-clock.ts} +0 -0
  121. /package/src/{bunfig-declaration-schema.ts → config/bunfig-declaration-schema.ts} +0 -0
  122. /package/src/{format-parse-error.ts → config/format-parse-error.ts} +0 -0
  123. /package/src/{make-ignore-check.ts → config/make-ignore-check.ts} +0 -0
  124. /package/src/{parse-duration.ts → config/parse-duration.ts} +0 -0
  125. /package/src/{repo-glob-schema.ts → config/repo-glob-schema.ts} +0 -0
  126. /package/src/{collect-eval-files.ts → eval/collect-eval-files.ts} +0 -0
  127. /package/src/{init-files.ts → init/init-files.ts} +0 -0
  128. /package/src/{has-lane-suffix.ts → lanes/has-lane-suffix.ts} +0 -0
  129. /package/src/{lane-hooks.ts → lanes/lane-hooks.ts} +0 -0
  130. /package/src/{run-lane-hooks.ts → lanes/run-lane-hooks.ts} +0 -0
  131. /package/src/{pick-e2e-dirs.ts → programs/pick-e2e-dirs.ts} +0 -0
  132. /package/src/{build-diet-command.ts → unit/build-diet-command.ts} +0 -0
  133. /package/src/{find-single-run-flag.ts → unit/find-single-run-flag.ts} +0 -0
  134. /package/src/{find-timeout-arg.ts → unit/find-timeout-arg.ts} +0 -0
  135. /package/src/{format-no-match-message.ts → unit/format-no-match-message.ts} +0 -0
  136. /package/src/{format-no-tests-message.ts → unit/format-no-tests-message.ts} +0 -0
  137. /package/src/{is-test-file.ts → unit/is-test-file.ts} +0 -0
  138. /package/src/{parse-test-args.ts → unit/parse-test-args.ts} +0 -0
  139. /package/src/{read-memory-budget.ts → unit/read-memory-budget.ts} +0 -0
  140. /package/src/{read-worker-count.ts → unit/read-worker-count.ts} +0 -0
  141. /package/src/{resolve-diet-script.ts → unit/resolve-diet-script.ts} +0 -0
  142. /package/src/{test-run-args.ts → unit/test-run-args.ts} +0 -0
  143. /package/src/{probe-workspace-repo.ts → workspace/probe-workspace-repo.ts} +0 -0
  144. /package/src/{read-tracked-files.ts → workspace/read-tracked-files.ts} +0 -0
package/README.md CHANGED
@@ -41,7 +41,7 @@ so a run that outgrows its memory budget fails alone when `diet` finds a
41
41
  lane the repo declares.
42
42
  - `rig bench [name]` and `rig eval [name]` run the benchmarks and the evaluation suites, or the one
43
43
  named `name`.
44
- - `rig init` sets `test` to `rig unit`, adds each missing `test:related`, `test:<lane>`, `bench` and
44
+ - `rig init` adds each missing `test` (as `rig unit`), `test:related`, `test:<lane>`, `bench` and
45
45
  `eval` script the repo has files for, keeps its other scripts, and writes a starter config.
46
46
 
47
47
  `rig unit` and the lane commands pass every argument after the command on to `bun test`, so
@@ -1,3 +1,3 @@
1
- import type { CommandOutput } from '../read-command-output.ts';
1
+ import type { CommandOutput } from '../command/read-command-output.ts';
2
2
  import type { CheckoutState } from './types.ts';
3
3
  export declare function pickUnremovedCheckoutState(listing: CommandOutput, baseRoot: string): Exclude<CheckoutState, 'removed'>;
@@ -1,6 +1,6 @@
1
- import type { ReadCommandOutput } from './read-command-output.ts';
2
- import type { ProgramBuildDeps } from './run-program-builds.ts';
3
- import type { RigConfig, RigRun } from './types.ts';
1
+ import type { ReadCommandOutput } from '../command/read-command-output.ts';
2
+ import type { ProgramBuildDeps } from '../programs/run-program-builds.ts';
3
+ import type { RigConfig, RigRun } from '../types.ts';
4
4
  export interface BenchDeps extends ProgramBuildDeps {
5
5
  readonly dietScript: string;
6
6
  readonly benchScript: string;
@@ -1,4 +1,4 @@
1
- import type { LaneHooks } from '../lane-hooks.ts';
1
+ import type { LaneHooks } from '../lanes/lane-hooks.ts';
2
2
  import type { BrowserRun } from './build-browser-run.ts';
3
3
  import type { LaneFiles } from './lane-files.ts';
4
4
  import type { ChromeDirs } from './pick-chrome-dirs.ts';
@@ -1,4 +1,4 @@
1
- import type { Clock } from '../system-clock.ts';
1
+ import type { Clock } from '../command/system-clock.ts';
2
2
  export interface SpawnedProcess {
3
3
  readonly pid: number;
4
4
  readonly stdout: ReadableStream<Uint8Array> | null;
@@ -1,4 +1,4 @@
1
- import type { Clock } from '../system-clock.ts';
1
+ import type { Clock } from '../command/system-clock.ts';
2
2
  import type { ProcessEntry } from './read-process-table.ts';
3
3
  export interface DescendantStop {
4
4
  readonly rootPID: number;
@@ -1,4 +1,4 @@
1
- import type { LaneHooks } from '../lane-hooks.ts';
1
+ import type { LaneHooks } from '../lanes/lane-hooks.ts';
2
2
  type Environment = Readonly<Record<string, string | undefined>>;
3
3
  export interface BrowserLaneWiring {
4
4
  readonly repoRoot: string;
@@ -0,0 +1,10 @@
1
+ import type { BenchDeps } from '../bench/run-bench.ts';
2
+ import type { EvalDeps } from '../eval/run-eval.ts';
3
+ import type { InitDeps } from '../init/run-init.ts';
4
+ import type { LaneDeps } from '../lanes/run-lane.ts';
5
+ import type { RigRun } from '../types.ts';
6
+ import type { RelatedTestDeps } from '../unit/run-related-tests.ts';
7
+ import type { UnitDeps } from '../unit/run-unit.ts';
8
+ export interface CLIDeps extends LaneDeps, UnitDeps, RelatedTestDeps, InitDeps, BenchDeps, EvalDeps {
9
+ }
10
+ export declare function runCLI(argv: readonly string[], run: RigRun, deps: CLIDeps): Promise<number>;
@@ -1,4 +1,4 @@
1
- import type { ProcessRuntime, SpawnOptions } from './browser/process-runtime.ts';
1
+ import type { ProcessRuntime, SpawnOptions } from '../browser/process-runtime.ts';
2
2
  export interface CommandOutput {
3
3
  readonly exitCode: number;
4
4
  readonly stdout: string;
@@ -1,2 +1,2 @@
1
- import type { RigConfig, RigDeclaration } from './types.ts';
1
+ import type { RigConfig, RigDeclaration } from '../types.ts';
2
2
  export declare function defineRig(declaration: RigDeclaration): RigConfig;
@@ -1,4 +1,4 @@
1
- import type { RigConfig } from './types.ts';
1
+ import type { RigConfig } from '../types.ts';
2
2
  export type ParsedRigConfig = {
3
3
  readonly kind: 'parsed';
4
4
  readonly config: RigConfig;
@@ -1,4 +1,4 @@
1
- import type { RigConfig } from './types.ts';
1
+ import type { RigConfig } from '../types.ts';
2
2
  export interface RigConfigSources {
3
3
  readonly probeFile: (path: string) => boolean;
4
4
  readonly importModule: (path: string) => Promise<unknown>;
@@ -1,5 +1,5 @@
1
- import type { CommandOptions } from './run-command.ts';
2
- import type { RigOutput, RigRun } from './types.ts';
1
+ import type { CommandOptions } from '../command/run-command.ts';
2
+ import type { RigOutput, RigRun } from '../types.ts';
3
3
  export interface EvalDeps {
4
4
  readonly output: RigOutput;
5
5
  readonly readTrackedFiles: (repoRoot: string) => Promise<readonly string[]>;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { defineRig } from './define-rig.ts';
2
- export { parseRigConfig } from './parse-rig-config.ts';
3
- export type { ParsedRigConfig } from './parse-rig-config.ts';
1
+ export { defineRig } from './config/define-rig.ts';
2
+ export { parseRigConfig } from './config/parse-rig-config.ts';
3
+ export type { ParsedRigConfig } from './config/parse-rig-config.ts';
4
4
  export { runInPage } from './browser/run-in-page.ts';
5
5
  export type { PageResultSchema } from './browser/run-in-page.ts';
6
6
  export type { LaneContext, BenchDeclaration, LaneDeclaration, ProgramDeclaration, LaneStart, ResolvedLane, RigConfig, RigDeclaration, } from './types.ts';
package/dist/index.js CHANGED
@@ -1,26 +1,37 @@
1
- // src/bunfig-declaration-schema.ts
1
+ // src/cli/is-command-name.ts
2
+ var commandNames = ["bench", "eval", "init", "related"];
3
+ function isCommandName(name) {
4
+ return commandNames.some((command) => command === name);
5
+ }
6
+
7
+ // src/lanes/standard-lanes.ts
8
+ var standardLanes = [
9
+ { name: "unit", suffix: null, limitMs: 5000, parallel: "workers" },
10
+ { name: "e2e", suffix: null, limitMs: 15000, parallel: 1 },
11
+ { name: "browser", suffix: ".browser", limitMs: 1e4, parallel: 1 },
12
+ { name: "docker", suffix: ".docker", limitMs: 15000, parallel: 1 },
13
+ { name: "host", suffix: ".host", limitMs: 15000, parallel: 1 },
14
+ { name: "agent-sdk", suffix: ".agent-sdk", limitMs: 5000, parallel: 1 },
15
+ { name: "model-api", suffix: ".model-api", limitMs: 120000, parallel: 1 }
16
+ ];
17
+
18
+ // src/config/bunfig-declaration-schema.ts
2
19
  import { z as z2 } from "zod";
3
20
 
4
- // src/repo-glob-schema.ts
21
+ // src/config/repo-glob-schema.ts
5
22
  import { z } from "zod";
6
23
  var repoGlobSchema = z.string().refine((pattern) => pattern !== "" && !pattern.startsWith("/") && !hasDotSegment(pattern));
7
24
  function hasDotSegment(path) {
8
25
  return path.split("/").some((segment) => segment === "." || segment === "..");
9
26
  }
10
27
 
11
- // src/bunfig-declaration-schema.ts
28
+ // src/config/bunfig-declaration-schema.ts
12
29
  var bunfigDeclarationSchema = z2.object({
13
30
  path: repoGlobSchema.refine((path) => path.endsWith(".toml")),
14
31
  files: z2.array(repoGlobSchema).min(1)
15
32
  }).readonly();
16
33
 
17
- // src/is-command-name.ts
18
- var commandNames = ["bench", "eval", "init", "related"];
19
- function isCommandName(name) {
20
- return commandNames.some((command) => command === name);
21
- }
22
-
23
- // src/parse-duration.ts
34
+ // src/config/parse-duration.ts
24
35
  var durationPattern = /^(?<count>[1-9]\d*)(?<unit>ms|s)$/u;
25
36
  function parseDuration(text) {
26
37
  const groups = durationPattern.exec(text)?.groups;
@@ -31,18 +42,7 @@ function parseDuration(text) {
31
42
  return groups["unit"] === "s" ? count * 1000 : count;
32
43
  }
33
44
 
34
- // src/standard-lanes.ts
35
- var standardLanes = [
36
- { name: "unit", suffix: null, limitMs: 5000, parallel: "workers" },
37
- { name: "e2e", suffix: null, limitMs: 15000, parallel: 1 },
38
- { name: "browser", suffix: ".browser", limitMs: 1e4, parallel: 1 },
39
- { name: "docker", suffix: ".docker", limitMs: 15000, parallel: 1 },
40
- { name: "host", suffix: ".host", limitMs: 15000, parallel: 1 },
41
- { name: "agent-sdk", suffix: ".agent-sdk", limitMs: 5000, parallel: 1 },
42
- { name: "model-api", suffix: ".model-api", limitMs: 120000, parallel: 1 }
43
- ];
44
-
45
- // src/define-rig.ts
45
+ // src/config/define-rig.ts
46
46
  var laneNamePattern = /^[a-z][a-z0-9-]*$/u;
47
47
  function defineRig(declaration) {
48
48
  const declared = Object.entries(declaration.lanes ?? {});
@@ -222,7 +222,7 @@ function readBenchLane(lane, lanes) {
222
222
  }
223
223
  return lane;
224
224
  }
225
- // src/parse-rig-config.ts
225
+ // src/config/parse-rig-config.ts
226
226
  import { z as z3 } from "zod";
227
227
  function parseRigConfig(value) {
228
228
  if (typeof value !== "object" || value === null || !("lanes" in value)) {
@@ -1,3 +1,3 @@
1
- import type { RigConfig } from './types.ts';
1
+ import type { RigConfig } from '../types.ts';
2
2
  export type PackageScripts = Readonly<Record<string, string>>;
3
3
  export declare function buildInitScripts(oldScripts: PackageScripts, config: RigConfig, trackedFiles: readonly string[], isWorkspaceRepo: boolean): PackageScripts;
@@ -1,5 +1,5 @@
1
+ import type { RigConfig, RigOutput } from '../types.ts';
1
2
  import type { InitFiles } from './init-files.ts';
2
- import type { RigConfig, RigOutput } from './types.ts';
3
3
  export interface InitDeps {
4
4
  readonly probeWorkspaceRepo: (repoRoot: string) => Promise<boolean>;
5
5
  readonly readTrackedFiles: (repoRoot: string) => Promise<readonly string[]>;
@@ -1,3 +1,3 @@
1
+ import type { ProgramDeclaration } from '../types.ts';
1
2
  import type { LaneHooks } from './lane-hooks.ts';
2
- import type { ProgramDeclaration } from './types.ts';
3
3
  export declare function buildProgramLaneHooks(hooks: LaneHooks, repoRoot: string, programs: Readonly<Record<string, ProgramDeclaration>>): LaneHooks;
@@ -1,6 +1,6 @@
1
+ import type { CommandOptions } from '../command/run-command.ts';
2
+ import type { LaneContext } from '../types.ts';
1
3
  import type { LaneHooks } from './lane-hooks.ts';
2
- import type { CommandOptions } from './run-command.ts';
3
- import type { LaneContext } from './types.ts';
4
4
  export interface RepoLaneOptions {
5
5
  readonly context: LaneContext;
6
6
  readonly dietScript: string;
@@ -1,3 +1,3 @@
1
- import type { LaneContext } from './types.ts';
1
+ import type { LaneContext } from '../types.ts';
2
2
  export type LaneHook = (context: LaneContext) => Promise<unknown>;
3
3
  export declare function parseLaneHook(loaded: unknown, path: string): LaneHook;
@@ -1,2 +1,2 @@
1
- import type { LaneStart } from './types.ts';
1
+ import type { LaneStart } from '../types.ts';
2
2
  export declare function parseLaneStart(value: unknown, path: string): LaneStart;
@@ -1,2 +1,2 @@
1
- import type { ResolvedLane } from './types.ts';
1
+ import type { ResolvedLane } from '../types.ts';
2
2
  export declare function pickLaneSelection(lane: ResolvedLane, e2eDirs: readonly string[]): readonly string[];
@@ -1,7 +1,7 @@
1
- import type { BrowserLaneWiring } from './browser/wire-browser-lane-hooks.ts';
1
+ import type { BrowserLaneWiring } from '../browser/wire-browser-lane-hooks.ts';
2
+ import type { ProgramBuildDeps } from '../programs/run-program-builds.ts';
3
+ import type { ResolvedLane, RigConfig, RigRun } from '../types.ts';
2
4
  import type { LaneHooks } from './lane-hooks.ts';
3
- import type { ProgramBuildDeps } from './run-program-builds.ts';
4
- import type { ResolvedLane, RigConfig, RigRun } from './types.ts';
5
5
  export interface LaneDeps extends ProgramBuildDeps {
6
6
  readonly dietScript: string;
7
7
  readonly probeWorkspaceRepo: (repoRoot: string) => Promise<boolean>;
@@ -1,4 +1,4 @@
1
- import type { LaneParallelism } from './types.ts';
1
+ import type { LaneParallelism } from '../types.ts';
2
2
  export interface StandardLane {
3
3
  readonly name: string;
4
4
  readonly suffix: string | null;
@@ -1,3 +1,3 @@
1
- import type { ProgramDeclaration } from './types.ts';
1
+ import type { ProgramDeclaration } from '../types.ts';
2
2
  export declare function buildProgramVariable(name: string): string;
3
3
  export declare function buildProgramEnvironment(repoRoot: string, programs: Readonly<Record<string, ProgramDeclaration>>): Readonly<Record<string, string>>;
@@ -1,2 +1,2 @@
1
- import type { ProgramDeclaration } from './types.ts';
1
+ import type { ProgramDeclaration } from '../types.ts';
2
2
  export declare function collectUnprogrammedE2EDirs(e2eDirs: readonly string[], programs: Readonly<Record<string, ProgramDeclaration>>): readonly string[];
@@ -1,5 +1,5 @@
1
- import type { CommandOptions } from './run-command.ts';
2
- import type { ProgramDeclaration, RigOutput, RigRun } from './types.ts';
1
+ import type { CommandOptions } from '../command/run-command.ts';
2
+ import type { ProgramDeclaration, RigOutput, RigRun } from '../types.ts';
3
3
  export interface ProgramBuildDeps {
4
4
  readonly output: RigOutput;
5
5
  readonly runCommand: (command: readonly string[], options: CommandOptions) => Promise<number>;
@@ -1,5 +1,5 @@
1
+ import type { ResolvedLane, RigConfig } from '../types.ts';
1
2
  import type { TestArgs } from './parse-test-args.ts';
2
- import type { ResolvedLane, RigConfig } from './types.ts';
3
3
  export type TestSelection = {
4
4
  readonly kind: 'lane';
5
5
  readonly files: readonly string[];
@@ -1,5 +1,5 @@
1
+ import type { RigConfig } from '../types.ts';
1
2
  import type { TestRun } from './collect-test-runs.ts';
2
- import type { RigConfig } from './types.ts';
3
3
  export interface UnitCommandRequest {
4
4
  readonly e2eDirs: readonly string[];
5
5
  readonly workerCount: number;
@@ -1,4 +1,4 @@
1
- import type { BunfigDeclaration } from './types.ts';
1
+ import type { BunfigDeclaration } from '../types.ts';
2
2
  export interface TestRun {
3
3
  readonly folder: string;
4
4
  readonly bunfig: string | null;
@@ -1,5 +1,5 @@
1
+ import type { RigConfig } from '../types.ts';
1
2
  import type { TestRun } from './collect-test-runs.ts';
2
- import type { RigConfig } from './types.ts';
3
3
  export interface UnitRunPlanRequest {
4
4
  readonly flags: readonly string[];
5
5
  readonly tests: readonly string[];
@@ -1,4 +1,4 @@
1
- import type { RigConfig } from './types.ts';
1
+ import type { RigConfig } from '../types.ts';
2
2
  export interface RelatedTestSources {
3
3
  readonly cwd: string;
4
4
  readonly probeFile: (path: string) => boolean;
@@ -1,7 +1,7 @@
1
+ import type { RigConfig, RigRun } from '../types.ts';
1
2
  import type { WorkerCount } from './read-worker-count.ts';
2
3
  import type { RelatedTestSources } from './resolve-related-tests.ts';
3
4
  import type { UnitRunDeps } from './run-unit-tests.ts';
4
- import type { RigConfig, RigRun } from './types.ts';
5
5
  export interface RelatedTestDeps extends UnitRunDeps {
6
6
  readonly sources: Readonly<RelatedTestSources>;
7
7
  readonly readWorkerCount: () => Promise<WorkerCount>;
@@ -1,6 +1,6 @@
1
+ import type { CommandOptions } from '../command/run-command.ts';
2
+ import type { RigConfig, RigOutput, RigRun } from '../types.ts';
1
3
  import type { UnitRunPlanRequest } from './pick-unit-run-plan.ts';
2
- import type { CommandOptions } from './run-command.ts';
3
- import type { RigConfig, RigOutput, RigRun } from './types.ts';
4
4
  export interface UnitRequest extends UnitRunPlanRequest {
5
5
  readonly workerCount: number;
6
6
  }
@@ -1,6 +1,6 @@
1
+ import type { RigConfig, RigRun } from '../types.ts';
1
2
  import type { WorkerCount } from './read-worker-count.ts';
2
3
  import type { UnitRunDeps } from './run-unit-tests.ts';
3
- import type { RigConfig, RigRun } from './types.ts';
4
4
  export interface UnitDeps extends UnitRunDeps {
5
5
  readonly readWorkerCount: () => Promise<WorkerCount>;
6
6
  }
@@ -1,5 +1,5 @@
1
- import type { SpawnOptions } from './browser/process-runtime.ts';
2
- import type { ReadCommandOutput } from './read-command-output.ts';
1
+ import type { SpawnOptions } from '../browser/process-runtime.ts';
2
+ import type { ReadCommandOutput } from '../command/read-command-output.ts';
3
3
  export interface GitCommonDirDeps {
4
4
  readonly readCommandOutput: ReadCommandOutput;
5
5
  }
@@ -1,5 +1,5 @@
1
- import type { SpawnOptions } from './browser/process-runtime.ts';
2
- import type { ReadCommandOutput } from './read-command-output.ts';
1
+ import type { SpawnOptions } from '../browser/process-runtime.ts';
2
+ import type { ReadCommandOutput } from '../command/read-command-output.ts';
3
3
  export interface GitPrefixDeps {
4
4
  readonly readCommandOutput: ReadCommandOutput;
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgeoff/rig",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Run every test lane of a repo from one declaration of its limits, with a browser lane built in",
5
5
  "keywords": [
6
6
  "bun",
@@ -44,21 +44,21 @@
44
44
  },
45
45
  "scripts": {
46
46
  "build": "rm -rf dist && bun build src/index.ts --outdir dist --target node --packages external && tsc -p tsconfig.build.json",
47
- "typecheck": "tsrs"
47
+ "typecheck": "tsrs --fast"
48
48
  },
49
49
  "dependencies": {
50
- "@zgeoff/diet": "0.2.2",
51
- "@zgeoff/std": "0.4.3",
50
+ "@zgeoff/diet": "0.2.3",
51
+ "@zgeoff/std": "0.4.4",
52
52
  "gunshi": "1.0.0-rc.1",
53
53
  "ts-pattern": "5.9.2",
54
54
  "zod": "4.6.7"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/bun": "1.4.4",
58
- "@zgeoff/std": "0.4.3",
59
- "@zgeoff/testing": "0.3.0",
58
+ "@zgeoff/std": "0.4.4",
59
+ "@zgeoff/testing": "0.3.1",
60
60
  "tiny-invariant": "1.3.3",
61
- "tsrs": "0.18.0-ts7.1.0-dev.20260929",
61
+ "tsrs": "0.25.0-ts7.1.0-beta",
62
62
  "typescript": "7.0.2"
63
63
  },
64
64
  "engines": {
@@ -1,4 +1,4 @@
1
- import { parseDuration } from '../parse-duration.ts';
1
+ import { parseDuration } from '../config/parse-duration.ts';
2
2
  import { isConcurrencyList } from './is-concurrency-list.ts';
3
3
 
4
4
  interface BenchBaseOptions {
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'node:path';
2
- import type { CommandOutput } from '../read-command-output.ts';
2
+ import type { CommandOutput } from '../command/read-command-output.ts';
3
3
  import type { CheckoutState } from './types.ts';
4
4
 
5
5
  // Takes what `git worktree list --porcelain -z` gave after a failed removal. A listing that failed
@@ -1,6 +1,6 @@
1
1
  import { cli } from 'gunshi/bone';
2
2
  import { define } from 'gunshi/definition';
3
- import { formatParseError } from '../format-parse-error.ts';
3
+ import { formatParseError } from '../config/format-parse-error.ts';
4
4
 
5
5
  export type BenchArgs =
6
6
  | { readonly kind: 'parsed'; readonly name: string | null; readonly baseRef: string | null }
@@ -1,6 +1,6 @@
1
1
  import { cli } from 'gunshi/bone';
2
2
  import { define } from 'gunshi/definition';
3
- import { formatParseError } from '../format-parse-error.ts';
3
+ import { formatParseError } from '../config/format-parse-error.ts';
4
4
 
5
5
  export type BenchFileArgs =
6
6
  | { readonly kind: 'parsed'; readonly file: string; readonly reportPath: string }
@@ -1,9 +1,9 @@
1
1
  import { appendFile } from 'node:fs/promises';
2
- import { formatBenchReport } from './bench/format-bench-report.ts';
3
- import { formatBenchmarkResult } from './bench/format-benchmark-result.ts';
4
- import { parseBenchDefinition } from './bench/parse-bench-definition.ts';
5
- import { readBenchFileArgs } from './bench/read-bench-file-args.ts';
6
- import { runBenchmark } from './bench/run-benchmark.ts';
2
+ import { formatBenchReport } from './format-bench-report.ts';
3
+ import { formatBenchmarkResult } from './format-benchmark-result.ts';
4
+ import { parseBenchDefinition } from './parse-bench-definition.ts';
5
+ import { readBenchFileArgs } from './read-bench-file-args.ts';
6
+ import { runBenchmark } from './run-benchmark.ts';
7
7
 
8
8
  // `rig bench` runs this once per bench file, in the environment the benchmarks get, and judges the
9
9
  // budget from the report this appends, so a bench that ran exits 0 whatever its median.
@@ -1,32 +1,32 @@
1
1
  import { join, relative } from 'node:path';
2
2
  import { match } from 'ts-pattern';
3
- import { buildBaseSideRoot } from './bench/build-base-side-root.ts';
4
- import { findBaseSetupVerdict } from './bench/find-base-setup-verdict.ts';
5
- import { findMissingBenchVerdict } from './bench/find-missing-bench-verdict.ts';
6
- import { parseBenchReport } from './bench/parse-bench-report.ts';
7
- import type { ParsedBenchReport } from './bench/parse-bench-report.ts';
8
- import { pickBenchPlan } from './bench/pick-bench-plan.ts';
9
- import { pickCheckoutCleanup } from './bench/pick-checkout-cleanup.ts';
10
- import { pickCleanedUpResult } from './bench/pick-cleaned-up-result.ts';
11
- import { pickComparisonVerdict } from './bench/pick-comparison-verdict.ts';
12
- import { pickHeadVerdict } from './bench/pick-head-verdict.ts';
13
- import { pickNamedBenchFiles } from './bench/pick-named-bench-files.ts';
14
- import { pickUnremovedCheckoutState } from './bench/pick-unremoved-checkout-state.ts';
15
- import { readBenchArgs } from './bench/read-bench-args.ts';
16
- import type { BenchOutput, BenchVerdict, CheckoutState } from './bench/types.ts';
17
- import { pickExitCodeAfterTests } from './browser/pick-exit-code-after-tests.ts';
18
- import { buildDietCommand } from './build-diet-command.ts';
19
- import { buildProgramLaneHooks } from './build-program-lane-hooks.ts';
3
+ import { pickExitCodeAfterTests } from '../browser/pick-exit-code-after-tests.ts';
4
+ import type { ReadCommandOutput } from '../command/read-command-output.ts';
5
+ import { defineRig } from '../config/define-rig.ts';
6
+ import { buildProgramLaneHooks } from '../lanes/build-program-lane-hooks.ts';
7
+ import type { LaneHooks } from '../lanes/lane-hooks.ts';
8
+ import { makeRepoLaneHooks } from '../lanes/make-repo-lane-hooks.ts';
9
+ import { runLaneHooks } from '../lanes/run-lane-hooks.ts';
10
+ import type { ProgramBuildDeps } from '../programs/run-program-builds.ts';
11
+ import { runProgramBuilds } from '../programs/run-program-builds.ts';
12
+ import type { RigConfig, RigRun } from '../types.ts';
13
+ import { buildDietCommand } from '../unit/build-diet-command.ts';
14
+ import { readGitPrefix } from '../workspace/read-git-prefix.ts';
15
+ import { buildBaseSideRoot } from './build-base-side-root.ts';
20
16
  import { collectBenchFiles } from './collect-bench-files.ts';
21
- import { defineRig } from './define-rig.ts';
22
- import type { LaneHooks } from './lane-hooks.ts';
23
- import { makeRepoLaneHooks } from './make-repo-lane-hooks.ts';
24
- import type { ReadCommandOutput } from './read-command-output.ts';
25
- import { readGitPrefix } from './read-git-prefix.ts';
26
- import { runLaneHooks } from './run-lane-hooks.ts';
27
- import type { ProgramBuildDeps } from './run-program-builds.ts';
28
- import { runProgramBuilds } from './run-program-builds.ts';
29
- import type { RigConfig, RigRun } from './types.ts';
17
+ import { findBaseSetupVerdict } from './find-base-setup-verdict.ts';
18
+ import { findMissingBenchVerdict } from './find-missing-bench-verdict.ts';
19
+ import { parseBenchReport } from './parse-bench-report.ts';
20
+ import type { ParsedBenchReport } from './parse-bench-report.ts';
21
+ import { pickBenchPlan } from './pick-bench-plan.ts';
22
+ import { pickCheckoutCleanup } from './pick-checkout-cleanup.ts';
23
+ import { pickCleanedUpResult } from './pick-cleaned-up-result.ts';
24
+ import { pickComparisonVerdict } from './pick-comparison-verdict.ts';
25
+ import { pickHeadVerdict } from './pick-head-verdict.ts';
26
+ import { pickNamedBenchFiles } from './pick-named-bench-files.ts';
27
+ import { pickUnremovedCheckoutState } from './pick-unremoved-checkout-state.ts';
28
+ import { readBenchArgs } from './read-bench-args.ts';
29
+ import type { BenchOutput, BenchVerdict, CheckoutState } from './types.ts';
30
30
 
31
31
  export interface BenchDeps extends ProgramBuildDeps {
32
32
  readonly dietScript: string;
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { afterAll } from 'bun:test';
6
6
  import { hostname } from 'node:os';
7
- import { systemClock } from '../system-clock.ts';
7
+ import { systemClock } from '../command/system-clock.ts';
8
8
  import { laneFiles } from './lane-files.ts';
9
9
  import { readProcessTable } from './read-process-table.ts';
10
10
  import { startBrowser } from './start-browser.ts';
@@ -1,6 +1,6 @@
1
1
  import { join } from 'node:path';
2
- import type { LaneHooks, LaneStartOutcome } from '../lane-hooks.ts';
3
- import { testRunArgs } from '../test-run-args.ts';
2
+ import type { LaneHooks, LaneStartOutcome } from '../lanes/lane-hooks.ts';
3
+ import { testRunArgs } from '../unit/test-run-args.ts';
4
4
  import type { BrowserRun } from './build-browser-run.ts';
5
5
  import type { LaneEnvironments } from './build-lane-environments.ts';
6
6
  import { buildLaneEnvironments } from './build-lane-environments.ts';
@@ -1,5 +1,5 @@
1
- import type { Clock } from '../system-clock.ts';
2
- import { systemClock } from '../system-clock.ts';
1
+ import type { Clock } from '../command/system-clock.ts';
2
+ import { systemClock } from '../command/system-clock.ts';
3
3
 
4
4
  export interface SpawnedProcess {
5
5
  readonly pid: number;
@@ -1,5 +1,5 @@
1
1
  import { match } from 'ts-pattern';
2
- import type { Clock } from '../system-clock.ts';
2
+ import type { Clock } from '../command/system-clock.ts';
3
3
  import { collectDescendantPIDs } from './collect-descendant-pids.ts';
4
4
  import { hasErrorCode } from './has-error-code.ts';
5
5
  import { pickDescendantStopStep } from './pick-descendant-stop-step.ts';
@@ -1,7 +1,7 @@
1
1
  import { hostname, tmpdir, userInfo } from 'node:os';
2
2
  import { join } from 'node:path';
3
- import { buildDietCommand } from '../build-diet-command.ts';
4
- import type { LaneHooks } from '../lane-hooks.ts';
3
+ import type { LaneHooks } from '../lanes/lane-hooks.ts';
4
+ import { buildDietCommand } from '../unit/build-diet-command.ts';
5
5
  import { buildBrowserRun } from './build-browser-run.ts';
6
6
  import { buildRecordedCommand } from './build-recorded-command.ts';
7
7
  import { hasBrowserBuildScript } from './has-browser-build-script.ts';
@@ -1,6 +1,6 @@
1
1
  import { cli } from 'gunshi/bone';
2
2
  import { define } from 'gunshi/definition';
3
- import { formatParseError } from './format-parse-error.ts';
3
+ import { formatParseError } from '../config/format-parse-error.ts';
4
4
 
5
5
  export interface CLIArgs {
6
6
  readonly command: string;