@agent-teams/engineering-foundation 1.10.2 → 2.0.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 (113) hide show
  1. package/assets/windows-managed-process/bootstrap.ps1 +2 -2
  2. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.d.ts.map +1 -1
  3. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.js +16 -1
  4. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.js.map +1 -1
  5. package/dist/capabilities/quality-gate-runner/application/policies/quality-gate-input.js +1 -1
  6. package/dist/capabilities/quality-gate-runner/application/policies/quality-gate-input.js.map +1 -1
  7. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/check-changed-command.d.ts +6 -0
  8. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/check-changed-command.d.ts.map +1 -0
  9. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/check-changed-command.js +9 -0
  10. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/check-changed-command.js.map +1 -0
  11. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy-v2.d.ts +7 -0
  12. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy-v2.d.ts.map +1 -0
  13. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy-v2.js +9 -0
  14. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy-v2.js.map +1 -0
  15. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-versioned-agent-workflow-policy.d.ts +20 -0
  16. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-versioned-agent-workflow-policy.d.ts.map +1 -0
  17. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-versioned-agent-workflow-policy.js +23 -0
  18. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-versioned-agent-workflow-policy.js.map +1 -0
  19. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/parse-agent-workflow-policy-v2.d.ts +3 -0
  20. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/parse-agent-workflow-policy-v2.d.ts.map +1 -0
  21. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/parse-agent-workflow-policy-v2.js +110 -0
  22. package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/parse-agent-workflow-policy-v2.js.map +1 -0
  23. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/mutable-check-input-custody.d.ts +8 -0
  24. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/mutable-check-input-custody.d.ts.map +1 -0
  25. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/mutable-check-input-custody.js +154 -0
  26. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/mutable-check-input-custody.js.map +1 -0
  27. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/mutable-pnpm-check-runner.d.ts +9 -0
  28. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/mutable-pnpm-check-runner.d.ts.map +1 -0
  29. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/mutable-pnpm-check-runner.js +72 -0
  30. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/mutable-pnpm-check-runner.js.map +1 -0
  31. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/pnpm-package-script-runner.d.ts.map +1 -1
  32. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/pnpm-package-script-runner.js +23 -6
  33. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/pnpm-package-script-runner.js.map +1 -1
  34. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/qualified-pnpm-check-runner.d.ts +44 -0
  35. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/qualified-pnpm-check-runner.d.ts.map +1 -0
  36. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/qualified-pnpm-check-runner.js +279 -0
  37. package/dist/capabilities/repository-agent-workflow/adapters/outbound/pnpm/qualified-pnpm-check-runner.js.map +1 -0
  38. package/dist/capabilities/repository-agent-workflow/application/model/check-changed.d.ts +102 -0
  39. package/dist/capabilities/repository-agent-workflow/application/model/check-changed.d.ts.map +1 -0
  40. package/dist/capabilities/repository-agent-workflow/application/model/check-changed.js +2 -0
  41. package/dist/capabilities/repository-agent-workflow/application/model/check-changed.js.map +1 -0
  42. package/dist/capabilities/repository-agent-workflow/application/policies/check-cancellation.d.ts +4 -0
  43. package/dist/capabilities/repository-agent-workflow/application/policies/check-cancellation.d.ts.map +1 -0
  44. package/dist/capabilities/repository-agent-workflow/application/policies/check-cancellation.js +6 -0
  45. package/dist/capabilities/repository-agent-workflow/application/policies/check-cancellation.js.map +1 -0
  46. package/dist/capabilities/repository-agent-workflow/application/policies/check-coverage.d.ts +10 -0
  47. package/dist/capabilities/repository-agent-workflow/application/policies/check-coverage.d.ts.map +1 -0
  48. package/dist/capabilities/repository-agent-workflow/application/policies/check-coverage.js +38 -0
  49. package/dist/capabilities/repository-agent-workflow/application/policies/check-coverage.js.map +1 -0
  50. package/dist/capabilities/repository-agent-workflow/application/policies/evaluate-repository-agent-workflow.d.ts +5 -0
  51. package/dist/capabilities/repository-agent-workflow/application/policies/evaluate-repository-agent-workflow.d.ts.map +1 -1
  52. package/dist/capabilities/repository-agent-workflow/application/policies/evaluate-repository-agent-workflow.js +30 -4
  53. package/dist/capabilities/repository-agent-workflow/application/policies/evaluate-repository-agent-workflow.js.map +1 -1
  54. package/dist/capabilities/repository-agent-workflow/application/policies/test-dispatch-observation.d.ts +3 -0
  55. package/dist/capabilities/repository-agent-workflow/application/policies/test-dispatch-observation.d.ts.map +1 -0
  56. package/dist/capabilities/repository-agent-workflow/application/policies/test-dispatch-observation.js +40 -0
  57. package/dist/capabilities/repository-agent-workflow/application/policies/test-dispatch-observation.js.map +1 -0
  58. package/dist/capabilities/repository-agent-workflow/application/ports/check-changed.d.ts +53 -0
  59. package/dist/capabilities/repository-agent-workflow/application/ports/check-changed.d.ts.map +1 -0
  60. package/dist/capabilities/repository-agent-workflow/application/ports/check-changed.js +27 -0
  61. package/dist/capabilities/repository-agent-workflow/application/ports/check-changed.js.map +1 -0
  62. package/dist/capabilities/repository-agent-workflow/application/ports/contained-file-reader.d.ts +11 -0
  63. package/dist/capabilities/repository-agent-workflow/application/ports/contained-file-reader.d.ts.map +1 -0
  64. package/dist/capabilities/repository-agent-workflow/application/ports/contained-file-reader.js +2 -0
  65. package/dist/capabilities/repository-agent-workflow/application/ports/contained-file-reader.js.map +1 -0
  66. package/dist/capabilities/repository-agent-workflow/application/use-cases/analyze-repository-agent-workflow.d.ts +6 -0
  67. package/dist/capabilities/repository-agent-workflow/application/use-cases/analyze-repository-agent-workflow.d.ts.map +1 -1
  68. package/dist/capabilities/repository-agent-workflow/application/use-cases/analyze-repository-agent-workflow.js +5 -1
  69. package/dist/capabilities/repository-agent-workflow/application/use-cases/analyze-repository-agent-workflow.js.map +1 -1
  70. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-check-changed-agent-workflow.d.ts +12 -0
  71. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-check-changed-agent-workflow.d.ts.map +1 -0
  72. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-check-changed-agent-workflow.js +182 -0
  73. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-check-changed-agent-workflow.js.map +1 -0
  74. package/dist/capabilities/repository-agent-workflow/composition/node-commands.d.ts +5 -2
  75. package/dist/capabilities/repository-agent-workflow/composition/node-commands.d.ts.map +1 -1
  76. package/dist/capabilities/repository-agent-workflow/composition/node-commands.js +48 -23
  77. package/dist/capabilities/repository-agent-workflow/composition/node-commands.js.map +1 -1
  78. package/dist/capabilities/repository-agent-workflow/module.d.ts +2 -2
  79. package/dist/capabilities/repository-agent-workflow/module.d.ts.map +1 -1
  80. package/dist/capabilities/repository-agent-workflow/module.js +24 -10
  81. package/dist/capabilities/repository-agent-workflow/module.js.map +1 -1
  82. package/dist/capabilities/source-dependencies/adapters/outbound/node/node-source-dependency-resolver.d.ts.map +1 -1
  83. package/dist/capabilities/source-dependencies/adapters/outbound/node/node-source-dependency-resolver.js +4 -2
  84. package/dist/capabilities/source-dependencies/adapters/outbound/node/node-source-dependency-resolver.js.map +1 -1
  85. package/dist/features/command-host/adapters/inbound/cli/cli-arguments.d.ts.map +1 -1
  86. package/dist/features/command-host/adapters/inbound/cli/cli-arguments.js +3 -2
  87. package/dist/features/command-host/adapters/inbound/cli/cli-arguments.js.map +1 -1
  88. package/dist/features/command-host/adapters/inbound/cli/foundation-cli.d.ts.map +1 -1
  89. package/dist/features/command-host/adapters/inbound/cli/foundation-cli.js +17 -11
  90. package/dist/features/command-host/adapters/inbound/cli/foundation-cli.js.map +1 -1
  91. package/dist/features/command-host/application/command-services.d.ts +4 -0
  92. package/dist/features/command-host/application/command-services.d.ts.map +1 -1
  93. package/dist/features/configuration-input/application/static-host-command.d.ts +8 -0
  94. package/dist/features/configuration-input/application/static-host-command.d.ts.map +1 -0
  95. package/dist/features/configuration-input/application/static-host-command.js +17 -0
  96. package/dist/features/configuration-input/application/static-host-command.js.map +1 -0
  97. package/dist/features/quality-coverage/adapters/consumer-observations.d.ts.map +1 -1
  98. package/dist/features/quality-coverage/adapters/consumer-observations.js +6 -5
  99. package/dist/features/quality-coverage/adapters/consumer-observations.js.map +1 -1
  100. package/dist/features/quality-coverage/adapters/profile-input.d.ts +2 -0
  101. package/dist/features/quality-coverage/adapters/profile-input.d.ts.map +1 -1
  102. package/dist/features/quality-coverage/adapters/profile-input.js +8 -0
  103. package/dist/features/quality-coverage/adapters/profile-input.js.map +1 -1
  104. package/dist/features/quality-coverage/api.d.ts +1 -1
  105. package/dist/features/quality-coverage/api.d.ts.map +1 -1
  106. package/dist/features/quality-coverage/api.js +1 -1
  107. package/dist/features/quality-coverage/api.js.map +1 -1
  108. package/dist/features/quality-coverage/application/script-route.d.ts +2 -0
  109. package/dist/features/quality-coverage/application/script-route.d.ts.map +1 -1
  110. package/dist/features/quality-coverage/application/script-route.js +43 -16
  111. package/dist/features/quality-coverage/application/script-route.js.map +1 -1
  112. package/package.json +1 -1
  113. package/schemas/repository-agent-workflow/v2.schema.json +258 -18
@@ -0,0 +1,72 @@
1
+ import { isCheckCancelled } from "../../../application/policies/check-cancellation.js";
2
+ import { randomUUID } from "node:crypto";
3
+ import { performance } from "node:perf_hooks";
4
+ import { CoverageExecutionFailure, InputRevocationError } from "../../../application/ports/check-changed.js";
5
+ import { PnpmPackageScriptRunner } from "./pnpm-package-script-runner.js";
6
+ import { pnpmLifecycleIsolationArgs } from "./qualified-pnpm-check-runner.js";
7
+ import { BunPackageScriptRunner } from "../bun/bun-package-script-runner.js";
8
+ /** Honest feedback for the current CLI Host: no trusted tool/script closure or
9
+ * frozen custody is available. No facets or test observations are qualified. */
10
+ function createMutableCheckRunner(scriptRunner) {
11
+ return {
12
+ async run({ lease, check, packageManager, signal }) {
13
+ if (lease.classification !== "mutable") {
14
+ throw new Error("Feedback runner requires mutable custody.");
15
+ }
16
+ const binding = { invocationId: randomUUID(), sourceIdentity: lease.sourceIdentity, configIdentity: lease.configIdentity, checkId: check.id };
17
+ const commands = [];
18
+ const start = performance.now();
19
+ let exitCode = 0;
20
+ const result = () => ({ binding, commands, exitCode, durationMs: performance.now() - start, cancelled: isCheckCancelled(signal), output: "Unqualified mutable command feedback; raw output omitted.", observation: null, qualifiedFacets: [] });
21
+ let admissionRevoked = true;
22
+ try {
23
+ for (const script of [...check.prerequisites, check.script]) {
24
+ await lease.assertCurrent(signal);
25
+ if (isCheckCancelled(signal)) {
26
+ break;
27
+ }
28
+ const commandStart = performance.now();
29
+ admissionRevoked = false;
30
+ const execution = await scriptRunner.run({ packageManager, consumerRoot: lease.executionRoot, script, paths: [], ...(signal === undefined ? {} : { signal }) }).catch((error) => {
31
+ commands.push({ script, exitCode: null, durationMs: performance.now() - commandStart });
32
+ throw error;
33
+ });
34
+ commands.push({ script, exitCode: execution.exitCode, durationMs: performance.now() - commandStart });
35
+ exitCode = execution.exitCode;
36
+ admissionRevoked = true;
37
+ if (exitCode !== 0 || isCheckCancelled(signal)) {
38
+ break;
39
+ }
40
+ }
41
+ await lease.assertCurrent(signal);
42
+ return result();
43
+ }
44
+ catch (error) {
45
+ // Admission revocation classifies as revoked (stale) regardless of how
46
+ // many commands ran; a raw rethrow would surface as a plain failure and
47
+ // make the outcome depend on timing.
48
+ if (error instanceof InputRevocationError) {
49
+ throw new CoverageExecutionFailure(result(), true);
50
+ }
51
+ if (commands.length === 0) {
52
+ throw error;
53
+ }
54
+ exitCode ||= 1;
55
+ throw new CoverageExecutionFailure(result(), admissionRevoked);
56
+ }
57
+ }
58
+ };
59
+ }
60
+ /** Mutable feedback over pnpm with lifecycle and install effects disabled. */
61
+ export function createMutablePnpmCheckRunner(environment, execute) {
62
+ const scriptRunner = new PnpmPackageScriptRunner(environment, (command, args, options) => {
63
+ const index = args.indexOf("run");
64
+ return execute(command, [...args.slice(0, index), ...pnpmLifecycleIsolationArgs, ...args.slice(index)], options);
65
+ });
66
+ return createMutableCheckRunner(scriptRunner);
67
+ }
68
+ /** Mutable feedback over Bun for repositories with packageManager: bun. */
69
+ export function createMutableBunCheckRunner(environment, execute) {
70
+ return createMutableCheckRunner(new BunPackageScriptRunner(environment, execute));
71
+ }
72
+ //# sourceMappingURL=mutable-pnpm-check-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutable-pnpm-check-runner.js","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/pnpm/mutable-pnpm-check-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO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E,CAAC;gBACf,uEAAuE;gBACvE,wEAAwE;gBACxE,qCAAqC;gBACrC,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;oBAAA,MAAM,IAAI,wBAAwB,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;gBAAA,CAAC;gBAChG,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAAA,MAAM,KAAK,CAAC;gBAAA,CAAC;gBACzC,QAAQ,KAAK,CAAC,CAAC;gBACf,MAAM,IAAI,wBAAwB,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,4BAA4B,CAAC,WAAmC,EAAE,OAA+B;IAC/G,MAAM,YAAY,GAAG,IAAI,uBAAuB,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QACvF,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,0BAA0B,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACnH,CAAC,CAAC,CAAC;IACH,OAAO,wBAAwB,CAAC,YAAY,CAAC,CAAC;AAChD,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,2BAA2B,CAAC,WAAkC,EAAE,OAA+B;IAC7G,OAAO,wBAAwB,CAAC,IAAI,sBAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AACpF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm-package-script-runner.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/pnpm/pnpm-package-script-runner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAE1F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAmED,qBAAa,uBAAwB,YAAW,mBAAmB;IAE/D,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF1B,YACmB,WAAW,EAAE,sBAAsB,EACnC,OAAO,EAAE,sBAAsB,EAC9C;IAEE,GAAG,CAAC,KAAK,EAAE;QACf,QAAQ,CAAC,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;QACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,uFAkBA;CACF"}
1
+ {"version":3,"file":"pnpm-package-script-runner.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/pnpm/pnpm-package-script-runner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAE1F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAqFD,qBAAa,uBAAwB,YAAW,mBAAmB;IAE/D,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF1B,YACmB,WAAW,EAAE,sBAAsB,EACnC,OAAO,EAAE,sBAAsB,EAC9C;IAEE,GAAG,CAAC,KAAK,EAAE;QACf,QAAQ,CAAC,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;QACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,uFAkBA;CACF"}
@@ -1,4 +1,4 @@
1
- import { lstat } from "node:fs/promises";
1
+ import { lstat, realpath } from "node:fs/promises";
2
2
  import { delimiter, isAbsolute, resolve } from "node:path";
3
3
  import { rejectWorkflowExecutor } from "../../../application/policies/workflow-input.js";
4
4
  async function isRegularFile(path) {
@@ -7,16 +7,33 @@ async function isRegularFile(path) {
7
7
  }
8
8
  async function nodeEntrypoint(candidates) {
9
9
  for (const candidate of candidates) {
10
- if (candidate !== undefined &&
11
- isAbsolute(candidate) &&
12
- /\.(?:c|m)?js$/u.test(candidate) &&
13
- await isRegularFile(candidate)) {
14
- return candidate;
10
+ if (candidate !== undefined && isAbsolute(candidate)) {
11
+ const canonical = await realpath(candidate).catch(() => null);
12
+ if (canonical !== null &&
13
+ /\.(?:c|m)?js$/iu.test(canonical) &&
14
+ await isRegularFile(canonical)) {
15
+ return canonical;
16
+ }
15
17
  }
16
18
  }
17
19
  return undefined;
18
20
  }
19
21
  async function resolvePnpmInvocation(environment) {
22
+ if (process.platform !== "win32" &&
23
+ environment.npmExecPath !== undefined &&
24
+ isAbsolute(environment.npmExecPath)) {
25
+ // Same precedence as the quality-gate executor: an explicit native
26
+ // npmExecPath wins, classified on the canonical executed target.
27
+ const canonical = await realpath(environment.npmExecPath).catch(() => null);
28
+ if (canonical !== null && await isRegularFile(canonical)) {
29
+ if (!/\.(?:c|m)?js$/iu.test(canonical)) {
30
+ return { command: canonical, argsPrefix: [] };
31
+ }
32
+ }
33
+ else if (!/\.(?:c|m)?js$/iu.test(environment.npmExecPath)) {
34
+ rejectWorkflowExecutor();
35
+ }
36
+ }
20
37
  const pnpmPackageEntrypoint = environment.pnpmHome === undefined
21
38
  ? undefined
22
39
  : resolve(environment.pnpmHome, "..", "pnpm", "bin", "pnpm.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm-package-script-runner.js","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/pnpm/pnpm-package-script-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAezF,KAAK,UAAU,aAAa,CAAC,IAAY;IACvC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrD,OAAO,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;AAChD,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,UAA2C;IAE3C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IACE,SAAS,KAAK,SAAS;YACvB,UAAU,CAAC,SAAS,CAAC;YACrB,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC;YAChC,MAAM,aAAa,CAAC,SAAS,CAAC,EAC9B,CAAC;YAC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js","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/pnpm/pnpm-package-script-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAezF,KAAK,UAAU,aAAa,CAAC,IAAY;IACvC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrD,OAAO,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;AAChD,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,UAA2C;IAE3C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,SAAS,KAAK,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACrD,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;YAC9D,IACE,SAAS,KAAK,IAAI;gBAClB,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;gBACjC,MAAM,aAAa,CAAC,SAAS,CAAC,EAC9B,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,KAAK,UAAU,qBAAqB,CAClC,WAAmC;IAEnC,IACE,OAAO,CAAC,QAAQ,KAAK,OAAO;QAC5B,WAAW,CAAC,WAAW,KAAK,SAAS;QACrC,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,EACnC,CAAC;QACD,mEAAmE;QACnE,iEAAiE;QACjE,MAAM,SAAS,GAAG,MAAM,QAA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I,CAAC,OAAO,CACjB,UAAU,CAAC,OAAO,EAClB,CAAC,GAAG,UAAU,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,EACnC;YACE,GAAG,EAAE,KAAK,CAAC,YAAY;YACvB,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;SAChE,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,44 @@
1
+ import type { CoverageCheck, CoverageFacet } from "../../../application/model/check-changed.js";
2
+ import type { CheckInputLease, CoverageCheckRunner } from "../../../application/ports/check-changed.js";
3
+ import type { ContainedFileReader } from "../../../application/ports/contained-file-reader.js";
4
+ import type { ExecuteWorkflowProcess } from "../../../application/ports/process-execution.js";
5
+ /** Shared pnpm invocation flags: no pre/post lifecycle hooks, no dependency
6
+ * verification, no package-manager version management. Both the qualified and
7
+ * the mutable check runners reuse this constant so they cannot diverge. */
8
+ export declare const pnpmLifecycleIsolationArgs: readonly string[];
9
+ export interface PnpmToolIdentity {
10
+ readonly packageRoot: string;
11
+ readonly version: string;
12
+ readonly entrypointSha256: string;
13
+ readonly packageJsonSha256: string;
14
+ readonly packageTreeSha256: string;
15
+ readonly nodeExecutable: string;
16
+ readonly nodeSha256: string;
17
+ }
18
+ /** Consumer/Host qualifies the transitive commands and prerequisite effects.
19
+ * This record is trusted composition input, never executable workspace config.
20
+ * Files include all relevant enclosing configs/locks, wrappers, and scripts;
21
+ * the Host frozen closure additionally includes dependencies/fixtures/generated
22
+ * inputs. Digests verify identity; they do not qualify command semantics. */
23
+ export interface QualifiedScriptClosure {
24
+ readonly checkId: string;
25
+ readonly scripts: Readonly<Record<string, string>>;
26
+ readonly files: Readonly<Record<string, string>>;
27
+ readonly supplies: readonly CoverageFacet[];
28
+ readonly runnerIdentity: string | null;
29
+ readonly effects: "read-only-inputs-owned-outputs";
30
+ readonly effectiveConfig: {
31
+ readonly enablePrePostScripts: false;
32
+ readonly verifyDepsBeforeRun: false;
33
+ readonly managePackageManagerVersions: false;
34
+ };
35
+ }
36
+ export interface PnpmCheckQualification {
37
+ readonly files: ContainedFileReader;
38
+ readonly tool: PnpmToolIdentity;
39
+ readonly outputRoot: string;
40
+ readonly qualify: (lease: CheckInputLease, check: CoverageCheck) => Promise<QualifiedScriptClosure>;
41
+ }
42
+ export declare function fingerprintPnpmPackage(root: string, files: ContainedFileReader): Promise<string>;
43
+ export declare function createQualifiedPnpmCheckRunner(qualification: PnpmCheckQualification, execute: ExecuteWorkflowProcess): CoverageCheckRunner;
44
+ //# sourceMappingURL=qualified-pnpm-check-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualified-pnpm-check-runner.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/pnpm/qualified-pnpm-check-runner.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAqB,aAAa,EAA+C,MAAM,6CAA6C,CAAC;AAChK,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAExG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAI9F;;2EAE2E;AAC3E,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAItD,CAAC;AAEH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,C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ID } from "node:crypto";
3
+ import { lstat, realpath, mkdtemp, rm, readdir } from "node:fs/promises";
4
+ import { dirname, isAbsolute, join, resolve, relative as relativePath, sep } from "node:path";
5
+ import { performance } from "node:perf_hooks";
6
+ import { CoverageExecutionFailure } from "../../../application/ports/check-changed.js";
7
+ import { parseTestDispatchObservation } from "../../../application/policies/test-dispatch-observation.js";
8
+ import { assertConfigRepositoryRelativePath } from "../../../application/configuration-input.js";
9
+ /** Shared pnpm invocation flags: no pre/post lifecycle hooks, no dependency
10
+ * verification, no package-manager version management. Both the qualified and
11
+ * the mutable check runners reuse this constant so they cannot diverge. */
12
+ export const pnpmLifecycleIsolationArgs = Object.freeze([
13
+ "--config.enablePrePostScripts=false",
14
+ "--config.verifyDepsBeforeRun=false",
15
+ "--config.managePackageManagerVersions=false"
16
+ ]);
17
+ function digest(bytes) { return createHash("sha256").update(bytes).digest("hex"); }
18
+ export async function fingerprintPnpmPackage(root, files) {
19
+ const hash = createHash("sha256");
20
+ let entries = 0, bytes = 0;
21
+ async function walk(path, relative, depth) {
22
+ if (++entries > 10_000 || depth > 32) {
23
+ throw new Error("Pinned package exceeds inventory bound.");
24
+ }
25
+ const metadata = await lstat(path);
26
+ if (metadata.isDirectory()) {
27
+ for (const name of (await readdir(path)).toSorted()) {
28
+ await walk(join(path, name), `${relative}/${name}`, depth + 1);
29
+ }
30
+ }
31
+ else {
32
+ const input = await regular(files, root, path);
33
+ bytes += input.bytes.length;
34
+ if (bytes > 96 * 1024 * 1024) {
35
+ throw new Error("Pinned package exceeds byte bound.");
36
+ }
37
+ hash.update(JSON.stringify([relative, input.mode, digest(input.bytes)]));
38
+ }
39
+ }
40
+ await walk(root, "", 0);
41
+ return hash.digest("hex");
42
+ }
43
+ async function regular(files, root, path, maximum = 16 * 1024 * 1024) {
44
+ const metadata = await lstat(path, { bigint: true });
45
+ if (!metadata.isFile() || metadata.nlink !== 1n || metadata.size > BigInt(maximum)) {
46
+ throw new Error("Pinned input is not a bounded regular file.");
47
+ }
48
+ // The injected reader binds bounded bytes to an opened FD and checks enclosing
49
+ // ancestry. These snapshots retain the qualification's single-link/mode guard.
50
+ const bytes = Buffer.from(await files.read({ root, candidate: path, maxBytes: maximum }));
51
+ const after = await lstat(path, { bigint: true });
52
+ if (BigInt(bytes.length) !== metadata.size || bytes.length > maximum ||
53
+ ["dev", "ino", "mode", "size", "mtimeNs", "ctimeNs", "nlink"].some(key => metadata[key] !== after[key])) {
54
+ throw new Error("Pinned input changed during contained read.");
55
+ }
56
+ return { bytes, mode: Number(metadata.mode) };
57
+ }
58
+ async function contained(files, root, path) {
59
+ assertConfigRepositoryRelativePath(path);
60
+ return (await regular(files, root, join(root, path))).bytes;
61
+ }
62
+ function safeOutput(stdout, stderr) {
63
+ // Never echo raw tool output: scripts can print credentials. Preserve only a
64
+ // bounded diagnostic summary; callers retain protected raw TEST logs.
65
+ return `stdout chars=${stdout.length}; stderr chars=${stderr.length}`;
66
+ }
67
+ function disabledConfig(value) {
68
+ return value !== null && typeof value === "object" && Object.keys(value).length === 3 && ["enablePrePostScripts", "verifyDepsBeforeRun", "managePackageManagerVersions"].every((key) => Object.hasOwn(value, key) && value[key] === false);
69
+ }
70
+ function readOnlyEffects(value) { return value === "read-only-inputs-owned-outputs"; }
71
+ async function verifyPinnedTool(tool, lease, outputRoot, files) {
72
+ if (!isAbsolute(tool.packageRoot) || !isAbsolute(tool.nodeExecutable) || !isAbsolute(outputRoot)) {
73
+ throw new Error("Pinned executable and output paths must be absolute.");
74
+ }
75
+ if (await realpath(tool.packageRoot) !== tool.packageRoot || await realpath(tool.nodeExecutable) !== tool.nodeExecutable || await realpath(lease.executionRoot) !== lease.executionRoot) {
76
+ throw new Error("Pinned roots cannot be aliases.");
77
+ }
78
+ const entrypoint = resolve(tool.packageRoot, "bin/pnpm.mjs");
79
+ const packageBytes = await contained(files, tool.packageRoot, "package.json");
80
+ const manifest = JSON.parse(packageBytes.toString("utf8"));
81
+ if (manifest.name !== "pnpm" || manifest.version !== tool.version || manifest.bin?.pnpm !== "bin/pnpm.mjs" || digest(packageBytes) !== tool.packageJsonSha256 || digest(await contained(files, tool.packageRoot, "bin/pnpm.mjs")) !== tool.entrypointSha256 || digest((await regular(files, dirname(tool.nodeExecutable), tool.nodeExecutable, 256 * 1024 * 1024)).bytes) !== tool.nodeSha256) {
82
+ throw new Error("Pinned pnpm executable/package identity mismatch.");
83
+ }
84
+ if (await fingerprintPnpmPackage(tool.packageRoot, files) !== tool.packageTreeSha256) {
85
+ throw new Error("Transitive pnpm package substitution.");
86
+ }
87
+ return entrypoint;
88
+ }
89
+ async function verifyScriptClosure(lease, check, closure, version, files) {
90
+ if (closure.checkId !== check.id || !readOnlyEffects(closure.effects) || !disabledConfig(closure.effectiveConfig) || closure.supplies.some((facet) => !check.supplies.includes(facet))) {
91
+ throw new Error("Script closure qualification mismatch.");
92
+ }
93
+ const packageInput = JSON.parse((await contained(files, lease.executionRoot, "package.json")).toString("utf8"));
94
+ if (packageInput.packageManager !== `pnpm@${version}`) {
95
+ throw new Error("Consumer pnpm version mismatch.");
96
+ }
97
+ const names = Object.keys(closure.scripts);
98
+ if (names.length === 0 || names.length > 128 || Object.keys(closure.files).length === 0 || Object.keys(closure.files).length > 256 || !Object.hasOwn(closure.files, "package.json") || [check.script, ...check.prerequisites].some((name) => !names.includes(name))) {
99
+ throw new Error("Missing explicit/transitive script closure.");
100
+ }
101
+ for (const name of names) {
102
+ if (!/^[A-Za-z0-9][A-Za-z0-9:_-]{0,79}$/u.test(name) || packageInput.scripts?.[name] !== closure.scripts[name]) {
103
+ throw new Error("Script closure substitution.");
104
+ }
105
+ }
106
+ for (const [path, expected] of Object.entries(closure.files)) {
107
+ if (!/^[a-f0-9]{64}$/u.test(expected) || digest(await contained(files, lease.executionRoot, path)) !== expected) {
108
+ throw new Error("Script/config closure substitution.");
109
+ }
110
+ }
111
+ }
112
+ async function readObservation(input, check, closure, binding) {
113
+ const runnerIdentity = closure.runnerIdentity;
114
+ if (check.observation !== "test-dispatch/v1" || runnerIdentity === null) {
115
+ return null;
116
+ }
117
+ try {
118
+ const { bytes } = await regular(input.files, input.root, input.path, 256 * 1024);
119
+ return parseTestDispatchObservation(JSON.parse(bytes.toString("utf8")), binding, runnerIdentity);
120
+ }
121
+ catch {
122
+ return null;
123
+ }
124
+ }
125
+ function observedFacets(exitCode, cancelled, closure, observation) {
126
+ if (exitCode !== 0 || cancelled) {
127
+ return [];
128
+ }
129
+ return closure.supplies.filter((facet) => facet !== "tests" || observation?.outcome === "passed");
130
+ }
131
+ class OutputTransportFailure extends Error {
132
+ }
133
+ async function directoryIdentity(path) {
134
+ try {
135
+ const metadata = await lstat(path, { bigint: true });
136
+ if (!metadata.isDirectory() || await realpath(path) !== path) {
137
+ throw new Error("Output directory is not canonical.");
138
+ }
139
+ return { dev: metadata.dev, ino: metadata.ino };
140
+ }
141
+ catch (cause) {
142
+ throw new OutputTransportFailure("Output directory identity is unavailable.", { cause });
143
+ }
144
+ }
145
+ async function assertDirectoryIdentity(path, expected) {
146
+ const actual = await directoryIdentity(path);
147
+ if (actual.dev !== expected.dev || actual.ino !== expected.ino) {
148
+ throw new OutputTransportFailure("Output directory identity changed.");
149
+ }
150
+ }
151
+ async function assertOutputTransport(root, rootIdentity, transport, transportIdentity) {
152
+ await assertDirectoryIdentity(root, rootIdentity);
153
+ await assertDirectoryIdentity(transport, transportIdentity);
154
+ }
155
+ async function removeOutputTransport(root, rootIdentity, transport, transportIdentity) {
156
+ // A mismatch leaves cleanup debt with the trusted Host. Never recurse through
157
+ // a substituted ancestor or transport into content this invocation does not own.
158
+ await assertOutputTransport(root, rootIdentity, transport, transportIdentity);
159
+ await rm(transport, { recursive: true, force: true });
160
+ await assertDirectoryIdentity(root, rootIdentity);
161
+ try {
162
+ await lstat(transport);
163
+ }
164
+ catch (error) {
165
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") {
166
+ return;
167
+ }
168
+ throw new OutputTransportFailure("Output transport absence is unconfirmed.", { cause: error });
169
+ }
170
+ throw new OutputTransportFailure("Output transport remains after cleanup.");
171
+ }
172
+ function outputIsContained(source, output) {
173
+ const path = relativePath(source, output);
174
+ return path === "" || (!isAbsolute(path) && path !== ".." && !path.startsWith(`..${sep}`));
175
+ }
176
+ export function createQualifiedPnpmCheckRunner(qualification, execute) {
177
+ const configArgs = pnpmLifecycleIsolationArgs;
178
+ async function verify(lease, check, closure, signal) {
179
+ const tool = qualification.tool;
180
+ const entrypoint = await verifyPinnedTool(tool, lease, qualification.outputRoot, qualification.files);
181
+ await verifyScriptClosure(lease, check, closure, tool.version, qualification.files);
182
+ const options = { cwd: lease.executionRoot, ...(signal === undefined ? {} : { signal }) };
183
+ const version = await execute(tool.nodeExecutable, [entrypoint, "--version"], options);
184
+ if (version.exitCode !== 0 || version.stdout.trim() !== tool.version) {
185
+ throw new Error("Actual pnpm version mismatch.");
186
+ }
187
+ for (const key of ["enablePrePostScripts", "verifyDepsBeforeRun", "managePackageManagerVersions"]) {
188
+ const config = await execute(tool.nodeExecutable, [entrypoint, ...configArgs, "config", "get", key], options);
189
+ if (config.exitCode !== 0 || config.stdout.trim() !== "false") {
190
+ throw new Error("Effective lifecycle/install config mismatch.");
191
+ }
192
+ }
193
+ await lease.assertCurrent(signal);
194
+ return entrypoint;
195
+ }
196
+ return {
197
+ async run({ lease, check, signal }) {
198
+ const closure = await qualification.qualify(lease, check);
199
+ const entrypoint = await verify(lease, check, closure, signal);
200
+ const binding = { invocationId: randomUUID(), sourceIdentity: lease.sourceIdentity, configIdentity: lease.configIdentity, checkId: check.id };
201
+ // Output transport is external to the admitted source/input closure.
202
+ const outputRoot = await realpath(qualification.outputRoot);
203
+ if (outputIsContained(lease.executionRoot, outputRoot)) {
204
+ throw new Error("Observation output must be outside the source closure.");
205
+ }
206
+ const rootIdentity = await directoryIdentity(outputRoot);
207
+ const transport = await mkdtemp(join(outputRoot, "check-observation-"));
208
+ const transportIdentity = await directoryIdentity(transport);
209
+ await assertDirectoryIdentity(outputRoot, rootIdentity);
210
+ const observationPath = join(transport, "observation.json");
211
+ const start = performance.now();
212
+ let stdout = "", stderr = "", exitCode = 0;
213
+ const commands = [];
214
+ let admissionRevoked = true;
215
+ let failedAdmission = false;
216
+ let completed;
217
+ let failure;
218
+ let failed = false;
219
+ const executionFailure = (revoked) => new CoverageExecutionFailure({ binding, commands, exitCode: exitCode || 1, durationMs: performance.now() - start, cancelled: isCheckCancelled(signal), output: safeOutput(stdout, stderr), observation: null, qualifiedFacets: [] }, revoked);
220
+ try {
221
+ for (const script of [...check.prerequisites, check.script]) {
222
+ if (isCheckCancelled(signal)) {
223
+ break;
224
+ }
225
+ await verify(lease, check, closure, signal);
226
+ const args = [entrypoint, ...configArgs, "run", script];
227
+ // Dedicated explicit argv transport to a qualified wrapper, never
228
+ // human stdout parsing, env mutation, or shell interpolation.
229
+ if (script === check.script && check.observation === "test-dispatch/v1") {
230
+ args.push("--", "--foundation-observation", observationPath, "--foundation-binding", JSON.stringify(binding));
231
+ }
232
+ const commandStart = performance.now();
233
+ admissionRevoked = false;
234
+ const result = await execute(qualification.tool.nodeExecutable, args, { cwd: lease.executionRoot, ...(signal === undefined ? {} : { signal }) }).catch((error) => {
235
+ commands.push({ script, exitCode: null, durationMs: performance.now() - commandStart });
236
+ throw error;
237
+ });
238
+ commands.push({ script, exitCode: result.exitCode, durationMs: performance.now() - commandStart });
239
+ stdout = result.stdout;
240
+ stderr = result.stderr;
241
+ exitCode = result.exitCode;
242
+ admissionRevoked = true;
243
+ if (exitCode !== 0 || isCheckCancelled(signal)) {
244
+ break;
245
+ }
246
+ }
247
+ await verify(lease, check, closure, signal);
248
+ await assertOutputTransport(outputRoot, rootIdentity, transport, transportIdentity);
249
+ const observation = await readObservation({ files: qualification.files, root: transport, path: observationPath }, check, closure, binding);
250
+ const qualifiedFacets = observedFacets(exitCode, isCheckCancelled(signal), closure, observation);
251
+ completed = { binding, commands, exitCode, durationMs: performance.now() - start, cancelled: isCheckCancelled(signal), output: safeOutput(stdout, stderr), observation, qualifiedFacets };
252
+ }
253
+ catch (error) {
254
+ failure = error;
255
+ failed = true;
256
+ failedAdmission = admissionRevoked && !(error instanceof OutputTransportFailure);
257
+ }
258
+ // Settle cleanup before returning, preserving an earlier failure instead
259
+ // of allowing finally to overwrite its revocation or execution trace.
260
+ try {
261
+ await removeOutputTransport(outputRoot, rootIdentity, transport, transportIdentity);
262
+ }
263
+ catch (error) {
264
+ if (!failed) {
265
+ failure = error;
266
+ failed = true;
267
+ }
268
+ }
269
+ if (failed || completed === undefined) {
270
+ if (commands.length === 0) {
271
+ throw failure;
272
+ }
273
+ throw executionFailure(failedAdmission);
274
+ }
275
+ return completed;
276
+ }
277
+ };
278
+ }
279
+ //# sourceMappingURL=qualified-pnpm-check-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualified-pnpm-check-runner.js","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/pnpm/qualified-pnpm-check-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAGvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAC1G,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AAEjG;;2EAE2E;AAC3E,MAAM,CAAC,MAAM,0BAA0B,GAAsB,MAAM,CAAC,M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AO,KAAK,EAAE,CAAC;gBACf,OAAO,GAAG,KAAK,CAAC;gBAAC,MAAM,GAAG,IAAI,CAAC;gBAC/B,eAAe,GAAG,gBAAgB,IAAI,CAAC,CAAC,KAAK,YAAY,sBAAsB,CAAC,CAAC;YACnF,CAAC;YACD,yEAAyE;YACzE,sEAAsE;YACtE,IAAI,CAAC;gBAAC,MAAM,qBAAqB,CAAC,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;YAAC,CAAC;YAC5F,OAAO,KAAK,EAAE,CAAC;gBAAC,IAAI,CAAC,MAAM,EAAE,CAAC;oBAAC,OAAO,GAAG,KAAK,CAAC;oBAAC,MAAM,GAAG,IAAI,CAAC;gBAAC,CAAC;YAAC,CAAC;YAClE,IAAI,MAAM,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBACtC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAAA,MAAM,OAAO,CAAC;gBAAA,CAAC;gBAC3C,MAAM,gBAAgB,CAAC,eAAe,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,102 @@
1
+ import type { AgentInstructionPaths, AgentWorkflowScripts } from "./repository-agent-workflow.js";
2
+ import type { RepositoryChanges } from "./changed-workflow.js";
3
+ import type { RepositoryPackageManager } from "../../../../process-execution/application/runtime-selection.js";
4
+ export type CoverageFacet = "lint" | "typecheck" | "tests" | "standards" | "architecture";
5
+ export interface CoverageCheck {
6
+ readonly id: string;
7
+ readonly script: string;
8
+ readonly prerequisites: readonly string[];
9
+ readonly supplies: readonly CoverageFacet[];
10
+ readonly observation: "command" | "test-dispatch/v1";
11
+ }
12
+ export interface WorkflowCoveragePolicy {
13
+ readonly schemaVersion: 2;
14
+ readonly packageManager: RepositoryPackageManager;
15
+ readonly instructions: AgentInstructionPaths;
16
+ readonly scripts: AgentWorkflowScripts;
17
+ readonly scopes: readonly {
18
+ readonly id: string;
19
+ readonly roots: readonly string[];
20
+ readonly requiredFacets: readonly CoverageFacet[];
21
+ readonly checks: readonly string[];
22
+ }[];
23
+ readonly checks: readonly CoverageCheck[];
24
+ readonly exclusions: readonly {
25
+ readonly path: string;
26
+ readonly reason: string;
27
+ }[];
28
+ readonly escalationCheck: string;
29
+ }
30
+ export interface ObservationBinding {
31
+ readonly invocationId: string;
32
+ readonly sourceIdentity: string;
33
+ readonly configIdentity: string;
34
+ readonly checkId: string;
35
+ }
36
+ export interface TestDispatchObservation extends ObservationBinding {
37
+ readonly schemaVersion: 1;
38
+ readonly runnerIdentity: string;
39
+ readonly selectedSuites: readonly string[];
40
+ readonly executed: number;
41
+ readonly skipped: number;
42
+ readonly outcome: "passed" | "empty-selection" | "failed" | "cancelled";
43
+ }
44
+ export interface CoverageExecution {
45
+ readonly exitCode: number;
46
+ readonly durationMs: number;
47
+ readonly cancelled: boolean;
48
+ readonly output: string;
49
+ readonly qualifiedFacets: readonly CoverageFacet[];
50
+ readonly observation: TestDispatchObservation | null;
51
+ readonly binding: ObservationBinding;
52
+ /** null means the executor rejected without an observed exit status. */
53
+ readonly commands: readonly {
54
+ readonly script: string;
55
+ readonly exitCode: number | null;
56
+ readonly durationMs: number;
57
+ }[];
58
+ }
59
+ export interface CoverageRow {
60
+ readonly path: string;
61
+ readonly facet: CoverageFacet | null;
62
+ readonly state: "checked" | "explicitly-skipped" | "uncovered" | "stale";
63
+ readonly reason: string;
64
+ readonly checkIds: readonly string[];
65
+ }
66
+ export interface CheckChangedReport {
67
+ readonly reportSchemaVersion: 2;
68
+ readonly outcome: "passed" | "feedback-only" | "not-checked" | "uncovered" | "failed" | "cancelled" | "stale";
69
+ readonly reason: string;
70
+ readonly source: RepositoryChanges | null;
71
+ readonly base: {
72
+ readonly requestedRef: string | null;
73
+ readonly resolvedRef: string;
74
+ readonly commit: string | null;
75
+ readonly mergeBaseCommit: string | null;
76
+ } | null;
77
+ readonly head: {
78
+ readonly ref: "HEAD";
79
+ readonly commit: string | null;
80
+ } | null;
81
+ readonly scopeDigest: string | null;
82
+ readonly changeGroups: RepositoryChanges["changeGroups"] | null;
83
+ readonly inputCustody: {
84
+ readonly classification: "frozen-closure" | "cooperating-exclusive" | "mutable";
85
+ readonly sourceIdentity: string;
86
+ readonly configIdentity: string;
87
+ readonly closureIdentity: string;
88
+ readonly binding: "qualified-host-precondition" | "unverified";
89
+ readonly limitation: string;
90
+ };
91
+ readonly plannedChecks: readonly {
92
+ readonly id: string;
93
+ readonly target: "repository";
94
+ readonly reason: string;
95
+ }[];
96
+ readonly steps: readonly (CoverageExecution & {
97
+ readonly id: string;
98
+ readonly script: string;
99
+ })[];
100
+ readonly coverage: readonly CoverageRow[];
101
+ }
102
+ //# sourceMappingURL=check-changed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-changed.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/repository-agent-workflow/application/model/check-changed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gEAAgE,CAAC;AAE/G,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,CAAC;AAC1F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,kBAAkB,CAAC;CACtD;AACD,MAAM,WAAW,sBAAsB;IACrC,QAAQ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AClG,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;CAC3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=check-changed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-changed.js","sourceRoot":"","sources":["../../../../../src/capabilities/repository-agent-workflow/application/model/check-changed.ts"],"names":[],"mappings":""}