@leitwerk-dev/test-support 0.3.1 → 0.4.1

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 (65) hide show
  1. package/dist/{chunk-JGXSXRIJ.js → chunk-3RWI5WJK.js} +2 -2
  2. package/dist/{chunk-P2FF4AP7.js → chunk-FDXRT6UZ.js} +57 -2
  3. package/dist/chunk-FDXRT6UZ.js.map +1 -0
  4. package/dist/{chunk-5BZSJ4OO.js → chunk-RRE5BNSZ.js} +38 -4
  5. package/dist/chunk-RRE5BNSZ.js.map +1 -0
  6. package/dist/{chunk-WT7V7REB.js → chunk-WRAVDPEM.js} +15 -27
  7. package/dist/chunk-WRAVDPEM.js.map +1 -0
  8. package/dist/dashboard-fixture.d.ts +4 -0
  9. package/dist/dashboard-fixture.d.ts.map +1 -0
  10. package/dist/extension-integration-harness.d.ts +2 -2
  11. package/dist/extension-integration-harness.d.ts.map +1 -1
  12. package/dist/fixtures.d.ts +1 -0
  13. package/dist/fixtures.d.ts.map +1 -1
  14. package/dist/fixtures.js +95 -0
  15. package/dist/fixtures.js.map +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +9 -26
  19. package/dist/index.js.map +1 -1
  20. package/dist/integration-harness.d.ts +2 -0
  21. package/dist/integration-harness.d.ts.map +1 -1
  22. package/dist/integration.d.ts +1 -1
  23. package/dist/integration.d.ts.map +1 -1
  24. package/dist/integration.js +30 -16
  25. package/dist/integration.js.map +1 -1
  26. package/dist/local-git.d.ts +9 -0
  27. package/dist/local-git.d.ts.map +1 -1
  28. package/dist/local-git.js +31 -0
  29. package/dist/local-git.js.map +1 -1
  30. package/dist/model-provider-fixtures.d.ts +7 -0
  31. package/dist/model-provider-fixtures.d.ts.map +1 -1
  32. package/dist/process.d.ts +32 -2
  33. package/dist/process.d.ts.map +1 -1
  34. package/dist/process.js +24 -15
  35. package/dist/process.js.map +1 -1
  36. package/dist/server-extension-test-harness.d.ts +3 -1
  37. package/dist/server-extension-test-harness.d.ts.map +1 -1
  38. package/dist/stub-worker-entry.js +1 -1
  39. package/dist/worker-testing/index.d.ts +1 -1
  40. package/dist/worker-testing/index.d.ts.map +1 -1
  41. package/dist/worker-testing/index.js +7 -4
  42. package/dist/worker-testing/index.js.map +1 -1
  43. package/dist/worker-testing/schema-driven-stub-pi.d.ts.map +1 -1
  44. package/dist/worker-testing/stub-pi-tree-handle.d.ts +2 -0
  45. package/dist/worker-testing/stub-pi-tree-handle.d.ts.map +1 -1
  46. package/dist/worker-testing/worker-start-payload.d.ts.map +1 -1
  47. package/package.json +10 -10
  48. package/src/dashboard-fixture.ts +95 -0
  49. package/src/extension-integration-harness.ts +11 -13
  50. package/src/fixtures.ts +1 -0
  51. package/src/index.ts +2 -0
  52. package/src/integration-harness.ts +17 -1
  53. package/src/integration.ts +1 -0
  54. package/src/local-git.ts +34 -0
  55. package/src/model-provider-fixtures.ts +40 -0
  56. package/src/process.ts +22 -12
  57. package/src/server-extension-test-harness.ts +41 -1
  58. package/src/worker-testing/index.ts +1 -0
  59. package/src/worker-testing/schema-driven-stub-pi.ts +11 -23
  60. package/src/worker-testing/stub-pi-tree-handle.ts +20 -1
  61. package/src/worker-testing/worker-start-payload.ts +1 -0
  62. package/dist/chunk-5BZSJ4OO.js.map +0 -1
  63. package/dist/chunk-P2FF4AP7.js.map +0 -1
  64. package/dist/chunk-WT7V7REB.js.map +0 -1
  65. /package/dist/{chunk-JGXSXRIJ.js.map → chunk-3RWI5WJK.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"stub-pi-tree-handle.d.ts","sourceRoot":"","sources":["../../src/worker-testing/stub-pi-tree-handle.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EACX,oBAAoB,EACpB,YAAY,EAEZ,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,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B,GAAG,OAAO,CAAC,YAAY,CAAC;CA8E/E"}
1
+ {"version":3,"file":"stub-pi-tree-handle.d.ts","sourceRoot":"","sources":["../../src/worker-testing/stub-pi-tree-handle.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EACX,oBAAoB,EACpB,YAAY,EAEZ,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,0BAA0B,EAC1B,WAAW,EACX,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EACX,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,cAAc;AACd,MAAM,WAAW,sBAAsB;IACtC,cAAc;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,gBAAgB;IAChB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,cAAc;AACd,MAAM,MAAM,sBAAsB,GAC/B,sBAAsB,GACtB;IACA,cAAc;IACd,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACzC,cAAc;IACd,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,cAAc;IACd,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,cAAc;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,eAAe,CAAC,EAAE,CACjB,IAAI,EAAE,sBAAsB,EAC5B,MAAM,EAAE,OAAO,KACX,sBAAsB,GAAG,SAAS,CAAC;CACvC,CAAC;AAEL,cAAc;AACd,MAAM,WAAW,iCAAiC;IACjD,cAAc;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,mFAAmF;IAC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AgB;IAChB,2BAA2B,CAAC,EAAE,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;IAChF,gBAAgB;IAChB,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,gBAAgB;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,gBAAgB;IAChB,UAAU,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC7C,gBAAgB;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,4FAA4F;AAC5F,wBAAgB,+BAA+B,CAC9C,OAAO,EAAE,gCAAgC,GACvC,kBAAkB,CAkGpB"}
1
+ {"version":3,"file":"worker-start-payload.d.ts","sourceRoot":"","sources":["../../src/worker-testing/worker-start-payload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAG3B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,gBAAgB;AAChB,KAAK,QAAQ,GAAG,OAAO,CAAC,iBAAiB,EAAE;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAC5D,gBAAgB;AAChB,KAAK,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;AAElC,gBAAgB;AAChB,MAAM,WAAW,gCAAgC;IAChD,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,eAAe,EAAE,uBAAuB,CAAC;IACzC,gBAAgB;IAChB,gBAAgB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC5C,gBAAgB;IAChB,+BAA+B,CAAC,EAAE,kBAAkB,CAAC,iCAAiC,CAAC,CAAC;IACxF,gBAAgB;IAChB,2BAA2B,CAAC,EAAE,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;IAChF,gBAAgB;IAChB,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,gBAAgB;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,gBAAgB;IAChB,UAAU,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC7C,gBAAgB;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,4FAA4F;AAC5F,wBAAgB,+BAA+B,CAC9C,OAAO,EAAE,gCAAgC,GACvC,kBAAkB,CAmGpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leitwerk-dev/test-support",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/leitwerk-dev/leitwerk.git",
@@ -48,15 +48,15 @@
48
48
  "build": "tsup && tsc -p tsconfig.tsup.json --emitDeclarationOnly"
49
49
  },
50
50
  "dependencies": {
51
- "@earendil-works/pi-coding-agent": "^0.81.1",
52
- "@leitwerk-dev/domain": "0.3.1",
53
- "@leitwerk-dev/extension-runtime": "0.3.1",
54
- "@leitwerk-dev/process-sdk": "0.3.1",
55
- "@leitwerk-dev/protocol": "0.3.1",
56
- "@leitwerk-dev/server": "0.3.1",
57
- "@leitwerk-dev/worker": "0.3.1",
58
- "@leitwerk-dev/worker-protocol": "0.3.1",
59
- "@leitwerk-dev/external-writes": "0.3.1"
51
+ "@earendil-works/pi-coding-agent": "^0.87.0",
52
+ "@leitwerk-dev/domain": "0.4.1",
53
+ "@leitwerk-dev/extension-runtime": "0.4.1",
54
+ "@leitwerk-dev/process-sdk": "0.4.1",
55
+ "@leitwerk-dev/protocol": "0.4.1",
56
+ "@leitwerk-dev/server": "0.4.1",
57
+ "@leitwerk-dev/worker": "0.4.1",
58
+ "@leitwerk-dev/worker-protocol": "0.4.1",
59
+ "@leitwerk-dev/external-writes": "0.4.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "tsup": "^8.5.1"
@@ -0,0 +1,95 @@
1
+ import type { DashboardResponseBody } from "@leitwerk-dev/protocol/http-contracts";
2
+
3
+ /** Representative server-ordered dashboard data, fresh for each test. @internal */
4
+ export function createDashboardFixture(): DashboardResponseBody {
5
+ return {
6
+ generatedAt: "2026-10-14T10:30:00.000Z",
7
+ definitions: {
8
+ total: 4,
9
+ items: [
10
+ { id: "smoke", name: "Kubernetes Smoke" },
11
+ { id: "poem_creator_process", name: "Poem Creator" },
12
+ { id: "repo_change", name: "Repository Change" },
13
+ { id: "single_prompt_process", name: "Single Prompt" },
14
+ ],
15
+ },
16
+ watchers: {
17
+ total: 4,
18
+ enabled: 3,
19
+ items: [
20
+ { id: "paused", name: "Paused trigger", enabled: false },
21
+ { id: "poem", name: "Poem file", enabled: true },
22
+ { id: "repo", name: "Repository issues", enabled: true },
23
+ { id: "schedule", name: "Scheduled checks", enabled: true },
24
+ ],
25
+ },
26
+ skills: { total: 9, installed: 4, bundled: 5 },
27
+ processes: {
28
+ total: 27,
29
+ byStatus: [
30
+ { status: "running", count: 3 },
31
+ { status: "waiting", count: 5 },
32
+ { status: "error", count: 2 },
33
+ { status: "completed", count: 16 },
34
+ { status: "aborted", count: 1 },
35
+ ],
36
+ byDefinition: [
37
+ { processId: "single_prompt_process", name: "Single Prompt", count: 14 },
38
+ { processId: "poem_creator_process", name: "Poem Creator", count: 8 },
39
+ { processId: "repo_change", name: "Repository Change", count: 5 },
40
+ ],
41
+ },
42
+ costs: {
43
+ totalUsd: 8.4,
44
+ totalLlmTurnCount: 65,
45
+ pricedTurnCount: 60,
46
+ missingCostTurnCount: 5,
47
+ isPartial: true,
48
+ byModel: [
49
+ "gpt-6.1",
50
+ "gpt-6",
51
+ "gpt-6-mini",
52
+ "claude-sonnet",
53
+ "claude-haiku",
54
+ "historical-model",
55
+ ].map((modelId, index) => ({
56
+ providerId: index < 3 ? "openai" : "anthropic",
57
+ modelId,
58
+ costUsd: (6 - index) * 0.4,
59
+ turnCount: 10,
60
+ })),
61
+ },
62
+ configuration: {
63
+ issues: [
64
+ {
65
+ id: "credential",
66
+ code: "missing_credential",
67
+ severity: "error",
68
+ message: "The review model profile needs a provider credential.",
69
+ sources: [{ label: "Review model", href: "/settings" }],
70
+ },
71
+ {
72
+ id: "default",
73
+ code: "missing_default",
74
+ severity: "warning",
75
+ message: "Repository Change has no default model profile.",
76
+ sources: [{ label: "Repository Change", href: "/settings" }],
77
+ },
78
+ {
79
+ id: "unavailable",
80
+ code: "unavailable_model",
81
+ severity: "error",
82
+ message: "A configured model is unavailable from its provider.",
83
+ sources: [{ label: "Model catalog", href: "/settings" }],
84
+ },
85
+ {
86
+ id: "override",
87
+ code: "invalid_override",
88
+ severity: "warning",
89
+ message: "A turn override references a removed model profile.",
90
+ sources: [{ label: "Turn settings", href: "/settings" }],
91
+ },
92
+ ],
93
+ },
94
+ };
95
+ }
@@ -7,6 +7,7 @@ import path from "node:path";
7
7
  import type {
8
8
  Actor,
9
9
  ExternalWriteLog,
10
+ LaunchModelConfigInput,
10
11
  ProcessInstance,
11
12
  ProcessProject,
12
13
  ProcessTurnRecord,
@@ -27,7 +28,7 @@ import { createPersistentIntegrationFixture } from "./integration-harness.js";
27
28
  import { observe, type TestObservation } from "./observations.js";
28
29
  import { createProcessFixture, type ProcessFixtureOptions } from "./process-fixtures.js";
29
30
  import type { QuestionRequestFixture } from "./supported-question-fixtures.js";
30
- import { StubPiTreeHandleFactory } from "./worker-testing/stub-pi-tree-handle.js";
31
+ import { formatBranchText, StubPiTreeHandleFactory } from "./worker-testing/stub-pi-tree-handle.js";
31
32
 
32
33
  /** Model-visible inputs for a scripted invocation. @public */
33
34
  export interface IntegrationPromptObservation {
@@ -397,7 +398,11 @@ export interface ExtensionIntegrationHarness {
397
398
  /** @public */
398
399
  process(id: string): ExtensionIntegrationProcess;
399
400
  /** @public */
400
- launch(id: string, input: Record<string, unknown>): Promise<ExtensionIntegrationProcess>;
401
+ launch(
402
+ id: string,
403
+ input: Record<string, unknown>,
404
+ modelConfig?: LaunchModelConfigInput,
405
+ ): Promise<ExtensionIntegrationProcess>;
401
406
  /** @public */
402
407
  createProcess<TParams, TState>(
403
408
  definition: ExtensionProcessDefinition<TParams, TState>,
@@ -450,6 +455,7 @@ export async function createExtensionIntegrationHarness(
450
455
  thinking_level: model.thinkingLevel ?? "off",
451
456
  }));
452
457
  if (options.defaultModel) {
458
+ config.pi.default_model_profile = options.defaultModel;
453
459
  config.pi.process_title_generation.model_profile = options.defaultModel;
454
460
  config.process_configs = Object.fromEntries(
455
461
  [...catalog.processes.keys()].map((id) => [
@@ -490,16 +496,7 @@ export async function createExtensionIntegrationHarness(
490
496
  const session = [...piFactory.sessions]
491
497
  .reverse()
492
498
  .find((session) => session.treeFile === input.treeFile);
493
- const history =
494
- session
495
- ?.getBranch()
496
- .map((entry) => {
497
- if (entry.type === "custom_message") return entry.content;
498
- if (entry.type === "message" && entry.message) return entry.message.content;
499
- return "";
500
- })
501
- .filter((value) => typeof value === "string")
502
- .join("\n\n") ?? "";
499
+ const history = formatBranchText(session?.getBranch(), "");
503
500
  const script = manual
504
501
  ? scripts.get(id)
505
502
  : await options.script?.(
@@ -864,9 +861,10 @@ export async function createExtensionIntegrationHarness(
864
861
  /** Get a handle that remains valid across restart. @public */
865
862
  process: processHandle,
866
863
  /** Admit work through a registered UI launcher. @public */
867
- async launch(id, input) {
864
+ async launch(id, input, modelConfig) {
868
865
  const response = await postImmediateLaunch(context().config.server.base_url, id, {
869
866
  launcherInput: input,
867
+ ...(modelConfig ? { modelConfig } : {}),
870
868
  });
871
869
  const body = (await response.json()) as { process?: { id: string } };
872
870
  if (!response.ok || !body.process)
package/src/fixtures.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { createCompactProcessDetailFixtureFactory } from "./compact-process-detail-fixture.js";
2
+ export { createDashboardFixture } from "./dashboard-fixture.js";
2
3
  export {
3
4
  createProcessFixture,
4
5
  createProjectFixture,
package/src/index.ts CHANGED
@@ -4,7 +4,9 @@ export { FakeLlmProvider } from "./fakes/fake-llm.js";
4
4
  export { postImmediateLaunch, postImmediateLaunchRequest } from "./http-launch.js";
5
5
  export {
6
6
  type FixtureModelProviderSet,
7
+ fixtureModelProfiles,
7
8
  fixtureModelProviders,
9
+ withDefaultModelFixture,
8
10
  } from "./model-provider-fixtures.js";
9
11
  export {
10
12
  createPollingTestExtension,
@@ -2,6 +2,7 @@ import { mkdtempSync, rmSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import path from "node:path";
4
4
  import type { ExtensionCatalog } from "@leitwerk-dev/extension-runtime";
5
+ import { buildExtensionCatalogFromModules } from "@leitwerk-dev/extension-runtime/testing";
5
6
  import type { ProvidedCapability } from "@leitwerk-dev/process-sdk";
6
7
  import {
7
8
  type AppContext,
@@ -14,6 +15,18 @@ import {
14
15
  createInProcessWorkerSpawn,
15
16
  type InProcessWorkerSpawnOptions,
16
17
  } from "./in-process-worker.js";
18
+ import { withDefaultModelFixture } from "./model-provider-fixtures.js";
19
+
20
+ /** Server fixture with an explicit synthetic model when the test supplies no model catalog. @internal */
21
+ export async function createTestAppContext(options: AppOptions = {}): Promise<AppContext> {
22
+ const config = options.config ?? getDefaultConfig();
23
+ const catalog = await (options.extensionCatalog ?? buildExtensionCatalogFromModules([]));
24
+ return createAppContext({
25
+ ...options,
26
+ config,
27
+ extensionCatalog: withDefaultModelFixture(config, catalog),
28
+ });
29
+ }
17
30
 
18
31
  /** @public */
19
32
  export interface IntegrationHarness<
@@ -117,7 +130,10 @@ export async function createIntegrationHarness<
117
130
  }
118
131
  opts.configOverride?.(config);
119
132
 
120
- const extensionCatalog = await Promise.resolve(opts.extensionCatalog);
133
+ const extensionCatalog = withDefaultModelFixture(
134
+ config,
135
+ await Promise.resolve(opts.extensionCatalog),
136
+ );
121
137
 
122
138
  const appOpts: AppOptions = {
123
139
  logger: false,
@@ -22,6 +22,7 @@ export {
22
22
  export {
23
23
  createIntegrationHarness,
24
24
  createPersistentIntegrationFixture,
25
+ createTestAppContext,
25
26
  type IntegrationHarness,
26
27
  } from "./integration-harness.js";
27
28
  export { waitForValue } from "./polling.js";
package/src/local-git.ts CHANGED
@@ -1,13 +1,17 @@
1
1
  import { execFileSync } from "node:child_process";
2
2
  import {
3
+ cpSync,
3
4
  existsSync,
4
5
  lstatSync,
5
6
  mkdirSync,
7
+ mkdtempSync,
6
8
  readFileSync,
7
9
  realpathSync,
8
10
  renameSync,
11
+ rmSync,
9
12
  writeFileSync,
10
13
  } from "node:fs";
14
+ import { tmpdir } from "node:os";
11
15
  import path from "node:path";
12
16
  import type { RepositoryFeedbackItem, RepositoryPullRequest } from "@leitwerk-dev/process-sdk";
13
17
  import { traceTestSubprocess } from "./test-diagnostics.js";
@@ -33,6 +37,36 @@ export interface LocalRepositorySeed {
33
37
  signoff?: boolean;
34
38
  }
35
39
 
40
+ /** Copies immutable bare seeds into independent test fixtures. @internal */
41
+ export class LocalGitSeedCache {
42
+ private root: string | undefined;
43
+ private readonly templates = new Map<string, string>();
44
+
45
+ /** Seed options select the template; an existing destination is never overwritten. @internal */
46
+ copy(git: LocalGit, seed: LocalRepositorySeed): string {
47
+ const key = JSON.stringify(seed);
48
+ let template = this.templates.get(key);
49
+ if (!template) {
50
+ this.root ??= mkdtempSync(path.join(tmpdir(), "leitwerk-git-seeds-"));
51
+ const directory = mkdtempSync(path.join(this.root, "seed-"));
52
+ template = new LocalGit(directory).seed(seed).bare;
53
+ this.templates.set(key, template);
54
+ }
55
+ const destination = localPath(git.root, `repositories/${path.basename(template)}`);
56
+ if (existsSync(destination)) throw new Error("Git seed destination already exists");
57
+ mkdirSync(path.dirname(destination), { recursive: true });
58
+ cpSync(template, destination, { recursive: true, force: false, errorOnExist: true });
59
+ return destination;
60
+ }
61
+
62
+ /** Release templates after the suite; copied repositories remain usable. @internal */
63
+ close(): void {
64
+ if (this.root) rmSync(this.root, { recursive: true, force: true });
65
+ this.root = undefined;
66
+ this.templates.clear();
67
+ }
68
+ }
69
+
36
70
  /** Reject escaping paths and symlinks, including a not-yet-created file's parents. @public */
37
71
  export function localPath(root: string, relative: string): string {
38
72
  if (lstatSync(root, { throwIfNoEntry: false })?.isSymbolicLink())
@@ -1,8 +1,22 @@
1
+ import type { ExtensionCatalog } from "@leitwerk-dev/extension-runtime";
1
2
  import {
2
3
  builtinPiProvider,
3
4
  defineModelProvider,
4
5
  defineModelProviders,
5
6
  } from "@leitwerk-dev/process-sdk";
7
+ import type { ConfigSnapshot } from "@leitwerk-dev/protocol";
8
+ import type { ExtensionIntegrationHarnessOptions } from "./extension-integration-harness.js";
9
+
10
+ /** @internal */
11
+ export const fixtureModelProfiles: NonNullable<ExtensionIntegrationHarnessOptions["models"]> = [
12
+ {
13
+ id: "claude_fast",
14
+ thinkingLevel: "medium",
15
+ provider: "anthropic",
16
+ modelId: "claude-sonnet-4-20250514",
17
+ },
18
+ { id: "local_qwen", thinkingLevel: "low", provider: "ollama", modelId: "qwen2.5-coder:14b" },
19
+ ];
6
20
 
7
21
  /** @public */
8
22
  export type FixtureModelProviderSet = ReturnType<typeof defineModelProviders>;
@@ -34,3 +48,29 @@ export function fixtureModelProviders(
34
48
  })),
35
49
  );
36
50
  }
51
+
52
+ /** Explicit model wiring for server tests that do not exercise an LLM. @internal */
53
+ export function withDefaultModelFixture(
54
+ config: ConfigSnapshot,
55
+ catalog: ExtensionCatalog,
56
+ ): ExtensionCatalog {
57
+ if (config.pi.model_profiles.length === 0 && !config.pi.default_model_profile) {
58
+ config.pi.default_model_profile = "test-support-fixture";
59
+ config.pi.model_profiles = [
60
+ { id: "test-support-fixture", provider: "test-support-fixture", model_id: "fixture" },
61
+ ];
62
+ }
63
+ if (!config.pi.model_profiles.some((profile) => profile.provider === "test-support-fixture"))
64
+ return catalog;
65
+ return {
66
+ ...catalog,
67
+ modelProviders: [
68
+ ...catalog.modelProviders,
69
+ {
70
+ ownerExtensionId: "test-support-fixture",
71
+ packageName: "@leitwerk-dev/test-support",
72
+ resolve: fixtureModelProviders({ id: "test-support-fixture", modelId: "fixture" }),
73
+ },
74
+ ],
75
+ };
76
+ }
package/src/process.ts CHANGED
@@ -383,6 +383,8 @@ export async function createExtensionTestHarness(options: ExtensionTestHarnessOp
383
383
  name: string,
384
384
  args: Record<string, unknown>,
385
385
  fixture: ExtensionToolFixture = {},
386
+ /** @internal */
387
+ reportProgress: (report: TurnProgressReport) => void = () => {},
386
388
  ) {
387
389
  assertOpen();
388
390
  const tool = tools.get(name);
@@ -415,6 +417,7 @@ export async function createExtensionTestHarness(options: ExtensionTestHarnessOp
415
417
  process,
416
418
  projects,
417
419
  turn,
420
+ reportProgress,
418
421
  project:
419
422
  projects.find((project) => project.key === args.projectKey) ??
420
423
  (projects.length === 1 ? (projects[0] ?? null) : null),
@@ -647,6 +650,9 @@ export async function createExtensionTestHarness(options: ExtensionTestHarnessOp
647
650
  const prompts: string[] = [];
648
651
  const tools: { name: string; arguments: Record<string, unknown> }[] = [];
649
652
  const progress: TurnProgressReport[] = [];
653
+ const reportProgress = (report: TurnProgressReport) => {
654
+ progress.push(structuredClone(report));
655
+ };
650
656
  const completed: ExtensionTurnResponse[] = [];
651
657
  const requestedTools = new Set<string>();
652
658
  const parked: (string | undefined)[] = [];
@@ -664,18 +670,21 @@ export async function createExtensionTestHarness(options: ExtensionTestHarnessOp
664
670
  if (!allowed?.includes(name))
665
671
  throw new Error(`Integration tool '${name}' is not declared for '${id}'`);
666
672
  tools.push({ name, arguments: structuredClone(args) });
667
- return callTool(name, args, {
668
- ...defaults,
669
- ...options.fixture,
670
- processId: definition.id,
671
- params: base.params,
672
- state: base.state,
673
- position: { selectedTurnId: id, lifecycleStatus: "active" },
674
- });
675
- },
676
- reportProgress: (report: TurnProgressReport) => {
677
- progress.push(structuredClone(report));
673
+ return callTool(
674
+ name,
675
+ args,
676
+ {
677
+ ...defaults,
678
+ ...options.fixture,
679
+ processId: definition.id,
680
+ params: base.params,
681
+ state: base.state,
682
+ position: { selectedTurnId: id, lifecycleStatus: "active" },
683
+ },
684
+ reportProgress,
685
+ );
678
686
  },
687
+ reportProgress,
679
688
  };
680
689
  await handler({
681
690
  ctx,
@@ -686,7 +695,6 @@ export async function createExtensionTestHarness(options: ExtensionTestHarnessOp
686
695
  ...(def.resolveIntegrationTools?.(base.params, base.state) ??
687
696
  def.integrationTools ??
688
697
  []),
689
- ...(def.askQuestions ? ["ask_questions"] : []),
690
698
  ])
691
699
  requestedTools.add(name);
692
700
  const prepared = await def.prepare?.({
@@ -694,6 +702,8 @@ export async function createExtensionTestHarness(options: ExtensionTestHarnessOp
694
702
  callIntegrationTool: ctx.callIntegrationTool,
695
703
  reportProgress: ctx.reportProgress,
696
704
  });
705
+ if (def.askQuestions && (def.resolveAskQuestions?.({ ...ctx, prepared }) ?? true))
706
+ requestedTools.add("ask_questions");
697
707
  prompts.push(await def.prompt({ ...ctx, prepared }));
698
708
  const response = responses.shift();
699
709
  if (!response)
@@ -28,6 +28,8 @@ export function createPollingTestExtension<T>(
28
28
  poll(): Promise<T>;
29
29
  }
30
30
  | undefined,
31
+ /** Disable scheduled polling so tests control every observation. @internal */
32
+ manual = false,
31
33
  ) {
32
34
  let provider: ReturnType<typeof setup>;
33
35
  return {
@@ -35,7 +37,26 @@ export function createPollingTestExtension<T>(
35
37
  manifest,
36
38
  /** @internal */
37
39
  setupServer(api: ServerExtensionAPI) {
38
- provider = setup(api);
40
+ provider = setup(
41
+ manual
42
+ ? {
43
+ ...api,
44
+ get<T>(token: import("@leitwerk-dev/process-sdk").CapabilityToken<T>) {
45
+ const value = api.get(token);
46
+ return token === coreHostCapabilities.serverSetup && value && !Array.isArray(value)
47
+ ? ({
48
+ ...value,
49
+ polling: {
50
+ create: ({ pollOnce }: { pollOnce: () => Promise<unknown> }) => ({
51
+ poll: pollOnce,
52
+ }),
53
+ },
54
+ } as T)
55
+ : value;
56
+ },
57
+ }
58
+ : api,
59
+ );
39
60
  },
40
61
  /** @public */
41
62
  poll() {
@@ -115,6 +136,22 @@ function createDefaultServerSetupDeps(): CoreServerSetupDeps {
115
136
  serverBaseUrl: "https://leitwerk.example",
116
137
  components: {},
117
138
  externalWrites: createInMemoryExternalWriteLog(),
139
+ publications: {
140
+ publication: () => null,
141
+ publicationByExternalId: () => null,
142
+ reservePublication() {
143
+ throw new Error("Configure publication storage for this test");
144
+ },
145
+ finishPublication() {
146
+ throw new Error("Configure publication storage for this test");
147
+ },
148
+ releaseRejectedPublication() {
149
+ throw new Error("Configure publication storage for this test");
150
+ },
151
+ markPublicationTriggered() {
152
+ throw new Error("Configure publication storage for this test");
153
+ },
154
+ },
118
155
  polling: {
119
156
  create(options) {
120
157
  return { poll: options.pollOnce };
@@ -140,6 +177,7 @@ function createDefaultServerSetupDeps(): CoreServerSetupDeps {
140
177
  events: { create: () => {}, listByInstance: () => [] },
141
178
  broadcaster: { sendDurable: () => {} },
142
179
  commands: {
180
+ applyProcessObservation: async () => ({ ok: true, process: null }),
143
181
  getDeferredProcessActivationSnapshots: () => ({ outcome: "process_not_found" }),
144
182
  activateDeferredProcess: async () => ({
145
183
  ok: true,
@@ -154,6 +192,7 @@ function createDefaultServerSetupDeps(): CoreServerSetupDeps {
154
192
  startProcess: async () => ({ ok: true, process: null }),
155
193
  abortProcess: async () => ({ ok: true, process: null }),
156
194
  retryProcess: async () => ({ ok: true, process: null }),
195
+ retryStartupAutomatically: async () => ({ ok: true, process: null }),
157
196
  continueFailedTurn: async () => ({ ok: true, process: null }),
158
197
  queueInputs: async () => ({ ok: true, process: null }),
159
198
  },
@@ -172,6 +211,7 @@ function createDefaultServerSetupDeps(): CoreServerSetupDeps {
172
211
  resolveUiOptions: async () => ({}),
173
212
  resolveUiRelaunchInput: async (_launcherId, previousInput) => ({ ...previousInput }),
174
213
  resolveUiLauncher: async () => ({ ok: false as const, errors: [] }),
214
+ resolveUiLauncherPreview: async () => ({ ok: false as const, errors: [] }),
175
215
  },
176
216
  launcherRecentValues: {
177
217
  list: () => ({}),
@@ -2,6 +2,7 @@ export { flushAsyncWork } from "@leitwerk-dev/worker-protocol";
2
2
  export { createInProcessWorkerSpawn } from "../in-process-worker.js";
3
3
  export { createStubToolScriptController } from "./stub-pi-controls.js";
4
4
  export {
5
+ formatBranchText,
5
6
  StubPiTreeHandle,
6
7
  StubPiTreeHandleFactory,
7
8
  type StubToolCallScriptCall,
@@ -46,33 +46,21 @@ export function synthesizeStubToolArgs(
46
46
 
47
47
  /** @internal */
48
48
  export function createSchemaDrivenToolCallScriptResolver(): StubToolCallScriptResolver {
49
- return ({ tools }: StubToolCallScriptResolverContext) => {
49
+ return ({ tools: availableTools }: StubToolCallScriptResolverContext) => {
50
+ // Failure requires an explicit script; the default stub completes successful turns.
51
+ const tools = availableTools.filter((tool) => tool.name !== "abort_turn");
50
52
  const markdownTool = tools.find((tool) => tool.name === "markdown_result");
51
53
  const completionTool = tools.find(
52
54
  (tool) => tool.name !== "markdown_result" && tool.name !== "upload_result_images",
53
55
  );
54
- if (markdownTool && completionTool) {
55
- return {
56
- calls: [
57
- {
58
- toolName: markdownTool.name,
59
- args: synthesizeStubToolArgs(markdownTool.parameters),
60
- },
61
- {
62
- toolName: completionTool.name,
63
- args: synthesizeStubToolArgs(completionTool.parameters),
64
- },
65
- ],
66
- };
67
- }
68
- const tool = markdownTool ?? completionTool ?? tools[0];
69
- if (!tool) {
70
- return undefined;
71
- }
72
- return {
73
- toolName: tool.name,
74
- args: synthesizeStubToolArgs(tool.parameters),
75
- };
56
+ const selectedTools =
57
+ markdownTool && completionTool
58
+ ? [markdownTool, completionTool]
59
+ : [markdownTool ?? completionTool ?? tools[0]];
60
+ const calls = selectedTools
61
+ .filter((tool) => tool !== undefined)
62
+ .map((tool) => ({ toolName: tool.name, args: synthesizeStubToolArgs(tool.parameters) }));
63
+ return calls.length > 1 ? { calls } : calls[0];
76
64
  };
77
65
  }
78
66
 
@@ -93,6 +93,25 @@ export type StubToolCallScriptResolver = (
93
93
  context: StubToolCallScriptResolverContext,
94
94
  ) => StubToolCallScriptItem | undefined | Promise<StubToolCallScriptItem | undefined>;
95
95
 
96
+ /** Formats textual branch entries without choosing a session. @internal */
97
+ export function formatBranchText(
98
+ entries: readonly PiTreeEntry[] = [],
99
+ missingMessageText?: string,
100
+ ): string {
101
+ return entries
102
+ .map((entry) =>
103
+ entry.type === "custom_message"
104
+ ? entry.content
105
+ : entry.type === "message"
106
+ ? entry.message
107
+ ? entry.message.content
108
+ : missingMessageText
109
+ : "",
110
+ )
111
+ .filter((value): value is string => typeof value === "string")
112
+ .join("\n\n");
113
+ }
114
+
96
115
  function stringifyToolResult(result: unknown): string {
97
116
  if (typeof result === "string") {
98
117
  return result;
@@ -673,7 +692,7 @@ export class StubPiTreeHandle implements PiTreeHandle {
673
692
  createdEntryIds.push(intermediateEntryId);
674
693
  }
675
694
  }
676
- } else if (tools.size > 0 && !hasScriptedChunks) {
695
+ } else if ([...tools.keys()].some((name) => name !== "abort_turn") && !hasScriptedChunks) {
677
696
  throw new Error(
678
697
  `Stub Pi prompt requires a stub tool-call script when tools are provided (${[...tools.keys()].join(", ")})`,
679
698
  );
@@ -90,6 +90,7 @@ export function createTestLlmWorkerStartPayload(
90
90
  ]);
91
91
  const configSnapshot = createTestConfigSnapshot();
92
92
  configSnapshot.pi.agent_dir = path.join(options.root, "agent");
93
+ configSnapshot.pi.default_model_profile = model.profileId;
93
94
  configSnapshot.pi.model_profiles = [
94
95
  {
95
96
  id: model.profileId,