@agent-teams/engineering-foundation 0.17.0-rc.8 → 0.17.0

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 (147) hide show
  1. package/README.md +33 -47
  2. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.d.ts +3 -0
  3. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.d.ts.map +1 -0
  4. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.js +17 -0
  5. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.js.map +1 -0
  6. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.d.ts +7 -0
  7. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.d.ts.map +1 -0
  8. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.js +51 -0
  9. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.js.map +1 -0
  10. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.d.ts +22 -0
  11. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.d.ts.map +1 -0
  12. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.js +90 -0
  13. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.js.map +1 -0
  14. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.d.ts +3 -0
  15. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.d.ts.map +1 -0
  16. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.js +5 -0
  17. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.js.map +1 -0
  18. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.d.ts +18 -0
  19. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.d.ts.map +1 -0
  20. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.js +2 -0
  21. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.js.map +1 -0
  22. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.d.ts +19 -0
  23. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.d.ts.map +1 -0
  24. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.js +2 -0
  25. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.js.map +1 -0
  26. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.d.ts +4 -0
  27. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.d.ts.map +1 -0
  28. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.js +64 -0
  29. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.js.map +1 -0
  30. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.d.ts +6 -0
  31. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.d.ts.map +1 -0
  32. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.js +75 -0
  33. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.js.map +1 -0
  34. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.d.ts +4 -0
  35. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.d.ts.map +1 -0
  36. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.js +2 -0
  37. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.js.map +1 -0
  38. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.d.ts +5 -0
  39. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.d.ts.map +1 -0
  40. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.js +2 -0
  41. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.js.map +1 -0
  42. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.d.ts +20 -0
  43. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.d.ts.map +1 -0
  44. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.js +9 -0
  45. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.js.map +1 -0
  46. package/dist/capabilities/quality-gate-runner/application/rules.d.ts +12 -0
  47. package/dist/capabilities/quality-gate-runner/application/rules.d.ts.map +1 -0
  48. package/dist/capabilities/quality-gate-runner/application/rules.js +18 -0
  49. package/dist/capabilities/quality-gate-runner/application/rules.js.map +1 -0
  50. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.d.ts +9 -0
  51. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.d.ts.map +1 -0
  52. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.js +5 -0
  53. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.js.map +1 -0
  54. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.d.ts +10 -0
  55. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.d.ts.map +1 -0
  56. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.js +138 -0
  57. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.js.map +1 -0
  58. package/dist/capabilities/quality-gate-runner/contract/config.d.ts +5 -0
  59. package/dist/capabilities/quality-gate-runner/contract/config.d.ts.map +1 -0
  60. package/dist/capabilities/quality-gate-runner/contract/config.js +89 -0
  61. package/dist/capabilities/quality-gate-runner/contract/config.js.map +1 -0
  62. package/dist/capabilities/quality-gate-runner/gate-command.d.ts +10 -0
  63. package/dist/capabilities/quality-gate-runner/gate-command.d.ts.map +1 -0
  64. package/dist/capabilities/quality-gate-runner/gate-command.js +82 -0
  65. package/dist/capabilities/quality-gate-runner/gate-command.js.map +1 -0
  66. package/dist/capabilities/quality-gate-runner/module.d.ts +5 -0
  67. package/dist/capabilities/quality-gate-runner/module.d.ts.map +1 -0
  68. package/dist/capabilities/quality-gate-runner/module.js +49 -0
  69. package/dist/capabilities/quality-gate-runner/module.js.map +1 -0
  70. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.d.ts +2 -0
  71. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.d.ts.map +1 -1
  72. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.js +32 -0
  73. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.js.map +1 -1
  74. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.d.ts +16 -0
  75. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.d.ts.map +1 -0
  76. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.js +213 -0
  77. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.js.map +1 -0
  78. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.d.ts +9 -0
  79. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.d.ts.map +1 -1
  80. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.js +232 -62
  81. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.js.map +1 -1
  82. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.d.ts +1 -0
  83. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.d.ts.map +1 -1
  84. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.js +2 -1
  85. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.js.map +1 -1
  86. package/dist/capabilities/repository-agent-workflow/application/model/changed-workflow.d.ts +26 -0
  87. package/dist/capabilities/repository-agent-workflow/application/model/changed-workflow.d.ts.map +1 -1
  88. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.d.ts +61 -0
  89. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.d.ts.map +1 -0
  90. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.js +7 -0
  91. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.js.map +1 -0
  92. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.d.ts +15 -0
  93. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.d.ts.map +1 -0
  94. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.js +2 -0
  95. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.js.map +1 -0
  96. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.d.ts +8 -0
  97. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.d.ts.map +1 -0
  98. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.js +128 -0
  99. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.js.map +1 -0
  100. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-changed-agent-workflow.d.ts.map +1 -1
  101. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-changed-agent-workflow.js +8 -0
  102. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-changed-agent-workflow.js.map +1 -1
  103. package/dist/capabilities/repository-agent-workflow/instructions-command.d.ts +6 -0
  104. package/dist/capabilities/repository-agent-workflow/instructions-command.d.ts.map +1 -0
  105. package/dist/capabilities/repository-agent-workflow/instructions-command.js +26 -0
  106. package/dist/capabilities/repository-agent-workflow/instructions-command.js.map +1 -0
  107. package/dist/cli-arguments.d.ts.map +1 -1
  108. package/dist/cli-arguments.js +15 -8
  109. package/dist/cli-arguments.js.map +1 -1
  110. package/dist/cli.js +31 -8
  111. package/dist/cli.js.map +1 -1
  112. package/dist/composition/capability-modules.d.ts +13 -0
  113. package/dist/composition/capability-modules.d.ts.map +1 -0
  114. package/dist/composition/capability-modules.js +30 -0
  115. package/dist/composition/capability-modules.js.map +1 -0
  116. package/dist/composition/capability-registry.d.ts +2 -0
  117. package/dist/composition/capability-registry.d.ts.map +1 -1
  118. package/dist/composition/capability-registry.js +5 -25
  119. package/dist/composition/capability-registry.js.map +1 -1
  120. package/dist/composition/rule-registry.d.ts +4 -7
  121. package/dist/composition/rule-registry.d.ts.map +1 -1
  122. package/dist/composition/rule-registry.js +17 -25
  123. package/dist/composition/rule-registry.js.map +1 -1
  124. package/dist/filesystem-path-safety.d.ts +6 -0
  125. package/dist/filesystem-path-safety.d.ts.map +1 -1
  126. package/dist/filesystem-path-safety.js +76 -21
  127. package/dist/filesystem-path-safety.js.map +1 -1
  128. package/dist/legacy-docs-cli-deprecation.d.ts +10 -0
  129. package/dist/legacy-docs-cli-deprecation.d.ts.map +1 -0
  130. package/dist/legacy-docs-cli-deprecation.js +36 -0
  131. package/dist/legacy-docs-cli-deprecation.js.map +1 -0
  132. package/dist/process-execution/node-process-runner.d.ts +6 -1
  133. package/dist/process-execution/node-process-runner.d.ts.map +1 -1
  134. package/dist/process-execution/node-process-runner.js +29 -6
  135. package/dist/process-execution/node-process-runner.js.map +1 -1
  136. package/dist/quality-gate-cli-command.d.ts +3 -0
  137. package/dist/quality-gate-cli-command.d.ts.map +1 -0
  138. package/dist/quality-gate-cli-command.js +37 -0
  139. package/dist/quality-gate-cli-command.js.map +1 -0
  140. package/dist/schema-ids.d.ts +1 -1
  141. package/dist/schema-ids.d.ts.map +1 -1
  142. package/dist/schema-ids.js +2 -0
  143. package/dist/schema-ids.js.map +1 -1
  144. package/package.json +3 -1
  145. package/schemas/foundation-config/v1.schema.json +10 -0
  146. package/schemas/quality-gate-run-report/v1.schema.json +47 -0
  147. package/schemas/quality-gate-runner/v1.schema.json +74 -0
@@ -4,6 +4,11 @@ export function renderAgentWorkflowReport(report) {
4
4
  `Agent workflow: ${report.outcome}`,
5
5
  `Coverage: ${report.coverage}`,
6
6
  `Baseline: ${report.baselineRef}${report.baselineCommit === null ? "" : ` (${report.baselineCommit})`}`,
7
+ `Base: ${report.resolvedBaseRef}${report.baseCommit === null ? "" : ` (${report.baseCommit})`}`,
8
+ `Head: ${report.headRef}${report.headCommit === null ? "" : ` (${report.headCommit})`}`,
9
+ `Merge base: ${report.mergeBaseCommit ?? "none"}`,
10
+ `Scope digest: ${report.scopeDigest}`,
11
+ `Evidence groups: committed ${report.changeGroups.committed.paths.length}, staged ${report.changeGroups.staged.paths.length}, unstaged ${report.changeGroups.unstaged.paths.length}, untracked ${report.changeGroups.untracked.paths.length}`,
7
12
  `Changed paths: ${report.changedPaths.length}`
8
13
  ];
9
14
  if (report.changedPaths.length > 0) {
@@ -23,4 +28,31 @@ export function renderAgentWorkflowReport(report) {
23
28
  }
24
29
  return `${lines.join("\n")}\n`;
25
30
  }
31
+ export function renderEffectiveInstructionsReport(report) {
32
+ const lines = [
33
+ `Effective instructions for ${report.target.path}`,
34
+ `Target directory: ${report.target.directory}`,
35
+ `Loaded: ${report.budget.loadedBytes}/${report.budget.maximumBytes} bytes`,
36
+ `Resolution digest: ${report.resolutionDigest}`
37
+ ];
38
+ if (report.layers.length === 0) {
39
+ lines.push("Applicable instruction files: none");
40
+ }
41
+ for (const layer of report.layers) {
42
+ lines.push(`${layer.order}. ${layer.selectedPath} [${layer.status}]`, ` Scope: ${layer.scope}`, ` Size: ${layer.loadedBytes}/${layer.sourceBytes} bytes`, ` Source digest: ${layer.sourceDigest ?? "not read (budget exhausted)"}`, ` Loaded digest: ${layer.loadedDigest}`, " Why: first regular candidate in an ancestor directory of the target");
43
+ if (layer.canOverrideEarlier.length > 0) {
44
+ lines.push(` Can override earlier: ${layer.canOverrideEarlier.join(", ")}`);
45
+ }
46
+ for (const shadowed of layer.shadowed) {
47
+ lines.push(` Shadowed: ${shadowed.path} (higher-priority candidate selected)`);
48
+ }
49
+ }
50
+ if (report.budget.truncated) {
51
+ lines.push("Warning: the final applied instruction file was truncated by the byte budget.");
52
+ }
53
+ if (report.budget.exhausted) {
54
+ lines.push("Warning: later instruction layers may be excluded because the byte budget is exhausted.");
55
+ }
56
+ return `${lines.join("\n")}\n`;
57
+ }
26
58
  //# sourceMappingURL=report-renderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"report-renderer.js","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,yBAAyB,CAAC,MAAkC;IAC1E,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG;QACZ,mBAAmB,MAAM,CAAC,OAAO,EAAE;QACnC,aAAa,MAAM,CAAC,QAAQ,EAAE;QAC9B,aAAa,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,cAAc,GAAG,EAAE;QACvG,kBAAkB,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE;KAC/C,CAAC;IACF,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;QACzD,IAAI,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;YACvD,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,OAAO,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;IAC5D,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;QAC7F,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
1
+ {"version":3,"file":"report-renderer.js","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,yBAAyB,CAAC,MAAkC;IAC1E,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG;QACZ,mBAAmB,MAAM,CAAC,OAAO,EAAE;QACnC,aAAa,MAAM,CAAC,QAAQ,EAAE;QAC9B,aAAa,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,cAAc,GAAG,EAAE;QACvG,SAAS,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,UAAU,GAAG,EAAE;QAC/F,SAAS,MAA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,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,gBAAgB,QAAQ,CAAC,IAAI,uCAAuC,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;IAC9F,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,yFAAyF,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { EffectiveInstructionDirectoryObservation, EffectiveInstructionDiscovery } from "../../../application/model/effective-instructions.js";
2
+ import type { EffectiveInstructionsReader } from "../../../application/ports/effective-instructions-reader.js";
3
+ export declare class FilesystemEffectiveInstructionsReader implements EffectiveInstructionsReader {
4
+ discover(input: {
5
+ readonly consumerRoot: string;
6
+ readonly targetPath: string;
7
+ readonly signal?: AbortSignal;
8
+ }): Promise<EffectiveInstructionDiscovery>;
9
+ readDirectory(input: {
10
+ readonly consumerRoot: string;
11
+ readonly directory: string;
12
+ readonly readSelectedBytes: boolean;
13
+ readonly signal?: AbortSignal;
14
+ }): Promise<EffectiveInstructionDirectoryObservation>;
15
+ }
16
+ //# sourceMappingURL=filesystem-effective-instructions-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem-effective-instructions-reader.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAEV,wCAAwC,EACxC,6BAA6B,EAC9B,MAAM,sDAAsD,CAAC;AAE9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6DAA6D,CAAC;AAsM/G,qBAAa,qCAAsC,YAAW,2BAA2B;IACjF,QAAQ,CAAC,KAAK,EAAE;QACpB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CA0CzC;IAEK,aAAa,CAAC,KAAK,EAAE;QACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;QACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAqCpD;CACF"}
@@ -0,0 +1,213 @@
1
+ import { lstat, realpath, stat } from "node:fs/promises";
2
+ import { isAbsolute, join, posix, relative, sep, win32 } from "node:path";
3
+ import { CapabilityInputError } from "../../../../../capability-runtime.js";
4
+ import { ContainedFileReadError, inspectContainedRegularFile, readContainedRegularFile } from "../../../../../filesystem-path-safety.js";
5
+ import { assertNotCancelled, assertRepositoryRelativePath } from "../../../../../strict-yaml.js";
6
+ import { EFFECTIVE_INSTRUCTION_CANDIDATE_NAMES } from "../../../application/model/effective-instructions.js";
7
+ const MAXIMUM_INSTRUCTION_SOURCE_BYTES = 256 * 1024;
8
+ function inputError(code, message) {
9
+ throw new CapabilityInputError({
10
+ code,
11
+ message,
12
+ phase: "repository-agent-workflow-effective-instructions",
13
+ retryable: false
14
+ });
15
+ }
16
+ function isMissing(error) {
17
+ return error instanceof Error && "code" in error &&
18
+ error.code === "ENOENT";
19
+ }
20
+ function contained(root, candidate) {
21
+ const relation = relative(root, candidate);
22
+ return relation === "" ||
23
+ (!isAbsolute(relation) && relation !== ".." && !relation.startsWith(`..${sep}`));
24
+ }
25
+ function hasUnsafeDisplayCharacter(value) {
26
+ for (const character of value) {
27
+ const codePoint = character.codePointAt(0);
28
+ if (codePoint === undefined ||
29
+ codePoint <= 0x1f ||
30
+ (codePoint >= 0x7f && codePoint <= 0x9f) ||
31
+ (codePoint >= 0xd800 && codePoint <= 0xdfff) ||
32
+ codePoint === 0x2028 ||
33
+ codePoint === 0x2029 ||
34
+ codePoint === 0x061c ||
35
+ (codePoint >= 0x200e && codePoint <= 0x200f) ||
36
+ (codePoint >= 0x202a && codePoint <= 0x202e) ||
37
+ (codePoint >= 0x2066 && codePoint <= 0x2069)) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
43
+ async function resolveConsumerRoot(consumerRoot) {
44
+ try {
45
+ const root = await realpath(consumerRoot);
46
+ if (!(await stat(root)).isDirectory()) {
47
+ inputError("REPOSITORY_AGENT_WORKFLOW_ROOT_INVALID", "The consumer root must be an existing directory.");
48
+ }
49
+ return root;
50
+ }
51
+ catch (error) {
52
+ if (error instanceof CapabilityInputError) {
53
+ throw error;
54
+ }
55
+ inputError("REPOSITORY_AGENT_WORKFLOW_ROOT_UNAVAILABLE", "The consumer root is unavailable.");
56
+ }
57
+ }
58
+ async function safeTargetDirectories(root, targetDirectory) {
59
+ const directories = [{ absolute: root, repositoryPath: "." }];
60
+ let absolute = root;
61
+ let repositoryPath = "";
62
+ const segments = targetDirectory === "." ? [] : targetDirectory.split("/");
63
+ for (const segment of segments) {
64
+ const next = join(absolute, segment);
65
+ let metadata;
66
+ try {
67
+ metadata = await lstat(next);
68
+ }
69
+ catch (error) {
70
+ if (isMissing(error)) {
71
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_DIRECTORY_MISSING", `The target directory does not exist: ${targetDirectory}.`);
72
+ }
73
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_DIRECTORY_UNAVAILABLE", `The target directory is unavailable: ${targetDirectory}.`);
74
+ }
75
+ if (metadata.isSymbolicLink() || !metadata.isDirectory()) {
76
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_DIRECTORY_INVALID", `The target path must have only real repository directories: ${targetDirectory}.`);
77
+ }
78
+ const canonical = await realpath(next).catch(() => inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_DIRECTORY_UNAVAILABLE", `The target directory is unavailable: ${targetDirectory}.`));
79
+ if (!contained(root, canonical)) {
80
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_DIRECTORY_ESCAPE", `The target directory escapes the consumer repository: ${targetDirectory}.`);
81
+ }
82
+ absolute = canonical;
83
+ repositoryPath = repositoryPath.length === 0
84
+ ? segment
85
+ : posix.join(repositoryPath, segment);
86
+ directories.push({ absolute, repositoryPath });
87
+ }
88
+ return Object.freeze(directories);
89
+ }
90
+ async function readCandidate(root, directory, name, mode) {
91
+ const repositoryPath = directory.repositoryPath === "."
92
+ ? name
93
+ : posix.join(directory.repositoryPath, name);
94
+ const candidate = join(directory.absolute, name);
95
+ let metadata;
96
+ try {
97
+ metadata = await lstat(candidate);
98
+ }
99
+ catch (error) {
100
+ if (isMissing(error)) {
101
+ return Object.freeze({ kind: "missing", path: repositoryPath });
102
+ }
103
+ inputError("REPOSITORY_AGENT_WORKFLOW_INSTRUCTION_UNAVAILABLE", `The instruction candidate is unavailable: ${repositoryPath}.`);
104
+ }
105
+ if (metadata.isSymbolicLink()) {
106
+ return Object.freeze({ kind: "symlink", path: repositoryPath });
107
+ }
108
+ if (!metadata.isFile()) {
109
+ return Object.freeze({ kind: "not-file", path: repositoryPath });
110
+ }
111
+ if (!Number.isSafeInteger(metadata.size) || metadata.size < 0) {
112
+ inputError("REPOSITORY_AGENT_WORKFLOW_INSTRUCTION_UNAVAILABLE", `The instruction candidate has an unsupported size: ${repositoryPath}.`);
113
+ }
114
+ if (mode === "classify") {
115
+ return Object.freeze({
116
+ kind: "file",
117
+ path: repositoryPath,
118
+ sourceBytes: metadata.size,
119
+ bytes: null
120
+ });
121
+ }
122
+ if (mode === "metadata") {
123
+ try {
124
+ const observation = await inspectContainedRegularFile({ candidate, root });
125
+ return Object.freeze({
126
+ kind: "file",
127
+ path: repositoryPath,
128
+ sourceBytes: observation.size,
129
+ bytes: null
130
+ });
131
+ }
132
+ catch (error) {
133
+ const detail = error instanceof ContainedFileReadError ? error.failure : "unavailable";
134
+ inputError("REPOSITORY_AGENT_WORKFLOW_INSTRUCTION_UNAVAILABLE", `The instruction candidate must remain a stable real repository file: ${repositoryPath} (${detail}).`);
135
+ }
136
+ }
137
+ try {
138
+ const bytes = await readContainedRegularFile({
139
+ candidate,
140
+ maxBytes: MAXIMUM_INSTRUCTION_SOURCE_BYTES,
141
+ root
142
+ });
143
+ return Object.freeze({
144
+ kind: "file",
145
+ path: repositoryPath,
146
+ sourceBytes: bytes.byteLength,
147
+ bytes
148
+ });
149
+ }
150
+ catch (error) {
151
+ const detail = error instanceof ContainedFileReadError ? error.failure : "unavailable";
152
+ inputError("REPOSITORY_AGENT_WORKFLOW_INSTRUCTION_UNAVAILABLE", `The instruction candidate must be a stable real file no larger than ${MAXIMUM_INSTRUCTION_SOURCE_BYTES} bytes: ${repositoryPath} (${detail}).`);
153
+ }
154
+ }
155
+ export class FilesystemEffectiveInstructionsReader {
156
+ async discover(input) {
157
+ assertNotCancelled(input.signal);
158
+ if (hasUnsafeDisplayCharacter(input.targetPath) ||
159
+ win32.isAbsolute(input.targetPath) ||
160
+ input.targetPath.normalize("NFC") !== input.targetPath) {
161
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_PATH_INVALID", "The target path must be a well-formed repository-relative POSIX path in Unicode NFC without control, bidirectional-formatting, or line-separator characters.");
162
+ }
163
+ assertRepositoryRelativePath(input.targetPath, "repository-agent-workflow-effective-instructions");
164
+ const root = await resolveConsumerRoot(input.consumerRoot);
165
+ const targetDirectory = posix.dirname(input.targetPath);
166
+ const directories = await safeTargetDirectories(root, targetDirectory);
167
+ const target = join(root, ...input.targetPath.split("/"));
168
+ const targetMetadata = await lstat(target).catch((error) => {
169
+ if (isMissing(error)) {
170
+ return null;
171
+ }
172
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_UNAVAILABLE", `The target path is unavailable: ${input.targetPath}.`);
173
+ });
174
+ if (targetMetadata !== null &&
175
+ (targetMetadata.isSymbolicLink() || !targetMetadata.isFile())) {
176
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_INVALID", `The target must be a repository file or a planned file path: ${input.targetPath}.`);
177
+ }
178
+ assertNotCancelled(input.signal);
179
+ return Object.freeze({
180
+ targetPath: input.targetPath,
181
+ targetDirectory,
182
+ directories: Object.freeze(directories.map(({ repositoryPath }) => repositoryPath))
183
+ });
184
+ }
185
+ async readDirectory(input) {
186
+ assertNotCancelled(input.signal);
187
+ if (input.directory !== ".") {
188
+ assertRepositoryRelativePath(input.directory, "repository-agent-workflow-effective-instructions");
189
+ }
190
+ const root = await resolveConsumerRoot(input.consumerRoot);
191
+ const directories = await safeTargetDirectories(root, input.directory);
192
+ const directory = directories.at(-1);
193
+ if (directory === undefined || directory.repositoryPath !== input.directory) {
194
+ inputError("REPOSITORY_AGENT_WORKFLOW_TARGET_DIRECTORY_INVALID", `The instruction directory is invalid: ${input.directory}.`);
195
+ }
196
+ const candidates = [];
197
+ let selected = false;
198
+ for (const name of EFFECTIVE_INSTRUCTION_CANDIDATE_NAMES) {
199
+ const mode = selected
200
+ ? "classify"
201
+ : input.readSelectedBytes ? "content" : "metadata";
202
+ const candidate = await readCandidate(root, directory, name, mode);
203
+ candidates.push(candidate);
204
+ selected ||= candidate.kind === "file" || candidate.kind === "symlink";
205
+ }
206
+ assertNotCancelled(input.signal);
207
+ return Object.freeze({
208
+ directory: input.directory,
209
+ candidates: Object.freeze(candidates)
210
+ });
211
+ }
212
+ }
213
+ //# sourceMappingURL=filesystem-effective-instructions-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem-effective-instructions-reader.js","sourceRoot":"","sources":["../../../../../../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,CAAC,SAAS,GAAG,CAC5D,CAAC;QACJ,CAAC;QACD,MAAM,UAAU,GAA+C,EAAE,CAAC;QAClE,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,qCAAqC,EAAE,CAAC;YACzD,MAAM,IAAI,GAAG,QAAQ;gBACnB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;YACrD,MAAM,SAAS,GAAG,MAAM,aAAa,CACnC,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,IAAI,CACL,CAAC;YACF,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3B,QAAQ,KAAK,SAAS,CAAC,IAAI,KAAK,MAAM,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC;QACzE,CAAC;QACD,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,4 +1,5 @@
1
1
  import type { RepositoryChangesReader } from "../../../application/ports/changed-workflow.js";
2
+ import type { RepositoryChangeGroups } from "../../../application/model/changed-workflow.js";
2
3
  export declare class GitRepositoryChangesReader implements RepositoryChangesReader {
3
4
  collect(input: {
4
5
  readonly consumerRoot: string;
@@ -7,6 +8,14 @@ export declare class GitRepositoryChangesReader implements RepositoryChangesRead
7
8
  }): Promise<Readonly<{
8
9
  baselineRef: string;
9
10
  baselineCommit: string | null;
11
+ requestedBaseRef: string | null;
12
+ resolvedBaseRef: string;
13
+ baseCommit: string | null;
14
+ headRef: "HEAD";
15
+ headCommit: string | null;
16
+ mergeBaseCommit: string | null;
17
+ changeGroups: RepositoryChangeGroups;
18
+ scopeDigest: string;
10
19
  changedPaths: readonly string[];
11
20
  deletedPaths: readonly string[];
12
21
  existingPaths: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"git-repository-changes-reader.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAqK9F,qBAAa,0BAA2B,YAAW,uBAAuB;IAClE,OAAO,CAAC,KAAK,EAAE;QACnB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B;;;;;;QA2BA;CACF"}
1
+ {"version":3,"file":"git-repository-changes-reader.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,gDAAgD,CAAC;AAoZxD,qBAAa,0BAA2B,YAAW,uBAAuB;IAClE,OAAO,CAAC,KAAK,EAAE;QACnB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B;;;;;;iBAwCY,MAAM;;;;;;;;QASlB;CACF"}