agentic-engineering-harness 0.4.16

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 (280) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +273 -0
  3. package/dist/agents/audit.d.ts +12 -0
  4. package/dist/agents/audit.js +14 -0
  5. package/dist/agents/audit.js.map +1 -0
  6. package/dist/agents/compiler.d.ts +8 -0
  7. package/dist/agents/compiler.js +103 -0
  8. package/dist/agents/compiler.js.map +1 -0
  9. package/dist/agents/config.d.ts +6 -0
  10. package/dist/agents/config.js +161 -0
  11. package/dist/agents/config.js.map +1 -0
  12. package/dist/agents/escalation.d.ts +9 -0
  13. package/dist/agents/escalation.js +75 -0
  14. package/dist/agents/escalation.js.map +1 -0
  15. package/dist/agents/exceptionDetection.d.ts +24 -0
  16. package/dist/agents/exceptionDetection.js +42 -0
  17. package/dist/agents/exceptionDetection.js.map +1 -0
  18. package/dist/agents/findings.d.ts +14 -0
  19. package/dist/agents/findings.js +40 -0
  20. package/dist/agents/findings.js.map +1 -0
  21. package/dist/agents/gitCheckpoint.d.ts +6 -0
  22. package/dist/agents/gitCheckpoint.js +61 -0
  23. package/dist/agents/gitCheckpoint.js.map +1 -0
  24. package/dist/agents/jsonc.d.ts +1 -0
  25. package/dist/agents/jsonc.js +42 -0
  26. package/dist/agents/jsonc.js.map +1 -0
  27. package/dist/agents/outputContracts.d.ts +161 -0
  28. package/dist/agents/outputContracts.js +16 -0
  29. package/dist/agents/outputContracts.js.map +1 -0
  30. package/dist/agents/parallelism.d.ts +14 -0
  31. package/dist/agents/parallelism.js +54 -0
  32. package/dist/agents/parallelism.js.map +1 -0
  33. package/dist/agents/permissions.d.ts +5 -0
  34. package/dist/agents/permissions.js +30 -0
  35. package/dist/agents/permissions.js.map +1 -0
  36. package/dist/agents/qualityConvergence.d.ts +44 -0
  37. package/dist/agents/qualityConvergence.js +77 -0
  38. package/dist/agents/qualityConvergence.js.map +1 -0
  39. package/dist/agents/recovery.d.ts +13 -0
  40. package/dist/agents/recovery.js +35 -0
  41. package/dist/agents/recovery.js.map +1 -0
  42. package/dist/agents/reviewLifecycle.d.ts +30 -0
  43. package/dist/agents/reviewLifecycle.js +233 -0
  44. package/dist/agents/reviewLifecycle.js.map +1 -0
  45. package/dist/agents/routing.d.ts +9 -0
  46. package/dist/agents/routing.js +37 -0
  47. package/dist/agents/routing.js.map +1 -0
  48. package/dist/agents/structuredOutput.d.ts +1 -0
  49. package/dist/agents/structuredOutput.js +54 -0
  50. package/dist/agents/structuredOutput.js.map +1 -0
  51. package/dist/agents/types.d.ts +207 -0
  52. package/dist/agents/types.js +2 -0
  53. package/dist/agents/types.js.map +1 -0
  54. package/dist/cli.d.ts +2 -0
  55. package/dist/cli.js +221 -0
  56. package/dist/cli.js.map +1 -0
  57. package/dist/core/config.d.ts +3 -0
  58. package/dist/core/config.js +59 -0
  59. package/dist/core/config.js.map +1 -0
  60. package/dist/core/doctor.d.ts +8 -0
  61. package/dist/core/doctor.js +59 -0
  62. package/dist/core/doctor.js.map +1 -0
  63. package/dist/core/git.d.ts +8 -0
  64. package/dist/core/git.js +47 -0
  65. package/dist/core/git.js.map +1 -0
  66. package/dist/core/init.d.ts +1 -0
  67. package/dist/core/init.js +52 -0
  68. package/dist/core/init.js.map +1 -0
  69. package/dist/core/quick.d.ts +20 -0
  70. package/dist/core/quick.js +49 -0
  71. package/dist/core/quick.js.map +1 -0
  72. package/dist/core/repair.d.ts +8 -0
  73. package/dist/core/repair.js +7 -0
  74. package/dist/core/repair.js.map +1 -0
  75. package/dist/core/run.d.ts +38 -0
  76. package/dist/core/run.js +165 -0
  77. package/dist/core/run.js.map +1 -0
  78. package/dist/core/sdd.d.ts +10 -0
  79. package/dist/core/sdd.js +88 -0
  80. package/dist/core/sdd.js.map +1 -0
  81. package/dist/core/seal.d.ts +3 -0
  82. package/dist/core/seal.js +74 -0
  83. package/dist/core/seal.js.map +1 -0
  84. package/dist/core/triage.d.ts +22 -0
  85. package/dist/core/triage.js +38 -0
  86. package/dist/core/triage.js.map +1 -0
  87. package/dist/core/types.d.ts +354 -0
  88. package/dist/core/types.js +2 -0
  89. package/dist/core/types.js.map +1 -0
  90. package/dist/core/verify.d.ts +6 -0
  91. package/dist/core/verify.js +51 -0
  92. package/dist/core/verify.js.map +1 -0
  93. package/dist/delivery/finalize.d.ts +17 -0
  94. package/dist/delivery/finalize.js +71 -0
  95. package/dist/delivery/finalize.js.map +1 -0
  96. package/dist/delivery/handoff.d.ts +39 -0
  97. package/dist/delivery/handoff.js +250 -0
  98. package/dist/delivery/handoff.js.map +1 -0
  99. package/dist/entry.d.ts +2 -0
  100. package/dist/entry.js +112 -0
  101. package/dist/entry.js.map +1 -0
  102. package/dist/evals/runner.d.ts +4 -0
  103. package/dist/evals/runner.js +112 -0
  104. package/dist/evals/runner.js.map +1 -0
  105. package/dist/evals/scoring.d.ts +3 -0
  106. package/dist/evals/scoring.js +41 -0
  107. package/dist/evals/scoring.js.map +1 -0
  108. package/dist/evals/types.d.ts +46 -0
  109. package/dist/evals/types.js +2 -0
  110. package/dist/evals/types.js.map +1 -0
  111. package/dist/issues/intake.d.ts +114 -0
  112. package/dist/issues/intake.js +213 -0
  113. package/dist/issues/intake.js.map +1 -0
  114. package/dist/memory/benchmark.d.ts +33 -0
  115. package/dist/memory/benchmark.js +69 -0
  116. package/dist/memory/benchmark.js.map +1 -0
  117. package/dist/metrics/runMetrics.d.ts +9 -0
  118. package/dist/metrics/runMetrics.js +34 -0
  119. package/dist/metrics/runMetrics.js.map +1 -0
  120. package/dist/metrics/usage.d.ts +3 -0
  121. package/dist/metrics/usage.js +53 -0
  122. package/dist/metrics/usage.js.map +1 -0
  123. package/dist/provenance/generate.d.ts +30 -0
  124. package/dist/provenance/generate.js +96 -0
  125. package/dist/provenance/generate.js.map +1 -0
  126. package/dist/providers/engram.d.ts +8 -0
  127. package/dist/providers/engram.js +14 -0
  128. package/dist/providers/engram.js.map +1 -0
  129. package/dist/providers/graphify.d.ts +9 -0
  130. package/dist/providers/graphify.js +28 -0
  131. package/dist/providers/graphify.js.map +1 -0
  132. package/dist/providers/paseo.d.ts +8 -0
  133. package/dist/providers/paseo.js +14 -0
  134. package/dist/providers/paseo.js.map +1 -0
  135. package/dist/providers/types.d.ts +41 -0
  136. package/dist/providers/types.js +2 -0
  137. package/dist/providers/types.js.map +1 -0
  138. package/dist/telemetry/events.d.ts +2 -0
  139. package/dist/telemetry/events.js +29 -0
  140. package/dist/telemetry/events.js.map +1 -0
  141. package/dist/telemetry/otlp.d.ts +3 -0
  142. package/dist/telemetry/otlp.js +57 -0
  143. package/dist/telemetry/otlp.js.map +1 -0
  144. package/dist/toolchain/config.d.ts +10 -0
  145. package/dist/toolchain/config.js +54 -0
  146. package/dist/toolchain/config.js.map +1 -0
  147. package/dist/toolchain/doctor.d.ts +8 -0
  148. package/dist/toolchain/doctor.js +56 -0
  149. package/dist/toolchain/doctor.js.map +1 -0
  150. package/dist/toolchain/mise.d.ts +10 -0
  151. package/dist/toolchain/mise.js +61 -0
  152. package/dist/toolchain/mise.js.map +1 -0
  153. package/dist/toolchain/resolve.d.ts +8 -0
  154. package/dist/toolchain/resolve.js +159 -0
  155. package/dist/toolchain/resolve.js.map +1 -0
  156. package/dist/toolchain/setup.d.ts +7 -0
  157. package/dist/toolchain/setup.js +141 -0
  158. package/dist/toolchain/setup.js.map +1 -0
  159. package/dist/toolchain/types.d.ts +95 -0
  160. package/dist/toolchain/types.js +2 -0
  161. package/dist/toolchain/types.js.map +1 -0
  162. package/dist/utils/process.d.ts +15 -0
  163. package/dist/utils/process.js +94 -0
  164. package/dist/utils/process.js.map +1 -0
  165. package/dist/validators/commands.d.ts +2 -0
  166. package/dist/validators/commands.js +28 -0
  167. package/dist/validators/commands.js.map +1 -0
  168. package/dist/validators/constraints.d.ts +6 -0
  169. package/dist/validators/constraints.js +30 -0
  170. package/dist/validators/constraints.js.map +1 -0
  171. package/dist/validators/diffScope.d.ts +2 -0
  172. package/dist/validators/diffScope.js +36 -0
  173. package/dist/validators/diffScope.js.map +1 -0
  174. package/dist/validators/evidence.d.ts +6 -0
  175. package/dist/validators/evidence.js +8 -0
  176. package/dist/validators/evidence.js.map +1 -0
  177. package/dist/validators/external.d.ts +3 -0
  178. package/dist/validators/external.js +22 -0
  179. package/dist/validators/external.js.map +1 -0
  180. package/dist/validators/gherkin.d.ts +3 -0
  181. package/dist/validators/gherkin.js +59 -0
  182. package/dist/validators/gherkin.js.map +1 -0
  183. package/dist/validators/graphify.d.ts +4 -0
  184. package/dist/validators/graphify.js +108 -0
  185. package/dist/validators/graphify.js.map +1 -0
  186. package/dist/validators/opa.d.ts +3 -0
  187. package/dist/validators/opa.js +43 -0
  188. package/dist/validators/opa.js.map +1 -0
  189. package/dist/validators/openapi.d.ts +25 -0
  190. package/dist/validators/openapi.js +98 -0
  191. package/dist/validators/openapi.js.map +1 -0
  192. package/dist/validators/registry.d.ts +2 -0
  193. package/dist/validators/registry.js +36 -0
  194. package/dist/validators/registry.js.map +1 -0
  195. package/dist/validators/toolCommand.d.ts +5 -0
  196. package/dist/validators/toolCommand.js +33 -0
  197. package/dist/validators/toolCommand.js.map +1 -0
  198. package/dist/validators/types.d.ts +13 -0
  199. package/dist/validators/types.js +2 -0
  200. package/dist/validators/types.js.map +1 -0
  201. package/dist/workers/agentPrompt.d.ts +3 -0
  202. package/dist/workers/agentPrompt.js +84 -0
  203. package/dist/workers/agentPrompt.js.map +1 -0
  204. package/dist/workers/direct.d.ts +13 -0
  205. package/dist/workers/direct.js +30 -0
  206. package/dist/workers/direct.js.map +1 -0
  207. package/dist/workers/factory.d.ts +4 -0
  208. package/dist/workers/factory.js +10 -0
  209. package/dist/workers/factory.js.map +1 -0
  210. package/dist/workers/paseo.d.ts +14 -0
  211. package/dist/workers/paseo.js +29 -0
  212. package/dist/workers/paseo.js.map +1 -0
  213. package/dist/workers/podman.d.ts +13 -0
  214. package/dist/workers/podman.js +22 -0
  215. package/dist/workers/podman.js.map +1 -0
  216. package/dist/workers/prompt.d.ts +4 -0
  217. package/dist/workers/prompt.js +4 -0
  218. package/dist/workers/prompt.js.map +1 -0
  219. package/dist/workers/types.d.ts +11 -0
  220. package/dist/workers/types.js +2 -0
  221. package/dist/workers/types.js.map +1 -0
  222. package/docs/ARCHITECTURE.md +47 -0
  223. package/docs/EVALS.md +28 -0
  224. package/docs/MEMORY.md +28 -0
  225. package/docs/OBSERVABILITY.md +18 -0
  226. package/docs/OSS_STACK.md +27 -0
  227. package/docs/PASEO.md +9 -0
  228. package/docs/PUBLISHING.md +110 -0
  229. package/docs/SDD.md +35 -0
  230. package/docs/SECURITY.md +21 -0
  231. package/docs/V0.2.md +42 -0
  232. package/docs/V0.3.md +40 -0
  233. package/docs/V0.4.11.md +30 -0
  234. package/docs/V0.4.12.md +88 -0
  235. package/docs/V0.4.13.md +203 -0
  236. package/docs/V0.4.14.md +209 -0
  237. package/docs/V0.4.15.md +365 -0
  238. package/docs/V0.4.16.md +229 -0
  239. package/docs/V0.4.md +28 -0
  240. package/docs/VALIDATION.md +23 -0
  241. package/package.json +18 -0
  242. package/policies/core/dependency-policy.rego +12 -0
  243. package/policies/core/schema-policy.rego +12 -0
  244. package/policies/core/trust-boundary.rego +17 -0
  245. package/presets/agents/default.jsonc +80 -0
  246. package/presets/docker.yaml +4 -0
  247. package/presets/dotnet.yaml +12 -0
  248. package/presets/expo.yaml +6 -0
  249. package/presets/generic.yaml +3 -0
  250. package/presets/nextjs.yaml +8 -0
  251. package/presets/node.yaml +6 -0
  252. package/presets/pnpm.yaml +6 -0
  253. package/presets/postgres.yaml +4 -0
  254. package/schemas/agent-output-planner.schema.json +1 -0
  255. package/schemas/agent-topology.schema.json +37 -0
  256. package/schemas/project.schema.json +36 -0
  257. package/schemas/quick-contract.schema.json +17 -0
  258. package/schemas/task-contract.schema.json +18 -0
  259. package/schemas/toolchain.schema.json +70 -0
  260. package/schemas/validation-report.schema.json +15 -0
  261. package/skills/acceptance-traceability/SKILL.md +13 -0
  262. package/skills/deterministic-validation/SKILL.md +15 -0
  263. package/skills/engineering-workflow/SKILL.md +108 -0
  264. package/skills/finding-dedup/SKILL.md +12 -0
  265. package/skills/github-delivery-lifecycle/SKILL.md +16 -0
  266. package/skills/implementation-worker/SKILL.md +17 -0
  267. package/skills/lead-engineer/SKILL.md +30 -0
  268. package/skills/memory-hygiene/SKILL.md +22 -0
  269. package/skills/prompt-drift-audit/SKILL.md +10 -0
  270. package/skills/recovery-classifier/SKILL.md +13 -0
  271. package/skills/routing-normalizer/SKILL.md +17 -0
  272. package/skills/sdd/SKILL.md +21 -0
  273. package/skills/simplify/SKILL.md +16 -0
  274. package/skills/verification-planning/SKILL.md +17 -0
  275. package/skills/worktree-lifecycle/SKILL.md +18 -0
  276. package/templates/AGENTS.md +37 -0
  277. package/templates/agents.source.jsonc +39 -0
  278. package/templates/otel-collector.yaml +21 -0
  279. package/templates/project.yaml +196 -0
  280. package/templates/toolchain.yaml +127 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 James Morales Moreno
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,273 @@
1
+ # Agentic Engineering Harness
2
+
3
+ An **OSS-first, zero-mandatory-SaaS control layer** for spec-driven, issue-driven and bounded-quick multi-agent software engineering where LLM output is treated as untrusted until deterministic and quality gates accept it.
4
+
5
+ ```text
6
+ clone / npm bootstrap
7
+ -> aeh setup -> locked engineering toolchain
8
+ -> natural-language request / GitHub issue
9
+ -> lead / issue intake / triage
10
+ -> QUICK or SDD + Gherkin -> sealed contract
11
+ -> optional GitHub branch + Paseo worktree handoff
12
+ -> declarative agent routing -> runtime/model/selective MCPs
13
+ -> deterministic validators -> autonomous quality convergence
14
+ -> lead acceptance -> deterministic delivery
15
+ ```
16
+
17
+ ## Status: v0.4.16
18
+
19
+ v0.4.16 adds **declarative toolchain provisioning and one-command bootstrap** on top of v0.4.15 issue-driven execution.
20
+
21
+ - AEH remains a normal npm development package; it is not an application runtime dependency;
22
+ - `.harness/toolchain.yaml` declares external engineering tools instead of requiring manual one-by-one installation;
23
+ - `aeh setup` resolves the tools actually required by the current project and provisions them through mise;
24
+ - `.harness/toolchain.lock.json` freezes resolved tool versions and OCI digests;
25
+ - `.harness/toolchain.state.json` stores machine-local bin paths and is not committed;
26
+ - heavy validators may use local tooling or OCI/Podman through `prefer-container`;
27
+ - project lockfiles are installed with frozen/reproducible commands (`npm ci`, pnpm/yarn/bun lock modes, `uv sync --frozen`, `dotnet restore`);
28
+ - provisioned binaries are injected into Harness subprocess PATH without requiring `mise activate`;
29
+ - `aeh doctor` verifies the reconciled environment;
30
+ - no npm `postinstall` silently mutates the host.
31
+
32
+ See [docs/V0.4.16.md](docs/V0.4.16.md), [docs/V0.4.15.md](docs/V0.4.15.md) and the earlier v0.4 documentation.
33
+
34
+ ## Recommended installation
35
+
36
+ AEH should be pinned as a project development dependency:
37
+
38
+ ```bash
39
+ npm install --save-dev agentic-engineering-harness
40
+ npm exec aeh -- init --setup
41
+ npm exec aeh -- doctor
42
+ ```
43
+
44
+ For an existing clone that does not yet have `node_modules`, bootstrap a pinned AEH package explicitly:
45
+
46
+ ```bash
47
+ npm exec --yes --package=agentic-engineering-harness@0.4.16 -- aeh setup
48
+ ```
49
+
50
+ `aeh setup` is the explicit provisioning boundary. Installing the npm package itself does not install Codex, OpenCode, Paseo, scanners or system packages as a side effect.
51
+
52
+ ## Toolchain bootstrap
53
+
54
+ Every initialized project receives `.harness/toolchain.yaml`.
55
+
56
+ Default capabilities cover the common Harness stack:
57
+
58
+ ```text
59
+ host/system: git, optional podman
60
+ managed: node, bun, dotnet, codex, opencode, paseo,
61
+ uv, graphify, opa, opengrep, trivy
62
+ OCI optional: OPA, Trivy
63
+ ```
64
+
65
+ Auto mode selects only what the project needs. For example:
66
+
67
+ ```text
68
+ runtime:codex -> codex
69
+ runtime:opencode -> opencode
70
+ orchestration:paseo -> paseo
71
+ code-intelligence:graphify -> uv + graphify
72
+ validation:opa -> opa
73
+ security-tool:opengrep -> opengrep
74
+ validator:trivy -> trivy
75
+ project:dotnet -> dotnet
76
+ project:bun -> bun
77
+ ```
78
+
79
+ Useful commands:
80
+
81
+ ```bash
82
+ aeh toolchain show
83
+ aeh setup --dry-run
84
+ aeh setup
85
+ aeh setup --update-lock
86
+ aeh setup --prefer-containers
87
+ aeh setup --profile agents
88
+ aeh setup --profile validation
89
+ aeh setup --profile full
90
+ aeh doctor
91
+ ```
92
+
93
+ `--dry-run` is side-effect free. Existing locks are reused by default; `--update-lock` is the deliberate toolchain-upgrade operation.
94
+
95
+ The source/lock/state split is:
96
+
97
+ ```text
98
+ .harness/toolchain.yaml desired configuration, committed
99
+ .harness/toolchain.lock.json resolved versions/digests, committed
100
+ .harness/toolchain.state.json local absolute bin paths, gitignored
101
+ .config/mise/conf.d/aeh.toml generated mise layer
102
+ .harness/bin/ generated OCI command wrappers, gitignored
103
+ ```
104
+
105
+ Existing project version authority is respected before creating a new lock, including `.node-version` / `.nvmrc`, .NET `global.json`, and a pinned Bun `packageManager` declaration.
106
+
107
+ ## Bootstrap without an existing `.harness`
108
+
109
+ ```bash
110
+ npm exec --yes --package=agentic-engineering-harness@0.4.16 -- aeh init --setup /path/to/repo
111
+ ```
112
+
113
+ `aeh init` creates the project config, thin agent overlay extending `aeh:default`, reusable skills, policies and toolchain source. `--setup` additionally compiles and reconciles the toolchain.
114
+
115
+ ## Issue-driven workflow
116
+
117
+ Once the environment is ready, an existing issue can be implemented directly:
118
+
119
+ ```bash
120
+ aeh issue inspect 142
121
+ aeh issue import 142
122
+ aeh issue implement 142
123
+ # equivalent
124
+ aeh run --issue 142
125
+ ```
126
+
127
+ A lead using the `engineering-workflow` skill should route natural language such as **“implement issue #142”** directly through this workflow, including when started from Paseo mobile.
128
+
129
+ The issue pipeline is:
130
+
131
+ ```text
132
+ GitHub issue #142
133
+ -> fetch + freeze title/body + SHA-256
134
+ -> scope/domains/risk/acceptance
135
+ -> bounded low-risk -> QuickContract
136
+ OR non-trivial -> read-only planner -> SDD/TaskContract
137
+ -> deterministic validation + seal
138
+ -> reuse existing issue + branch/worktree
139
+ -> implementation + validation + review convergence
140
+ -> lead acceptance
141
+ -> optional deterministic commit/push/draft PR
142
+ ```
143
+
144
+ Before every issue-derived run, title/body are re-fetched. A changed fingerprint produces `ISSUE_DRIFT`; the active sealed contract is never silently reinterpreted.
145
+
146
+ ## Default agent pack
147
+
148
+ **Control/discovery:** `lead`, `planner`, `oracle`, `explorer`, `librarian`.
149
+
150
+ **Coordination/design:** `github-manager`, `designer`.
151
+
152
+ **Implementation:** `implementation-worker`, `backend-implementer`, `frontend-implementer`, `data-implementer`, `mobile-implementer`, `test-implementer`, `docs-implementer`, `ops-implementer`, `quality-implementer`, `senior-implementer`.
153
+
154
+ **Review:** `code-quality-reviewer`, `requirements-reviewer`, `architecture-reviewer`, `security-reviewer`, `api-reviewer`, plus backend/frontend/data/mobile/test/docs/ops reviewers.
155
+
156
+ **Validation:** `validator`, `integration-validator`, `e2e-validator`.
157
+
158
+ Unused agents incur no execution cost.
159
+
160
+ ## Compose, add, override or remove agents
161
+
162
+ ```jsonc
163
+ {
164
+ "version": 1,
165
+ "extends": ["aeh:default"],
166
+ "agents": {
167
+ "payments-implementer": {
168
+ "role": "implementer",
169
+ "domains": ["payments"],
170
+ "execution": { "model": "@workhorse" },
171
+ "permissions": { "read": "allow", "write": "allow", "shell": "allow" },
172
+ "outputContract": "implementer"
173
+ }
174
+ },
175
+ "remove": { "agents": ["mobile-*"] }
176
+ }
177
+ ```
178
+
179
+ Local agent/model/runtime/profile definitions partially override inherited definitions. Routing rules are keyed by `id`; inherited agents may be removed with minimatch patterns and stale routing/recovery/council references are cleaned automatically.
180
+
181
+ ## Brain + workhorse
182
+
183
+ ```jsonc
184
+ {
185
+ "models": {
186
+ "brain": {
187
+ "runtime": "codex",
188
+ "provider": "openai",
189
+ "model": "gpt-5.6-luna",
190
+ "variant": "max"
191
+ },
192
+ "workhorse": {
193
+ "runtime": "opencode",
194
+ "provider": "opencode-go",
195
+ "model": "deepseek-v4-flash"
196
+ }
197
+ }
198
+ }
199
+ ```
200
+
201
+ Logical agent, runtime, model and transport remain separate concepts.
202
+
203
+ ## Selective MCPs
204
+
205
+ Project MCPs live in `.harness/project.yaml`; each logical agent lists only the MCP names it needs. The default catalog includes Context7, Playwright, a read-only GitHub MCP and disabled Sentry integration.
206
+
207
+ For OpenCode direct/Podman sessions, AEH materializes only the selected MCP definitions into the runtime configuration and suppresses unrelated MCP tool namespaces. GitHub delivery writes remain deterministic Harness operations rather than write-capable LLM MCP access.
208
+
209
+ ## Reusable skills
210
+
211
+ The default pack includes `engineering-workflow`, `lead-engineer`, `implementation-worker`, `deterministic-validation`, `memory-hygiene`, `sdd`, `verification-planning`, `worktree-lifecycle`, `routing-normalizer`, `recovery-classifier`, `acceptance-traceability`, `finding-dedup`, `prompt-drift-audit`, `simplify` and `github-delivery-lifecycle`.
212
+
213
+ Framework-specific skills belong in project overlays.
214
+
215
+ ## Optional GitHub -> Paseo delivery
216
+
217
+ Remote delivery is disabled by default while read-only issue intake is enabled.
218
+
219
+ ```yaml
220
+ delivery:
221
+ github:
222
+ enabled: true
223
+ tokenEnv: GH_TOKEN
224
+ branchPattern: feature/gh-{issue}-{slug}
225
+ finalizeOnAcceptance: true
226
+ pullRequestDraft: true
227
+ paseo:
228
+ enabled: true
229
+ createWorkspace: true
230
+ autoUseWorkspace: true
231
+ ```
232
+
233
+ The control checkout owns configuration, sealed artifacts, telemetry and delivery state. The Paseo worktree owns code, Git diff, builds, tests, Graphify, remediation and reviews. Accepted issue work may be committed/pushed and linked to a draft PR only after the configured deterministic/quality/lead gates pass.
234
+
235
+ ## QUICK workflow
236
+
237
+ ```bash
238
+ aeh triage "Change button padding" --file src/Button.tsx --domain frontend --risk low
239
+ aeh quick new QUICK-001 --title "Adjust padding" --request "Change button padding" --scope src/Button.tsx --acceptance "Button uses 16px padding" --domain frontend
240
+ aeh quick validate QUICK-001
241
+ aeh run QUICK-001
242
+ ```
243
+
244
+ QUICK requires concrete bounded file paths; wildcard/repository-wide scope cannot bypass SDD.
245
+
246
+ ## Quality convergence
247
+
248
+ ```text
249
+ critical = 300 DebtPoints = DebtScore 100
250
+ high = 75 DebtPoints = DebtScore 25
251
+ medium = 24 DebtPoints = DebtScore 8
252
+ low = 3 DebtPoints = DebtScore 1
253
+ note = 1 DebtPoint = DebtScore 1/3
254
+ ```
255
+
256
+ Final acceptance requires critical/high/medium = 0, low <= 3 and DebtScore <= 3. Review remediation has no arbitrary round limit; stagnation, regression and cycles trigger rollback, stronger agents/models, diagnosis and autonomous replanning.
257
+
258
+ ## Trust model
259
+
260
+ - Human/lead owns intent and genuinely non-derivable product decisions.
261
+ - Git/SDD/TaskContract/QuickContract define normative truth.
262
+ - The frozen issue snapshot is provenance; remote issue drift cannot silently change an active run.
263
+ - `toolchain.yaml` defines desired engineering capabilities; its lock defines resolved executable versions.
264
+ - Agent topology defines who may act and with which model/skills/MCPs.
265
+ - Workers do not own acceptance criteria or Git delivery authority.
266
+ - Deterministic evidence outranks agent summaries.
267
+ - The Final Quality Gate outranks reviewer optimism.
268
+ - Memory and Graphify inform; neither authorizes desired behavior.
269
+ - Human interaction remains an exception path rather than a remediation cadence.
270
+
271
+ ## License
272
+
273
+ Apache-2.0.
@@ -0,0 +1,12 @@
1
+ import type { HarnessProjectConfig } from "../core/types.js";
2
+ export interface AgentAuditReport {
3
+ ok: boolean;
4
+ checks: Array<{
5
+ id: string;
6
+ status: "PASS" | "FAIL" | "WARN";
7
+ message: string;
8
+ }>;
9
+ }
10
+ export declare function auditAgentTopology(root: string, config: HarnessProjectConfig, profile?: string, options?: {
11
+ checkGenerated?: boolean;
12
+ }): Promise<AgentAuditReport>;
@@ -0,0 +1,14 @@
1
+ import { compileAgentTopology, validateAgentTopology } from "./compiler.js";
2
+ import { loadResolvedAgentTopology } from "./config.js";
3
+ import { knownOutputContracts } from "./outputContracts.js";
4
+ import { validateExecutionCapabilities } from "./permissions.js";
5
+ export async function auditAgentTopology(root, config, profile, options) { const checks = []; const structural = await validateAgentTopology(root, config, profile); checks.push({ id: "topology.references", status: structural.ok ? "PASS" : "FAIL", message: structural.ok ? "Agent/model/prompt/skill references resolve." : structural.issues.join("; ") }); if (!structural.ok)
6
+ return { ok: false, checks }; const topology = await loadResolvedAgentTopology(root, config, profile); const contracts = new Set(knownOutputContracts()); const contractIssues = Object.values(topology.agents).filter((agent) => agent.outputContract && !contracts.has(agent.outputContract)).map((agent) => `${agent.name}:${agent.outputContract}`); checks.push({ id: "topology.output-contracts", status: contractIssues.length ? "FAIL" : "PASS", message: contractIssues.length ? `Unknown output contracts: ${contractIssues.join(", ")}` : "All output contracts are known." }); const capabilityIssues = []; for (const agent of Object.values(topology.agents)) {
7
+ const transport = agent.execution.transport === "inherit" || !agent.execution.transport ? (config.orchestration?.provider ?? "none") : agent.execution.transport;
8
+ const selection = { profile: topology.profile, logicalAgent: agent.name, role: agent.role, domains: agent.domains ?? [], runtimeName: agent.runtime.name, runtimeAdapter: agent.runtime.adapter, paseoProvider: agent.runtime.paseoProvider ?? agent.runtime.adapter, modelAlias: agent.model.alias, modelId: agent.model.id, modelName: agent.model.model, modelProvider: agent.model.provider, variant: agent.execution.variant, nativeAgent: agent.execution.nativeAgent, transport: agent.execution.transport ?? "inherit", temperature: agent.temperature, skills: agent.skills ?? [], mcps: agent.mcps ?? [], permissions: agent.permissions ?? {}, outputContract: agent.outputContract, args: [], runtimeCapabilities: agent.runtime.capabilities ?? {} };
9
+ capabilityIssues.push(...validateExecutionCapabilities(selection, transport));
10
+ } checks.push({ id: "topology.permissions-capabilities", status: capabilityIssues.length ? "FAIL" : "PASS", message: capabilityIssues.length ? capabilityIssues.join("; ") : "Agent permissions and runtime capabilities are coherent." }); if (options?.checkGenerated !== false) {
11
+ const generated = await compileAgentTopology(root, config, profile, true);
12
+ checks.push({ id: "topology.generated-drift", status: generated.ok ? "PASS" : "FAIL", message: generated.ok ? "Generated runtime matches source topology and prompts." : generated.issues.join("; ") });
13
+ } return { ok: checks.every((check) => check.status !== "FAIL"), checks }; }
14
+ //# sourceMappingURL=audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/agents/audit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEjE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAA4B,EAAE,OAAgB,EAAE,OAAsC,IAA+B,MAAM,MAAM,GAA+B,EAAE,CAAC,CAAC,MAAM,UAAU,GAAG,MAAM,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;IAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,C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C;IAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,wDAAwD,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAAC,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { HarnessProjectConfig } from "../core/types.js";
2
+ export interface TopologyCheckResult {
3
+ ok: boolean;
4
+ issues: string[];
5
+ output?: string;
6
+ }
7
+ export declare function compileAgentTopology(root: string, config: HarnessProjectConfig, profile?: string, checkOnly?: boolean): Promise<TopologyCheckResult>;
8
+ export declare function validateAgentTopology(root: string, config: HarnessProjectConfig, profile?: string): Promise<TopologyCheckResult>;
@@ -0,0 +1,103 @@
1
+ import crypto from "node:crypto";
2
+ import fs from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { loadAgentTopologySource, resolveAgentTopology } from "./config.js";
5
+ export async function compileAgentTopology(root, config, profile, checkOnly = false) {
6
+ const source = await loadAgentTopologySource(root, config);
7
+ const topology = resolveAgentTopology(source, profile ?? config.agents?.activeProfile);
8
+ const issues = await validateReferences(root, topology);
9
+ if (issues.length)
10
+ return { ok: false, issues };
11
+ const agents = {};
12
+ const promptHashes = {};
13
+ for (const [name, agent] of Object.entries(topology.agents)) {
14
+ let prompt;
15
+ let orchestratorPrompt;
16
+ if (agent.promptPath) {
17
+ prompt = await fs.readFile(path.resolve(root, agent.promptPath), "utf8");
18
+ promptHashes[agent.promptPath] = sha(prompt);
19
+ }
20
+ if (agent.orchestratorPromptPath) {
21
+ orchestratorPrompt = await fs.readFile(path.resolve(root, agent.orchestratorPromptPath), "utf8");
22
+ promptHashes[agent.orchestratorPromptPath] = sha(orchestratorPrompt);
23
+ }
24
+ agents[name] = { ...agent, prompt, orchestratorPrompt };
25
+ }
26
+ const runtime = { version: 1, profile: topology.profile, sourceHash: sha(JSON.stringify({ source, promptHashes })), models: topology.models, agents, routing: topology.routing, recovery: topology.recovery, councils: topology.councils };
27
+ const generated = `${JSON.stringify(runtime, null, 2)}\n`;
28
+ const output = path.resolve(root, config.agents?.generatedPath ?? ".harness/generated/agents.json");
29
+ if (checkOnly) {
30
+ try {
31
+ const existing = await fs.readFile(output, "utf8");
32
+ if (existing !== generated)
33
+ return { ok: false, issues: ["Generated agent topology is stale. Run `aeh agents compile`."], output };
34
+ }
35
+ catch {
36
+ return { ok: false, issues: ["Generated agent topology does not exist. Run `aeh agents compile`."], output };
37
+ }
38
+ return { ok: true, issues: [], output };
39
+ }
40
+ await fs.mkdir(path.dirname(output), { recursive: true });
41
+ await fs.writeFile(output, generated);
42
+ return { ok: true, issues: [], output };
43
+ }
44
+ export async function validateAgentTopology(root, config, profile) {
45
+ try {
46
+ const topology = resolveAgentTopology(await loadAgentTopologySource(root, config), profile ?? config.agents?.activeProfile);
47
+ const issues = await validateReferences(root, topology);
48
+ return { ok: issues.length === 0, issues };
49
+ }
50
+ catch (error) {
51
+ return { ok: false, issues: [String(error instanceof Error ? error.message : error)] };
52
+ }
53
+ }
54
+ async function validateReferences(root, topology) {
55
+ const issues = [];
56
+ const agentNames = new Set(Object.keys(topology.agents));
57
+ for (const [name, agent] of Object.entries(topology.agents)) {
58
+ for (const promptPath of [agent.promptPath, agent.orchestratorPromptPath].filter((value) => Boolean(value))) {
59
+ try {
60
+ await fs.access(path.resolve(root, promptPath));
61
+ }
62
+ catch {
63
+ issues.push(`Agent ${name} references missing prompt ${promptPath}`);
64
+ }
65
+ }
66
+ for (const skill of agent.skills ?? []) {
67
+ if (skill === "*")
68
+ continue;
69
+ let found = false;
70
+ for (const skillRoot of topology.skillRoots) {
71
+ try {
72
+ await fs.access(path.resolve(root, skillRoot, skill, "SKILL.md"));
73
+ found = true;
74
+ break;
75
+ }
76
+ catch { /* continue */ }
77
+ }
78
+ if (!found)
79
+ issues.push(`Agent ${name} references missing skill ${skill}`);
80
+ }
81
+ }
82
+ for (const rule of topology.routing) {
83
+ if (rule.use && !agentNames.has(rule.use))
84
+ issues.push(`Routing rule ${rule.id} selects unknown agent ${rule.use}`);
85
+ for (const reviewer of rule.reviewers ?? [])
86
+ if (!agentNames.has(reviewer))
87
+ issues.push(`Routing rule ${rule.id} references unknown reviewer ${reviewer}`);
88
+ for (const validator of rule.validators ?? [])
89
+ if (!agentNames.has(validator))
90
+ issues.push(`Routing rule ${rule.id} references unknown validator ${validator}`);
91
+ }
92
+ for (const [failure, steps] of Object.entries(topology.recovery))
93
+ for (const step of steps ?? [])
94
+ if (step.action === "agent" && step.agent && !agentNames.has(step.agent))
95
+ issues.push(`Recovery ${failure} references unknown agent ${step.agent}`);
96
+ for (const [name, council] of Object.entries(topology.councils))
97
+ for (const member of council.members)
98
+ if (member.agent && !agentNames.has(member.agent))
99
+ issues.push(`Council ${name} references unknown agent ${member.agent}`);
100
+ return [...new Set(issues)];
101
+ }
102
+ function sha(value) { return crypto.createHash("sha256").update(value).digest("hex"); }
103
+ //# sourceMappingURL=compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/agents/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAK5E,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAY,EAAE,MAA4B,EAAE,OAAgB,EAAE,SAAS,G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MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { HarnessProjectConfig } from "../core/types.js";
2
+ import type { AgentTopologyLayer, AgentTopologySource, ResolvedAgentTopology } from "./types.js";
3
+ export declare function loadAgentTopologySource(root: string, config: HarnessProjectConfig): Promise<AgentTopologySource>;
4
+ export declare function composeAgentTopologyLayers(base: AgentTopologyLayer, overlay: AgentTopologyLayer): AgentTopologyLayer;
5
+ export declare function loadResolvedAgentTopology(root: string, config: HarnessProjectConfig, profileOverride?: string): Promise<ResolvedAgentTopology>;
6
+ export declare function resolveAgentTopology(source: AgentTopologySource, profileOverride?: string): ResolvedAgentTopology;