@empire-builder-kit/nx 1.0.0-beta.9 → 1.0.0-rc.2

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 (824) hide show
  1. package/NOTICE +6 -0
  2. package/README.md +113 -3
  3. package/executors.json +30 -0
  4. package/package.json +84 -6
  5. package/src/api-contract/baseline-update.d.ts +82 -0
  6. package/src/api-contract/baseline-update.js +225 -0
  7. package/src/api-contract/baseline-update.js.map +1 -0
  8. package/src/api-contract/compatibility.d.ts +30 -0
  9. package/src/api-contract/compatibility.js +643 -0
  10. package/src/api-contract/compatibility.js.map +1 -0
  11. package/src/api-contract/contract-graph.d.ts +35 -0
  12. package/src/api-contract/contract-graph.js +141 -0
  13. package/src/api-contract/contract-graph.js.map +1 -0
  14. package/src/api-contract/evidence.d.ts +23 -0
  15. package/src/api-contract/evidence.js +87 -0
  16. package/src/api-contract/evidence.js.map +1 -0
  17. package/src/api-contract/index.d.ts +6 -0
  18. package/src/api-contract/index.js +10 -0
  19. package/src/api-contract/index.js.map +1 -0
  20. package/src/api-contract/model.d.ts +144 -0
  21. package/src/api-contract/model.fixtures.d.ts +2 -0
  22. package/src/api-contract/model.fixtures.js +81 -0
  23. package/src/api-contract/model.fixtures.js.map +1 -0
  24. package/src/api-contract/model.js +993 -0
  25. package/src/api-contract/model.js.map +1 -0
  26. package/src/api-contract/rollout.d.ts +32 -0
  27. package/src/api-contract/rollout.js +88 -0
  28. package/src/api-contract/rollout.js.map +1 -0
  29. package/src/authorization/compatibility.d.ts +62 -0
  30. package/src/authorization/compatibility.js +175 -0
  31. package/src/authorization/compatibility.js.map +1 -0
  32. package/src/authorization/index.d.ts +1 -0
  33. package/src/authorization/index.js +5 -0
  34. package/src/authorization/index.js.map +1 -0
  35. package/src/blueprints/execution.d.ts +25 -1
  36. package/src/blueprints/execution.js +246 -83
  37. package/src/blueprints/execution.js.map +1 -1
  38. package/src/blueprints/external-sandbox.d.ts +53 -0
  39. package/src/blueprints/external-sandbox.js +1182 -0
  40. package/src/blueprints/external-sandbox.js.map +1 -0
  41. package/src/blueprints/manifest.d.ts +42 -2
  42. package/src/blueprints/manifest.js +82 -27
  43. package/src/blueprints/manifest.js.map +1 -1
  44. package/src/blueprints/resolver.d.ts +14 -5
  45. package/src/blueprints/resolver.js +228 -68
  46. package/src/blueprints/resolver.js.map +1 -1
  47. package/src/cli/agent-command.d.ts +30 -0
  48. package/src/cli/agent-command.js +204 -0
  49. package/src/cli/agent-command.js.map +1 -0
  50. package/src/cli/agent-runtime.d.ts +25 -0
  51. package/src/cli/agent-runtime.js +488 -0
  52. package/src/cli/agent-runtime.js.map +1 -0
  53. package/src/cli/blueprint-authority.d.ts +9 -0
  54. package/src/cli/blueprint-authority.js +43 -0
  55. package/src/cli/blueprint-authority.js.map +1 -0
  56. package/src/cli/blueprint-command.d.ts +24 -0
  57. package/src/cli/blueprint-command.js +63 -0
  58. package/src/cli/blueprint-command.js.map +1 -0
  59. package/src/cli/bootstrap.d.ts +31 -0
  60. package/src/cli/bootstrap.js +165 -0
  61. package/src/cli/bootstrap.js.map +1 -0
  62. package/src/cli/dev-command.d.ts +92 -0
  63. package/src/cli/dev-command.js +561 -0
  64. package/src/cli/dev-command.js.map +1 -0
  65. package/src/cli/main.d.ts +131 -0
  66. package/src/cli/main.js +1199 -0
  67. package/src/cli/main.js.map +1 -0
  68. package/src/cli/output.d.ts +19 -0
  69. package/src/cli/output.js +51 -0
  70. package/src/cli/output.js.map +1 -0
  71. package/src/cli/personal-secret-runtime.d.ts +81 -0
  72. package/src/cli/personal-secret-runtime.js +567 -0
  73. package/src/cli/personal-secret-runtime.js.map +1 -0
  74. package/src/cli/secret-terminal.d.ts +12 -0
  75. package/src/cli/secret-terminal.js +128 -0
  76. package/src/cli/secret-terminal.js.map +1 -0
  77. package/src/container-images.d.ts +1 -0
  78. package/src/container-images.js +5 -0
  79. package/src/container-images.js.map +1 -0
  80. package/src/data-lifecycle/index.d.ts +3 -0
  81. package/src/data-lifecycle/index.js +7 -0
  82. package/src/data-lifecycle/index.js.map +1 -0
  83. package/src/data-lifecycle/model.d.ts +172 -0
  84. package/src/data-lifecycle/model.fixtures.d.ts +2 -0
  85. package/src/data-lifecycle/model.fixtures.js +244 -0
  86. package/src/data-lifecycle/model.fixtures.js.map +1 -0
  87. package/src/data-lifecycle/model.js +95 -0
  88. package/src/data-lifecycle/model.js.map +1 -0
  89. package/src/data-lifecycle/sensitive-artifacts.d.ts +28 -0
  90. package/src/data-lifecycle/sensitive-artifacts.js +146 -0
  91. package/src/data-lifecycle/sensitive-artifacts.js.map +1 -0
  92. package/src/data-lifecycle/validation.d.ts +32 -0
  93. package/src/data-lifecycle/validation.js +837 -0
  94. package/src/data-lifecycle/validation.js.map +1 -0
  95. package/src/database-retirement/contract.d.ts +68 -0
  96. package/src/database-retirement/contract.js +166 -0
  97. package/src/database-retirement/contract.js.map +1 -0
  98. package/src/database-retirement/index.d.ts +1 -0
  99. package/src/database-retirement/index.js +5 -0
  100. package/src/database-retirement/index.js.map +1 -0
  101. package/src/deterministic-order.d.ts +2 -0
  102. package/src/deterministic-order.js +7 -0
  103. package/src/deterministic-order.js.map +1 -0
  104. package/src/developer-agent/context.d.ts +27 -0
  105. package/src/developer-agent/context.js +497 -0
  106. package/src/developer-agent/context.js.map +1 -0
  107. package/src/developer-agent/generator-planning.d.ts +34 -0
  108. package/src/developer-agent/generator-planning.js +645 -0
  109. package/src/developer-agent/generator-planning.js.map +1 -0
  110. package/src/developer-agent/generator-preview.d.ts +8 -0
  111. package/src/developer-agent/generator-preview.js +650 -0
  112. package/src/developer-agent/generator-preview.js.map +1 -0
  113. package/src/developer-agent/git-inspection.d.ts +108 -0
  114. package/src/developer-agent/git-inspection.js +815 -0
  115. package/src/developer-agent/git-inspection.js.map +1 -0
  116. package/src/developer-agent/handoff.d.ts +43 -0
  117. package/src/developer-agent/handoff.js +698 -0
  118. package/src/developer-agent/handoff.js.map +1 -0
  119. package/src/developer-agent/index.d.ts +10 -0
  120. package/src/developer-agent/index.js +14 -0
  121. package/src/developer-agent/index.js.map +1 -0
  122. package/src/developer-agent/model.d.ts +481 -0
  123. package/src/developer-agent/model.js +143 -0
  124. package/src/developer-agent/model.js.map +1 -0
  125. package/src/developer-agent/operation-registry.d.ts +45 -0
  126. package/src/developer-agent/operation-registry.js +1255 -0
  127. package/src/developer-agent/operation-registry.js.map +1 -0
  128. package/src/developer-agent/ordering.d.ts +9 -0
  129. package/src/developer-agent/ordering.js +15 -0
  130. package/src/developer-agent/ordering.js.map +1 -0
  131. package/src/developer-agent/planning.d.ts +18 -0
  132. package/src/developer-agent/planning.js +447 -0
  133. package/src/developer-agent/planning.js.map +1 -0
  134. package/src/developer-agent/preview-changes.d.ts +26 -0
  135. package/src/developer-agent/preview-changes.js +203 -0
  136. package/src/developer-agent/preview-changes.js.map +1 -0
  137. package/src/developer-agent/preview-source.d.ts +2 -0
  138. package/src/developer-agent/preview-source.js +16 -0
  139. package/src/developer-agent/preview-source.js.map +1 -0
  140. package/src/developer-agent/validation.d.ts +18 -0
  141. package/src/developer-agent/validation.js +2617 -0
  142. package/src/developer-agent/validation.js.map +1 -0
  143. package/src/developer-agent/workspace-inspection.d.ts +20 -0
  144. package/src/developer-agent/workspace-inspection.js +1134 -0
  145. package/src/developer-agent/workspace-inspection.js.map +1 -0
  146. package/src/developer-agent/workspace-path.d.ts +6 -0
  147. package/src/developer-agent/workspace-path.js +22 -0
  148. package/src/developer-agent/workspace-path.js.map +1 -0
  149. package/src/executors/blueprint-trust/blueprint-trust.d.ts +29 -0
  150. package/src/executors/blueprint-trust/blueprint-trust.js +115 -0
  151. package/src/executors/blueprint-trust/blueprint-trust.js.map +1 -0
  152. package/src/executors/blueprint-trust/schema.json +27 -0
  153. package/src/executors/blueprint-verification/blueprint-verification.d.ts +13 -0
  154. package/src/executors/blueprint-verification/blueprint-verification.js +110 -0
  155. package/src/executors/blueprint-verification/blueprint-verification.js.map +1 -0
  156. package/src/executors/blueprint-verification/schema.json +44 -0
  157. package/src/executors/deployment-plan/deployment-plan.js +1 -0
  158. package/src/executors/deployment-plan/deployment-plan.js.map +1 -1
  159. package/src/executors/dev-doctor/dev-doctor.d.ts +19 -5
  160. package/src/executors/dev-doctor/dev-doctor.js +186 -32
  161. package/src/executors/dev-doctor/dev-doctor.js.map +1 -1
  162. package/src/executors/dev-doctor/schema.json +1 -6
  163. package/src/executors/dev-setup/dev-setup.d.ts +7 -1
  164. package/src/executors/dev-setup/dev-setup.js +14 -3
  165. package/src/executors/dev-setup/dev-setup.js.map +1 -1
  166. package/src/executors/developer-context/developer-context.d.ts +38 -0
  167. package/src/executors/developer-context/developer-context.js +78 -0
  168. package/src/executors/developer-context/developer-context.js.map +1 -0
  169. package/src/executors/developer-context/schema.json +87 -0
  170. package/src/executors/fleet/fleet.d.ts +12 -43
  171. package/src/executors/fleet/fleet.js +120 -500
  172. package/src/executors/fleet/fleet.js.map +1 -1
  173. package/src/executors/fleet/schema.json +64 -14
  174. package/src/executors/github-bootstrap/github-bootstrap.d.ts +1 -0
  175. package/src/executors/github-bootstrap/github-bootstrap.js +1 -0
  176. package/src/executors/github-bootstrap/github-bootstrap.js.map +1 -1
  177. package/src/executors/github-bootstrap/schema.json +5 -0
  178. package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +144 -0
  179. package/src/executors/infrastructure-plan/infrastructure-plan.js +3320 -0
  180. package/src/executors/infrastructure-plan/infrastructure-plan.js.map +1 -0
  181. package/src/executors/infrastructure-plan/schema.json +78 -0
  182. package/src/executors/secret-guardrails/schema.json +6 -0
  183. package/src/executors/secret-guardrails/secret-guardrails.d.ts +3 -0
  184. package/src/executors/secret-guardrails/secret-guardrails.js +44 -0
  185. package/src/executors/secret-guardrails/secret-guardrails.js.map +1 -0
  186. package/src/executors/secret-metadata/schema.json +31 -0
  187. package/src/executors/secret-metadata/secret-metadata.d.ts +32 -0
  188. package/src/executors/secret-metadata/secret-metadata.js +131 -0
  189. package/src/executors/secret-metadata/secret-metadata.js.map +1 -0
  190. package/src/executors/sst-lifecycle/logging-preflight.d.ts +17 -0
  191. package/src/executors/sst-lifecycle/logging-preflight.js +196 -0
  192. package/src/executors/sst-lifecycle/logging-preflight.js.map +1 -0
  193. package/src/executors/sst-lifecycle/run-sst-command.d.ts +23 -3
  194. package/src/executors/sst-lifecycle/run-sst-command.js +113 -10
  195. package/src/executors/sst-lifecycle/run-sst-command.js.map +1 -1
  196. package/src/executors/sst-lifecycle/schema.json +9 -5
  197. package/src/executors/sst-lifecycle/secret-preflight.d.ts +25 -0
  198. package/src/executors/sst-lifecycle/secret-preflight.js +119 -0
  199. package/src/executors/sst-lifecycle/secret-preflight.js.map +1 -0
  200. package/src/foundation/discovery.d.ts +17 -1
  201. package/src/foundation/discovery.js +16 -1
  202. package/src/foundation/discovery.js.map +1 -1
  203. package/src/foundation/index.d.ts +3 -0
  204. package/src/foundation/index.js +3 -0
  205. package/src/foundation/index.js.map +1 -1
  206. package/src/foundation/local-database-contract.d.ts +1 -0
  207. package/src/foundation/local-database-contract.js +3 -0
  208. package/src/foundation/local-database-contract.js.map +1 -1
  209. package/src/foundation/logging-preflight.d.ts +30 -0
  210. package/src/foundation/logging-preflight.js +138 -0
  211. package/src/foundation/logging-preflight.js.map +1 -0
  212. package/src/foundation/logging.d.ts +70 -0
  213. package/src/foundation/logging.js +133 -0
  214. package/src/foundation/logging.js.map +1 -0
  215. package/src/foundation/preflight.d.ts +9 -0
  216. package/src/foundation/preflight.js +58 -2
  217. package/src/foundation/preflight.js.map +1 -1
  218. package/src/foundation/provision-database-bindings.d.ts +9 -1
  219. package/src/foundation/provision-database-bindings.js +25 -5
  220. package/src/foundation/provision-database-bindings.js.map +1 -1
  221. package/src/foundation/provision-logical-database.d.ts +10 -2
  222. package/src/foundation/provision-logical-database.js +68 -113
  223. package/src/foundation/provision-logical-database.js.map +1 -1
  224. package/src/foundation/router-origin-proof.d.ts +2 -0
  225. package/src/foundation/router-origin-proof.js +25 -0
  226. package/src/foundation/router-origin-proof.js.map +1 -0
  227. package/src/foundation/stages.d.ts +1 -0
  228. package/src/foundation/stages.js +9 -1
  229. package/src/foundation/stages.js.map +1 -1
  230. package/src/frontend-security/index.d.ts +1 -0
  231. package/src/frontend-security/index.js +5 -0
  232. package/src/frontend-security/index.js.map +1 -0
  233. package/src/frontend-security/security-headers.d.ts +50 -0
  234. package/src/frontend-security/security-headers.js +418 -0
  235. package/src/frontend-security/security-headers.js.map +1 -0
  236. package/src/generators/feature-registry.d.ts +13 -0
  237. package/src/generators/feature-registry.js +73 -0
  238. package/src/generators/feature-registry.js.map +1 -0
  239. package/src/generators/function/function.d.ts +1 -1
  240. package/src/generators/function/function.js +51 -6
  241. package/src/generators/function/function.js.map +1 -1
  242. package/src/generators/function/schema.d.ts +1 -0
  243. package/src/generators/function/schema.json +6 -1
  244. package/src/generators/logging-registry.d.ts +13 -0
  245. package/src/generators/logging-registry.js +62 -0
  246. package/src/generators/logging-registry.js.map +1 -0
  247. package/src/generators/post-generation-install.d.ts +67 -0
  248. package/src/generators/post-generation-install.js +3308 -0
  249. package/src/generators/post-generation-install.js.map +1 -0
  250. package/src/generators/preset/generator.js +3 -0
  251. package/src/generators/preset/generator.js.map +1 -1
  252. package/src/generators/preset/tool-versions.d.ts +18 -0
  253. package/src/generators/preset/tool-versions.js +22 -0
  254. package/src/generators/preset/tool-versions.js.map +1 -0
  255. package/src/generators/preset/workspace-files-developer-agent.d.ts +14 -0
  256. package/src/generators/preset/workspace-files-developer-agent.js +511 -0
  257. package/src/generators/preset/workspace-files-developer-agent.js.map +1 -0
  258. package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +6 -0
  259. package/src/generators/preset/workspace-files-foundation-workload-roles.js +406 -0
  260. package/src/generators/preset/workspace-files-foundation-workload-roles.js.map +1 -0
  261. package/src/generators/preset/workspace-files-performance-cost.d.ts +66 -0
  262. package/src/generators/preset/workspace-files-performance-cost.js +866 -0
  263. package/src/generators/preset/workspace-files-performance-cost.js.map +1 -0
  264. package/src/generators/preset/workspace-files-performance-load.d.ts +73 -0
  265. package/src/generators/preset/workspace-files-performance-load.js +801 -0
  266. package/src/generators/preset/workspace-files-performance-load.js.map +1 -0
  267. package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +9 -0
  268. package/src/generators/preset/workspace-files-workload-role-baseline.js +1102 -0
  269. package/src/generators/preset/workspace-files-workload-role-baseline.js.map +1 -0
  270. package/src/generators/preset/workspace-files.d.ts +14 -1
  271. package/src/generators/preset/workspace-files.js +8189 -245
  272. package/src/generators/preset/workspace-files.js.map +1 -1
  273. package/src/generators/repository-policy/repository-policy.js +3 -47
  274. package/src/generators/repository-policy/repository-policy.js.map +1 -1
  275. package/src/generators/slice/built-in-plan-api-contract-files.d.ts +2 -0
  276. package/src/generators/slice/built-in-plan-api-contract-files.js +2656 -0
  277. package/src/generators/slice/built-in-plan-api-contract-files.js.map +1 -0
  278. package/src/generators/slice/built-in-plan-api-files.d.ts +2 -0
  279. package/src/generators/slice/built-in-plan-api-files.js +1186 -0
  280. package/src/generators/slice/built-in-plan-api-files.js.map +1 -0
  281. package/src/generators/slice/built-in-plan-async-work-files.d.ts +2 -0
  282. package/src/generators/slice/built-in-plan-async-work-files.js +7903 -0
  283. package/src/generators/slice/built-in-plan-async-work-files.js.map +1 -0
  284. package/src/generators/slice/built-in-plan-authorization-files.d.ts +2 -0
  285. package/src/generators/slice/built-in-plan-authorization-files.js +2314 -0
  286. package/src/generators/slice/built-in-plan-authorization-files.js.map +1 -0
  287. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +2 -0
  288. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +559 -0
  289. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js.map +1 -0
  290. package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +2 -0
  291. package/src/generators/slice/built-in-plan-data-deletion-files.js +1101 -0
  292. package/src/generators/slice/built-in-plan-data-deletion-files.js.map +1 -0
  293. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +2 -0
  294. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +249 -0
  295. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js.map +1 -0
  296. package/src/generators/slice/built-in-plan-data-files.d.ts +2 -0
  297. package/src/generators/slice/built-in-plan-data-files.js +1530 -0
  298. package/src/generators/slice/built-in-plan-data-files.js.map +1 -0
  299. package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +2 -0
  300. package/src/generators/slice/built-in-plan-data-lifecycle-files.js +750 -0
  301. package/src/generators/slice/built-in-plan-data-lifecycle-files.js.map +1 -0
  302. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +2 -0
  303. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +828 -0
  304. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js.map +1 -0
  305. package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +2 -0
  306. package/src/generators/slice/built-in-plan-data-retention-job-files.js +2604 -0
  307. package/src/generators/slice/built-in-plan-data-retention-job-files.js.map +1 -0
  308. package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +2 -0
  309. package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +144 -0
  310. package/src/generators/slice/built-in-plan-data-retention-launcher-files.js.map +1 -0
  311. package/src/generators/slice/built-in-plan-data-rights-files.d.ts +2 -0
  312. package/src/generators/slice/built-in-plan-data-rights-files.js +4628 -0
  313. package/src/generators/slice/built-in-plan-data-rights-files.js.map +1 -0
  314. package/src/generators/slice/built-in-plan-database-lifecycle-files.d.ts +2 -0
  315. package/src/generators/slice/built-in-plan-database-lifecycle-files.js +1901 -0
  316. package/src/generators/slice/built-in-plan-database-lifecycle-files.js.map +1 -0
  317. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +2 -0
  318. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +485 -0
  319. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js.map +1 -0
  320. package/src/generators/slice/built-in-plan-foundation-files.d.ts +2 -0
  321. package/src/generators/slice/built-in-plan-foundation-files.js +184 -0
  322. package/src/generators/slice/built-in-plan-foundation-files.js.map +1 -0
  323. package/src/generators/slice/built-in-plan-frontend-files.d.ts +2 -0
  324. package/src/generators/slice/built-in-plan-frontend-files.js +2233 -0
  325. package/src/generators/slice/built-in-plan-frontend-files.js.map +1 -0
  326. package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +2 -0
  327. package/src/generators/slice/built-in-plan-infrastructure-files.js +3038 -0
  328. package/src/generators/slice/built-in-plan-infrastructure-files.js.map +1 -0
  329. package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +2 -0
  330. package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +312 -0
  331. package/src/generators/slice/built-in-plan-infrastructure-safety-files.js.map +1 -0
  332. package/src/generators/slice/built-in-plan-metadata-files.d.ts +3 -0
  333. package/src/generators/slice/built-in-plan-metadata-files.js +219 -0
  334. package/src/generators/slice/built-in-plan-metadata-files.js.map +1 -0
  335. package/src/generators/slice/built-in-plan-operations-files.d.ts +2 -0
  336. package/src/generators/slice/built-in-plan-operations-files.js +630 -0
  337. package/src/generators/slice/built-in-plan-operations-files.js.map +1 -0
  338. package/src/generators/slice/built-in-plan-performance-files.d.ts +3 -0
  339. package/src/generators/slice/built-in-plan-performance-files.js +3293 -0
  340. package/src/generators/slice/built-in-plan-performance-files.js.map +1 -0
  341. package/src/generators/slice/built-in-plan-project-files.d.ts +3 -0
  342. package/src/generators/slice/built-in-plan-project-files.js +979 -0
  343. package/src/generators/slice/built-in-plan-project-files.js.map +1 -0
  344. package/src/generators/slice/built-in-plan-release-files.d.ts +2 -0
  345. package/src/generators/slice/built-in-plan-release-files.js +6387 -0
  346. package/src/generators/slice/built-in-plan-release-files.js.map +1 -0
  347. package/src/generators/slice/built-in-plan-reliability-files.d.ts +2 -0
  348. package/src/generators/slice/built-in-plan-reliability-files.js +4499 -0
  349. package/src/generators/slice/built-in-plan-reliability-files.js.map +1 -0
  350. package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +2 -0
  351. package/src/generators/slice/built-in-plan-secret-runtime-files.js +1004 -0
  352. package/src/generators/slice/built-in-plan-secret-runtime-files.js.map +1 -0
  353. package/src/generators/slice/built-in-plan-shared.d.ts +53 -0
  354. package/src/generators/slice/built-in-plan-shared.js +113 -0
  355. package/src/generators/slice/built-in-plan-shared.js.map +1 -0
  356. package/src/generators/slice/built-in-plan-testing-files.d.ts +2 -0
  357. package/src/generators/slice/built-in-plan-testing-files.js +2356 -0
  358. package/src/generators/slice/built-in-plan-testing-files.js.map +1 -0
  359. package/src/generators/slice/built-in-plan-verification-files.d.ts +2 -0
  360. package/src/generators/slice/built-in-plan-verification-files.js +358 -0
  361. package/src/generators/slice/built-in-plan-verification-files.js.map +1 -0
  362. package/src/generators/slice/built-in-plan-web-files.d.ts +2 -0
  363. package/src/generators/slice/built-in-plan-web-files.js +430 -0
  364. package/src/generators/slice/built-in-plan-web-files.js.map +1 -0
  365. package/src/generators/slice/built-in-plan-workload-role-files.d.ts +2 -0
  366. package/src/generators/slice/built-in-plan-workload-role-files.js +2356 -0
  367. package/src/generators/slice/built-in-plan-workload-role-files.js.map +1 -0
  368. package/src/generators/slice/built-in-plan.d.ts +8 -0
  369. package/src/generators/slice/built-in-plan.js +264 -0
  370. package/src/generators/slice/built-in-plan.js.map +1 -0
  371. package/src/generators/slice/schema.json +1 -1
  372. package/src/generators/slice/slice.d.ts +1 -22
  373. package/src/generators/slice/slice.js +185 -1510
  374. package/src/generators/slice/slice.js.map +1 -1
  375. package/src/generators/upgrade/schema.d.ts +2 -0
  376. package/src/generators/upgrade/schema.json +11 -1
  377. package/src/generators/upgrade/upgrade.d.ts +51 -1
  378. package/src/generators/upgrade/upgrade.js +820 -82
  379. package/src/generators/upgrade/upgrade.js.map +1 -1
  380. package/src/generators/workload/frozen-container.d.ts +8 -0
  381. package/src/generators/workload/frozen-container.js +36 -0
  382. package/src/generators/workload/frozen-container.js.map +1 -0
  383. package/src/generators/workload/performance-registration.d.ts +32 -0
  384. package/src/generators/workload/performance-registration.js +226 -0
  385. package/src/generators/workload/performance-registration.js.map +1 -0
  386. package/src/generators/workload/reliability-registration.d.ts +16 -0
  387. package/src/generators/workload/reliability-registration.js +150 -0
  388. package/src/generators/workload/reliability-registration.js.map +1 -0
  389. package/src/generators/workload/schema.d.ts +1 -0
  390. package/src/generators/workload/schema.json +6 -1
  391. package/src/generators/workload/service-performance-files.d.ts +4 -0
  392. package/src/generators/workload/service-performance-files.js +1846 -0
  393. package/src/generators/workload/service-performance-files.js.map +1 -0
  394. package/src/generators/workload/workload.d.ts +3 -2
  395. package/src/generators/workload/workload.js +1083 -18
  396. package/src/generators/workload/workload.js.map +1 -1
  397. package/src/git-policy/action-pins.d.ts +10 -0
  398. package/src/git-policy/action-pins.js +10 -0
  399. package/src/git-policy/action-pins.js.map +1 -1
  400. package/src/git-policy/github-bootstrap.d.ts +14 -1
  401. package/src/git-policy/github-bootstrap.js +274 -46
  402. package/src/git-policy/github-bootstrap.js.map +1 -1
  403. package/src/index.d.ts +2 -0
  404. package/src/index.js +2 -0
  405. package/src/index.js.map +1 -1
  406. package/src/infrastructure-change/convergence.d.ts +13 -0
  407. package/src/infrastructure-change/convergence.js +85 -0
  408. package/src/infrastructure-change/convergence.js.map +1 -0
  409. package/src/infrastructure-change/drift.d.ts +13 -0
  410. package/src/infrastructure-change/drift.js +112 -0
  411. package/src/infrastructure-change/drift.js.map +1 -0
  412. package/src/infrastructure-change/index.d.ts +7 -0
  413. package/src/infrastructure-change/index.js +11 -0
  414. package/src/infrastructure-change/index.js.map +1 -0
  415. package/src/infrastructure-change/model.d.ts +253 -0
  416. package/src/infrastructure-change/model.js +28 -0
  417. package/src/infrastructure-change/model.js.map +1 -0
  418. package/src/infrastructure-change/normalize.d.ts +12 -0
  419. package/src/infrastructure-change/normalize.js +245 -0
  420. package/src/infrastructure-change/normalize.js.map +1 -0
  421. package/src/infrastructure-change/plan.d.ts +40 -0
  422. package/src/infrastructure-change/plan.js +361 -0
  423. package/src/infrastructure-change/plan.js.map +1 -0
  424. package/src/infrastructure-change/risk.d.ts +7 -0
  425. package/src/infrastructure-change/risk.js +269 -0
  426. package/src/infrastructure-change/risk.js.map +1 -0
  427. package/src/infrastructure-change/summary.d.ts +20 -0
  428. package/src/infrastructure-change/summary.js +130 -0
  429. package/src/infrastructure-change/summary.js.map +1 -0
  430. package/src/local-dev/context-discovery.d.ts +2 -0
  431. package/src/local-dev/context-discovery.js +59 -0
  432. package/src/local-dev/context-discovery.js.map +1 -0
  433. package/src/local-dev/contract-validation.d.ts +15 -0
  434. package/src/local-dev/contract-validation.js +84 -0
  435. package/src/local-dev/contract-validation.js.map +1 -0
  436. package/src/local-dev/contracts.d.ts +10 -1
  437. package/src/local-dev/contracts.js +57 -5
  438. package/src/local-dev/contracts.js.map +1 -1
  439. package/src/local-dev/control-contract.d.ts +67 -0
  440. package/src/local-dev/control-contract.js +180 -0
  441. package/src/local-dev/control-contract.js.map +1 -0
  442. package/src/local-dev/dev-command-core.d.ts +60 -0
  443. package/src/local-dev/dev-command-core.js +89 -0
  444. package/src/local-dev/dev-command-core.js.map +1 -0
  445. package/src/local-dev/effects.d.ts +16 -0
  446. package/src/local-dev/effects.js +63 -0
  447. package/src/local-dev/effects.js.map +1 -0
  448. package/src/local-dev/environment-inspector.d.ts +125 -0
  449. package/src/local-dev/environment-inspector.js +687 -0
  450. package/src/local-dev/environment-inspector.js.map +1 -0
  451. package/src/local-dev/environment-state.d.ts +113 -0
  452. package/src/local-dev/environment-state.js +463 -0
  453. package/src/local-dev/environment-state.js.map +1 -0
  454. package/src/local-dev/errors.d.ts +6 -0
  455. package/src/local-dev/errors.js +41 -0
  456. package/src/local-dev/errors.js.map +1 -0
  457. package/src/local-dev/fleet-client.d.ts +33 -0
  458. package/src/local-dev/fleet-client.js +156 -0
  459. package/src/local-dev/fleet-client.js.map +1 -0
  460. package/src/local-dev/fleet-configuration.d.ts +13 -0
  461. package/src/local-dev/fleet-configuration.js +71 -0
  462. package/src/local-dev/fleet-configuration.js.map +1 -0
  463. package/src/local-dev/fleet-inventory.d.ts +56 -0
  464. package/src/local-dev/fleet-inventory.js +469 -0
  465. package/src/local-dev/fleet-inventory.js.map +1 -0
  466. package/src/local-dev/fleet-ipc.d.ts +28 -0
  467. package/src/local-dev/fleet-ipc.js +267 -0
  468. package/src/local-dev/fleet-ipc.js.map +1 -0
  469. package/src/local-dev/fleet-launcher.d.ts +53 -0
  470. package/src/local-dev/fleet-launcher.js +379 -0
  471. package/src/local-dev/fleet-launcher.js.map +1 -0
  472. package/src/local-dev/fleet-lock.d.ts +41 -0
  473. package/src/local-dev/fleet-lock.js +135 -0
  474. package/src/local-dev/fleet-lock.js.map +1 -0
  475. package/src/local-dev/fleet-logs.d.ts +66 -0
  476. package/src/local-dev/fleet-logs.js +542 -0
  477. package/src/local-dev/fleet-logs.js.map +1 -0
  478. package/src/local-dev/fleet-process.d.ts +50 -0
  479. package/src/local-dev/fleet-process.js +289 -0
  480. package/src/local-dev/fleet-process.js.map +1 -0
  481. package/src/local-dev/fleet-runtime.d.ts +22 -0
  482. package/src/local-dev/fleet-runtime.js +368 -0
  483. package/src/local-dev/fleet-runtime.js.map +1 -0
  484. package/src/local-dev/fleet-session.d.ts +70 -0
  485. package/src/local-dev/fleet-session.js +301 -0
  486. package/src/local-dev/fleet-session.js.map +1 -0
  487. package/src/local-dev/fleet-slice-runner-daemon.d.ts +1 -0
  488. package/src/local-dev/fleet-slice-runner-daemon.js +21 -0
  489. package/src/local-dev/fleet-slice-runner-daemon.js.map +1 -0
  490. package/src/local-dev/fleet-startup.d.ts +22 -0
  491. package/src/local-dev/fleet-startup.js +114 -0
  492. package/src/local-dev/fleet-startup.js.map +1 -0
  493. package/src/local-dev/fleet-state.d.ts +62 -0
  494. package/src/local-dev/fleet-state.js +297 -0
  495. package/src/local-dev/fleet-state.js.map +1 -0
  496. package/src/local-dev/fleet-supervisor-daemon.d.ts +1 -0
  497. package/src/local-dev/fleet-supervisor-daemon.js +41 -0
  498. package/src/local-dev/fleet-supervisor-daemon.js.map +1 -0
  499. package/src/local-dev/fleet-supervisor.d.ts +52 -0
  500. package/src/local-dev/fleet-supervisor.js +384 -0
  501. package/src/local-dev/fleet-supervisor.js.map +1 -0
  502. package/src/local-dev/gateway.js +1 -1
  503. package/src/local-dev/gateway.js.map +1 -1
  504. package/src/local-dev/identity.js +4 -6
  505. package/src/local-dev/identity.js.map +1 -1
  506. package/src/local-dev/index.d.ts +1 -0
  507. package/src/local-dev/index.js +1 -0
  508. package/src/local-dev/index.js.map +1 -1
  509. package/src/local-dev/local-context.d.ts +62 -0
  510. package/src/local-dev/local-context.js +299 -0
  511. package/src/local-dev/local-context.js.map +1 -0
  512. package/src/local-dev/nx-workspace.d.ts +45 -0
  513. package/src/local-dev/nx-workspace.js +228 -0
  514. package/src/local-dev/nx-workspace.js.map +1 -0
  515. package/src/local-dev/personal-secret-ledger.d.ts +75 -0
  516. package/src/local-dev/personal-secret-ledger.js +391 -0
  517. package/src/local-dev/personal-secret-ledger.js.map +1 -0
  518. package/src/local-dev/personal-stage.d.ts +18 -0
  519. package/src/local-dev/personal-stage.js +129 -0
  520. package/src/local-dev/personal-stage.js.map +1 -0
  521. package/src/local-dev/private-state.d.ts +17 -0
  522. package/src/local-dev/private-state.js +254 -0
  523. package/src/local-dev/private-state.js.map +1 -0
  524. package/src/local-dev/process-identity.d.ts +9 -0
  525. package/src/local-dev/process-identity.js +79 -0
  526. package/src/local-dev/process-identity.js.map +1 -0
  527. package/src/local-dev/runtime-paths.d.ts +17 -0
  528. package/src/local-dev/runtime-paths.js +33 -0
  529. package/src/local-dev/runtime-paths.js.map +1 -0
  530. package/src/local-dev/secret-slice-claim.d.ts +17 -0
  531. package/src/local-dev/secret-slice-claim.js +75 -0
  532. package/src/local-dev/secret-slice-claim.js.map +1 -0
  533. package/src/local-dev/slice-claim.d.ts +36 -0
  534. package/src/local-dev/slice-claim.js +199 -0
  535. package/src/local-dev/slice-claim.js.map +1 -0
  536. package/src/local-dev/slice-runner.d.ts +121 -0
  537. package/src/local-dev/slice-runner.js +715 -0
  538. package/src/local-dev/slice-runner.js.map +1 -0
  539. package/src/local-dev/tls.js +51 -17
  540. package/src/local-dev/tls.js.map +1 -1
  541. package/src/ownership/composition.d.ts +5 -2
  542. package/src/ownership/composition.js +26 -3
  543. package/src/ownership/composition.js.map +1 -1
  544. package/src/ownership/hash.d.ts +1 -1
  545. package/src/ownership/hash.js +3 -1
  546. package/src/ownership/hash.js.map +1 -1
  547. package/src/ownership/record.d.ts +32 -1
  548. package/src/ownership/record.js +139 -2
  549. package/src/ownership/record.js.map +1 -1
  550. package/src/performance/cost-collection.d.ts +225 -0
  551. package/src/performance/cost-collection.js +825 -0
  552. package/src/performance/cost-collection.js.map +1 -0
  553. package/src/performance/cost-controls.d.ts +131 -0
  554. package/src/performance/cost-controls.js +336 -0
  555. package/src/performance/cost-controls.js.map +1 -0
  556. package/src/performance/evidence.d.ts +140 -0
  557. package/src/performance/evidence.js +599 -0
  558. package/src/performance/evidence.js.map +1 -0
  559. package/src/performance/index.d.ts +10 -0
  560. package/src/performance/index.js +14 -0
  561. package/src/performance/index.js.map +1 -0
  562. package/src/performance/load-safety.d.ts +84 -0
  563. package/src/performance/load-safety.js +346 -0
  564. package/src/performance/load-safety.js.map +1 -0
  565. package/src/performance/model.d.ts +129 -0
  566. package/src/performance/model.js +452 -0
  567. package/src/performance/model.js.map +1 -0
  568. package/src/performance/pr-artifact-budget.d.ts +42 -0
  569. package/src/performance/pr-artifact-budget.js +151 -0
  570. package/src/performance/pr-artifact-budget.js.map +1 -0
  571. package/src/performance/runner.d.ts +75 -0
  572. package/src/performance/runner.js +227 -0
  573. package/src/performance/runner.js.map +1 -0
  574. package/src/performance/scenario-endpoint.d.ts +1 -0
  575. package/src/performance/scenario-endpoint.js +5 -0
  576. package/src/performance/scenario-endpoint.js.map +1 -0
  577. package/src/performance/scenario.d.ts +193 -0
  578. package/src/performance/scenario.js +736 -0
  579. package/src/performance/scenario.js.map +1 -0
  580. package/src/performance/test-fixtures.d.ts +7 -0
  581. package/src/performance/test-fixtures.js +169 -0
  582. package/src/performance/test-fixtures.js.map +1 -0
  583. package/src/performance/unit-cost.d.ts +105 -0
  584. package/src/performance/unit-cost.js +364 -0
  585. package/src/performance/unit-cost.js.map +1 -0
  586. package/src/release/index.d.ts +4 -0
  587. package/src/release/index.js +8 -0
  588. package/src/release/index.js.map +1 -0
  589. package/src/release/lifecycle.d.ts +132 -0
  590. package/src/release/lifecycle.js +411 -0
  591. package/src/release/lifecycle.js.map +1 -0
  592. package/src/release/manifest.d.ts +148 -0
  593. package/src/release/manifest.js +503 -0
  594. package/src/release/manifest.js.map +1 -0
  595. package/src/release/rollout.d.ts +170 -0
  596. package/src/release/rollout.js +578 -0
  597. package/src/release/rollout.js.map +1 -0
  598. package/src/release/source-authority.d.ts +19 -0
  599. package/src/release/source-authority.js +195 -0
  600. package/src/release/source-authority.js.map +1 -0
  601. package/src/repository-policy/deployment-plan.d.ts +2 -1
  602. package/src/repository-policy/deployment-plan.js +2 -0
  603. package/src/repository-policy/deployment-plan.js.map +1 -1
  604. package/src/repository-policy/policy.d.ts +1 -1
  605. package/src/repository-policy/policy.js +29 -25
  606. package/src/repository-policy/policy.js.map +1 -1
  607. package/src/schemas/aggregate-count-evidence-v1.json +135 -0
  608. package/src/schemas/api-contract-baseline-v1.json +674 -0
  609. package/src/schemas/api-contract-compatibility-report-v1.json +126 -0
  610. package/src/schemas/aws-billing-actual-evidence-v1.json +407 -0
  611. package/src/schemas/blueprint-v1.json +18 -1
  612. package/src/schemas/data-lifecycle-policy-v1.json +517 -0
  613. package/src/schemas/generated-ownership-v2.json +22 -0
  614. package/src/schemas/performance-policy-v1.json +335 -0
  615. package/src/schemas/repository-policy-v1.json +1 -0
  616. package/src/schemas/testing-evidence-quarantine-v1.json +168 -0
  617. package/src/schemas/testing-evidence-result-v1.json +319 -0
  618. package/src/secrets/adapters.d.ts +49 -0
  619. package/src/secrets/adapters.js +184 -0
  620. package/src/secrets/adapters.js.map +1 -0
  621. package/src/secrets/aws-control-plane.d.ts +20 -0
  622. package/src/secrets/aws-control-plane.js +255 -0
  623. package/src/secrets/aws-control-plane.js.map +1 -0
  624. package/src/secrets/declaration-verification.d.ts +11 -0
  625. package/src/secrets/declaration-verification.js +68 -0
  626. package/src/secrets/declaration-verification.js.map +1 -0
  627. package/src/secrets/guardrails.d.ts +26 -0
  628. package/src/secrets/guardrails.js +328 -0
  629. package/src/secrets/guardrails.js.map +1 -0
  630. package/src/secrets/index.d.ts +12 -0
  631. package/src/secrets/index.js +16 -0
  632. package/src/secrets/index.js.map +1 -0
  633. package/src/secrets/metadata.d.ts +48 -0
  634. package/src/secrets/metadata.js +171 -0
  635. package/src/secrets/metadata.js.map +1 -0
  636. package/src/secrets/model.d.ts +49 -0
  637. package/src/secrets/model.js +125 -0
  638. package/src/secrets/model.js.map +1 -0
  639. package/src/secrets/operator.d.ts +101 -0
  640. package/src/secrets/operator.js +229 -0
  641. package/src/secrets/operator.js.map +1 -0
  642. package/src/secrets/permissions.d.ts +34 -0
  643. package/src/secrets/permissions.js +86 -0
  644. package/src/secrets/permissions.js.map +1 -0
  645. package/src/secrets/personal-command.d.ts +83 -0
  646. package/src/secrets/personal-command.js +197 -0
  647. package/src/secrets/personal-command.js.map +1 -0
  648. package/src/secrets/personal-ledger.d.ts +21 -0
  649. package/src/secrets/personal-ledger.js +135 -0
  650. package/src/secrets/personal-ledger.js.map +1 -0
  651. package/src/secrets/registry.d.ts +9 -0
  652. package/src/secrets/registry.js +86 -0
  653. package/src/secrets/registry.js.map +1 -0
  654. package/src/secrets/verification.d.ts +18 -0
  655. package/src/secrets/verification.js +139 -0
  656. package/src/secrets/verification.js.map +1 -0
  657. package/src/secrets/workload-access.d.ts +46 -0
  658. package/src/secrets/workload-access.js +163 -0
  659. package/src/secrets/workload-access.js.map +1 -0
  660. package/src/supply-chain/action-pins.d.ts +26 -0
  661. package/src/supply-chain/action-pins.js +208 -0
  662. package/src/supply-chain/action-pins.js.map +1 -0
  663. package/src/supply-chain/blueprint-trust-git.d.ts +130 -0
  664. package/src/supply-chain/blueprint-trust-git.js +1581 -0
  665. package/src/supply-chain/blueprint-trust-git.js.map +1 -0
  666. package/src/supply-chain/blueprint-trust-process.d.ts +4 -0
  667. package/src/supply-chain/blueprint-trust-process.js +88 -0
  668. package/src/supply-chain/blueprint-trust-process.js.map +1 -0
  669. package/src/supply-chain/blueprint-trust.d.ts +354 -0
  670. package/src/supply-chain/blueprint-trust.js +1558 -0
  671. package/src/supply-chain/blueprint-trust.js.map +1 -0
  672. package/src/supply-chain/blueprint-verification-authority.d.ts +62 -0
  673. package/src/supply-chain/blueprint-verification-authority.js +588 -0
  674. package/src/supply-chain/blueprint-verification-authority.js.map +1 -0
  675. package/src/supply-chain/blueprint-verification-execution.d.ts +68 -0
  676. package/src/supply-chain/blueprint-verification-execution.js +624 -0
  677. package/src/supply-chain/blueprint-verification-execution.js.map +1 -0
  678. package/src/supply-chain/build-output.d.ts +35 -0
  679. package/src/supply-chain/build-output.js +398 -0
  680. package/src/supply-chain/build-output.js.map +1 -0
  681. package/src/supply-chain/common.d.ts +21 -0
  682. package/src/supply-chain/common.js +107 -0
  683. package/src/supply-chain/common.js.map +1 -0
  684. package/src/supply-chain/container-artifact-contract.d.ts +23 -0
  685. package/src/supply-chain/container-artifact-contract.js +208 -0
  686. package/src/supply-chain/container-artifact-contract.js.map +1 -0
  687. package/src/supply-chain/container-release.d.ts +119 -0
  688. package/src/supply-chain/container-release.js +496 -0
  689. package/src/supply-chain/container-release.js.map +1 -0
  690. package/src/supply-chain/ecr-applicability.d.ts +19 -0
  691. package/src/supply-chain/ecr-applicability.js +103 -0
  692. package/src/supply-chain/ecr-applicability.js.map +1 -0
  693. package/src/supply-chain/ecr-scanning.d.ts +83 -0
  694. package/src/supply-chain/ecr-scanning.js +321 -0
  695. package/src/supply-chain/ecr-scanning.js.map +1 -0
  696. package/src/supply-chain/ecs-deployed-image.d.ts +85 -0
  697. package/src/supply-chain/ecs-deployed-image.js +300 -0
  698. package/src/supply-chain/ecs-deployed-image.js.map +1 -0
  699. package/src/supply-chain/errors.d.ts +6 -0
  700. package/src/supply-chain/errors.js +15 -0
  701. package/src/supply-chain/errors.js.map +1 -0
  702. package/src/supply-chain/generated-blueprint-trust-command.d.ts +4 -0
  703. package/src/supply-chain/generated-blueprint-trust-command.js +1362 -0
  704. package/src/supply-chain/generated-blueprint-trust-command.js.map +1 -0
  705. package/src/supply-chain/generated-command.d.ts +1 -0
  706. package/src/supply-chain/generated-command.js +687 -0
  707. package/src/supply-chain/generated-command.js.map +1 -0
  708. package/src/supply-chain/generated-container-release-command.d.ts +16 -0
  709. package/src/supply-chain/generated-container-release-command.js +2087 -0
  710. package/src/supply-chain/generated-container-release-command.js.map +1 -0
  711. package/src/supply-chain/generated-ecr-collector-command.d.ts +21 -0
  712. package/src/supply-chain/generated-ecr-collector-command.js +1338 -0
  713. package/src/supply-chain/generated-ecr-collector-command.js.map +1 -0
  714. package/src/supply-chain/generated-files.d.ts +13 -0
  715. package/src/supply-chain/generated-files.js +401 -0
  716. package/src/supply-chain/generated-files.js.map +1 -0
  717. package/src/supply-chain/generated-scanner-command.d.ts +1 -0
  718. package/src/supply-chain/generated-scanner-command.js +718 -0
  719. package/src/supply-chain/generated-scanner-command.js.map +1 -0
  720. package/src/supply-chain/index.d.ts +28 -0
  721. package/src/supply-chain/index.js +35 -0
  722. package/src/supply-chain/index.js.map +1 -0
  723. package/src/supply-chain/inventory.d.ts +79 -0
  724. package/src/supply-chain/inventory.js +717 -0
  725. package/src/supply-chain/inventory.js.map +1 -0
  726. package/src/supply-chain/license-expression.d.ts +7 -0
  727. package/src/supply-chain/license-expression.js +128 -0
  728. package/src/supply-chain/license-expression.js.map +1 -0
  729. package/src/supply-chain/pnpm-toolchain-authority.d.ts +31 -0
  730. package/src/supply-chain/pnpm-toolchain-authority.js +316 -0
  731. package/src/supply-chain/pnpm-toolchain-authority.js.map +1 -0
  732. package/src/supply-chain/policy.d.ts +105 -0
  733. package/src/supply-chain/policy.js +301 -0
  734. package/src/supply-chain/policy.js.map +1 -0
  735. package/src/supply-chain/publication.d.ts +48 -0
  736. package/src/supply-chain/publication.js +85 -0
  737. package/src/supply-chain/publication.js.map +1 -0
  738. package/src/supply-chain/sbom.d.ts +228 -0
  739. package/src/supply-chain/sbom.js +826 -0
  740. package/src/supply-chain/sbom.js.map +1 -0
  741. package/src/supply-chain/scanner.d.ts +77 -0
  742. package/src/supply-chain/scanner.js +502 -0
  743. package/src/supply-chain/scanner.js.map +1 -0
  744. package/src/supply-chain/vendored-source.d.ts +95 -0
  745. package/src/supply-chain/vendored-source.js +315 -0
  746. package/src/supply-chain/vendored-source.js.map +1 -0
  747. package/src/testing-evidence/fixture-scope.d.ts +52 -0
  748. package/src/testing-evidence/fixture-scope.js +140 -0
  749. package/src/testing-evidence/fixture-scope.js.map +1 -0
  750. package/src/testing-evidence/index.d.ts +5 -0
  751. package/src/testing-evidence/index.js +9 -0
  752. package/src/testing-evidence/index.js.map +1 -0
  753. package/src/testing-evidence/quarantine.d.ts +48 -0
  754. package/src/testing-evidence/quarantine.js +253 -0
  755. package/src/testing-evidence/quarantine.js.map +1 -0
  756. package/src/testing-evidence/result.d.ts +108 -0
  757. package/src/testing-evidence/result.js +571 -0
  758. package/src/testing-evidence/result.js.map +1 -0
  759. package/src/testing-evidence/runner-adapter.d.ts +51 -0
  760. package/src/testing-evidence/runner-adapter.js +288 -0
  761. package/src/testing-evidence/runner-adapter.js.map +1 -0
  762. package/src/testing-evidence/sensitive-artifacts.d.ts +13 -0
  763. package/src/testing-evidence/sensitive-artifacts.js +93 -0
  764. package/src/testing-evidence/sensitive-artifacts.js.map +1 -0
  765. package/src/work-markers/work-markers.js +4 -3
  766. package/src/work-markers/work-markers.js.map +1 -1
  767. package/src/workload-roles/account-baseline.d.ts +132 -0
  768. package/src/workload-roles/account-baseline.js +743 -0
  769. package/src/workload-roles/account-baseline.js.map +1 -0
  770. package/src/workload-roles/authority.d.ts +38 -0
  771. package/src/workload-roles/authority.js +156 -0
  772. package/src/workload-roles/authority.js.map +1 -0
  773. package/src/workload-roles/aws-adapter.d.ts +99 -0
  774. package/src/workload-roles/aws-adapter.js +416 -0
  775. package/src/workload-roles/aws-adapter.js.map +1 -0
  776. package/src/workload-roles/aws-internal-handler.d.ts +27 -0
  777. package/src/workload-roles/aws-internal-handler.js +58 -0
  778. package/src/workload-roles/aws-internal-handler.js.map +1 -0
  779. package/src/workload-roles/aws-s3-state.d.ts +52 -0
  780. package/src/workload-roles/aws-s3-state.js +164 -0
  781. package/src/workload-roles/aws-s3-state.js.map +1 -0
  782. package/src/workload-roles/aws-sdk-control-plane.d.ts +12 -0
  783. package/src/workload-roles/aws-sdk-control-plane.js +291 -0
  784. package/src/workload-roles/aws-sdk-control-plane.js.map +1 -0
  785. package/src/workload-roles/boundary.d.ts +33 -0
  786. package/src/workload-roles/boundary.js +130 -0
  787. package/src/workload-roles/boundary.js.map +1 -0
  788. package/src/workload-roles/convergence.d.ts +66 -0
  789. package/src/workload-roles/convergence.js +186 -0
  790. package/src/workload-roles/convergence.js.map +1 -0
  791. package/src/workload-roles/effective-policy.d.ts +51 -0
  792. package/src/workload-roles/effective-policy.js +183 -0
  793. package/src/workload-roles/effective-policy.js.map +1 -0
  794. package/src/workload-roles/handler.d.ts +43 -0
  795. package/src/workload-roles/handler.js +130 -0
  796. package/src/workload-roles/handler.js.map +1 -0
  797. package/src/workload-roles/history.d.ts +47 -0
  798. package/src/workload-roles/history.js +324 -0
  799. package/src/workload-roles/history.js.map +1 -0
  800. package/src/workload-roles/index.d.ts +17 -0
  801. package/src/workload-roles/index.js +21 -0
  802. package/src/workload-roles/index.js.map +1 -0
  803. package/src/workload-roles/injection.d.ts +119 -0
  804. package/src/workload-roles/injection.js +495 -0
  805. package/src/workload-roles/injection.js.map +1 -0
  806. package/src/workload-roles/manifest.d.ts +54 -0
  807. package/src/workload-roles/manifest.js +343 -0
  808. package/src/workload-roles/manifest.js.map +1 -0
  809. package/src/workload-roles/provisioner.d.ts +70 -0
  810. package/src/workload-roles/provisioner.js +231 -0
  811. package/src/workload-roles/provisioner.js.map +1 -0
  812. package/src/workload-roles/registration.d.ts +101 -0
  813. package/src/workload-roles/registration.js +457 -0
  814. package/src/workload-roles/registration.js.map +1 -0
  815. package/src/workload-roles/stage-boundary.d.ts +31 -0
  816. package/src/workload-roles/stage-boundary.js +208 -0
  817. package/src/workload-roles/stage-boundary.js.map +1 -0
  818. package/src/workload-roles/standard-slice.d.ts +54 -0
  819. package/src/workload-roles/standard-slice.js +252 -0
  820. package/src/workload-roles/standard-slice.js.map +1 -0
  821. package/migrations/standard-pre-v1-to-v1.md +0 -11
  822. package/src/foundation/aurora-logical-database.d.ts +0 -76
  823. package/src/foundation/aurora-logical-database.js +0 -419
  824. package/src/foundation/aurora-logical-database.js.map +0 -1
@@ -0,0 +1,1134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inspectDeveloperAgentWorkspace = inspectDeveloperAgentWorkspace;
4
+ const node_crypto_1 = require("node:crypto");
5
+ const node_util_1 = require("node:util");
6
+ const semver_1 = require("semver");
7
+ const node_fs_1 = require("node:fs");
8
+ const node_path_1 = require("node:path");
9
+ const index_js_1 = require("../ownership/index.js");
10
+ const index_js_2 = require("../repository-policy/index.js");
11
+ const index_js_3 = require("../work-markers/index.js");
12
+ const feature_registry_js_1 = require("../generators/feature-registry.js");
13
+ const index_js_4 = require("../blueprints/index.js");
14
+ const blueprint_trust_js_1 = require("../supply-chain/blueprint-trust.js");
15
+ const blueprint_trust_git_js_1 = require("../supply-chain/blueprint-trust-git.js");
16
+ const blueprint_verification_authority_js_1 = require("../supply-chain/blueprint-verification-authority.js");
17
+ const generated_blueprint_trust_command_js_1 = require("../supply-chain/generated-blueprint-trust-command.js");
18
+ const blueprint_verification_execution_js_1 = require("../supply-chain/blueprint-verification-execution.js");
19
+ const model_js_1 = require("./model.js");
20
+ const operation_registry_js_1 = require("./operation-registry.js");
21
+ const ordering_js_1 = require("./ordering.js");
22
+ const MAX_PROJECTS = model_js_1.DEVELOPER_AGENT_MAX_PROJECT_NAMES;
23
+ const MAX_TARGETS_PER_PROJECT = 256;
24
+ const MAX_OWNED_PATHS = 8_192;
25
+ const MAX_SELECTED_FILES = 256;
26
+ const MAX_CANDIDATE_BYTES = 1024 * 1024;
27
+ const MAX_CONTROL_JSON_BYTES = 1024 * 1024;
28
+ const MAX_OWNED_FILE_BYTES = 5 * 1024 * 1024;
29
+ const PROJECT_NAME_PATTERN = /^[A-Za-z0-9@][A-Za-z0-9@/._-]{0,255}$/;
30
+ const FOUNDATION_PROJECT_NAME = 'foundation';
31
+ const FOUNDATION_PROJECT_ROOT = 'packages/foundation';
32
+ function isRecord(value) {
33
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
34
+ }
35
+ function warning(classification, sanitizedSummary, upgradeVersionDrift) {
36
+ return {
37
+ classification,
38
+ sanitizedSummary,
39
+ ...(upgradeVersionDrift ? { upgradeVersionDrift } : {}),
40
+ };
41
+ }
42
+ function isContained(root, path) {
43
+ const fromRoot = (0, node_path_1.relative)(root, path);
44
+ return (fromRoot === '' ||
45
+ (!fromRoot.startsWith(`..${node_path_1.sep}`) &&
46
+ fromRoot !== '..' &&
47
+ !(0, node_path_1.isAbsolute)(fromRoot)));
48
+ }
49
+ function readBoundedWorkspaceFile(root, relativePath, label, maximumBytes) {
50
+ const path = containedPath(root, relativePath);
51
+ let real;
52
+ try {
53
+ const link = (0, node_fs_1.lstatSync)(path);
54
+ if (link.isSymbolicLink()) {
55
+ throw new Error('the final path is a symbolic link');
56
+ }
57
+ real = (0, node_fs_1.realpathSync)(path);
58
+ if (!isContained(root, real)) {
59
+ throw new Error('a parent path resolves outside the repository');
60
+ }
61
+ }
62
+ catch (error) {
63
+ throw new Error(`${label} is required as a contained regular non-symlink file at ${path}: ${error instanceof Error ? error.message : String(error)}`);
64
+ }
65
+ let descriptor;
66
+ try {
67
+ descriptor = (0, node_fs_1.openSync)(path, node_fs_1.constants.O_RDONLY | node_fs_1.constants.O_NOFOLLOW);
68
+ const metadata = (0, node_fs_1.fstatSync)(descriptor);
69
+ if (!metadata.isFile()) {
70
+ throw new Error('the resolved path is not a regular file');
71
+ }
72
+ if (metadata.size > maximumBytes) {
73
+ throw new Error(`the file exceeds its ${maximumBytes}-byte bound`);
74
+ }
75
+ // Allocate only after the descriptor-backed size check. The extra byte
76
+ // makes a concurrent growth fail closed without allocating beyond the
77
+ // declared bound.
78
+ const capacity = Math.min(maximumBytes + 1, metadata.size + 1);
79
+ const buffer = Buffer.alloc(capacity);
80
+ let offset = 0;
81
+ while (offset < buffer.byteLength) {
82
+ const count = (0, node_fs_1.readSync)(descriptor, buffer, offset, buffer.byteLength - offset, null);
83
+ if (count === 0)
84
+ break;
85
+ offset += count;
86
+ }
87
+ if (offset > maximumBytes || offset > metadata.size) {
88
+ throw new Error('the file changed while it was read or exceeded its byte bound');
89
+ }
90
+ return { bytes: buffer.subarray(0, offset), path: real };
91
+ }
92
+ catch (error) {
93
+ throw new Error(`${label} at ${path} could not be read safely: ${error instanceof Error ? error.message : String(error)}`);
94
+ }
95
+ finally {
96
+ if (descriptor !== undefined)
97
+ (0, node_fs_1.closeSync)(descriptor);
98
+ }
99
+ }
100
+ function readJson(root, relativePath, label) {
101
+ const source = readBoundedWorkspaceFile(root, relativePath, label, MAX_CONTROL_JSON_BYTES).bytes.toString('utf8');
102
+ try {
103
+ return JSON.parse(source);
104
+ }
105
+ catch {
106
+ throw new Error(`${label} at ${relativePath} is not valid JSON.`);
107
+ }
108
+ }
109
+ function formatIssues(issues) {
110
+ return issues.map(({ message, path }) => `${path}: ${message}`).join('; ');
111
+ }
112
+ function safeRealRoot(repositoryRoot) {
113
+ if (!(0, node_path_1.isAbsolute)(repositoryRoot)) {
114
+ throw new Error('Developer-agent repository root must be absolute.');
115
+ }
116
+ const root = (0, node_fs_1.realpathSync)(repositoryRoot);
117
+ if (!(0, node_fs_1.lstatSync)(root).isDirectory()) {
118
+ throw new Error('Developer-agent repository root must be a directory.');
119
+ }
120
+ return root;
121
+ }
122
+ function containedPath(root, relativePath) {
123
+ if (relativePath.length === 0 ||
124
+ (0, node_path_1.isAbsolute)(relativePath) ||
125
+ relativePath.split(/[\\/]/).includes('..')) {
126
+ throw new Error(`Unsafe workspace-relative path ${relativePath}.`);
127
+ }
128
+ const absolute = (0, node_path_1.resolve)(root, ...relativePath.split('/'));
129
+ const fromRoot = (0, node_path_1.relative)(root, absolute);
130
+ if (fromRoot === '' ||
131
+ fromRoot.startsWith(`..${node_path_1.sep}`) ||
132
+ fromRoot === '..' ||
133
+ (0, node_path_1.isAbsolute)(fromRoot)) {
134
+ throw new Error(`Workspace path ${relativePath} escapes its owner root.`);
135
+ }
136
+ return absolute;
137
+ }
138
+ function packageVersion(root, packageName) {
139
+ const relativePath = (0, node_path_1.join)('node_modules', ...packageName.split('/'), 'package.json');
140
+ const path = containedPath(root, relativePath);
141
+ if (!(0, node_fs_1.existsSync)(path))
142
+ return undefined;
143
+ const manifest = readJson(root, relativePath, `${packageName} package manifest`);
144
+ if (!manifest ||
145
+ typeof manifest !== 'object' ||
146
+ Array.isArray(manifest) ||
147
+ typeof manifest.version !== 'string') {
148
+ throw new Error(`${packageName} package manifest has no exact version.`);
149
+ }
150
+ return manifest.version;
151
+ }
152
+ function workspaceIdentity(graph) {
153
+ const candidates = Object.values(graph.nodes).filter((node) => node.data.tags?.includes('scope:workspace'));
154
+ if (candidates.length !== 1) {
155
+ throw new Error(`Expected exactly one scope:workspace Nx project; found ${candidates.length}.`);
156
+ }
157
+ if (candidates[0].data.root !== '.') {
158
+ throw new Error('The sole scope:workspace Nx project must be rooted at the repository root.');
159
+ }
160
+ return { name: candidates[0].name, node: candidates[0] };
161
+ }
162
+ function foundationIdentity(workspaceRoot, graph) {
163
+ const candidates = Object.values(graph.nodes).filter((node) => node.data.tags?.includes('scope:foundation'));
164
+ if (candidates.length > 1) {
165
+ throw new Error(`Expected at most one scope:foundation Nx project; found ${candidates.length}.`);
166
+ }
167
+ if (candidates.length === 0) {
168
+ const untaggedCanonicalIdentity = Object.values(graph.nodes).some((node) => node.name === FOUNDATION_PROJECT_NAME ||
169
+ node.data.root.split(node_path_1.sep).join('/') === FOUNDATION_PROJECT_ROOT);
170
+ if (untaggedCanonicalIdentity) {
171
+ throw new Error('The canonical Foundation Nx project must declare scope:foundation.');
172
+ }
173
+ return undefined;
174
+ }
175
+ const foundation = candidates[0];
176
+ const declaredRoot = foundation.data.root.split(node_path_1.sep).join('/');
177
+ if (foundation.name !== FOUNDATION_PROJECT_NAME ||
178
+ declaredRoot !== FOUNDATION_PROJECT_ROOT) {
179
+ throw new Error('The sole scope:foundation Nx project must be the canonical foundation project.');
180
+ }
181
+ if (canonicalGraphProjectRoot(workspaceRoot, foundation) !==
182
+ (0, node_path_1.resolve)(workspaceRoot, FOUNDATION_PROJECT_ROOT)) {
183
+ throw new Error('The sole scope:foundation Nx project must resolve to its canonical repository directory.');
184
+ }
185
+ return foundation.name;
186
+ }
187
+ function selectedNodes(graph, requested) {
188
+ const names = requested === undefined
189
+ ? Object.keys(graph.nodes).sort()
190
+ : [...requested].sort();
191
+ if (names.length === 0 ||
192
+ names.length > MAX_PROJECTS ||
193
+ new Set(names).size !== names.length) {
194
+ throw new Error(`Developer-agent project selection must contain 1-${MAX_PROJECTS} unique projects.`);
195
+ }
196
+ return names.map((name) => {
197
+ if (!PROJECT_NAME_PATTERN.test(name)) {
198
+ throw new Error(`Developer-agent project name ${name} is invalid.`);
199
+ }
200
+ const node = graph.nodes[name];
201
+ if (!node)
202
+ throw new Error(`Nx project ${name} does not exist.`);
203
+ return node;
204
+ });
205
+ }
206
+ function fullGraphProjectNames(graph) {
207
+ const names = Object.keys(graph.nodes).sort(ordering_js_1.compareDeveloperAgentStrings);
208
+ if (names.length === 0 || names.length > model_js_1.DEVELOPER_AGENT_MAX_PROJECT_NAMES) {
209
+ throw new Error(`Developer-agent full Nx project-name inventory must contain 1-${model_js_1.DEVELOPER_AGENT_MAX_PROJECT_NAMES} projects.`);
210
+ }
211
+ for (const name of names) {
212
+ if (!PROJECT_NAME_PATTERN.test(name) || graph.nodes[name]?.name !== name) {
213
+ throw new Error('Developer-agent full Nx project-name inventory contains an invalid project identity.');
214
+ }
215
+ }
216
+ return names;
217
+ }
218
+ function selectedDependencyClosureNodes(graph, selected) {
219
+ const closure = new Map(selected.map((node) => [node.name, node]));
220
+ const pending = [...selected];
221
+ while (pending.length > 0) {
222
+ const node = pending.pop();
223
+ if (!node)
224
+ continue;
225
+ for (const { target } of graph.dependencies[node.name] ?? []) {
226
+ const dependency = graph.nodes[target];
227
+ if (!dependency || closure.has(target))
228
+ continue;
229
+ closure.set(target, dependency);
230
+ pending.push(dependency);
231
+ if (closure.size > MAX_PROJECTS) {
232
+ throw new Error(`Developer-agent project dependency closure exceeds the ${MAX_PROJECTS}-project bound.`);
233
+ }
234
+ }
235
+ }
236
+ return [...closure.values()].sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.name, right.name));
237
+ }
238
+ function dependencies(graph, name) {
239
+ return [
240
+ ...new Set((graph.dependencies[name] ?? [])
241
+ .map(({ target }) => target)
242
+ .filter((target) => target in graph.nodes)),
243
+ ].sort();
244
+ }
245
+ function projectContext(graph, node) {
246
+ const targets = Object.keys(node.data.targets ?? {}).sort();
247
+ if (targets.length > MAX_TARGETS_PER_PROJECT) {
248
+ throw new Error(`Nx project ${node.name} exceeds the ${MAX_TARGETS_PER_PROJECT}-target context bound.`);
249
+ }
250
+ return {
251
+ dependencies: dependencies(graph, node.name),
252
+ name: node.name,
253
+ root: node.data.root.split(node_path_1.sep).join('/'),
254
+ tags: [...(node.data.tags ?? [])].sort(),
255
+ targets,
256
+ };
257
+ }
258
+ function canonicalGraphProjectRoot(workspaceRoot, node) {
259
+ const declaredRoot = node.data.root.split(node_path_1.sep).join('/');
260
+ if (declaredRoot === '.')
261
+ return workspaceRoot;
262
+ const candidate = containedPath(workspaceRoot, declaredRoot);
263
+ if (!(0, node_fs_1.existsSync)(candidate)) {
264
+ throw new Error(`Nx project ${node.name} root does not exist.`);
265
+ }
266
+ const metadata = (0, node_fs_1.lstatSync)(candidate);
267
+ if (metadata.isSymbolicLink() || !metadata.isDirectory()) {
268
+ throw new Error(`Nx project ${node.name} root must be one canonical directory.`);
269
+ }
270
+ const canonical = (0, node_fs_1.realpathSync)(candidate);
271
+ if (!isContained(workspaceRoot, canonical)) {
272
+ throw new Error(`Nx project ${node.name} root escapes the workspace.`);
273
+ }
274
+ return canonical;
275
+ }
276
+ function externalOwnedProjectNames(workspaceRoot, nodes, ownershipRoots, history, foundationProjectName) {
277
+ const roots = [
278
+ ...new Set([
279
+ ...ownershipRoots.map(({ root }) => root),
280
+ ...history.externalSliceRoots.map((root) => {
281
+ if (!/^packages\/[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(root)) {
282
+ throw new Error('Protected external Blueprint history contains an invalid Slice root.');
283
+ }
284
+ return (0, node_path_1.resolve)(workspaceRoot, ...root.split('/'));
285
+ }),
286
+ ]),
287
+ ];
288
+ const identities = new Set([
289
+ ...history.externalProjectNames,
290
+ ...ownershipRoots.flatMap(({ projects, slice }) => [slice, ...projects]),
291
+ ]);
292
+ if (roots.length === 0 && identities.size === 0 && history.complete) {
293
+ return [];
294
+ }
295
+ const packagesRoot = (0, node_path_1.resolve)(workspaceRoot, 'packages');
296
+ return nodes.flatMap((node) => {
297
+ const projectRoot = canonicalGraphProjectRoot(workspaceRoot, node);
298
+ const owners = roots.filter((root) => isContained(root, projectRoot));
299
+ if (owners.length > 1) {
300
+ throw new Error(`Nx project ${node.name} has ambiguous external Blueprint ownership.`);
301
+ }
302
+ const incompletePackageAuthority = !history.complete &&
303
+ node.name !== foundationProjectName &&
304
+ isContained(packagesRoot, projectRoot);
305
+ return owners.length === 1 ||
306
+ identities.has(node.name) ||
307
+ incompletePackageAuthority
308
+ ? [node.name]
309
+ : [];
310
+ });
311
+ }
312
+ function normalizeSelectedFilePath(value) {
313
+ if (value.length === 0 ||
314
+ value.length > 1024 ||
315
+ value !== value.trim() ||
316
+ (0, node_path_1.isAbsolute)(value) ||
317
+ /^[A-Za-z]:[\\/]/.test(value) ||
318
+ value.includes('\\') ||
319
+ [...value].some((character) => {
320
+ const codePoint = character.codePointAt(0) ?? 0;
321
+ return codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f);
322
+ })) {
323
+ throw new Error('Selected files must be bounded canonical workspace-relative paths.');
324
+ }
325
+ const segments = value.split('/');
326
+ if (segments.some((segment) => segment.length === 0 || segment === '.' || segment === '..')) {
327
+ throw new Error('Selected files must be bounded canonical workspace-relative paths.');
328
+ }
329
+ return segments.join('/');
330
+ }
331
+ function selectedFilePath(root, relativePath) {
332
+ const segments = relativePath.split('/');
333
+ let current = root;
334
+ for (const [index, segment] of segments.entries()) {
335
+ current = (0, node_path_1.join)(current, segment);
336
+ if (!(0, node_fs_1.existsSync)(current)) {
337
+ const unresolved = (0, node_path_1.resolve)(current, ...segments.slice(index + 1));
338
+ if (!isContained(root, unresolved)) {
339
+ throw new Error(`Selected file ${relativePath} escapes the repository.`);
340
+ }
341
+ return unresolved;
342
+ }
343
+ const metadata = (0, node_fs_1.lstatSync)(current);
344
+ if (metadata.isSymbolicLink()) {
345
+ throw new Error(`Selected file ${relativePath} traverses a symbolic link.`);
346
+ }
347
+ if (index < segments.length - 1 && !metadata.isDirectory()) {
348
+ throw new Error(`Selected file ${relativePath} has a non-directory parent.`);
349
+ }
350
+ if (index === segments.length - 1 && !metadata.isFile()) {
351
+ throw new Error(`Selected file ${relativePath} is not a regular file path.`);
352
+ }
353
+ }
354
+ if (!isContained(root, current)) {
355
+ throw new Error(`Selected file ${relativePath} escapes the repository.`);
356
+ }
357
+ return current;
358
+ }
359
+ function projectRootPath(root, node) {
360
+ const declared = node.data.root.split(node_path_1.sep).join('/');
361
+ const absolute = declared === '.' ? root : containedPath(root, declared);
362
+ const metadata = (0, node_fs_1.lstatSync)(absolute);
363
+ if (metadata.isSymbolicLink() || !metadata.isDirectory()) {
364
+ throw new Error(`Nx project ${node.name} root must be a contained non-symlink directory.`);
365
+ }
366
+ const real = (0, node_fs_1.realpathSync)(absolute);
367
+ if (!isContained(root, real)) {
368
+ throw new Error(`Nx project ${node.name} root escapes the repository.`);
369
+ }
370
+ return real;
371
+ }
372
+ function selectedFileContexts(root, graph, selected, records, requested) {
373
+ const paths = (requested ?? []).map(normalizeSelectedFilePath);
374
+ if (paths.length > MAX_SELECTED_FILES ||
375
+ new Set(paths).size !== paths.length) {
376
+ throw new Error(`Selected files must contain at most ${MAX_SELECTED_FILES} unique paths.`);
377
+ }
378
+ const selectedNames = new Set(selected.map(({ name }) => name));
379
+ const projectRoots = Object.values(graph.nodes).map((node) => ({
380
+ node,
381
+ root: projectRootPath(root, node),
382
+ }));
383
+ return paths
384
+ .map((path) => {
385
+ const absolute = selectedFilePath(root, path);
386
+ const owners = projectRoots
387
+ .filter(({ root: projectRoot }) => isContained(projectRoot, absolute))
388
+ .sort((left, right) => right.root.length - left.root.length ||
389
+ (0, ordering_js_1.compareDeveloperAgentStrings)(left.node.name, right.node.name));
390
+ if (owners.length === 0) {
391
+ throw new Error(`Selected file ${path} has no owning Nx project.`);
392
+ }
393
+ if (owners[1] && owners[0].root === owners[1].root) {
394
+ throw new Error(`Selected file ${path} has ambiguous most-specific Nx project ownership.`);
395
+ }
396
+ const project = owners[0].node.name;
397
+ if (!selectedNames.has(project)) {
398
+ throw new Error(`Selected file ${path} belongs to unselected Nx project ${project}.`);
399
+ }
400
+ const claims = records.flatMap((record) => record.paths
401
+ .filter((entry) => containedPath(record.root, entry.path) === absolute)
402
+ .map((entry) => ({
403
+ mode: entry.mode,
404
+ record: record.path,
405
+ })));
406
+ if (claims.length > 1) {
407
+ throw new Error(`Selected file ${path} has conflicting ownership records ${claims
408
+ .map(({ record }) => record)
409
+ .join(', ')}.`);
410
+ }
411
+ return {
412
+ ownershipMode: claims[0]?.mode ?? 'adopter-owned',
413
+ path,
414
+ project,
415
+ };
416
+ })
417
+ .sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.path, right.path));
418
+ }
419
+ function readOwnershipRecords(root, nodes) {
420
+ const records = [];
421
+ const warnings = [];
422
+ const workspaceValidation = (0, index_js_1.validateWorkspaceOwnershipRecord)(readJson(root, '.ebk/ownership.json', 'Workspace ownership record'));
423
+ if (!workspaceValidation.valid) {
424
+ throw new Error(`Workspace ownership record is invalid: ${formatIssues(workspaceValidation.issues)}`);
425
+ }
426
+ records.push({
427
+ frameworkVersion: workspaceValidation.value.frameworkVersion,
428
+ kind: 'workspace',
429
+ path: '.ebk/ownership.json',
430
+ paths: workspaceValidation.value.paths,
431
+ root,
432
+ });
433
+ for (const node of nodes) {
434
+ const tags = new Set(node.data.tags ?? []);
435
+ if (!tags.has('scope:foundation') && !tags.has('type:slice'))
436
+ continue;
437
+ const relativeOwnership = `${node.data.root.split(node_path_1.sep).join('/')}/.ebk/ownership.json`;
438
+ const ownershipFile = readBoundedWorkspaceFile(root, relativeOwnership, `${node.name} ownership record`, MAX_CONTROL_JSON_BYTES);
439
+ const projectRoot = (0, node_fs_1.realpathSync)(containedPath(root, node.data.root));
440
+ if (!isContained(root, projectRoot) ||
441
+ !(0, node_fs_1.lstatSync)(projectRoot).isDirectory()) {
442
+ throw new Error(`Nx project ${node.name} root must resolve to a contained directory.`);
443
+ }
444
+ let ownershipValue;
445
+ try {
446
+ ownershipValue = JSON.parse(ownershipFile.bytes.toString('utf8'));
447
+ }
448
+ catch {
449
+ throw new Error(`${node.name} ownership record at ${relativeOwnership} is not valid JSON.`);
450
+ }
451
+ if (tags.has('scope:foundation')) {
452
+ const validation = (0, index_js_1.validateFoundationOwnershipRecord)(ownershipValue);
453
+ if (!validation.valid) {
454
+ throw new Error(`Foundation ownership record is invalid: ${formatIssues(validation.issues)}`);
455
+ }
456
+ records.push({
457
+ frameworkVersion: validation.value.frameworkVersion,
458
+ kind: 'foundation',
459
+ path: relativeOwnership,
460
+ paths: validation.value.paths,
461
+ root: projectRoot,
462
+ });
463
+ continue;
464
+ }
465
+ const validation = (0, index_js_1.validateGeneratedOwnershipRecord)(ownershipValue);
466
+ if (!validation.valid) {
467
+ throw new Error(`Product Slice ${node.name} ownership record is invalid: ${formatIssues(validation.issues)}`);
468
+ }
469
+ if (validation.value.slice !== node.name) {
470
+ warnings.push(warning('ownership-conflict', `Nx project ${node.name} disagrees with its Product Slice ownership identity.`));
471
+ }
472
+ records.push({
473
+ kind: 'slice',
474
+ path: relativeOwnership,
475
+ paths: validation.value.paths,
476
+ root: projectRoot,
477
+ slice: validation.value,
478
+ });
479
+ }
480
+ return { records, warnings };
481
+ }
482
+ function ownershipWarnings(records) {
483
+ const warnings = [];
484
+ let ownedPathCount = 0;
485
+ const claims = new Map();
486
+ for (const record of records) {
487
+ ownedPathCount += record.paths.length;
488
+ if (ownedPathCount > MAX_OWNED_PATHS) {
489
+ throw new Error(`Ownership inventory exceeds the ${MAX_OWNED_PATHS}-path bound.`);
490
+ }
491
+ for (const entry of record.paths) {
492
+ const absolute = containedPath(record.root, entry.path);
493
+ const prior = claims.get(absolute);
494
+ if (prior &&
495
+ (prior.mode !== entry.mode || prior.record !== record.path)) {
496
+ warnings.push(warning('ownership-conflict', `Ownership records ${prior.record} and ${record.path} both claim one generated path.`));
497
+ }
498
+ else {
499
+ claims.set(absolute, { mode: entry.mode, record: record.path });
500
+ }
501
+ if (entry.mode !== 'managed')
502
+ continue;
503
+ if (!(0, node_fs_1.existsSync)(absolute) || !(0, node_fs_1.lstatSync)(absolute).isFile()) {
504
+ warnings.push(warning('generated-drift', `Managed path ${entry.path} is missing from ${record.path}.`));
505
+ continue;
506
+ }
507
+ const current = readBoundedWorkspaceFile(record.root, entry.path, `Managed path ${entry.path} from ${record.path}`, MAX_OWNED_FILE_BYTES).bytes.toString('utf8');
508
+ if ((0, index_js_1.hashOwnedContent)(current, entry) !== entry.sha256) {
509
+ warnings.push(warning('generated-drift', `Managed path ${entry.path} differs from ${record.path}.`));
510
+ }
511
+ }
512
+ }
513
+ return warnings;
514
+ }
515
+ function versionContext(root, identity, records) {
516
+ const warnings = [];
517
+ const installedNx = packageVersion(root, '@empire-builder-kit/nx');
518
+ const installedRuntime = packageVersion(root, '@empire-builder-kit/runtime');
519
+ if (!installedNx || !installedRuntime) {
520
+ warnings.push(warning('prerequisite-missing', 'Exact installed @empire-builder-kit/nx and runtime package identities are required.'));
521
+ }
522
+ if (installedNx !== undefined &&
523
+ installedRuntime !== undefined &&
524
+ installedNx !== installedRuntime) {
525
+ warnings.push(warning('ownership-conflict', 'Installed framework Nx and Runtime packages are not the same exact candidate version.'));
526
+ }
527
+ const ownershipVersions = records
528
+ .map((record) => {
529
+ const target = record.kind === 'slice'
530
+ ? (record.slice?.slice ?? 'unavailable')
531
+ : record.kind;
532
+ const blueprintName = record.slice?.blueprint.name;
533
+ const installedBlueprintVersion = blueprintName === undefined
534
+ ? undefined
535
+ : blueprintName === '@empire-builder-kit/blueprint-standard'
536
+ ? installedNx
537
+ : packageVersion(root, blueprintName);
538
+ return {
539
+ ...(blueprintName ? { blueprintName } : {}),
540
+ ...(installedBlueprintVersion ? { installedBlueprintVersion } : {}),
541
+ ...(installedNx ? { installedFrameworkVersion: installedNx } : {}),
542
+ kind: record.kind,
543
+ ...(record.slice
544
+ ? {
545
+ recordedBlueprintVersion: record.slice.blueprint.version,
546
+ }
547
+ : {}),
548
+ ...(record.frameworkVersion
549
+ ? { recordedFrameworkVersion: record.frameworkVersion }
550
+ : {}),
551
+ target,
552
+ };
553
+ })
554
+ .sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.target, right.target) ||
555
+ (0, ordering_js_1.compareDeveloperAgentStrings)(left.kind, right.kind));
556
+ for (const state of ownershipVersions) {
557
+ const frameworkDrift = state.installedFrameworkVersion !== undefined &&
558
+ state.recordedFrameworkVersion !== undefined &&
559
+ state.installedFrameworkVersion !== state.recordedFrameworkVersion;
560
+ const blueprintDrift = state.installedBlueprintVersion !== undefined &&
561
+ state.recordedBlueprintVersion !== undefined &&
562
+ state.installedBlueprintVersion !== state.recordedBlueprintVersion;
563
+ if (frameworkDrift || blueprintDrift) {
564
+ warnings.push(warning('ownership-conflict', `${state.kind} ${state.target} ownership records expected version drift from the installed framework candidate.`, { kind: state.kind, target: state.target }));
565
+ }
566
+ if (state.blueprintName !== undefined &&
567
+ state.installedBlueprintVersion === undefined) {
568
+ warnings.push(warning('prerequisite-missing', `Exact installed Blueprint package identity is required for Product Slice ${state.target}.`));
569
+ }
570
+ }
571
+ const blueprintVersions = records
572
+ .filter((record) => record.slice !== undefined)
573
+ .map(({ slice }) => ({
574
+ name: `${slice.slice}:${slice.blueprint.name}`,
575
+ version: slice.blueprint.version,
576
+ }))
577
+ .sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.name, right.name));
578
+ const hasConflict = warnings.some(({ classification }) => classification === 'ownership-conflict');
579
+ return {
580
+ warnings,
581
+ workspace: {
582
+ blueprintVersions,
583
+ frameworkVersion: installedNx ?? 'unavailable',
584
+ identity,
585
+ ownershipVersions,
586
+ ownershipAgreement: hasConflict
587
+ ? 'conflict'
588
+ : installedNx
589
+ ? 'agrees'
590
+ : 'unavailable',
591
+ repositoryRoot: root,
592
+ },
593
+ };
594
+ }
595
+ function protectedExternalBlueprintVerification(root, frameworkVersion, records, graph, registryProjectNames, now, git) {
596
+ const external = records.filter((record) => record.slice !== undefined &&
597
+ record.slice.blueprint.name !== index_js_4.BUILTIN_BLUEPRINT_NAME &&
598
+ [record.slice.slice, ...record.slice.projects].some((name) => registryProjectNames.has(name)));
599
+ if (external.length === 0)
600
+ return { reviews: [], warnings: [] };
601
+ const unavailable = () => ({
602
+ reviews: [],
603
+ warnings: [
604
+ warning('prerequisite-missing', 'External Blueprint verification lacks an exact protected review and matching exact-root execution receipt for its target closure and managed bytes.'),
605
+ ],
606
+ });
607
+ try {
608
+ const protectedBranch = git.defaultBaseRef === 'origin/main' ||
609
+ git.defaultBaseRef === 'refs/remotes/origin/main'
610
+ ? 'main'
611
+ : git.defaultBaseRef === 'origin/develop' ||
612
+ git.defaultBaseRef === 'refs/remotes/origin/develop'
613
+ ? 'develop'
614
+ : undefined;
615
+ if (!protectedBranch)
616
+ return unavailable();
617
+ const configurationPaths = (0, blueprint_verification_authority_js_1.assertNoMutableBlueprintVerificationConfiguration)(root);
618
+ (0, blueprint_verification_authority_js_1.assertBlueprintVerificationNxAuthority)(readBoundedWorkspaceFile(root, 'nx.json', 'Blueprint verification Nx authority', MAX_CONTROL_JSON_BYTES).bytes.toString('utf8'));
619
+ const policy = readJson(root, 'supply-chain/blueprint-trust-policy.json', 'Blueprint trust policy');
620
+ const snapshot = readJson(root, 'supply-chain/blueprint-trust-snapshot.json', 'Blueprint trust snapshot');
621
+ const authority = (0, blueprint_trust_git_js_1.inspectBlueprintTrustGitAuthority)({
622
+ builtIn: { name: index_js_4.BUILTIN_BLUEPRINT_NAME, version: frameworkVersion },
623
+ current: { policy, snapshot },
624
+ ownership: records.flatMap((record) => record.slice ? [{ path: record.path, value: record.slice }] : []),
625
+ protectedBranch,
626
+ protectedRef: git.defaultBaseCommit,
627
+ workspaceRoot: root,
628
+ });
629
+ const assertCurrentExecutionAuthority = () => {
630
+ const currentConfigurationPaths = (0, blueprint_verification_authority_js_1.assertNoMutableBlueprintVerificationConfiguration)(root);
631
+ if (!(0, node_util_1.isDeepStrictEqual)(currentConfigurationPaths, configurationPaths)) {
632
+ throw new Error('Blueprint verification configuration inventory changed during inspection.');
633
+ }
634
+ (0, blueprint_verification_authority_js_1.assertBlueprintVerificationNxAuthority)(readBoundedWorkspaceFile(root, 'nx.json', 'Blueprint verification Nx authority', MAX_CONTROL_JSON_BYTES).bytes.toString('utf8'));
635
+ (0, blueprint_trust_git_js_1.assertProtectedGitVerificationExecutionAuthority)({
636
+ headCommit: authority.headCommit,
637
+ protectedCommit: authority.protectedCommit,
638
+ protectedRef: `refs/remotes/origin/${protectedBranch}`,
639
+ workspaceRoot: root,
640
+ });
641
+ for (const path of currentConfigurationPaths) {
642
+ (0, blueprint_trust_git_js_1.inspectProtectedGitFileAuthority)({
643
+ current: readBoundedWorkspaceFile(root, path, `Blueprint verification configuration ${path}`, MAX_CONTROL_JSON_BYTES).bytes,
644
+ headCommit: authority.headCommit,
645
+ path,
646
+ protectedCommit: authority.protectedCommit,
647
+ workspaceRoot: root,
648
+ });
649
+ }
650
+ };
651
+ assertCurrentExecutionAuthority();
652
+ const lockfileBytes = readBoundedWorkspaceFile(root, 'pnpm-lock.yaml', 'pnpm-lock.yaml', 25 * 1024 * 1024).bytes;
653
+ const lockfile = lockfileBytes.toString('utf8');
654
+ const nodeVersionSource = readBoundedWorkspaceFile(root, '.node-version', '.node-version', 128).bytes.toString('utf8');
655
+ const manifest = readJson(root, 'package.json', 'Workspace package.json');
656
+ if (readBoundedWorkspaceFile(root, 'tools/blueprint-verification-vitest.config.mjs', 'Blueprint verification Vitest config', MAX_CONTROL_JSON_BYTES).bytes.toString('utf8') !== generated_blueprint_trust_command_js_1.BLUEPRINT_VERIFICATION_VITEST_CONFIG_SOURCE) {
657
+ return unavailable();
658
+ }
659
+ if (!isRecord(manifest) || typeof manifest.name !== 'string') {
660
+ return unavailable();
661
+ }
662
+ const devDependencies = manifest.devDependencies;
663
+ if (!isRecord(devDependencies))
664
+ return unavailable();
665
+ const otherDeclarationGroups = ['dependencies', 'optionalDependencies']
666
+ .map((group) => manifest[group])
667
+ .filter(isRecord);
668
+ const reviews = [];
669
+ for (const record of external) {
670
+ const blueprint = record.slice.blueprint;
671
+ if (devDependencies[blueprint.name] !== blueprint.version ||
672
+ otherDeclarationGroups.some((group) => Object.prototype.hasOwnProperty.call(group, blueprint.name))) {
673
+ return unavailable();
674
+ }
675
+ const integrity = (0, blueprint_trust_js_1.resolveBlueprintPackageIntegrity)(lockfile, blueprint.name, blueprint.version);
676
+ const decision = (0, blueprint_trust_js_1.authorizeBlueprintTrust)({
677
+ frameworkVersion,
678
+ integrity,
679
+ name: blueprint.name,
680
+ now,
681
+ operation: 'adopt',
682
+ policy: authority.authorization.policy,
683
+ snapshot: authority.authorization.snapshot,
684
+ version: blueprint.version,
685
+ });
686
+ if (decision.decision !== 'allow')
687
+ return unavailable();
688
+ const projectNode = graph.nodes[record.slice.slice];
689
+ if (!projectNode)
690
+ return unavailable();
691
+ const project = {
692
+ context: projectContext(graph, projectNode),
693
+ targets: (projectNode.data.targets ?? {}),
694
+ };
695
+ const verificationTargets = (0, blueprint_trust_js_1.blueprintVerificationTargetClosure)({
696
+ projectRoot: project.context.root,
697
+ roots: record.slice.verification,
698
+ targets: project.targets,
699
+ });
700
+ const blueprintFiles = record.slice.paths
701
+ .filter(({ origin }) => origin === 'blueprint')
702
+ .map((owned) => {
703
+ const currentBytes = readBoundedWorkspaceFile(record.root, owned.path, `Blueprint-origin path ${owned.path}`, MAX_OWNED_FILE_BYTES).bytes;
704
+ const current = currentBytes.toString('utf8');
705
+ if (owned.mode === 'managed' &&
706
+ (0, index_js_1.hashOwnedContent)(current, owned) !== owned.sha256) {
707
+ throw new Error('Blueprint-managed content differs from ownership.');
708
+ }
709
+ return {
710
+ digest: (0, index_js_1.hashGeneratedContent)(currentBytes),
711
+ mode: owned.mode,
712
+ path: owned.path,
713
+ };
714
+ })
715
+ .sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.path, right.path));
716
+ const exactBlueprint = {
717
+ integrity,
718
+ name: blueprint.name,
719
+ version: blueprint.version,
720
+ };
721
+ const review = authority.authorization.policy.generatedReviews.find((candidate) => {
722
+ const candidateContent = {
723
+ blueprintFiles,
724
+ containerRegistries: [...candidate.allowedContainerRegistries],
725
+ projectPath: `packages/${record.slice.slice}/project.json`,
726
+ slice: record.slice.slice,
727
+ verificationRoots: [...candidate.verificationRoots],
728
+ verificationTargets,
729
+ };
730
+ return (candidate.blueprint.name === blueprint.name &&
731
+ candidate.blueprint.version === blueprint.version &&
732
+ candidate.blueprint.integrity === integrity &&
733
+ candidate.slice === record.slice.slice &&
734
+ candidate.projectPath ===
735
+ `packages/${record.slice.slice}/project.json` &&
736
+ (0, node_util_1.isDeepStrictEqual)(candidate.verificationRoots, [...record.slice.verification].sort(ordering_js_1.compareDeveloperAgentStrings)) &&
737
+ (0, node_util_1.isDeepStrictEqual)(candidate.verificationTargets, verificationTargets) &&
738
+ (0, node_util_1.isDeepStrictEqual)(candidate.blueprintFiles, blueprintFiles) &&
739
+ candidate.evidenceDigest ===
740
+ (0, blueprint_trust_js_1.blueprintGeneratedContentApprovalDigest)(exactBlueprint, candidateContent));
741
+ });
742
+ if (!review)
743
+ return unavailable();
744
+ const content = {
745
+ blueprintFiles,
746
+ containerRegistries: [...review.allowedContainerRegistries],
747
+ projectPath: `packages/${record.slice.slice}/project.json`,
748
+ slice: record.slice.slice,
749
+ verificationRoots: [...review.verificationRoots],
750
+ verificationTargets,
751
+ };
752
+ const receiptPath = (0, blueprint_trust_js_1.blueprintVerificationExecutionReceiptPath)(record.slice.slice);
753
+ const protectedReceipt = authority.protectedVerificationReceipts.find(({ reference }) => reference === receiptPath);
754
+ if (!protectedReceipt)
755
+ return unavailable();
756
+ const receipt = (0, blueprint_trust_js_1.createBlueprintVerificationExecutionReceipt)(protectedReceipt.receipt, {
757
+ approvalDigest: review.evidenceDigest,
758
+ blueprint: exactBlueprint,
759
+ content,
760
+ executionCommit: protectedReceipt.receipt.executionCommit,
761
+ repositoryRootCommit: authority.repositoryRootCommit,
762
+ reviewedAt: review.reviewedAt,
763
+ workspace: manifest.name,
764
+ });
765
+ const nodeEngine = isRecord(manifest.engines)
766
+ ? manifest.engines.node
767
+ : undefined;
768
+ if (typeof nodeEngine !== 'string' ||
769
+ nodeEngine !== receipt.nodeEngine ||
770
+ nodeVersionSource !== `${receipt.nodeVersionDeclaration}\n` ||
771
+ !(0, semver_1.satisfies)(receipt.nodeVersion, nodeEngine) ||
772
+ (0, node_crypto_1.createHash)('sha256').update(lockfileBytes).digest('hex') !==
773
+ receipt.lockfileSha256) {
774
+ return unavailable();
775
+ }
776
+ const invocations = (0, blueprint_verification_execution_js_1.resolveBlueprintVerificationExecutions)(verificationTargets.map(({ name }) => {
777
+ const target = project.targets[name];
778
+ return {
779
+ options: target?.options ?? {},
780
+ projectName: record.slice.slice,
781
+ projectRoot: project.context.root,
782
+ workspaceRoot: root,
783
+ };
784
+ }));
785
+ const currentExecutionAuthorities = verificationTargets.map(({ name }, index) => {
786
+ const invocation = invocations[index];
787
+ if (!invocation) {
788
+ throw new Error('Blueprint verification target lost its portable invocation.');
789
+ }
790
+ const targetIdentity = `${record.slice.slice}:${name}`;
791
+ if (invocation.plan.kind === 'node') {
792
+ if (invocation.toolAuthority !== undefined) {
793
+ throw new Error('Blueprint verification Node target acquired package authority.');
794
+ }
795
+ return { kind: 'node', target: targetIdentity };
796
+ }
797
+ if (!invocation.toolAuthority ||
798
+ invocation.toolAuthority.name !== invocation.plan.kind) {
799
+ throw new Error('Blueprint verification target lost its portable package authority.');
800
+ }
801
+ return {
802
+ ...invocation.toolAuthority,
803
+ kind: invocation.plan.kind,
804
+ target: targetIdentity,
805
+ };
806
+ });
807
+ if (!(0, node_util_1.isDeepStrictEqual)(currentExecutionAuthorities, receipt.executionAuthorities)) {
808
+ return unavailable();
809
+ }
810
+ reviews.push({
811
+ project: record.slice.slice,
812
+ roots: [...review.verificationRoots],
813
+ verificationTargets,
814
+ });
815
+ }
816
+ assertCurrentExecutionAuthority();
817
+ return { reviews, warnings: [] };
818
+ }
819
+ catch {
820
+ return unavailable();
821
+ }
822
+ }
823
+ function candidateReference(root, requestedPath) {
824
+ if (!requestedPath)
825
+ return undefined;
826
+ const relativePath = requestedPath;
827
+ const bytes = readBoundedWorkspaceFile(root, relativePath, `Candidate provenance reference ${relativePath}`, MAX_CANDIDATE_BYTES).bytes;
828
+ return {
829
+ digest: `sha256:${(0, node_crypto_1.createHash)('sha256').update(bytes).digest('hex')}`,
830
+ reference: relativePath,
831
+ };
832
+ }
833
+ function policyContext(root, stage, policy, nodes) {
834
+ const selected = nodes
835
+ .filter((node) => node.data.tags?.includes('scope:foundation') ||
836
+ node.data.tags?.includes('type:slice'))
837
+ .map((node) => ({
838
+ kind: node.data.tags?.includes('scope:foundation')
839
+ ? 'foundation'
840
+ : 'slice',
841
+ name: node.name,
842
+ }))
843
+ .sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.name, right.name));
844
+ const selectedPolicyProjects = selected.map(({ name }) => name);
845
+ const decisions = model_js_1.DEVELOPER_AGENT_POLICY_LIFECYCLE_ACTIONS.map((action) => {
846
+ const decision = (0, index_js_2.evaluateRepositoryPolicyRequest)(policy, {
847
+ action,
848
+ projects: selected,
849
+ stage,
850
+ });
851
+ return {
852
+ action,
853
+ allowed: decision.allowed,
854
+ ...(decision.effectiveProductionProfile
855
+ ? {
856
+ effectiveProductionProfile: decision.effectiveProductionProfile,
857
+ }
858
+ : {}),
859
+ projects: selectedPolicyProjects,
860
+ reasons: [...decision.reasons],
861
+ stage,
862
+ };
863
+ });
864
+ const fields = [
865
+ { name: 'productionAccess', value: policy.productionAccess },
866
+ {
867
+ name: 'productionApproval.mode',
868
+ value: policy.productionApproval.mode,
869
+ },
870
+ {
871
+ name: 'productionFoundation.profile',
872
+ value: policy.productionFoundation.profile,
873
+ },
874
+ ...Object.entries(policy.slices)
875
+ .sort(([left], [right]) => (0, ordering_js_1.compareDeveloperAgentStrings)(left, right))
876
+ .map(([slice, value]) => ({
877
+ name: `slices.${slice}.productionStatus`,
878
+ value: value.productionStatus,
879
+ })),
880
+ ...decisions.map(({ action, allowed }) => ({
881
+ name: `effective.${stage}.${action}`,
882
+ value: allowed ? 'allowed' : 'blocked',
883
+ })),
884
+ ];
885
+ const canonicalPolicyMaterial = JSON.stringify({
886
+ decisions,
887
+ policy: {
888
+ $schema: policy.$schema ?? null,
889
+ productionAccess: policy.productionAccess,
890
+ productionApproval: policy.productionApproval,
891
+ productionFoundation: policy.productionFoundation,
892
+ schemaVersion: policy.schemaVersion,
893
+ slices: Object.fromEntries(Object.entries(policy.slices).sort(([left], [right]) => (0, ordering_js_1.compareDeveloperAgentStrings)(left, right))),
894
+ },
895
+ selected,
896
+ stage,
897
+ });
898
+ return {
899
+ canonicalStage: stage,
900
+ effectiveDecisions: decisions,
901
+ effectivePolicyDigest: `sha256:${(0, node_crypto_1.createHash)('sha256')
902
+ .update(canonicalPolicyMaterial)
903
+ .digest('hex')}`,
904
+ effectivePolicyReferences: [
905
+ 'ebk.repository-policy.json',
906
+ 'docs/repository-operating-policy.md',
907
+ ].filter((path) => (0, node_fs_1.existsSync)((0, node_path_1.join)(root, path))),
908
+ repositoryPolicyFields: fields,
909
+ };
910
+ }
911
+ function selectedSliceRecord(records, selectedSlice) {
912
+ if (!selectedSlice)
913
+ return undefined;
914
+ const record = records.find(({ slice }) => slice?.slice === selectedSlice);
915
+ if (!record?.slice) {
916
+ throw new Error(`Selected Product Slice ${selectedSlice} has no valid ownership record.`);
917
+ }
918
+ return record;
919
+ }
920
+ function selectionContext(record, feature, projectInventory) {
921
+ if (!record) {
922
+ if (feature)
923
+ throw new Error('A feature selection requires one Product Slice.');
924
+ return { contracts: [], foundationCapabilities: [], projectInventory };
925
+ }
926
+ if (feature) {
927
+ const registryPath = 'operations/features.json';
928
+ const registry = (0, feature_registry_js_1.parseSliceFeatureRegistry)(readJson(record.root, registryPath, `Product Slice ${record.slice.slice} feature registry`), `Product Slice ${record.slice.slice} feature registry`);
929
+ if (!registry.features.some(({ id }) => id === feature)) {
930
+ throw new Error(`Feature ${feature} is not registered for Product Slice ${record.slice.slice}.`);
931
+ }
932
+ }
933
+ return {
934
+ contracts: [
935
+ ...record.slice.contracts.consumes.map((reference) => ({
936
+ class: 'other',
937
+ reference: `consumes:${reference}`,
938
+ })),
939
+ ...record.slice.contracts.publishes.map((reference) => ({
940
+ class: 'other',
941
+ reference: `publishes:${reference}`,
942
+ })),
943
+ ].sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.reference, right.reference)),
944
+ ...(feature ? { feature } : {}),
945
+ foundationCapabilities: [...record.slice.foundation.capabilities].sort(),
946
+ projectInventory,
947
+ slice: record.slice.slice,
948
+ };
949
+ }
950
+ function markerContext(root) {
951
+ const report = (0, index_js_3.scanWorkMarkers)(root);
952
+ const markers = report.markers.map((marker) => ({
953
+ blocking: marker.kind === 'BLOCKER' || marker.kind === 'SECURITY',
954
+ path: marker.path,
955
+ reference: marker.reference,
956
+ sanitizedSummary: `EBK-${marker.kind} marker in ${marker.ownership} source.`,
957
+ }));
958
+ const warnings = [
959
+ ...(report.blockingMarkers.length > 0
960
+ ? [
961
+ warning('marker-blocked', `${report.blockingMarkers.length} work marker(s) block protected promotion.`),
962
+ ]
963
+ : []),
964
+ ...report.issues.map((issue) => warning(issue.code === 'ownership-conflict' ||
965
+ issue.code === 'managed-file-marker'
966
+ ? 'ownership-conflict'
967
+ : 'marker-blocked', `Work-marker validation reported ${issue.code} at ${issue.path}:${issue.line}.`)),
968
+ ];
969
+ return { markers, warnings };
970
+ }
971
+ function reportContexts(warnings, markers) {
972
+ const ownershipFailed = warnings.some(({ classification }) => ['generated-drift', 'ownership-conflict'].includes(classification));
973
+ return [
974
+ {
975
+ name: 'ownership-and-version',
976
+ outcome: ownershipFailed ? 'failed' : 'passed',
977
+ reference: '.ebk/ownership.json',
978
+ },
979
+ {
980
+ name: 'repository-policy',
981
+ outcome: warnings.some(({ classification }) => classification === 'policy-conflict')
982
+ ? 'failed'
983
+ : 'passed',
984
+ reference: 'ebk.repository-policy.json',
985
+ },
986
+ {
987
+ name: 'work-markers',
988
+ outcome: markers.some(({ blocking }) => blocking)
989
+ ? 'blocked'
990
+ : 'passed',
991
+ reference: 'AGENTS.md',
992
+ },
993
+ {
994
+ name: 'github-bootstrap',
995
+ outcome: 'unavailable',
996
+ reference: 'github-bootstrap',
997
+ },
998
+ {
999
+ name: 'infrastructure-drift',
1000
+ outcome: 'unavailable',
1001
+ reference: 'infrastructure-drift',
1002
+ },
1003
+ ];
1004
+ }
1005
+ function uniqueWarnings(values) {
1006
+ const seen = new Set();
1007
+ return values
1008
+ .filter(({ classification, sanitizedSummary }) => {
1009
+ const key = `${classification}\0${sanitizedSummary}`;
1010
+ if (seen.has(key))
1011
+ return false;
1012
+ seen.add(key);
1013
+ return true;
1014
+ })
1015
+ .sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.classification, right.classification) ||
1016
+ (0, ordering_js_1.compareDeveloperAgentStrings)(left.sanitizedSummary, right.sanitizedSummary));
1017
+ }
1018
+ function inspectDeveloperAgentWorkspace(options) {
1019
+ const root = safeRealRoot(options.repositoryRoot);
1020
+ const projectNames = fullGraphProjectNames(options.graph);
1021
+ const identity = workspaceIdentity(options.graph);
1022
+ const foundationProjectName = foundationIdentity(root, options.graph);
1023
+ const nodes = selectedNodes(options.graph, options.selectedProjects);
1024
+ const registryNodes = selectedDependencyClosureNodes(options.graph, [
1025
+ ...new Map([...nodes, identity.node].map((node) => [node.name, node])).values(),
1026
+ ]);
1027
+ if (options.selectedSlice &&
1028
+ !nodes.some((node) => node.name === options.selectedSlice)) {
1029
+ throw new Error('The selected Product Slice must be included in the bounded project selection.');
1030
+ }
1031
+ const projects = nodes.map((node) => projectContext(options.graph, node));
1032
+ const selectedProjectNames = new Set(nodes.map(({ name }) => name));
1033
+ const ownershipNodes = Object.values(options.graph.nodes).filter((node) => node.data.tags?.some((tag) => tag === 'scope:foundation' || tag === 'type:slice'));
1034
+ const ownership = readOwnershipRecords(root, ownershipNodes);
1035
+ const externalOwnershipRoots = (0, blueprint_verification_authority_js_1.externalBlueprintOwnershipRoots)(root);
1036
+ const versions = versionContext(root, identity.name, ownership.records);
1037
+ const provenance = candidateReference(root, options.candidateProvenancePath);
1038
+ const ownedWarnings = ownershipWarnings(ownership.records);
1039
+ const hasOwnershipConflict = [...ownership.warnings, ...ownedWarnings].some(({ classification }) => classification === 'ownership-conflict');
1040
+ const workspace = {
1041
+ ...versions.workspace,
1042
+ ...(provenance ? { candidateProvenance: provenance } : {}),
1043
+ ...(hasOwnershipConflict
1044
+ ? { ownershipAgreement: 'conflict' }
1045
+ : {}),
1046
+ };
1047
+ let policy;
1048
+ const policyWarnings = [];
1049
+ try {
1050
+ const policySource = readBoundedWorkspaceFile(root, index_js_2.REPOSITORY_POLICY_FILE, 'Repository Operating Policy', MAX_CONTROL_JSON_BYTES).bytes.toString('utf8');
1051
+ policy = (0, index_js_2.parseRepositoryOperatingPolicy)(policySource, index_js_2.REPOSITORY_POLICY_FILE);
1052
+ }
1053
+ catch {
1054
+ policyWarnings.push(warning('policy-conflict', 'Repository Operating Policy is missing, malformed, or contradictory.'));
1055
+ throw new Error(policyWarnings[0].sanitizedSummary);
1056
+ }
1057
+ const selectedRecord = selectedSliceRecord(ownership.records, options.selectedSlice);
1058
+ const selection = {
1059
+ ...selectionContext(selectedRecord, options.selectedFeature, options.selectedProjects === undefined ? 'full' : 'bounded'),
1060
+ files: selectedFileContexts(root, options.graph, nodes, ownership.records, options.selectedFiles),
1061
+ };
1062
+ const marker = markerContext(root);
1063
+ const projectTargets = registryNodes.map((node) => ({
1064
+ context: projectContext(options.graph, node),
1065
+ targets: (node.data.targets ?? {}),
1066
+ }));
1067
+ const externalVerification = protectedExternalBlueprintVerification(root, versions.workspace.frameworkVersion, ownership.records, options.graph, new Set(registryNodes.map(({ name }) => name)), options.blueprintTrustNow ?? new Date().toISOString(), options.git);
1068
+ const operationRegistry = (0, operation_registry_js_1.createDeveloperAgentOperationRegistry)(projectTargets, {
1069
+ exposedProjectNames: nodes.map(({ name }) => name),
1070
+ externalOwnedProjectNames: externalOwnedProjectNames(root, registryNodes, externalOwnershipRoots, options.externalOwnershipHistory, foundationProjectName),
1071
+ namedInputDefinitions: [
1072
+ options.workspaceNamedInputs ?? { runtime: 'uninspected' },
1073
+ ...Object.values(options.graph.nodes).map((node) => node.data.namedInputs ?? {}),
1074
+ ],
1075
+ reviewedExternalVerification: externalVerification.reviews,
1076
+ });
1077
+ const intentionallyNonPlannable = new Set(operationRegistry.nonPlannableTargets.map(({ target }) => target));
1078
+ const unsupportedWarnings = operationRegistry.unsupportedTargets
1079
+ .filter((target) => !intentionallyNonPlannable.has(target))
1080
+ .filter((target) => (0, operation_registry_js_1.operationLooksMutating)(target.slice(target.lastIndexOf(':') + 1)))
1081
+ .map(() => warning('unsupported-operation', 'One mutation-shaped Nx target has no declared Developer-Agent authority contract.'));
1082
+ const warnings = uniqueWarnings([
1083
+ ...ownership.warnings,
1084
+ ...versions.warnings,
1085
+ ...ownedWarnings,
1086
+ ...policyWarnings,
1087
+ ...marker.warnings,
1088
+ ...externalVerification.warnings,
1089
+ ...unsupportedWarnings,
1090
+ ]);
1091
+ const requiredVerification = [
1092
+ ...new Set([
1093
+ ...ownership.records.flatMap((record) => record.slice && selectedProjectNames.has(record.slice.slice)
1094
+ ? record.slice.verification.map((target) => `${record.slice.slice}:${target}`)
1095
+ : []),
1096
+ ...projects
1097
+ .filter(({ targets }) => targets.includes('verify'))
1098
+ .map(({ name }) => `${name}:verify`),
1099
+ ]),
1100
+ ].sort();
1101
+ const documentationPaths = [
1102
+ 'AGENTS.md',
1103
+ 'docs/architecture.md',
1104
+ 'docs/developer-agent.md',
1105
+ 'docs/git-workflow.md',
1106
+ 'docs/repository-operating-policy.md',
1107
+ 'docs/work-markers.md',
1108
+ ].filter((path) => (0, node_fs_1.existsSync)((0, node_path_1.join)(root, path)));
1109
+ return {
1110
+ ...(options.affected ? { affected: options.affected } : {}),
1111
+ authenticatedTargets: operationRegistry.authenticatedTargets,
1112
+ documentationPaths,
1113
+ evidenceClasses: [
1114
+ 'source',
1115
+ 'local-integration',
1116
+ 'protected-promotion-proof',
1117
+ ],
1118
+ git: options.git,
1119
+ kind: model_js_1.DEVELOPER_AGENT_CONTEXT_KIND,
1120
+ markers: marker.markers,
1121
+ nonPlannableTargets: operationRegistry.nonPlannableTargets,
1122
+ policy: policyContext(root, options.canonicalStage ?? 'development', policy, registryNodes),
1123
+ projectNames,
1124
+ projects,
1125
+ reports: reportContexts(warnings, marker.markers),
1126
+ requiredVerification,
1127
+ schemaVersion: model_js_1.DEVELOPER_AGENT_CONTRACT_SCHEMA_VERSION,
1128
+ selection,
1129
+ supportedOperations: operationRegistry.operations,
1130
+ warnings,
1131
+ workspace,
1132
+ };
1133
+ }
1134
+ //# sourceMappingURL=workspace-inspection.js.map