@agentic-sdlc-kit/contracts 0.0.0-stage → 0.8.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 (495) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -2
  3. package/dist/agent/capability.d.ts +9 -0
  4. package/dist/agent/capability.d.ts.map +1 -0
  5. package/dist/agent/capability.js +31 -0
  6. package/dist/agent/capability.js.map +1 -0
  7. package/dist/agent/errors.d.ts +30 -0
  8. package/dist/agent/errors.d.ts.map +1 -0
  9. package/dist/agent/errors.js +62 -0
  10. package/dist/agent/errors.js.map +1 -0
  11. package/dist/agent/events.d.ts +222 -0
  12. package/dist/agent/events.d.ts.map +1 -0
  13. package/dist/agent/events.js +92 -0
  14. package/dist/agent/events.js.map +1 -0
  15. package/dist/agent/execution.d.ts +553 -0
  16. package/dist/agent/execution.d.ts.map +1 -0
  17. package/dist/agent/execution.js +229 -0
  18. package/dist/agent/execution.js.map +1 -0
  19. package/dist/agent/index.d.ts +8 -0
  20. package/dist/agent/index.d.ts.map +1 -0
  21. package/dist/agent/index.js +19 -0
  22. package/dist/agent/index.js.map +1 -0
  23. package/dist/agent/policy.d.ts +135 -0
  24. package/dist/agent/policy.d.ts.map +1 -0
  25. package/dist/agent/policy.js +78 -0
  26. package/dist/agent/policy.js.map +1 -0
  27. package/dist/agent/provider.d.ts +82 -0
  28. package/dist/agent/provider.d.ts.map +1 -0
  29. package/dist/agent/provider.js +33 -0
  30. package/dist/agent/provider.js.map +1 -0
  31. package/dist/agent/session.d.ts +17 -0
  32. package/dist/agent/session.d.ts.map +1 -0
  33. package/dist/agent/session.js +23 -0
  34. package/dist/agent/session.js.map +1 -0
  35. package/dist/application/application-context.d.ts +512 -0
  36. package/dist/application/application-context.d.ts.map +1 -0
  37. package/dist/application/application-context.js +42 -0
  38. package/dist/application/application-context.js.map +1 -0
  39. package/dist/application/application-persistence.d.ts +846 -0
  40. package/dist/application/application-persistence.d.ts.map +1 -0
  41. package/dist/application/application-persistence.js +37 -0
  42. package/dist/application/application-persistence.js.map +1 -0
  43. package/dist/application/application-state.d.ts +89 -0
  44. package/dist/application/application-state.d.ts.map +1 -0
  45. package/dist/application/application-state.js +66 -0
  46. package/dist/application/application-state.js.map +1 -0
  47. package/dist/application/application-transitions.d.ts +23 -0
  48. package/dist/application/application-transitions.d.ts.map +1 -0
  49. package/dist/application/application-transitions.js +60 -0
  50. package/dist/application/application-transitions.js.map +1 -0
  51. package/dist/application/index.d.ts +5 -0
  52. package/dist/application/index.d.ts.map +1 -0
  53. package/dist/application/index.js +6 -0
  54. package/dist/application/index.js.map +1 -0
  55. package/dist/architecture/api-contract.d.ts +259 -0
  56. package/dist/architecture/api-contract.d.ts.map +1 -0
  57. package/dist/architecture/api-contract.js +43 -0
  58. package/dist/architecture/api-contract.js.map +1 -0
  59. package/dist/architecture/architecture-approval.d.ts +40 -0
  60. package/dist/architecture/architecture-approval.d.ts.map +1 -0
  61. package/dist/architecture/architecture-approval.js +24 -0
  62. package/dist/architecture/architecture-approval.js.map +1 -0
  63. package/dist/architecture/architecture-options.d.ts +103 -0
  64. package/dist/architecture/architecture-options.d.ts.map +1 -0
  65. package/dist/architecture/architecture-options.js +35 -0
  66. package/dist/architecture/architecture-options.js.map +1 -0
  67. package/dist/architecture/component-map.d.ts +76 -0
  68. package/dist/architecture/component-map.d.ts.map +1 -0
  69. package/dist/architecture/component-map.js +28 -0
  70. package/dist/architecture/component-map.js.map +1 -0
  71. package/dist/architecture/data-model.d.ts +252 -0
  72. package/dist/architecture/data-model.d.ts.map +1 -0
  73. package/dist/architecture/data-model.js +53 -0
  74. package/dist/architecture/data-model.js.map +1 -0
  75. package/dist/architecture/index.d.ts +8 -0
  76. package/dist/architecture/index.d.ts.map +1 -0
  77. package/dist/architecture/index.js +9 -0
  78. package/dist/architecture/index.js.map +1 -0
  79. package/dist/architecture/operational-design.d.ts +134 -0
  80. package/dist/architecture/operational-design.d.ts.map +1 -0
  81. package/dist/architecture/operational-design.js +46 -0
  82. package/dist/architecture/operational-design.js.map +1 -0
  83. package/dist/architecture/security-design.d.ts +107 -0
  84. package/dist/architecture/security-design.d.ts.map +1 -0
  85. package/dist/architecture/security-design.js +40 -0
  86. package/dist/architecture/security-design.js.map +1 -0
  87. package/dist/common/errors.d.ts +40 -0
  88. package/dist/common/errors.d.ts.map +1 -0
  89. package/dist/common/errors.js +45 -0
  90. package/dist/common/errors.js.map +1 -0
  91. package/dist/common/identifier.d.ts +12 -0
  92. package/dist/common/identifier.d.ts.map +1 -0
  93. package/dist/common/identifier.js +21 -0
  94. package/dist/common/identifier.js.map +1 -0
  95. package/dist/common/index.d.ts +4 -0
  96. package/dist/common/index.d.ts.map +1 -0
  97. package/dist/common/index.js +5 -0
  98. package/dist/common/index.js.map +1 -0
  99. package/dist/common/result.d.ts +28 -0
  100. package/dist/common/result.d.ts.map +1 -0
  101. package/dist/common/result.js +33 -0
  102. package/dist/common/result.js.map +1 -0
  103. package/dist/evaluation/benchmark.d.ts +88 -0
  104. package/dist/evaluation/benchmark.d.ts.map +1 -0
  105. package/dist/evaluation/benchmark.js +34 -0
  106. package/dist/evaluation/benchmark.js.map +1 -0
  107. package/dist/evaluation/index.d.ts +3 -0
  108. package/dist/evaluation/index.d.ts.map +1 -0
  109. package/dist/evaluation/index.js +4 -0
  110. package/dist/evaluation/index.js.map +1 -0
  111. package/dist/evaluation/metrics.d.ts +164 -0
  112. package/dist/evaluation/metrics.d.ts.map +1 -0
  113. package/dist/evaluation/metrics.js +64 -0
  114. package/dist/evaluation/metrics.js.map +1 -0
  115. package/dist/evolution/experiment.d.ts +85 -0
  116. package/dist/evolution/experiment.d.ts.map +1 -0
  117. package/dist/evolution/experiment.js +52 -0
  118. package/dist/evolution/experiment.js.map +1 -0
  119. package/dist/evolution/improvement-hypothesis.d.ts +98 -0
  120. package/dist/evolution/improvement-hypothesis.d.ts.map +1 -0
  121. package/dist/evolution/improvement-hypothesis.js +59 -0
  122. package/dist/evolution/improvement-hypothesis.js.map +1 -0
  123. package/dist/evolution/index.d.ts +3 -0
  124. package/dist/evolution/index.d.ts.map +1 -0
  125. package/dist/evolution/index.js +4 -0
  126. package/dist/evolution/index.js.map +1 -0
  127. package/dist/index.d.ts +24 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +43 -0
  130. package/dist/index.js.map +1 -0
  131. package/dist/installer/index.d.ts +4 -0
  132. package/dist/installer/index.d.ts.map +1 -0
  133. package/dist/installer/index.js +5 -0
  134. package/dist/installer/index.js.map +1 -0
  135. package/dist/installer/install-plan.d.ts +168 -0
  136. package/dist/installer/install-plan.d.ts.map +1 -0
  137. package/dist/installer/install-plan.js +40 -0
  138. package/dist/installer/install-plan.js.map +1 -0
  139. package/dist/installer/ownership-manifest.d.ts +78 -0
  140. package/dist/installer/ownership-manifest.d.ts.map +1 -0
  141. package/dist/installer/ownership-manifest.js +30 -0
  142. package/dist/installer/ownership-manifest.js.map +1 -0
  143. package/dist/installer/package-manifest.d.ts +55 -0
  144. package/dist/installer/package-manifest.d.ts.map +1 -0
  145. package/dist/installer/package-manifest.js +46 -0
  146. package/dist/installer/package-manifest.js.map +1 -0
  147. package/dist/learning/engineering-lesson.d.ts +84 -0
  148. package/dist/learning/engineering-lesson.d.ts.map +1 -0
  149. package/dist/learning/engineering-lesson.js +47 -0
  150. package/dist/learning/engineering-lesson.js.map +1 -0
  151. package/dist/learning/engineering-memory.d.ts +66 -0
  152. package/dist/learning/engineering-memory.d.ts.map +1 -0
  153. package/dist/learning/engineering-memory.js +44 -0
  154. package/dist/learning/engineering-memory.js.map +1 -0
  155. package/dist/learning/experience-episode.d.ts +176 -0
  156. package/dist/learning/experience-episode.d.ts.map +1 -0
  157. package/dist/learning/experience-episode.js +68 -0
  158. package/dist/learning/experience-episode.js.map +1 -0
  159. package/dist/learning/experience.d.ts +68 -0
  160. package/dist/learning/experience.d.ts.map +1 -0
  161. package/dist/learning/experience.js +22 -0
  162. package/dist/learning/experience.js.map +1 -0
  163. package/dist/learning/hypothesis.d.ts +57 -0
  164. package/dist/learning/hypothesis.d.ts.map +1 -0
  165. package/dist/learning/hypothesis.js +27 -0
  166. package/dist/learning/hypothesis.js.map +1 -0
  167. package/dist/learning/index.d.ts +8 -0
  168. package/dist/learning/index.d.ts.map +1 -0
  169. package/dist/learning/index.js +9 -0
  170. package/dist/learning/index.js.map +1 -0
  171. package/dist/learning/memory.d.ts +42 -0
  172. package/dist/learning/memory.d.ts.map +1 -0
  173. package/dist/learning/memory.js +20 -0
  174. package/dist/learning/memory.js.map +1 -0
  175. package/dist/learning/promotion.d.ts +31 -0
  176. package/dist/learning/promotion.d.ts.map +1 -0
  177. package/dist/learning/promotion.js +16 -0
  178. package/dist/learning/promotion.js.map +1 -0
  179. package/dist/maintenance/bug-fix-workflow.d.ts +57 -0
  180. package/dist/maintenance/bug-fix-workflow.d.ts.map +1 -0
  181. package/dist/maintenance/bug-fix-workflow.js +100 -0
  182. package/dist/maintenance/bug-fix-workflow.js.map +1 -0
  183. package/dist/maintenance/bug-report.d.ts +62 -0
  184. package/dist/maintenance/bug-report.d.ts.map +1 -0
  185. package/dist/maintenance/bug-report.js +49 -0
  186. package/dist/maintenance/bug-report.js.map +1 -0
  187. package/dist/maintenance/index.d.ts +6 -0
  188. package/dist/maintenance/index.d.ts.map +1 -0
  189. package/dist/maintenance/index.js +7 -0
  190. package/dist/maintenance/index.js.map +1 -0
  191. package/dist/maintenance/performance-baseline.d.ts +80 -0
  192. package/dist/maintenance/performance-baseline.d.ts.map +1 -0
  193. package/dist/maintenance/performance-baseline.js +32 -0
  194. package/dist/maintenance/performance-baseline.js.map +1 -0
  195. package/dist/maintenance/refactor-contract.d.ts +158 -0
  196. package/dist/maintenance/refactor-contract.d.ts.map +1 -0
  197. package/dist/maintenance/refactor-contract.js +65 -0
  198. package/dist/maintenance/refactor-contract.js.map +1 -0
  199. package/dist/maintenance/refactor-workflow.d.ts +79 -0
  200. package/dist/maintenance/refactor-workflow.d.ts.map +1 -0
  201. package/dist/maintenance/refactor-workflow.js +100 -0
  202. package/dist/maintenance/refactor-workflow.js.map +1 -0
  203. package/dist/observer/event-schema.d.ts +49 -0
  204. package/dist/observer/event-schema.d.ts.map +1 -0
  205. package/dist/observer/event-schema.js +48 -0
  206. package/dist/observer/event-schema.js.map +1 -0
  207. package/dist/observer/index.d.ts +5 -0
  208. package/dist/observer/index.d.ts.map +1 -0
  209. package/dist/observer/index.js +6 -0
  210. package/dist/observer/index.js.map +1 -0
  211. package/dist/observer/journal.d.ts +83 -0
  212. package/dist/observer/journal.d.ts.map +1 -0
  213. package/dist/observer/journal.js +76 -0
  214. package/dist/observer/journal.js.map +1 -0
  215. package/dist/observer/retention.d.ts +25 -0
  216. package/dist/observer/retention.d.ts.map +1 -0
  217. package/dist/observer/retention.js +21 -0
  218. package/dist/observer/retention.js.map +1 -0
  219. package/dist/observer/run-summary.d.ts +260 -0
  220. package/dist/observer/run-summary.d.ts.map +1 -0
  221. package/dist/observer/run-summary.js +32 -0
  222. package/dist/observer/run-summary.js.map +1 -0
  223. package/dist/patterns/index.d.ts +2 -0
  224. package/dist/patterns/index.d.ts.map +1 -0
  225. package/dist/patterns/index.js +3 -0
  226. package/dist/patterns/index.js.map +1 -0
  227. package/dist/patterns/pattern.d.ts +106 -0
  228. package/dist/patterns/pattern.d.ts.map +1 -0
  229. package/dist/patterns/pattern.js +69 -0
  230. package/dist/patterns/pattern.js.map +1 -0
  231. package/dist/planning/index.d.ts +2 -0
  232. package/dist/planning/index.d.ts.map +1 -0
  233. package/dist/planning/index.js +3 -0
  234. package/dist/planning/index.js.map +1 -0
  235. package/dist/planning/task.d.ts +178 -0
  236. package/dist/planning/task.d.ts.map +1 -0
  237. package/dist/planning/task.js +35 -0
  238. package/dist/planning/task.js.map +1 -0
  239. package/dist/policy/index.d.ts +2 -0
  240. package/dist/policy/index.d.ts.map +1 -0
  241. package/dist/policy/index.js +3 -0
  242. package/dist/policy/index.js.map +1 -0
  243. package/dist/policy/policy.d.ts +83 -0
  244. package/dist/policy/policy.d.ts.map +1 -0
  245. package/dist/policy/policy.js +57 -0
  246. package/dist/policy/policy.js.map +1 -0
  247. package/dist/product/index.d.ts +5 -0
  248. package/dist/product/index.d.ts.map +1 -0
  249. package/dist/product/index.js +6 -0
  250. package/dist/product/index.js.map +1 -0
  251. package/dist/product/mvp-scope.d.ts +25 -0
  252. package/dist/product/mvp-scope.d.ts.map +1 -0
  253. package/dist/product/mvp-scope.js +18 -0
  254. package/dist/product/mvp-scope.js.map +1 -0
  255. package/dist/product/product-brief.d.ts +94 -0
  256. package/dist/product/product-brief.d.ts.map +1 -0
  257. package/dist/product/product-brief.js +44 -0
  258. package/dist/product/product-brief.js.map +1 -0
  259. package/dist/product/requirements.d.ts +251 -0
  260. package/dist/product/requirements.d.ts.map +1 -0
  261. package/dist/product/requirements.js +50 -0
  262. package/dist/product/requirements.js.map +1 -0
  263. package/dist/product/traceability.d.ts +50 -0
  264. package/dist/product/traceability.d.ts.map +1 -0
  265. package/dist/product/traceability.js +20 -0
  266. package/dist/product/traceability.js.map +1 -0
  267. package/dist/project/index.d.ts +3 -0
  268. package/dist/project/index.d.ts.map +1 -0
  269. package/dist/project/index.js +4 -0
  270. package/dist/project/index.js.map +1 -0
  271. package/dist/project/project-profile.d.ts +79 -0
  272. package/dist/project/project-profile.d.ts.map +1 -0
  273. package/dist/project/project-profile.js +53 -0
  274. package/dist/project/project-profile.js.map +1 -0
  275. package/dist/project/repository-scan.d.ts +82 -0
  276. package/dist/project/repository-scan.d.ts.map +1 -0
  277. package/dist/project/repository-scan.js +29 -0
  278. package/dist/project/repository-scan.js.map +1 -0
  279. package/dist/routing/capability-registry.d.ts +87 -0
  280. package/dist/routing/capability-registry.d.ts.map +1 -0
  281. package/dist/routing/capability-registry.js +26 -0
  282. package/dist/routing/capability-registry.js.map +1 -0
  283. package/dist/routing/escalation.d.ts +25 -0
  284. package/dist/routing/escalation.d.ts.map +1 -0
  285. package/dist/routing/escalation.js +21 -0
  286. package/dist/routing/escalation.js.map +1 -0
  287. package/dist/routing/index.d.ts +5 -0
  288. package/dist/routing/index.d.ts.map +1 -0
  289. package/dist/routing/index.js +6 -0
  290. package/dist/routing/index.js.map +1 -0
  291. package/dist/routing/routing-policy.d.ts +103 -0
  292. package/dist/routing/routing-policy.d.ts.map +1 -0
  293. package/dist/routing/routing-policy.js +32 -0
  294. package/dist/routing/routing-policy.js.map +1 -0
  295. package/dist/routing/routing-request.d.ts +63 -0
  296. package/dist/routing/routing-request.d.ts.map +1 -0
  297. package/dist/routing/routing-request.js +46 -0
  298. package/dist/routing/routing-request.js.map +1 -0
  299. package/dist/runtime-guard/action-classification.d.ts +54 -0
  300. package/dist/runtime-guard/action-classification.d.ts.map +1 -0
  301. package/dist/runtime-guard/action-classification.js +90 -0
  302. package/dist/runtime-guard/action-classification.js.map +1 -0
  303. package/dist/runtime-guard/audit-event.d.ts +98 -0
  304. package/dist/runtime-guard/audit-event.d.ts.map +1 -0
  305. package/dist/runtime-guard/audit-event.js +45 -0
  306. package/dist/runtime-guard/audit-event.js.map +1 -0
  307. package/dist/runtime-guard/index.d.ts +4 -0
  308. package/dist/runtime-guard/index.d.ts.map +1 -0
  309. package/dist/runtime-guard/index.js +5 -0
  310. package/dist/runtime-guard/index.js.map +1 -0
  311. package/dist/runtime-guard/policy-schema.d.ts +139 -0
  312. package/dist/runtime-guard/policy-schema.d.ts.map +1 -0
  313. package/dist/runtime-guard/policy-schema.js +50 -0
  314. package/dist/runtime-guard/policy-schema.js.map +1 -0
  315. package/dist/scaffolding/index.d.ts +3 -0
  316. package/dist/scaffolding/index.d.ts.map +1 -0
  317. package/dist/scaffolding/index.js +4 -0
  318. package/dist/scaffolding/index.js.map +1 -0
  319. package/dist/scaffolding/scaffold-contract.d.ts +528 -0
  320. package/dist/scaffolding/scaffold-contract.d.ts.map +1 -0
  321. package/dist/scaffolding/scaffold-contract.js +50 -0
  322. package/dist/scaffolding/scaffold-contract.js.map +1 -0
  323. package/dist/scaffolding/template-manifest.d.ts +105 -0
  324. package/dist/scaffolding/template-manifest.d.ts.map +1 -0
  325. package/dist/scaffolding/template-manifest.js +44 -0
  326. package/dist/scaffolding/template-manifest.js.map +1 -0
  327. package/dist/secret-guard/detection-rule.d.ts +33 -0
  328. package/dist/secret-guard/detection-rule.d.ts.map +1 -0
  329. package/dist/secret-guard/detection-rule.js +109 -0
  330. package/dist/secret-guard/detection-rule.js.map +1 -0
  331. package/dist/secret-guard/finding.d.ts +89 -0
  332. package/dist/secret-guard/finding.d.ts.map +1 -0
  333. package/dist/secret-guard/finding.js +85 -0
  334. package/dist/secret-guard/finding.js.map +1 -0
  335. package/dist/secret-guard/index.d.ts +5 -0
  336. package/dist/secret-guard/index.d.ts.map +1 -0
  337. package/dist/secret-guard/index.js +6 -0
  338. package/dist/secret-guard/index.js.map +1 -0
  339. package/dist/secret-guard/redaction-policy.d.ts +26 -0
  340. package/dist/secret-guard/redaction-policy.d.ts.map +1 -0
  341. package/dist/secret-guard/redaction-policy.js +30 -0
  342. package/dist/secret-guard/redaction-policy.js.map +1 -0
  343. package/dist/secret-guard/scanner-failure.d.ts +59 -0
  344. package/dist/secret-guard/scanner-failure.d.ts.map +1 -0
  345. package/dist/secret-guard/scanner-failure.js +40 -0
  346. package/dist/secret-guard/scanner-failure.js.map +1 -0
  347. package/dist/specification/index.d.ts +2 -0
  348. package/dist/specification/index.d.ts.map +1 -0
  349. package/dist/specification/index.js +3 -0
  350. package/dist/specification/index.js.map +1 -0
  351. package/dist/specification/specification.d.ts +229 -0
  352. package/dist/specification/specification.d.ts.map +1 -0
  353. package/dist/specification/specification.js +67 -0
  354. package/dist/specification/specification.js.map +1 -0
  355. package/dist/stack-pack/index.d.ts +2 -0
  356. package/dist/stack-pack/index.d.ts.map +1 -0
  357. package/dist/stack-pack/index.js +3 -0
  358. package/dist/stack-pack/index.js.map +1 -0
  359. package/dist/stack-pack/manifest.d.ts +88 -0
  360. package/dist/stack-pack/manifest.d.ts.map +1 -0
  361. package/dist/stack-pack/manifest.js +51 -0
  362. package/dist/stack-pack/manifest.js.map +1 -0
  363. package/dist/verification/index.d.ts +2 -0
  364. package/dist/verification/index.d.ts.map +1 -0
  365. package/dist/verification/index.js +3 -0
  366. package/dist/verification/index.js.map +1 -0
  367. package/dist/verification/report.d.ts +95 -0
  368. package/dist/verification/report.d.ts.map +1 -0
  369. package/dist/verification/report.js +57 -0
  370. package/dist/verification/report.js.map +1 -0
  371. package/dist/workflow/index.d.ts +3 -0
  372. package/dist/workflow/index.d.ts.map +1 -0
  373. package/dist/workflow/index.js +4 -0
  374. package/dist/workflow/index.js.map +1 -0
  375. package/dist/workflow/next-action.d.ts +130 -0
  376. package/dist/workflow/next-action.d.ts.map +1 -0
  377. package/dist/workflow/next-action.js +92 -0
  378. package/dist/workflow/next-action.js.map +1 -0
  379. package/dist/workflow/workflow.d.ts +68 -0
  380. package/dist/workflow/workflow.d.ts.map +1 -0
  381. package/dist/workflow/workflow.js +33 -0
  382. package/dist/workflow/workflow.js.map +1 -0
  383. package/package.json +31 -3
  384. package/src/agent/agent.test.ts +451 -0
  385. package/src/agent/capability.ts +35 -0
  386. package/src/agent/errors.ts +69 -0
  387. package/src/agent/events.ts +107 -0
  388. package/src/agent/execution.ts +275 -0
  389. package/src/agent/index.ts +19 -0
  390. package/src/agent/policy.ts +82 -0
  391. package/src/agent/provider.ts +124 -0
  392. package/src/agent/session.ts +29 -0
  393. package/src/application/application-context.ts +47 -0
  394. package/src/application/application-persistence.ts +44 -0
  395. package/src/application/application-state.test.ts +107 -0
  396. package/src/application/application-state.ts +81 -0
  397. package/src/application/application-transitions.ts +71 -0
  398. package/src/application/index.ts +5 -0
  399. package/src/architecture/api-contract.ts +56 -0
  400. package/src/architecture/architecture-approval.ts +27 -0
  401. package/src/architecture/architecture-options.ts +42 -0
  402. package/src/architecture/architecture.test.ts +263 -0
  403. package/src/architecture/component-map.ts +35 -0
  404. package/src/architecture/data-model.ts +66 -0
  405. package/src/architecture/index.ts +8 -0
  406. package/src/architecture/operational-design.ts +55 -0
  407. package/src/architecture/security-design.ts +47 -0
  408. package/src/common/errors.test.ts +46 -0
  409. package/src/common/errors.ts +114 -0
  410. package/src/common/identifier.test.ts +51 -0
  411. package/src/common/identifier.ts +33 -0
  412. package/src/common/index.ts +4 -0
  413. package/src/common/result.test.ts +52 -0
  414. package/src/common/result.ts +50 -0
  415. package/src/evaluation/benchmark.ts +42 -0
  416. package/src/evaluation/index.ts +3 -0
  417. package/src/evaluation/metrics.ts +76 -0
  418. package/src/evolution/experiment.ts +61 -0
  419. package/src/evolution/improvement-hypothesis.ts +67 -0
  420. package/src/evolution/index.ts +3 -0
  421. package/src/index.test.ts +54 -0
  422. package/src/index.ts +53 -0
  423. package/src/installer/index.ts +4 -0
  424. package/src/installer/install-plan.ts +49 -0
  425. package/src/installer/ownership-manifest.ts +36 -0
  426. package/src/installer/package-manifest.ts +54 -0
  427. package/src/learning/engineering-lesson.ts +55 -0
  428. package/src/learning/engineering-memory.ts +51 -0
  429. package/src/learning/experience-episode.ts +76 -0
  430. package/src/learning/experience.ts +27 -0
  431. package/src/learning/hypothesis.ts +33 -0
  432. package/src/learning/index.ts +8 -0
  433. package/src/learning/memory.ts +25 -0
  434. package/src/learning/promotion.ts +19 -0
  435. package/src/maintenance/bug-fix-workflow.ts +119 -0
  436. package/src/maintenance/bug-report.ts +58 -0
  437. package/src/maintenance/index.ts +6 -0
  438. package/src/maintenance/maintenance.test.ts +219 -0
  439. package/src/maintenance/performance-baseline.ts +35 -0
  440. package/src/maintenance/refactor-contract.ts +77 -0
  441. package/src/maintenance/refactor-workflow.ts +121 -0
  442. package/src/observer/event-schema.ts +54 -0
  443. package/src/observer/index.ts +5 -0
  444. package/src/observer/journal.test.ts +73 -0
  445. package/src/observer/journal.ts +84 -0
  446. package/src/observer/retention.ts +24 -0
  447. package/src/observer/run-summary.ts +37 -0
  448. package/src/patterns/index.ts +2 -0
  449. package/src/patterns/pattern.ts +80 -0
  450. package/src/planning/index.ts +2 -0
  451. package/src/planning/task.ts +47 -0
  452. package/src/policy/index.ts +2 -0
  453. package/src/policy/policy.test.ts +50 -0
  454. package/src/policy/policy.ts +67 -0
  455. package/src/product/index.ts +5 -0
  456. package/src/product/mvp-scope.ts +21 -0
  457. package/src/product/product-brief.test.ts +108 -0
  458. package/src/product/product-brief.ts +53 -0
  459. package/src/product/requirements.ts +59 -0
  460. package/src/product/traceability.ts +25 -0
  461. package/src/project/index.ts +3 -0
  462. package/src/project/project-profile.test.ts +98 -0
  463. package/src/project/project-profile.ts +65 -0
  464. package/src/project/repository-scan.ts +34 -0
  465. package/src/routing/capability-registry.ts +31 -0
  466. package/src/routing/escalation.ts +24 -0
  467. package/src/routing/index.ts +5 -0
  468. package/src/routing/routing-policy.ts +38 -0
  469. package/src/routing/routing-request.ts +55 -0
  470. package/src/runtime-guard/action-classification.ts +99 -0
  471. package/src/runtime-guard/audit-event.ts +49 -0
  472. package/src/runtime-guard/index.ts +4 -0
  473. package/src/runtime-guard/policy-schema.ts +56 -0
  474. package/src/runtime-guard/runtime-guard.test.ts +147 -0
  475. package/src/scaffolding/index.ts +3 -0
  476. package/src/scaffolding/scaffold-contract.test.ts +107 -0
  477. package/src/scaffolding/scaffold-contract.ts +63 -0
  478. package/src/scaffolding/template-manifest.ts +52 -0
  479. package/src/secret-guard/detection-rule.ts +115 -0
  480. package/src/secret-guard/finding.ts +93 -0
  481. package/src/secret-guard/index.ts +5 -0
  482. package/src/secret-guard/redaction-policy.ts +34 -0
  483. package/src/secret-guard/scanner-failure.ts +47 -0
  484. package/src/secret-guard/secret-guard.test.ts +130 -0
  485. package/src/specification/index.ts +2 -0
  486. package/src/specification/specification.ts +79 -0
  487. package/src/stack-pack/index.ts +2 -0
  488. package/src/stack-pack/manifest.ts +60 -0
  489. package/src/verification/index.ts +2 -0
  490. package/src/verification/report.test.ts +91 -0
  491. package/src/verification/report.ts +62 -0
  492. package/src/workflow/index.ts +3 -0
  493. package/src/workflow/next-action.test.ts +101 -0
  494. package/src/workflow/next-action.ts +101 -0
  495. package/src/workflow/workflow.ts +49 -0
@@ -0,0 +1,5 @@
1
+ export * from './event-schema.js';
2
+ export * from './run-summary.js';
3
+ export * from './retention.js';
4
+ export * from './journal.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observer/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ // packages/contracts/src/observer/index.ts
2
+ export * from './event-schema.js';
3
+ export * from './run-summary.js';
4
+ export * from './retention.js';
5
+ export * from './journal.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/observer/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { z } from 'zod';
2
+ export declare const JOURNAL_SCHEMA_VERSION: 1;
3
+ /** Semantic events in the life of a feature run. */
4
+ export declare const JournalEventKindSchema: z.ZodEnum<["workflow.started", "phase.recorded", "phase.rejected", "phase.failed", "workflow.finalized"]>;
5
+ export type JournalEventKind = z.infer<typeof JournalEventKindSchema>;
6
+ /**
7
+ * Who invoked the kit. The kit CANNOT infer agent vs. human at the CLI
8
+ * boundary — a host declares itself (`--host <id>` or KIT_HOST env) and
9
+ * the kit records the declaration, defaulting to 'human'. An undeclared
10
+ * agent is recorded honestly as what the kit observed, not what it
11
+ * guessed.
12
+ */
13
+ export declare const JournalActorSchema: z.ZodObject<{
14
+ kind: z.ZodEnum<["agent", "human", "kit"]>;
15
+ /** Declared host id (e.g. 'claude-code', 'cursor', 'agy', 'github-actions'). */
16
+ host: z.ZodOptional<z.ZodString>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ kind: "agent" | "human" | "kit";
19
+ host?: string | undefined;
20
+ }, {
21
+ kind: "agent" | "human" | "kit";
22
+ host?: string | undefined;
23
+ }>;
24
+ export type JournalActor = z.infer<typeof JournalActorSchema>;
25
+ export declare const JournalEventSchema: z.ZodObject<{
26
+ schemaVersion: z.ZodLiteral<1>;
27
+ /** 0-based position in the chain; strictly increasing, no gaps. */
28
+ seq: z.ZodNumber;
29
+ /** ISO 8601 timestamp. */
30
+ ts: z.ZodString;
31
+ /** The feature run this event belongs to (run id == feature id). */
32
+ featureId: z.ZodString;
33
+ /** Target task, when the event is task-scoped. */
34
+ taskId: z.ZodOptional<z.ZodString>;
35
+ kind: z.ZodEnum<["workflow.started", "phase.recorded", "phase.rejected", "phase.failed", "workflow.finalized"]>;
36
+ actor: z.ZodObject<{
37
+ kind: z.ZodEnum<["agent", "human", "kit"]>;
38
+ /** Declared host id (e.g. 'claude-code', 'cursor', 'agy', 'github-actions'). */
39
+ host: z.ZodOptional<z.ZodString>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ kind: "agent" | "human" | "kit";
42
+ host?: string | undefined;
43
+ }, {
44
+ kind: "agent" | "human" | "kit";
45
+ host?: string | undefined;
46
+ }>;
47
+ /** Redacted, bounded event detail (evidence excerpts, statuses). */
48
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
49
+ /** Hash of the previous event ('GENESIS' for seq 0). */
50
+ prevHash: z.ZodString;
51
+ /** SHA-256 over the canonical serialization of this event without `hash`. */
52
+ hash: z.ZodEffects<z.ZodString, string, string>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ schemaVersion: 1;
55
+ featureId: string;
56
+ kind: "workflow.started" | "phase.recorded" | "phase.rejected" | "phase.failed" | "workflow.finalized";
57
+ seq: number;
58
+ ts: string;
59
+ actor: {
60
+ kind: "agent" | "human" | "kit";
61
+ host?: string | undefined;
62
+ };
63
+ payload: Record<string, unknown>;
64
+ prevHash: string;
65
+ hash: string;
66
+ taskId?: string | undefined;
67
+ }, {
68
+ schemaVersion: 1;
69
+ featureId: string;
70
+ kind: "workflow.started" | "phase.recorded" | "phase.rejected" | "phase.failed" | "workflow.finalized";
71
+ seq: number;
72
+ ts: string;
73
+ actor: {
74
+ kind: "agent" | "human" | "kit";
75
+ host?: string | undefined;
76
+ };
77
+ payload: Record<string, unknown>;
78
+ prevHash: string;
79
+ hash: string;
80
+ taskId?: string | undefined;
81
+ }>;
82
+ export type JournalEvent = z.infer<typeof JournalEventSchema>;
83
+ //# sourceMappingURL=journal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../src/observer/journal.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AAEjD,oDAAoD;AACpD,eAAO,MAAM,sBAAsB,2GAWjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;IAE7B,gFAAgF;;;;;;;;EAEhF,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAK9D,eAAO,MAAM,kBAAkB;;IAE7B,mEAAmE;;IAEnE,0BAA0B;;IAE1B,oEAAoE;;IAEpE,kDAAkD;;;;;QAhBlD,gFAAgF;;;;;;;;;IAoBhF,oEAAoE;;IAEpE,wDAAwD;;IAExD,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE7E,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,76 @@
1
+ // packages/contracts/src/observer/journal.ts
2
+ //
3
+ // Hash-chained execution journal (ADR-0021 §3).
4
+ //
5
+ // The feature run state (.ai-kit/state/feature-runs/<featureId>.json)
6
+ // is the handoff boundary; the journal is the EXECUTED RECORD: an
7
+ // append-only, tamper-evident, per-run event log at
8
+ // .ai-kit/journal/feature-runs/<featureId>.jsonl.
9
+ //
10
+ // Chain rule: every event carries `prevHash` (the `hash` of the
11
+ // previous event; the literal string 'GENESIS' for seq 0) and `hash`
12
+ // (SHA-256 over the canonical serialization of the event without its
13
+ // `hash` field). `kit journal <featureId> --verify` recomputes the
14
+ // chain and fails on any gap, reordering, or mutation.
15
+ //
16
+ // Honest limits (ADR-0021 §3.4):
17
+ // - Modification, insertion, and reordering of recorded events are
18
+ // DETECTABLE. Tail truncation is NOT detectable from the journal
19
+ // alone — a truncated file is still a valid chain. Anchoring (e.g.
20
+ // recording the final hash in the run report or an external system)
21
+ // is the follow-up; the journal never claims more than it proves.
22
+ // - The journal is observability, never authority: an event never
23
+ // authorizes anything and cannot substitute for evidence records.
24
+ // Journal write failures never block the workflow (the run-observer
25
+ // invariant: telemetry must not block the chain).
26
+ // - `payload` carries redacted, bounded strings only — the same
27
+ // redaction policy and excerpt bound as phase evidence.
28
+ import { z } from 'zod';
29
+ export const JOURNAL_SCHEMA_VERSION = 1;
30
+ /** Semantic events in the life of a feature run. */
31
+ export const JournalEventKindSchema = z.enum([
32
+ /** `kit feature <id> start` created the run state. */
33
+ 'workflow.started',
34
+ /** A phase attempt satisfied its invariant and advanced the task. */
35
+ 'phase.recorded',
36
+ /** A phase attempt was recorded but did NOT advance (e.g. Red failed with a non-assertion classification). */
37
+ 'phase.rejected',
38
+ /** A phase attempt ran and violated its invariant (e.g. Green failed). */
39
+ 'phase.failed',
40
+ /** Final verification completed. `payload.status` is 'passed' | 'failed'. */
41
+ 'workflow.finalized',
42
+ ]);
43
+ /**
44
+ * Who invoked the kit. The kit CANNOT infer agent vs. human at the CLI
45
+ * boundary — a host declares itself (`--host <id>` or KIT_HOST env) and
46
+ * the kit records the declaration, defaulting to 'human'. An undeclared
47
+ * agent is recorded honestly as what the kit observed, not what it
48
+ * guessed.
49
+ */
50
+ export const JournalActorSchema = z.object({
51
+ kind: z.enum(['agent', 'human', 'kit']),
52
+ /** Declared host id (e.g. 'claude-code', 'cursor', 'agy', 'github-actions'). */
53
+ host: z.string().min(1).optional(),
54
+ });
55
+ /** SHA-256 hex digest (64 lowercase hex chars) or the GENESIS sentinel. */
56
+ const HashSchema = z.string().regex(/^(GENESIS|[0-9a-f]{64})$/, 'expected 64 hex chars or GENESIS');
57
+ export const JournalEventSchema = z.object({
58
+ schemaVersion: z.literal(JOURNAL_SCHEMA_VERSION),
59
+ /** 0-based position in the chain; strictly increasing, no gaps. */
60
+ seq: z.number().int().nonnegative(),
61
+ /** ISO 8601 timestamp. */
62
+ ts: z.string().min(1),
63
+ /** The feature run this event belongs to (run id == feature id). */
64
+ featureId: z.string().min(1),
65
+ /** Target task, when the event is task-scoped. */
66
+ taskId: z.string().optional(),
67
+ kind: JournalEventKindSchema,
68
+ actor: JournalActorSchema,
69
+ /** Redacted, bounded event detail (evidence excerpts, statuses). */
70
+ payload: z.record(z.unknown()),
71
+ /** Hash of the previous event ('GENESIS' for seq 0). */
72
+ prevHash: HashSchema,
73
+ /** SHA-256 over the canonical serialization of this event without `hash`. */
74
+ hash: HashSchema.refine((h) => h !== 'GENESIS', 'the GENESIS sentinel is only valid as prevHash'),
75
+ });
76
+ //# sourceMappingURL=journal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal.js","sourceRoot":"","sources":["../../src/observer/journal.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,kEAAkE;AAClE,oDAAoD;AACpD,kDAAkD;AAClD,EAAE;AACF,gEAAgE;AAChE,qEAAqE;AACrE,qEAAqE;AACrE,mEAAmE;AACnE,uDAAuD;AACvD,EAAE;AACF,iCAAiC;AACjC,qEAAqE;AACrE,qEAAqE;AACrE,uEAAuE;AACvE,wEAAwE;AACxE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AACtE,wEAAwE;AACxE,sDAAsD;AACtD,kEAAkE;AAClE,4DAA4D;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAU,CAAC;AAEjD,oDAAoD;AACpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,sDAAsD;IACtD,kBAAkB;IAClB,qEAAqE;IACrE,gBAAgB;IAChB,8GAA8G;IAC9G,gBAAgB;IAChB,0EAA0E;IAC1E,cAAc;IACd,6EAA6E;IAC7E,oBAAoB;CACrB,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACvC,gFAAgF;IAChF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGH,2EAA2E;AAC3E,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,0BAA0B,EAAE,kCAAkC,CAAC,CAAC;AAEpG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;IAChD,mEAAmE;IACnE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACnC,0BAA0B;IAC1B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,oEAAoE;IACpE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,kDAAkD;IAClD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,kBAAkB;IACzB,oEAAoE;IACpE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC9B,wDAAwD;IACxD,QAAQ,EAAE,UAAU;IACpB,6EAA6E;IAC7E,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,EAAE,gDAAgD,CAAC;CAClG,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export declare const RetentionPolicySchema: z.ZodObject<{
3
+ schemaVersion: z.ZodLiteral<1>;
4
+ retainDays: z.ZodDefault<z.ZodNumber>;
5
+ maxEventsPerRun: z.ZodDefault<z.ZodNumber>;
6
+ redactSummaries: z.ZodDefault<z.ZodBoolean>;
7
+ dropUsageData: z.ZodDefault<z.ZodBoolean>;
8
+ redactPathPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ schemaVersion: 1;
11
+ retainDays: number;
12
+ maxEventsPerRun: number;
13
+ redactSummaries: boolean;
14
+ dropUsageData: boolean;
15
+ redactPathPatterns: string[];
16
+ }, {
17
+ schemaVersion: 1;
18
+ retainDays?: number | undefined;
19
+ maxEventsPerRun?: number | undefined;
20
+ redactSummaries?: boolean | undefined;
21
+ dropUsageData?: boolean | undefined;
22
+ redactPathPatterns?: string[] | undefined;
23
+ }>;
24
+ export type RetentionPolicy = z.infer<typeof RetentionPolicySchema>;
25
+ //# sourceMappingURL=retention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention.d.ts","sourceRoot":"","sources":["../../src/observer/retention.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EAchC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ // packages/contracts/src/observer/retention.ts
2
+ //
3
+ // M13 retention policy (M13-09). Local retention and cleanup for observer
4
+ // events. Privacy-first: redacted by default, configurable retention.
5
+ import { z } from 'zod';
6
+ export const RetentionPolicySchema = z.object({
7
+ schemaVersion: z.literal(1),
8
+ // How long to keep events (in days). 0 = delete immediately after
9
+ // summary is written; -1 = keep forever.
10
+ retainDays: z.number().int().default(30),
11
+ // Maximum number of events per run before truncating (cap memory).
12
+ maxEventsPerRun: z.number().int().positive().default(10_000),
13
+ // Whether to redact summaries (strip anything that looks like a path,
14
+ // identifier, or value).
15
+ redactSummaries: z.boolean().default(true),
16
+ // Whether to drop token/cost data (privacy).
17
+ dropUsageData: z.boolean().default(false),
18
+ // Path patterns to never record in summaries.
19
+ redactPathPatterns: z.array(z.string()).default([]),
20
+ });
21
+ //# sourceMappingURL=retention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention.js","sourceRoot":"","sources":["../../src/observer/retention.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,0EAA0E;AAC1E,sEAAsE;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,kEAAkE;IAClE,yCAAyC;IACzC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,mEAAmE;IACnE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IAC5D,sEAAsE;IACtE,yBAAyB;IACzB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1C,6CAA6C;IAC7C,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACzC,8CAA8C;IAC9C,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACpD,CAAC,CAAC"}
@@ -0,0 +1,260 @@
1
+ import { z } from 'zod';
2
+ export declare const RunSummarySchema: z.ZodObject<{
3
+ schemaVersion: z.ZodLiteral<1>;
4
+ runId: z.ZodString;
5
+ startedAt: z.ZodString;
6
+ completedAt: z.ZodOptional<z.ZodString>;
7
+ status: z.ZodEnum<["in-progress", "completed", "failed", "blocked"]>;
8
+ totals: z.ZodObject<{
9
+ turns: z.ZodOptional<z.ZodNumber>;
10
+ toolCalls: z.ZodOptional<z.ZodNumber>;
11
+ agentsSpawned: z.ZodOptional<z.ZodNumber>;
12
+ tokensIn: z.ZodOptional<z.ZodNumber>;
13
+ tokensOut: z.ZodOptional<z.ZodNumber>;
14
+ estimatedCostUnits: z.ZodOptional<z.ZodNumber>;
15
+ escalations: z.ZodOptional<z.ZodNumber>;
16
+ blockedActions: z.ZodOptional<z.ZodNumber>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ tokensIn?: number | undefined;
19
+ tokensOut?: number | undefined;
20
+ estimatedCostUnits?: number | undefined;
21
+ turns?: number | undefined;
22
+ toolCalls?: number | undefined;
23
+ agentsSpawned?: number | undefined;
24
+ escalations?: number | undefined;
25
+ blockedActions?: number | undefined;
26
+ }, {
27
+ tokensIn?: number | undefined;
28
+ tokensOut?: number | undefined;
29
+ estimatedCostUnits?: number | undefined;
30
+ turns?: number | undefined;
31
+ toolCalls?: number | undefined;
32
+ agentsSpawned?: number | undefined;
33
+ escalations?: number | undefined;
34
+ blockedActions?: number | undefined;
35
+ }>;
36
+ verificationStatus: z.ZodOptional<z.ZodEnum<["passed", "failed", "blocked", "not-run"]>>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ status: "failed" | "blocked" | "completed" | "in-progress";
39
+ schemaVersion: 1;
40
+ runId: string;
41
+ startedAt: string;
42
+ totals: {
43
+ tokensIn?: number | undefined;
44
+ tokensOut?: number | undefined;
45
+ estimatedCostUnits?: number | undefined;
46
+ turns?: number | undefined;
47
+ toolCalls?: number | undefined;
48
+ agentsSpawned?: number | undefined;
49
+ escalations?: number | undefined;
50
+ blockedActions?: number | undefined;
51
+ };
52
+ completedAt?: string | undefined;
53
+ verificationStatus?: "passed" | "failed" | "blocked" | "not-run" | undefined;
54
+ }, {
55
+ status: "failed" | "blocked" | "completed" | "in-progress";
56
+ schemaVersion: 1;
57
+ runId: string;
58
+ startedAt: string;
59
+ totals: {
60
+ tokensIn?: number | undefined;
61
+ tokensOut?: number | undefined;
62
+ estimatedCostUnits?: number | undefined;
63
+ turns?: number | undefined;
64
+ toolCalls?: number | undefined;
65
+ agentsSpawned?: number | undefined;
66
+ escalations?: number | undefined;
67
+ blockedActions?: number | undefined;
68
+ };
69
+ completedAt?: string | undefined;
70
+ verificationStatus?: "passed" | "failed" | "blocked" | "not-run" | undefined;
71
+ }>;
72
+ export declare const RunReportSchema: z.ZodObject<{
73
+ schemaVersion: z.ZodLiteral<1>;
74
+ summary: z.ZodObject<{
75
+ schemaVersion: z.ZodLiteral<1>;
76
+ runId: z.ZodString;
77
+ startedAt: z.ZodString;
78
+ completedAt: z.ZodOptional<z.ZodString>;
79
+ status: z.ZodEnum<["in-progress", "completed", "failed", "blocked"]>;
80
+ totals: z.ZodObject<{
81
+ turns: z.ZodOptional<z.ZodNumber>;
82
+ toolCalls: z.ZodOptional<z.ZodNumber>;
83
+ agentsSpawned: z.ZodOptional<z.ZodNumber>;
84
+ tokensIn: z.ZodOptional<z.ZodNumber>;
85
+ tokensOut: z.ZodOptional<z.ZodNumber>;
86
+ estimatedCostUnits: z.ZodOptional<z.ZodNumber>;
87
+ escalations: z.ZodOptional<z.ZodNumber>;
88
+ blockedActions: z.ZodOptional<z.ZodNumber>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ tokensIn?: number | undefined;
91
+ tokensOut?: number | undefined;
92
+ estimatedCostUnits?: number | undefined;
93
+ turns?: number | undefined;
94
+ toolCalls?: number | undefined;
95
+ agentsSpawned?: number | undefined;
96
+ escalations?: number | undefined;
97
+ blockedActions?: number | undefined;
98
+ }, {
99
+ tokensIn?: number | undefined;
100
+ tokensOut?: number | undefined;
101
+ estimatedCostUnits?: number | undefined;
102
+ turns?: number | undefined;
103
+ toolCalls?: number | undefined;
104
+ agentsSpawned?: number | undefined;
105
+ escalations?: number | undefined;
106
+ blockedActions?: number | undefined;
107
+ }>;
108
+ verificationStatus: z.ZodOptional<z.ZodEnum<["passed", "failed", "blocked", "not-run"]>>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ status: "failed" | "blocked" | "completed" | "in-progress";
111
+ schemaVersion: 1;
112
+ runId: string;
113
+ startedAt: string;
114
+ totals: {
115
+ tokensIn?: number | undefined;
116
+ tokensOut?: number | undefined;
117
+ estimatedCostUnits?: number | undefined;
118
+ turns?: number | undefined;
119
+ toolCalls?: number | undefined;
120
+ agentsSpawned?: number | undefined;
121
+ escalations?: number | undefined;
122
+ blockedActions?: number | undefined;
123
+ };
124
+ completedAt?: string | undefined;
125
+ verificationStatus?: "passed" | "failed" | "blocked" | "not-run" | undefined;
126
+ }, {
127
+ status: "failed" | "blocked" | "completed" | "in-progress";
128
+ schemaVersion: 1;
129
+ runId: string;
130
+ startedAt: string;
131
+ totals: {
132
+ tokensIn?: number | undefined;
133
+ tokensOut?: number | undefined;
134
+ estimatedCostUnits?: number | undefined;
135
+ turns?: number | undefined;
136
+ toolCalls?: number | undefined;
137
+ agentsSpawned?: number | undefined;
138
+ escalations?: number | undefined;
139
+ blockedActions?: number | undefined;
140
+ };
141
+ completedAt?: string | undefined;
142
+ verificationStatus?: "passed" | "failed" | "blocked" | "not-run" | undefined;
143
+ }>;
144
+ events: z.ZodArray<z.ZodObject<{
145
+ schemaVersion: z.ZodLiteral<1>;
146
+ id: z.ZodString;
147
+ runId: z.ZodString;
148
+ sessionId: z.ZodOptional<z.ZodString>;
149
+ at: z.ZodString;
150
+ kind: z.ZodEnum<["session-start", "session-end", "turn-start", "turn-step", "turn-complete", "agent-spawn", "agent-complete", "tool-call", "tool-result", "verification", "escalation", "failure", "blocked-action"]>;
151
+ model: z.ZodOptional<z.ZodString>;
152
+ effort: z.ZodOptional<z.ZodString>;
153
+ tokensIn: z.ZodOptional<z.ZodNumber>;
154
+ tokensOut: z.ZodOptional<z.ZodNumber>;
155
+ estimatedCostUnits: z.ZodOptional<z.ZodNumber>;
156
+ summary: z.ZodString;
157
+ partial: z.ZodDefault<z.ZodBoolean>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ at: string;
160
+ schemaVersion: 1;
161
+ id: string;
162
+ runId: string;
163
+ summary: string;
164
+ kind: "verification" | "session-start" | "session-end" | "turn-start" | "turn-step" | "turn-complete" | "agent-spawn" | "agent-complete" | "tool-call" | "tool-result" | "escalation" | "failure" | "blocked-action";
165
+ partial: boolean;
166
+ model?: string | undefined;
167
+ effort?: string | undefined;
168
+ sessionId?: string | undefined;
169
+ tokensIn?: number | undefined;
170
+ tokensOut?: number | undefined;
171
+ estimatedCostUnits?: number | undefined;
172
+ }, {
173
+ at: string;
174
+ schemaVersion: 1;
175
+ id: string;
176
+ runId: string;
177
+ summary: string;
178
+ kind: "verification" | "session-start" | "session-end" | "turn-start" | "turn-step" | "turn-complete" | "agent-spawn" | "agent-complete" | "tool-call" | "tool-result" | "escalation" | "failure" | "blocked-action";
179
+ model?: string | undefined;
180
+ effort?: string | undefined;
181
+ sessionId?: string | undefined;
182
+ tokensIn?: number | undefined;
183
+ tokensOut?: number | undefined;
184
+ estimatedCostUnits?: number | undefined;
185
+ partial?: boolean | undefined;
186
+ }>, "many">;
187
+ }, "strip", z.ZodTypeAny, {
188
+ schemaVersion: 1;
189
+ summary: {
190
+ status: "failed" | "blocked" | "completed" | "in-progress";
191
+ schemaVersion: 1;
192
+ runId: string;
193
+ startedAt: string;
194
+ totals: {
195
+ tokensIn?: number | undefined;
196
+ tokensOut?: number | undefined;
197
+ estimatedCostUnits?: number | undefined;
198
+ turns?: number | undefined;
199
+ toolCalls?: number | undefined;
200
+ agentsSpawned?: number | undefined;
201
+ escalations?: number | undefined;
202
+ blockedActions?: number | undefined;
203
+ };
204
+ completedAt?: string | undefined;
205
+ verificationStatus?: "passed" | "failed" | "blocked" | "not-run" | undefined;
206
+ };
207
+ events: {
208
+ at: string;
209
+ schemaVersion: 1;
210
+ id: string;
211
+ runId: string;
212
+ summary: string;
213
+ kind: "verification" | "session-start" | "session-end" | "turn-start" | "turn-step" | "turn-complete" | "agent-spawn" | "agent-complete" | "tool-call" | "tool-result" | "escalation" | "failure" | "blocked-action";
214
+ partial: boolean;
215
+ model?: string | undefined;
216
+ effort?: string | undefined;
217
+ sessionId?: string | undefined;
218
+ tokensIn?: number | undefined;
219
+ tokensOut?: number | undefined;
220
+ estimatedCostUnits?: number | undefined;
221
+ }[];
222
+ }, {
223
+ schemaVersion: 1;
224
+ summary: {
225
+ status: "failed" | "blocked" | "completed" | "in-progress";
226
+ schemaVersion: 1;
227
+ runId: string;
228
+ startedAt: string;
229
+ totals: {
230
+ tokensIn?: number | undefined;
231
+ tokensOut?: number | undefined;
232
+ estimatedCostUnits?: number | undefined;
233
+ turns?: number | undefined;
234
+ toolCalls?: number | undefined;
235
+ agentsSpawned?: number | undefined;
236
+ escalations?: number | undefined;
237
+ blockedActions?: number | undefined;
238
+ };
239
+ completedAt?: string | undefined;
240
+ verificationStatus?: "passed" | "failed" | "blocked" | "not-run" | undefined;
241
+ };
242
+ events: {
243
+ at: string;
244
+ schemaVersion: 1;
245
+ id: string;
246
+ runId: string;
247
+ summary: string;
248
+ kind: "verification" | "session-start" | "session-end" | "turn-start" | "turn-step" | "turn-complete" | "agent-spawn" | "agent-complete" | "tool-call" | "tool-result" | "escalation" | "failure" | "blocked-action";
249
+ model?: string | undefined;
250
+ effort?: string | undefined;
251
+ sessionId?: string | undefined;
252
+ tokensIn?: number | undefined;
253
+ tokensOut?: number | undefined;
254
+ estimatedCostUnits?: number | undefined;
255
+ partial?: boolean | undefined;
256
+ }[];
257
+ }>;
258
+ export type RunSummary = z.infer<typeof RunSummarySchema>;
259
+ export type RunReport = z.infer<typeof RunReportSchema>;
260
+ //# sourceMappingURL=run-summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-summary.d.ts","sourceRoot":"","sources":["../../src/observer/run-summary.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB3B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI1B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ // packages/contracts/src/observer/run-summary.ts
2
+ //
3
+ // M13 run summary (M13-06). The shape produced by `kit runs show RUN-001`.
4
+ import { z } from 'zod';
5
+ import { ObserverEventSchema } from './event-schema.js';
6
+ export const RunSummarySchema = z.object({
7
+ schemaVersion: z.literal(1),
8
+ runId: z.string(),
9
+ startedAt: z.string(),
10
+ completedAt: z.string().optional(),
11
+ status: z.enum(['in-progress', 'completed', 'failed', 'blocked']),
12
+ // Aggregated metrics. Every field is optional because the observer
13
+ // represents partial telemetry honestly (never as zero).
14
+ totals: z.object({
15
+ turns: z.number().int().nonnegative().optional(),
16
+ toolCalls: z.number().int().nonnegative().optional(),
17
+ agentsSpawned: z.number().int().nonnegative().optional(),
18
+ tokensIn: z.number().int().nonnegative().optional(),
19
+ tokensOut: z.number().int().nonnegative().optional(),
20
+ estimatedCostUnits: z.number().nonnegative().optional(),
21
+ escalations: z.number().int().nonnegative().optional(),
22
+ blockedActions: z.number().int().nonnegative().optional(),
23
+ }),
24
+ // Verification results correlated with this run.
25
+ verificationStatus: z.enum(['passed', 'failed', 'blocked', 'not-run']).optional(),
26
+ });
27
+ export const RunReportSchema = z.object({
28
+ schemaVersion: z.literal(1),
29
+ summary: RunSummarySchema,
30
+ events: z.array(ObserverEventSchema),
31
+ });
32
+ //# sourceMappingURL=run-summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-summary.js","sourceRoot":"","sources":["../../src/observer/run-summary.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,2EAA2E;AAE3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACjE,mEAAmE;IACnE,yDAAyD;IACzD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACpD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACnD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACpD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACvD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACtD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;KAC1D,CAAC;IACF,iDAAiD;IACjD,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CAClF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;CACrC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './pattern.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ // packages/contracts/src/patterns/index.ts
2
+ export * from './pattern.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,cAAc,cAAc,CAAC"}