@empire-builder-kit/nx 1.0.0-rc.46 → 1.0.0-rc.48

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 (780) hide show
  1. package/README.md +14 -169
  2. package/executors.json +24 -79
  3. package/generators.json +18 -18
  4. package/package.json +13 -71
  5. package/src/aws/identity.d.ts +1 -1
  6. package/src/aws-authority/boundary-transforms.d.ts +9 -0
  7. package/src/aws-authority/boundary-transforms.js +78 -0
  8. package/src/aws-authority/contracts.d.ts +116 -0
  9. package/src/aws-authority/contracts.js +40 -0
  10. package/src/aws-authority/deployment-guardrails.d.ts +4 -0
  11. package/src/aws-authority/deployment-guardrails.js +543 -0
  12. package/src/aws-authority/deployment-policy-groups.d.ts +3 -0
  13. package/src/aws-authority/deployment-policy-groups.js +299 -0
  14. package/src/aws-authority/deployment-resources.d.ts +64 -0
  15. package/src/aws-authority/deployment-resources.js +265 -0
  16. package/src/aws-authority/deployment-services.d.ts +3 -0
  17. package/src/aws-authority/deployment-services.js +717 -0
  18. package/src/aws-authority/development-authority.d.ts +11 -0
  19. package/src/aws-authority/development-authority.js +160 -0
  20. package/src/aws-authority/guardrail-actions.d.ts +87 -0
  21. package/src/aws-authority/guardrail-actions.js +463 -0
  22. package/src/aws-authority/policy-document.d.ts +15 -0
  23. package/src/aws-authority/policy-document.js +264 -0
  24. package/src/aws-authority/runtime-boundary.d.ts +7 -0
  25. package/src/aws-authority/runtime-boundary.js +211 -0
  26. package/src/aws-authority/service-actions.d.ts +96 -0
  27. package/src/aws-authority/service-actions.js +512 -0
  28. package/src/aws-authority/stage-authority.d.ts +6 -244
  29. package/src/aws-authority/stage-authority.js +114 -3419
  30. package/src/aws-authority/stage-identity.d.ts +6 -0
  31. package/src/aws-authority/stage-identity.js +134 -0
  32. package/src/cli/bootstrap.d.ts +0 -20
  33. package/src/cli/bootstrap.js +2 -153
  34. package/src/cli/dev-command.d.ts +2 -4
  35. package/src/cli/dev-command.js +1 -19
  36. package/src/cli/main.d.ts +0 -4
  37. package/src/cli/main.js +22 -80
  38. package/src/cli/output.d.ts +2 -4
  39. package/src/cli/output.js +2 -8
  40. package/src/executors/deployment-plan/deployment-plan.d.ts +0 -2
  41. package/src/executors/deployment-plan/deployment-plan.js +5 -67
  42. package/src/executors/dev-doctor/dev-doctor.d.ts +25 -3
  43. package/src/executors/dev-doctor/dev-doctor.js +137 -50
  44. package/src/executors/dev-setup/dev-setup.d.ts +18 -1
  45. package/src/executors/dev-setup/dev-setup.js +320 -196
  46. package/src/executors/foundation-preflight/foundation-preflight.js +9 -1
  47. package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +2 -2
  48. package/src/executors/local-deploy/deployed-smoke.d.ts +12 -0
  49. package/src/executors/local-deploy/deployed-smoke.js +115 -0
  50. package/src/executors/local-deploy/deployment-authority.d.ts +24 -0
  51. package/src/executors/local-deploy/deployment-authority.js +81 -0
  52. package/src/executors/local-deploy/deployment-child.d.ts +18 -0
  53. package/src/executors/local-deploy/deployment-child.js +77 -0
  54. package/src/executors/local-deploy/deployment-contracts.d.ts +96 -0
  55. package/src/executors/local-deploy/deployment-contracts.js +3 -0
  56. package/src/executors/local-deploy/deployment-projects.d.ts +4 -0
  57. package/src/executors/local-deploy/deployment-projects.js +16 -0
  58. package/src/executors/local-deploy/deployment-receipt.d.ts +4 -0
  59. package/src/executors/local-deploy/deployment-receipt.js +55 -0
  60. package/src/executors/local-deploy/deployment-scope.d.ts +17 -0
  61. package/src/executors/local-deploy/deployment-scope.js +239 -0
  62. package/src/executors/local-deploy/deployment-source.d.ts +13 -0
  63. package/src/executors/local-deploy/deployment-source.js +86 -0
  64. package/src/executors/local-deploy/local-deploy.d.ts +5 -106
  65. package/src/executors/local-deploy/local-deploy.js +56 -855
  66. package/src/executors/sst-lifecycle/governed-child-process.d.ts +27 -0
  67. package/src/executors/sst-lifecycle/governed-child-process.js +277 -0
  68. package/src/executors/sst-lifecycle/governed-native-operation.js +4 -10
  69. package/src/executors/sst-lifecycle/run-sst-command.d.ts +4 -85
  70. package/src/executors/sst-lifecycle/run-sst-command.js +28 -788
  71. package/src/executors/sst-lifecycle/sst-contracts.d.ts +44 -0
  72. package/src/executors/sst-lifecycle/sst-contracts.js +3 -0
  73. package/src/executors/sst-lifecycle/sst-invocation.d.ts +17 -0
  74. package/src/executors/sst-lifecycle/sst-invocation.js +502 -0
  75. package/src/executors/sst-lifecycle/task-unlock.js +3 -3
  76. package/src/foundation/discovery.d.ts +1 -5
  77. package/src/foundation/discovery.js +0 -2
  78. package/src/foundation/identity-domain-parent-ready.d.ts +91 -0
  79. package/src/foundation/identity-domain-parent-ready.js +333 -0
  80. package/src/foundation/identity-domain.d.ts +94 -0
  81. package/src/foundation/identity-domain.js +115 -0
  82. package/src/foundation/index.d.ts +2 -2
  83. package/src/foundation/index.js +7 -9
  84. package/src/foundation/local-private-smoke-access.d.ts +6 -15
  85. package/src/foundation/local-private-smoke-access.js +8 -192
  86. package/src/foundation/observability.d.ts +16 -26
  87. package/src/foundation/observability.js +34 -135
  88. package/src/foundation/preflight.js +16 -14
  89. package/src/foundation/private-smoke-access.d.ts +7 -14
  90. package/src/foundation/private-smoke-access.js +4 -126
  91. package/src/foundation/root-site-workspace.d.ts +35 -0
  92. package/src/foundation/root-site-workspace.js +80 -0
  93. package/src/foundation/root-site.d.ts +82 -0
  94. package/src/foundation/root-site.js +276 -0
  95. package/src/generators/formatting.js +5 -4
  96. package/src/generators/framework-prerequisites.d.ts +2 -0
  97. package/src/generators/framework-prerequisites.js +34 -0
  98. package/src/generators/function/function.d.ts +20 -1
  99. package/src/generators/function/function.js +143 -90
  100. package/src/generators/function/schema.d.ts +1 -0
  101. package/src/generators/function/schema.json +8 -2
  102. package/src/generators/function-access/function-access.d.ts +8 -0
  103. package/src/generators/function-access/function-access.js +73 -0
  104. package/src/generators/function-access/schema.d.ts +6 -0
  105. package/src/generators/function-access/schema.json +25 -0
  106. package/src/generators/observability-policy.js +1 -2
  107. package/src/{supply-chain → generators}/pnpm-toolchain-authority.d.ts +3 -3
  108. package/src/{supply-chain → generators}/pnpm-toolchain-authority.js +12 -12
  109. package/src/generators/post-generation-install.d.ts +2 -9
  110. package/src/generators/post-generation-install.js +12 -140
  111. package/src/generators/preset/dependency-overrides.d.ts +14 -20
  112. package/src/generators/preset/dependency-overrides.js +13 -57
  113. package/src/generators/preset/generator.js +0 -3
  114. package/src/generators/preset/workspace-files-foundation-infra.d.ts +6 -0
  115. package/src/generators/preset/workspace-files-foundation-infra.js +586 -0
  116. package/src/generators/preset/workspace-files-foundation-readme.d.ts +5 -0
  117. package/src/generators/preset/workspace-files-foundation-readme.js +90 -0
  118. package/src/generators/preset/workspace-files-foundation.d.ts +3 -0
  119. package/src/generators/preset/workspace-files-foundation.js +170 -0
  120. package/src/generators/preset/workspace-files-ownership.d.ts +9 -0
  121. package/src/generators/preset/workspace-files-ownership.js +124 -0
  122. package/src/generators/preset/workspace-files-root-config.d.ts +32 -0
  123. package/src/generators/preset/workspace-files-root-config.js +356 -0
  124. package/src/generators/preset/workspace-files-root-docs.d.ts +5 -0
  125. package/src/generators/preset/workspace-files-root-docs.js +109 -0
  126. package/src/generators/preset/workspace-files-shared.d.ts +18 -0
  127. package/src/generators/preset/workspace-files-shared.js +7 -0
  128. package/src/generators/preset/workspace-files-workflows.d.ts +39 -0
  129. package/src/generators/preset/workspace-files-workflows.js +306 -0
  130. package/src/generators/preset/workspace-files-workspace-health.d.ts +6 -0
  131. package/src/generators/preset/workspace-files-workspace-health.js +148 -0
  132. package/src/generators/preset/workspace-files.d.ts +10 -24
  133. package/src/generators/preset/workspace-files.js +48 -10511
  134. package/src/generators/site/built-in-site-documentation-files.d.ts +3 -0
  135. package/src/generators/site/built-in-site-documentation-files.js +51 -0
  136. package/src/generators/site/built-in-site-files.d.ts +11 -0
  137. package/src/generators/site/built-in-site-files.js +41 -0
  138. package/src/generators/site/built-in-site-infrastructure-files.d.ts +3 -0
  139. package/src/generators/site/built-in-site-infrastructure-files.js +115 -0
  140. package/src/generators/site/built-in-site-plan.d.ts +23 -0
  141. package/src/generators/site/built-in-site-plan.js +67 -0
  142. package/src/generators/site/built-in-site-project-files.d.ts +11 -0
  143. package/src/generators/site/built-in-site-project-files.js +212 -0
  144. package/src/generators/site/built-in-site-script-files.d.ts +4 -0
  145. package/src/generators/site/built-in-site-script-files.js +102 -0
  146. package/src/generators/site/built-in-site-shared.d.ts +69 -0
  147. package/src/generators/site/built-in-site-shared.js +314 -0
  148. package/src/generators/site/built-in-site-sst-config-files.d.ts +3 -0
  149. package/src/generators/site/built-in-site-sst-config-files.js +107 -0
  150. package/src/generators/site/built-in-site-web-files.d.ts +3 -0
  151. package/src/generators/site/built-in-site-web-files.js +78 -0
  152. package/src/generators/site/schema.d.ts +9 -0
  153. package/src/generators/site/schema.json +26 -0
  154. package/src/generators/site/site.d.ts +5 -0
  155. package/src/generators/site/site.js +153 -0
  156. package/src/generators/slice/built-in-plan-api-files.d.ts +1 -2
  157. package/src/generators/slice/built-in-plan-api-files.js +30 -890
  158. package/src/generators/slice/built-in-plan-database-lifecycle-files.js +57 -1851
  159. package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +5 -2
  160. package/src/generators/slice/built-in-plan-infrastructure-files.js +80 -3358
  161. package/src/generators/slice/built-in-plan-key-value-files.d.ts +3 -2
  162. package/src/generators/slice/built-in-plan-key-value-files.js +3 -21
  163. package/src/generators/slice/built-in-plan-project-files.d.ts +5 -3
  164. package/src/generators/slice/built-in-plan-project-files.js +79 -897
  165. package/src/generators/slice/built-in-plan-shared.d.ts +4 -19
  166. package/src/generators/slice/built-in-plan-shared.js +5 -58
  167. package/src/generators/slice/built-in-plan-sst-config.d.ts +49 -0
  168. package/src/generators/slice/built-in-plan-sst-config.js +160 -0
  169. package/src/generators/slice/built-in-plan-web-files.d.ts +1 -1
  170. package/src/generators/slice/built-in-plan-web-files.js +14 -475
  171. package/src/generators/slice/built-in-plan.d.ts +2 -3
  172. package/src/generators/slice/built-in-plan.js +79 -277
  173. package/src/{developer-agent/preview-changes.d.ts → generators/slice/generation-tree.d.ts} +1 -5
  174. package/src/generators/slice/generation-tree.js +161 -0
  175. package/src/generators/slice/persistence-contract.js +2 -2
  176. package/src/generators/slice/schema.json +12 -4
  177. package/src/generators/slice/slice-config.d.ts +7 -0
  178. package/src/generators/slice/slice-config.js +125 -0
  179. package/src/generators/slice/slice.js +52 -257
  180. package/src/generators/slice/sql-bootstrap.d.ts +1 -0
  181. package/src/generators/slice/sql-bootstrap.js +505 -0
  182. package/src/generators/slice/sql-client.d.ts +1 -0
  183. package/src/generators/slice/sql-client.js +107 -0
  184. package/src/generators/slice/sql-infrastructure.d.ts +1 -0
  185. package/src/generators/slice/sql-infrastructure.js +225 -0
  186. package/src/generators/slice/sql-logging.d.ts +1 -0
  187. package/src/generators/slice/sql-logging.js +266 -0
  188. package/src/generators/slice/sql-migration.d.ts +2 -0
  189. package/src/generators/slice/sql-migration.js +202 -0
  190. package/src/generators/slice/standard-slice-contract.d.ts +25 -0
  191. package/src/generators/slice/standard-slice-contract.js +64 -0
  192. package/src/generators/sql/schema.json +1 -1
  193. package/src/generators/sql/sql.d.ts +1 -1
  194. package/src/generators/sql/sql.js +13 -7
  195. package/src/generators/upgrade/framework-package-upgrade.d.ts +35 -0
  196. package/src/generators/upgrade/framework-package-upgrade.js +55 -0
  197. package/src/generators/upgrade/framework-packages.d.ts +25 -0
  198. package/src/generators/upgrade/framework-packages.js +138 -0
  199. package/src/generators/upgrade/function-authentication-notice.d.ts +21 -0
  200. package/src/generators/upgrade/function-authentication-notice.js +54 -0
  201. package/src/generators/upgrade/schema.d.ts +0 -3
  202. package/src/generators/upgrade/schema.json +7 -17
  203. package/src/generators/upgrade/slice-compositions.d.ts +20 -0
  204. package/src/generators/upgrade/slice-compositions.js +100 -0
  205. package/src/generators/upgrade/slice-upgrade-guidance.d.ts +19 -0
  206. package/src/generators/upgrade/slice-upgrade-guidance.js +50 -0
  207. package/src/generators/upgrade/slice-upgrade.d.ts +4 -0
  208. package/src/generators/upgrade/slice-upgrade.js +231 -0
  209. package/src/generators/upgrade/upgrade-plan.d.ts +49 -0
  210. package/src/generators/upgrade/upgrade-plan.js +242 -0
  211. package/src/generators/upgrade/upgrade-preflight.d.ts +20 -0
  212. package/src/generators/upgrade/upgrade-preflight.js +64 -0
  213. package/src/generators/upgrade/upgrade.d.ts +8 -87
  214. package/src/generators/upgrade/upgrade.js +27 -1909
  215. package/src/generators/workload/schema.json +2 -2
  216. package/src/generators/workload/workload.d.ts +11 -11
  217. package/src/generators/workload/workload.js +167 -1200
  218. package/src/index.d.ts +0 -5
  219. package/src/index.js +0 -5
  220. package/src/local-dev/browser-verification.d.ts +0 -7
  221. package/src/local-dev/browser-verification.js +0 -136
  222. package/src/local-dev/contracts.d.ts +6 -0
  223. package/src/local-dev/contracts.js +17 -9
  224. package/src/local-dev/environment-checks.d.ts +126 -0
  225. package/src/local-dev/environment-checks.js +81 -0
  226. package/src/local-dev/environment-inspector.d.ts +3 -124
  227. package/src/local-dev/environment-inspector.js +9 -148
  228. package/src/local-dev/fleet-process.d.ts +9 -2
  229. package/src/local-dev/fleet-process.js +27 -7
  230. package/src/local-dev/gateway-daemon.d.ts +1 -1
  231. package/src/local-dev/gateway-daemon.js +6 -4
  232. package/src/local-dev/portless.d.ts +5 -0
  233. package/src/local-dev/portless.js +5 -0
  234. package/src/local-dev/private-state.d.ts +1 -0
  235. package/src/local-dev/private-state.js +19 -23
  236. package/src/local-dev/process-group.d.ts +10 -0
  237. package/src/local-dev/process-group.js +33 -0
  238. package/src/local-dev/process-identity.js +4 -2
  239. package/src/local-dev/slice-runner-child.d.ts +37 -0
  240. package/src/local-dev/slice-runner-child.js +127 -0
  241. package/src/local-dev/slice-runner-recovery.d.ts +32 -0
  242. package/src/local-dev/slice-runner-recovery.js +216 -0
  243. package/src/local-dev/slice-runner-state.d.ts +82 -0
  244. package/src/local-dev/slice-runner-state.js +265 -0
  245. package/src/local-dev/slice-runner.d.ts +4 -117
  246. package/src/local-dev/slice-runner.js +59 -594
  247. package/src/local-dev/tls.js +39 -99
  248. package/src/local-dev/trust-store.d.ts +42 -0
  249. package/src/local-dev/trust-store.js +87 -0
  250. package/src/ownership/composition.d.ts +7 -0
  251. package/src/ownership/composition.js +64 -56
  252. package/src/ownership/index.d.ts +2 -0
  253. package/src/ownership/index.js +7 -0
  254. package/src/ownership/pnpm-workspace.d.ts +77 -0
  255. package/src/ownership/pnpm-workspace.js +225 -0
  256. package/src/ownership/record.d.ts +19 -0
  257. package/src/ownership/record.js +26 -2
  258. package/src/ownership/site-record.d.ts +26 -0
  259. package/src/ownership/site-record.js +120 -0
  260. package/src/repository-policy/capacity-migration.d.ts +1 -1
  261. package/src/repository-policy/capacity-migration.js +1 -1
  262. package/src/repository-policy/deployment-plan.d.ts +3 -0
  263. package/src/repository-policy/deployment-plan.js +33 -4
  264. package/src/repository-policy/foundation-router.d.ts +17 -0
  265. package/src/repository-policy/foundation-router.js +44 -0
  266. package/src/repository-policy/index.d.ts +3 -0
  267. package/src/repository-policy/index.js +3 -0
  268. package/src/repository-policy/policy-accounts.d.ts +22 -0
  269. package/src/repository-policy/policy-accounts.js +134 -0
  270. package/src/repository-policy/policy-files.d.ts +8 -0
  271. package/src/repository-policy/policy-files.js +201 -0
  272. package/src/repository-policy/policy-internal.d.ts +2 -0
  273. package/src/repository-policy/policy-internal.js +11 -0
  274. package/src/repository-policy/policy-model.d.ts +95 -0
  275. package/src/repository-policy/policy-model.js +42 -0
  276. package/src/repository-policy/policy-validation.d.ts +4 -0
  277. package/src/repository-policy/policy-validation.js +308 -0
  278. package/src/repository-policy/policy.d.ts +6 -109
  279. package/src/repository-policy/policy.js +52 -626
  280. package/src/repository-policy/public-dns.d.ts +69 -0
  281. package/src/repository-policy/public-dns.js +265 -0
  282. package/src/{generators/repository-policy → repository-policy}/tree-policy.d.ts +1 -1
  283. package/src/{generators/repository-policy → repository-policy}/tree-policy.js +5 -5
  284. package/src/schemas/generated-ownership-v2.json +6 -0
  285. package/src/schemas/repository-policy-v1.json +106 -3
  286. package/src/secrets/index.d.ts +0 -5
  287. package/src/secrets/index.js +0 -5
  288. package/src/slice-infra/index.d.ts +57 -0
  289. package/src/slice-infra/index.js +117 -0
  290. package/src/slice-scripts/build.d.ts +27 -0
  291. package/src/slice-scripts/build.js +120 -0
  292. package/src/slice-scripts/database.d.ts +87 -0
  293. package/src/slice-scripts/database.js +328 -0
  294. package/src/slice-scripts/index.d.ts +11 -0
  295. package/src/slice-scripts/index.js +23 -0
  296. package/src/slice-scripts/root-site-routes.d.ts +11 -0
  297. package/src/slice-scripts/root-site-routes.js +83 -0
  298. package/src/slice-scripts/sql-migration-engine.mjs +180 -0
  299. package/src/workload-roles/effective-policy.d.ts +0 -37
  300. package/src/workload-roles/effective-policy.js +1 -174
  301. package/src/workload-roles/standard-slice.d.ts +2 -19
  302. package/src/workload-roles/standard-slice.js +3 -129
  303. package/src/workspace-deployment/ownership.d.ts +15 -0
  304. package/src/workspace-deployment/ownership.js +19 -3
  305. package/src/api-contract/baseline-update.d.ts +0 -82
  306. package/src/api-contract/baseline-update.js +0 -225
  307. package/src/api-contract/compatibility.d.ts +0 -30
  308. package/src/api-contract/compatibility.js +0 -643
  309. package/src/api-contract/contract-graph.d.ts +0 -35
  310. package/src/api-contract/contract-graph.js +0 -141
  311. package/src/api-contract/evidence.d.ts +0 -23
  312. package/src/api-contract/evidence.js +0 -87
  313. package/src/api-contract/index.d.ts +0 -6
  314. package/src/api-contract/index.js +0 -10
  315. package/src/api-contract/model.d.ts +0 -144
  316. package/src/api-contract/model.js +0 -993
  317. package/src/api-contract/rollout.d.ts +0 -32
  318. package/src/api-contract/rollout.js +0 -88
  319. package/src/authorization/compatibility.d.ts +0 -62
  320. package/src/authorization/compatibility.js +0 -175
  321. package/src/authorization/index.d.ts +0 -1
  322. package/src/authorization/index.js +0 -5
  323. package/src/blueprints/execution.d.ts +0 -55
  324. package/src/blueprints/execution.js +0 -329
  325. package/src/blueprints/external-sandbox.d.ts +0 -53
  326. package/src/blueprints/external-sandbox.js +0 -1194
  327. package/src/blueprints/index.d.ts +0 -5
  328. package/src/blueprints/index.js +0 -9
  329. package/src/blueprints/inputs.d.ts +0 -43
  330. package/src/blueprints/inputs.js +0 -103
  331. package/src/blueprints/manifest.d.ts +0 -281
  332. package/src/blueprints/manifest.js +0 -424
  333. package/src/blueprints/resolver.d.ts +0 -37
  334. package/src/blueprints/resolver.js +0 -387
  335. package/src/blueprints/transitions.d.ts +0 -20
  336. package/src/blueprints/transitions.js +0 -61
  337. package/src/cli/agent-command.d.ts +0 -30
  338. package/src/cli/agent-command.js +0 -204
  339. package/src/cli/agent-runtime.d.ts +0 -25
  340. package/src/cli/agent-runtime.js +0 -498
  341. package/src/cli/blueprint-authority.d.ts +0 -9
  342. package/src/cli/blueprint-authority.js +0 -43
  343. package/src/cli/blueprint-command.d.ts +0 -24
  344. package/src/cli/blueprint-command.js +0 -63
  345. package/src/data-lifecycle/index.d.ts +0 -3
  346. package/src/data-lifecycle/index.js +0 -7
  347. package/src/data-lifecycle/model.d.ts +0 -172
  348. package/src/data-lifecycle/model.js +0 -95
  349. package/src/data-lifecycle/sensitive-artifacts.d.ts +0 -28
  350. package/src/data-lifecycle/sensitive-artifacts.js +0 -146
  351. package/src/data-lifecycle/validation.d.ts +0 -32
  352. package/src/data-lifecycle/validation.js +0 -837
  353. package/src/database-retirement/contract.d.ts +0 -68
  354. package/src/database-retirement/contract.js +0 -166
  355. package/src/database-retirement/index.d.ts +0 -1
  356. package/src/database-retirement/index.js +0 -5
  357. package/src/developer-agent/context.d.ts +0 -57
  358. package/src/developer-agent/context.js +0 -662
  359. package/src/developer-agent/generator-planning.d.ts +0 -34
  360. package/src/developer-agent/generator-planning.js +0 -666
  361. package/src/developer-agent/generator-preview.d.ts +0 -8
  362. package/src/developer-agent/generator-preview.js +0 -650
  363. package/src/developer-agent/git-inspection.d.ts +0 -112
  364. package/src/developer-agent/git-inspection.js +0 -887
  365. package/src/developer-agent/handoff.d.ts +0 -43
  366. package/src/developer-agent/handoff.js +0 -713
  367. package/src/developer-agent/index.d.ts +0 -10
  368. package/src/developer-agent/index.js +0 -14
  369. package/src/developer-agent/model.d.ts +0 -493
  370. package/src/developer-agent/model.js +0 -143
  371. package/src/developer-agent/operation-registry.d.ts +0 -60
  372. package/src/developer-agent/operation-registry.js +0 -1550
  373. package/src/developer-agent/ordering.d.ts +0 -9
  374. package/src/developer-agent/ordering.js +0 -15
  375. package/src/developer-agent/planning.d.ts +0 -25
  376. package/src/developer-agent/planning.js +0 -478
  377. package/src/developer-agent/preview-changes.js +0 -215
  378. package/src/developer-agent/preview-source.d.ts +0 -2
  379. package/src/developer-agent/preview-source.js +0 -19
  380. package/src/developer-agent/validation.d.ts +0 -30
  381. package/src/developer-agent/validation.js +0 -2725
  382. package/src/developer-agent/workspace-inspection.d.ts +0 -20
  383. package/src/developer-agent/workspace-inspection.js +0 -1189
  384. package/src/developer-agent/workspace-path.d.ts +0 -6
  385. package/src/developer-agent/workspace-path.js +0 -22
  386. package/src/executors/blueprint-trust/blueprint-trust.d.ts +0 -29
  387. package/src/executors/blueprint-trust/blueprint-trust.js +0 -121
  388. package/src/executors/blueprint-trust/schema.json +0 -27
  389. package/src/executors/blueprint-verification/blueprint-verification.d.ts +0 -13
  390. package/src/executors/blueprint-verification/blueprint-verification.js +0 -110
  391. package/src/executors/blueprint-verification/schema.json +0 -44
  392. package/src/executors/developer-context/developer-context.d.ts +0 -38
  393. package/src/executors/developer-context/developer-context.js +0 -78
  394. package/src/executors/developer-context/schema.json +0 -87
  395. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +0 -19
  396. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +0 -105
  397. package/src/executors/foundation-profile-preflight/schema.json +0 -32
  398. package/src/executors/github-bootstrap/github-bootstrap.d.ts +0 -13
  399. package/src/executors/github-bootstrap/github-bootstrap.js +0 -62
  400. package/src/executors/github-bootstrap/schema.json +0 -50
  401. package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +0 -37
  402. package/src/executors/infrastructure-plan/infrastructure-plan.js +0 -268
  403. package/src/executors/infrastructure-plan/schema.json +0 -38
  404. package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +0 -42
  405. package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +0 -1229
  406. package/src/executors/router-waf-rehearsal/schema.json +0 -29
  407. package/src/executors/secret-guardrails/schema.json +0 -6
  408. package/src/executors/secret-guardrails/secret-guardrails.d.ts +0 -3
  409. package/src/executors/secret-guardrails/secret-guardrails.js +0 -44
  410. package/src/executors/secret-initialize/schema.json +0 -42
  411. package/src/executors/secret-initialize/secret-initialize.d.ts +0 -34
  412. package/src/executors/secret-initialize/secret-initialize.js +0 -297
  413. package/src/executors/secret-metadata/schema.json +0 -36
  414. package/src/executors/secret-metadata/secret-metadata.d.ts +0 -46
  415. package/src/executors/secret-metadata/secret-metadata.js +0 -230
  416. package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +0 -53
  417. package/src/executors/sst-lifecycle/generated-secret-retirement.js +0 -192
  418. package/src/executors/sst-lifecycle/logging-preflight.d.ts +0 -22
  419. package/src/executors/sst-lifecycle/logging-preflight.js +0 -206
  420. package/src/executors/sst-lifecycle/secret-preflight.d.ts +0 -27
  421. package/src/executors/sst-lifecycle/secret-preflight.js +0 -125
  422. package/src/executors/work-markers/schema.json +0 -14
  423. package/src/executors/work-markers/work-markers.d.ts +0 -6
  424. package/src/executors/work-markers/work-markers.js +0 -20
  425. package/src/foundation/cost-estimate.d.ts +0 -175
  426. package/src/foundation/cost-estimate.js +0 -706
  427. package/src/foundation/private-smoke-admission.d.ts +0 -45
  428. package/src/foundation/private-smoke-admission.js +0 -180
  429. package/src/foundation/private-smoke-control-plane.d.ts +0 -18
  430. package/src/foundation/private-smoke-control-plane.js +0 -184
  431. package/src/foundation/router-waf-rate-rehearsal.d.ts +0 -97
  432. package/src/foundation/router-waf-rate-rehearsal.js +0 -210
  433. package/src/foundation/router-waf.d.ts +0 -149
  434. package/src/foundation/router-waf.js +0 -809
  435. package/src/frontend-security/index.d.ts +0 -1
  436. package/src/frontend-security/index.js +0 -5
  437. package/src/frontend-security/security-headers.d.ts +0 -50
  438. package/src/frontend-security/security-headers.js +0 -418
  439. package/src/generators/blueprint/blueprint.d.ts +0 -5
  440. package/src/generators/blueprint/blueprint.js +0 -102
  441. package/src/generators/blueprint/files.d.ts +0 -6
  442. package/src/generators/blueprint/files.js +0 -217
  443. package/src/generators/blueprint/schema.d.ts +0 -4
  444. package/src/generators/blueprint/schema.json +0 -18
  445. package/src/generators/feature-registry.d.ts +0 -13
  446. package/src/generators/feature-registry.js +0 -73
  447. package/src/generators/observability-infrastructure.d.ts +0 -2
  448. package/src/generators/observability-infrastructure.js +0 -31
  449. package/src/generators/preset/workspace-files-adopter-skills.d.ts +0 -7
  450. package/src/generators/preset/workspace-files-adopter-skills.js +0 -345
  451. package/src/generators/preset/workspace-files-agent-development.d.ts +0 -9
  452. package/src/generators/preset/workspace-files-agent-development.js +0 -42
  453. package/src/generators/preset/workspace-files-ci-acceptance.d.ts +0 -1
  454. package/src/generators/preset/workspace-files-ci-acceptance.js +0 -791
  455. package/src/generators/preset/workspace-files-ci-install.d.ts +0 -2
  456. package/src/generators/preset/workspace-files-ci-install.js +0 -196
  457. package/src/generators/preset/workspace-files-developer-agent.d.ts +0 -16
  458. package/src/generators/preset/workspace-files-developer-agent.js +0 -638
  459. package/src/generators/preset/workspace-files-ecr-inspector.d.ts +0 -18
  460. package/src/generators/preset/workspace-files-ecr-inspector.js +0 -298
  461. package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +0 -6
  462. package/src/generators/preset/workspace-files-foundation-workload-roles.js +0 -409
  463. package/src/generators/preset/workspace-files-performance-cost.d.ts +0 -66
  464. package/src/generators/preset/workspace-files-performance-cost.js +0 -866
  465. package/src/generators/preset/workspace-files-performance-load.d.ts +0 -73
  466. package/src/generators/preset/workspace-files-performance-load.js +0 -815
  467. package/src/generators/preset/workspace-files-shared-operation-claims.d.ts +0 -10
  468. package/src/generators/preset/workspace-files-shared-operation-claims.js +0 -59
  469. package/src/generators/preset/workspace-files-stage-authority.d.ts +0 -6
  470. package/src/generators/preset/workspace-files-stage-authority.js +0 -529
  471. package/src/generators/preset/workspace-files-thin-deploy.d.ts +0 -65
  472. package/src/generators/preset/workspace-files-thin-deploy.js +0 -2520
  473. package/src/generators/preset/workspace-files-thin-docs.d.ts +0 -7
  474. package/src/generators/preset/workspace-files-thin-docs.js +0 -358
  475. package/src/generators/preset/workspace-files-thin-release.d.ts +0 -14
  476. package/src/generators/preset/workspace-files-thin-release.js +0 -26
  477. package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +0 -9
  478. package/src/generators/preset/workspace-files-workload-role-baseline.js +0 -1314
  479. package/src/generators/repository-policy/repository-policy.d.ts +0 -4
  480. package/src/generators/repository-policy/repository-policy.js +0 -293
  481. package/src/generators/repository-policy/schema.d.ts +0 -28
  482. package/src/generators/repository-policy/schema.json +0 -122
  483. package/src/generators/slice/built-in-plan-alarm-identity.d.ts +0 -173
  484. package/src/generators/slice/built-in-plan-alarm-identity.js +0 -202
  485. package/src/generators/slice/built-in-plan-api-contract-files.d.ts +0 -2
  486. package/src/generators/slice/built-in-plan-api-contract-files.js +0 -2830
  487. package/src/generators/slice/built-in-plan-async-work-files.d.ts +0 -2
  488. package/src/generators/slice/built-in-plan-async-work-files.js +0 -6100
  489. package/src/generators/slice/built-in-plan-authorization-files.d.ts +0 -2
  490. package/src/generators/slice/built-in-plan-authorization-files.js +0 -2082
  491. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +0 -2
  492. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +0 -1301
  493. package/src/generators/slice/built-in-plan-authorization-storage.d.ts +0 -3
  494. package/src/generators/slice/built-in-plan-authorization-storage.js +0 -119
  495. package/src/generators/slice/built-in-plan-background-work-files.d.ts +0 -2
  496. package/src/generators/slice/built-in-plan-background-work-files.js +0 -99
  497. package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +0 -2
  498. package/src/generators/slice/built-in-plan-data-deletion-files.js +0 -273
  499. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +0 -2
  500. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +0 -223
  501. package/src/generators/slice/built-in-plan-data-files.d.ts +0 -2
  502. package/src/generators/slice/built-in-plan-data-files.js +0 -513
  503. package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +0 -2
  504. package/src/generators/slice/built-in-plan-data-lifecycle-files.js +0 -775
  505. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +0 -2
  506. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +0 -863
  507. package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +0 -2
  508. package/src/generators/slice/built-in-plan-data-retention-job-files.js +0 -169
  509. package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +0 -2
  510. package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +0 -186
  511. package/src/generators/slice/built-in-plan-data-rights-files.d.ts +0 -2
  512. package/src/generators/slice/built-in-plan-data-rights-files.js +0 -152
  513. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +0 -2
  514. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +0 -508
  515. package/src/generators/slice/built-in-plan-event-contract-literal.d.ts +0 -6
  516. package/src/generators/slice/built-in-plan-event-contract-literal.js +0 -52
  517. package/src/generators/slice/built-in-plan-foundation-files.d.ts +0 -3
  518. package/src/generators/slice/built-in-plan-foundation-files.js +0 -205
  519. package/src/generators/slice/built-in-plan-frontend-files.d.ts +0 -2
  520. package/src/generators/slice/built-in-plan-frontend-files.js +0 -2244
  521. package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +0 -2
  522. package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +0 -373
  523. package/src/generators/slice/built-in-plan-key-value-cleanup.d.ts +0 -4
  524. package/src/generators/slice/built-in-plan-key-value-cleanup.js +0 -100
  525. package/src/generators/slice/built-in-plan-key-value-consumer.d.ts +0 -4
  526. package/src/generators/slice/built-in-plan-key-value-consumer.js +0 -151
  527. package/src/generators/slice/built-in-plan-key-value-deletion.d.ts +0 -2
  528. package/src/generators/slice/built-in-plan-key-value-deletion.js +0 -377
  529. package/src/generators/slice/built-in-plan-key-value-delivery.d.ts +0 -2
  530. package/src/generators/slice/built-in-plan-key-value-delivery.js +0 -137
  531. package/src/generators/slice/built-in-plan-key-value-export.d.ts +0 -2
  532. package/src/generators/slice/built-in-plan-key-value-export.js +0 -595
  533. package/src/generators/slice/built-in-plan-key-value-holds.d.ts +0 -2
  534. package/src/generators/slice/built-in-plan-key-value-holds.js +0 -189
  535. package/src/generators/slice/built-in-plan-key-value-infrastructure.d.ts +0 -2
  536. package/src/generators/slice/built-in-plan-key-value-infrastructure.js +0 -102
  537. package/src/generators/slice/built-in-plan-key-value-performance.d.ts +0 -5
  538. package/src/generators/slice/built-in-plan-key-value-performance.js +0 -530
  539. package/src/generators/slice/built-in-plan-key-value-provider.d.ts +0 -4
  540. package/src/generators/slice/built-in-plan-key-value-provider.js +0 -366
  541. package/src/generators/slice/built-in-plan-key-value-records.d.ts +0 -3
  542. package/src/generators/slice/built-in-plan-key-value-records.js +0 -232
  543. package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.d.ts +0 -2
  544. package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.js +0 -103
  545. package/src/generators/slice/built-in-plan-key-value-retention-job-files.d.ts +0 -2
  546. package/src/generators/slice/built-in-plan-key-value-retention-job-files.js +0 -160
  547. package/src/generators/slice/built-in-plan-key-value-retention-maintenance.d.ts +0 -2
  548. package/src/generators/slice/built-in-plan-key-value-retention-maintenance.js +0 -329
  549. package/src/generators/slice/built-in-plan-key-value-retention-worker.d.ts +0 -2
  550. package/src/generators/slice/built-in-plan-key-value-retention-worker.js +0 -477
  551. package/src/generators/slice/built-in-plan-key-value-retention.d.ts +0 -2
  552. package/src/generators/slice/built-in-plan-key-value-retention.js +0 -184
  553. package/src/generators/slice/built-in-plan-metadata-files.d.ts +0 -3
  554. package/src/generators/slice/built-in-plan-metadata-files.js +0 -384
  555. package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +0 -2
  556. package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +0 -324
  557. package/src/generators/slice/built-in-plan-operations-files.d.ts +0 -2
  558. package/src/generators/slice/built-in-plan-operations-files.js +0 -1218
  559. package/src/generators/slice/built-in-plan-performance-files.d.ts +0 -4
  560. package/src/generators/slice/built-in-plan-performance-files.js +0 -2439
  561. package/src/generators/slice/built-in-plan-release-files.d.ts +0 -2
  562. package/src/generators/slice/built-in-plan-release-files.js +0 -6585
  563. package/src/generators/slice/built-in-plan-reliability-files.d.ts +0 -2
  564. package/src/generators/slice/built-in-plan-reliability-files.js +0 -4724
  565. package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +0 -2
  566. package/src/generators/slice/built-in-plan-secret-runtime-files.js +0 -1015
  567. package/src/generators/slice/built-in-plan-sql-events.d.ts +0 -2
  568. package/src/generators/slice/built-in-plan-sql-events.js +0 -276
  569. package/src/generators/slice/built-in-plan-testing-files.d.ts +0 -2
  570. package/src/generators/slice/built-in-plan-testing-files.js +0 -2575
  571. package/src/generators/slice/built-in-plan-testing-persistence-event-files.d.ts +0 -7
  572. package/src/generators/slice/built-in-plan-testing-persistence-event-files.js +0 -487
  573. package/src/generators/slice/built-in-plan-testing-persistence-files.d.ts +0 -2
  574. package/src/generators/slice/built-in-plan-testing-persistence-files.js +0 -180
  575. package/src/generators/slice/built-in-plan-thin-release-files.d.ts +0 -11
  576. package/src/generators/slice/built-in-plan-thin-release-files.js +0 -162
  577. package/src/generators/slice/built-in-plan-verification-files.d.ts +0 -2
  578. package/src/generators/slice/built-in-plan-verification-files.js +0 -431
  579. package/src/generators/slice/built-in-plan-workload-role-files.d.ts +0 -2
  580. package/src/generators/slice/built-in-plan-workload-role-files.js +0 -2220
  581. package/src/generators/slice/data-policy-review-seed.d.ts +0 -2
  582. package/src/generators/slice/data-policy-review-seed.js +0 -22
  583. package/src/generators/slice/deployed-smoke-readiness.d.ts +0 -2
  584. package/src/generators/slice/deployed-smoke-readiness.js +0 -214
  585. package/src/generators/slice/local-source-identity.d.ts +0 -2
  586. package/src/generators/slice/local-source-identity.js +0 -31
  587. package/src/generators/upgrade/sql-seeded-reconciliation.d.ts +0 -2
  588. package/src/generators/upgrade/sql-seeded-reconciliation.js +0 -170
  589. package/src/generators/workload/performance-registration.d.ts +0 -33
  590. package/src/generators/workload/performance-registration.js +0 -224
  591. package/src/generators/workload/reliability-registration.d.ts +0 -16
  592. package/src/generators/workload/reliability-registration.js +0 -150
  593. package/src/generators/workload/service-performance-files.d.ts +0 -5
  594. package/src/generators/workload/service-performance-files.js +0 -1883
  595. package/src/git-policy/action-pins.d.ts +0 -43
  596. package/src/git-policy/action-pins.js +0 -50
  597. package/src/git-policy/github-bootstrap.d.ts +0 -94
  598. package/src/git-policy/github-bootstrap.js +0 -1248
  599. package/src/git-policy/index.d.ts +0 -3
  600. package/src/git-policy/index.js +0 -7
  601. package/src/git-policy/routing.d.ts +0 -21
  602. package/src/git-policy/routing.js +0 -138
  603. package/src/infrastructure-change/convergence.d.ts +0 -13
  604. package/src/infrastructure-change/convergence.js +0 -85
  605. package/src/infrastructure-change/drift.d.ts +0 -13
  606. package/src/infrastructure-change/drift.js +0 -112
  607. package/src/infrastructure-change/index.d.ts +0 -7
  608. package/src/infrastructure-change/index.js +0 -11
  609. package/src/infrastructure-change/local-capability.d.ts +0 -73
  610. package/src/infrastructure-change/local-capability.js +0 -114
  611. package/src/infrastructure-change/model.d.ts +0 -274
  612. package/src/infrastructure-change/model.js +0 -29
  613. package/src/infrastructure-change/normalize.d.ts +0 -16
  614. package/src/infrastructure-change/normalize.js +0 -285
  615. package/src/infrastructure-change/plan.d.ts +0 -67
  616. package/src/infrastructure-change/plan.js +0 -671
  617. package/src/infrastructure-change/risk.d.ts +0 -9
  618. package/src/infrastructure-change/risk.js +0 -349
  619. package/src/infrastructure-change/summary.d.ts +0 -20
  620. package/src/infrastructure-change/summary.js +0 -130
  621. package/src/performance/cost-collection.d.ts +0 -225
  622. package/src/performance/cost-collection.js +0 -827
  623. package/src/performance/cost-controls.d.ts +0 -135
  624. package/src/performance/cost-controls.js +0 -347
  625. package/src/performance/evidence.d.ts +0 -140
  626. package/src/performance/evidence.js +0 -601
  627. package/src/performance/index.d.ts +0 -10
  628. package/src/performance/index.js +0 -14
  629. package/src/performance/load-safety.d.ts +0 -84
  630. package/src/performance/load-safety.js +0 -348
  631. package/src/performance/model.d.ts +0 -129
  632. package/src/performance/model.js +0 -451
  633. package/src/performance/pr-artifact-budget.d.ts +0 -42
  634. package/src/performance/pr-artifact-budget.js +0 -151
  635. package/src/performance/runner.d.ts +0 -75
  636. package/src/performance/runner.js +0 -227
  637. package/src/performance/scenario-endpoint.d.ts +0 -1
  638. package/src/performance/scenario-endpoint.js +0 -5
  639. package/src/performance/scenario.d.ts +0 -215
  640. package/src/performance/scenario.js +0 -744
  641. package/src/performance/unit-cost.d.ts +0 -105
  642. package/src/performance/unit-cost.js +0 -364
  643. package/src/release/index.d.ts +0 -2
  644. package/src/release/index.js +0 -6
  645. package/src/release/lifecycle.d.ts +0 -132
  646. package/src/release/lifecycle.js +0 -411
  647. package/src/release/manifest.d.ts +0 -148
  648. package/src/release/manifest.js +0 -503
  649. package/src/release/rollout.d.ts +0 -170
  650. package/src/release/rollout.js +0 -578
  651. package/src/release/source-authority.d.ts +0 -19
  652. package/src/release/source-authority.js +0 -212
  653. package/src/schemas/aggregate-count-evidence-v1.json +0 -135
  654. package/src/schemas/api-contract-baseline-v1.json +0 -674
  655. package/src/schemas/api-contract-compatibility-report-v1.json +0 -126
  656. package/src/schemas/aws-billing-actual-evidence-v1.json +0 -407
  657. package/src/schemas/blueprint-input-schema-v1.json +0 -23
  658. package/src/schemas/blueprint-v1.json +0 -188
  659. package/src/schemas/data-lifecycle-policy-v1.json +0 -517
  660. package/src/schemas/performance-policy-v1.json +0 -335
  661. package/src/schemas/testing-evidence-quarantine-v1.json +0 -168
  662. package/src/schemas/testing-evidence-result-v1.json +0 -319
  663. package/src/secrets/aws-control-plane.d.ts +0 -29
  664. package/src/secrets/aws-control-plane.js +0 -322
  665. package/src/secrets/generated-aws-control-plane.d.ts +0 -33
  666. package/src/secrets/generated-aws-control-plane.js +0 -322
  667. package/src/secrets/guardrails.d.ts +0 -26
  668. package/src/secrets/guardrails.js +0 -328
  669. package/src/secrets/metadata.d.ts +0 -48
  670. package/src/secrets/metadata.js +0 -199
  671. package/src/secrets/operator.d.ts +0 -190
  672. package/src/secrets/operator.js +0 -701
  673. package/src/secrets/verification.d.ts +0 -18
  674. package/src/secrets/verification.js +0 -152
  675. package/src/supply-chain/action-pins.d.ts +0 -26
  676. package/src/supply-chain/action-pins.js +0 -262
  677. package/src/supply-chain/blueprint-trust-git.d.ts +0 -130
  678. package/src/supply-chain/blueprint-trust-git.js +0 -1642
  679. package/src/supply-chain/blueprint-trust-process.d.ts +0 -4
  680. package/src/supply-chain/blueprint-trust-process.js +0 -88
  681. package/src/supply-chain/blueprint-trust.d.ts +0 -354
  682. package/src/supply-chain/blueprint-trust.js +0 -1558
  683. package/src/supply-chain/blueprint-verification-authority.d.ts +0 -62
  684. package/src/supply-chain/blueprint-verification-authority.js +0 -661
  685. package/src/supply-chain/blueprint-verification-execution.d.ts +0 -68
  686. package/src/supply-chain/blueprint-verification-execution.js +0 -639
  687. package/src/supply-chain/build-output-bounds.d.ts +0 -2
  688. package/src/supply-chain/build-output-bounds.js +0 -12
  689. package/src/supply-chain/build-output.d.ts +0 -41
  690. package/src/supply-chain/build-output.js +0 -551
  691. package/src/supply-chain/common.d.ts +0 -21
  692. package/src/supply-chain/common.js +0 -107
  693. package/src/supply-chain/container-artifact-contract.d.ts +0 -23
  694. package/src/supply-chain/container-artifact-contract.js +0 -208
  695. package/src/supply-chain/container-release.d.ts +0 -119
  696. package/src/supply-chain/container-release.js +0 -496
  697. package/src/supply-chain/ecr-applicability.d.ts +0 -19
  698. package/src/supply-chain/ecr-applicability.js +0 -103
  699. package/src/supply-chain/ecr-scanning.d.ts +0 -85
  700. package/src/supply-chain/ecr-scanning.js +0 -325
  701. package/src/supply-chain/ecs-deployed-image.d.ts +0 -87
  702. package/src/supply-chain/ecs-deployed-image.js +0 -302
  703. package/src/supply-chain/errors.d.ts +0 -6
  704. package/src/supply-chain/errors.js +0 -15
  705. package/src/supply-chain/generated-blueprint-trust-command.d.ts +0 -4
  706. package/src/supply-chain/generated-blueprint-trust-command.js +0 -1379
  707. package/src/supply-chain/generated-command.d.ts +0 -1
  708. package/src/supply-chain/generated-command.js +0 -775
  709. package/src/supply-chain/generated-container-release-command.d.ts +0 -16
  710. package/src/supply-chain/generated-container-release-command.js +0 -3248
  711. package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -20
  712. package/src/supply-chain/generated-ecr-collector-command.js +0 -1445
  713. package/src/supply-chain/generated-files.d.ts +0 -13
  714. package/src/supply-chain/generated-files.js +0 -421
  715. package/src/supply-chain/generated-scanner-command.d.ts +0 -1
  716. package/src/supply-chain/generated-scanner-command.js +0 -778
  717. package/src/supply-chain/index.d.ts +0 -28
  718. package/src/supply-chain/index.js +0 -36
  719. package/src/supply-chain/inventory.d.ts +0 -96
  720. package/src/supply-chain/inventory.js +0 -828
  721. package/src/supply-chain/license-expression.d.ts +0 -7
  722. package/src/supply-chain/license-expression.js +0 -128
  723. package/src/supply-chain/policy.d.ts +0 -105
  724. package/src/supply-chain/policy.js +0 -304
  725. package/src/supply-chain/publication.d.ts +0 -48
  726. package/src/supply-chain/publication.js +0 -85
  727. package/src/supply-chain/sbom.d.ts +0 -228
  728. package/src/supply-chain/sbom.js +0 -913
  729. package/src/supply-chain/scanner.d.ts +0 -77
  730. package/src/supply-chain/scanner.js +0 -514
  731. package/src/supply-chain/vendored-source.d.ts +0 -95
  732. package/src/supply-chain/vendored-source.js +0 -315
  733. package/src/testing-evidence/fixture-scope.d.ts +0 -53
  734. package/src/testing-evidence/fixture-scope.js +0 -142
  735. package/src/testing-evidence/index.d.ts +0 -5
  736. package/src/testing-evidence/index.js +0 -9
  737. package/src/testing-evidence/quarantine.d.ts +0 -48
  738. package/src/testing-evidence/quarantine.js +0 -253
  739. package/src/testing-evidence/result.d.ts +0 -109
  740. package/src/testing-evidence/result.js +0 -585
  741. package/src/testing-evidence/runner-adapter.d.ts +0 -51
  742. package/src/testing-evidence/runner-adapter.js +0 -288
  743. package/src/testing-evidence/sensitive-artifacts.d.ts +0 -13
  744. package/src/testing-evidence/sensitive-artifacts.js +0 -93
  745. package/src/work-markers/index.d.ts +0 -1
  746. package/src/work-markers/index.js +0 -5
  747. package/src/work-markers/work-markers.d.ts +0 -39
  748. package/src/work-markers/work-markers.js +0 -360
  749. package/src/workload-roles/account-baseline.d.ts +0 -143
  750. package/src/workload-roles/account-baseline.js +0 -980
  751. package/src/workload-roles/authority.d.ts +0 -40
  752. package/src/workload-roles/authority.js +0 -202
  753. package/src/workload-roles/aws-adapter.d.ts +0 -99
  754. package/src/workload-roles/aws-adapter.js +0 -416
  755. package/src/workload-roles/aws-internal-handler.d.ts +0 -27
  756. package/src/workload-roles/aws-internal-handler.js +0 -58
  757. package/src/workload-roles/aws-s3-state.d.ts +0 -52
  758. package/src/workload-roles/aws-s3-state.js +0 -191
  759. package/src/workload-roles/aws-sdk-control-plane.d.ts +0 -12
  760. package/src/workload-roles/aws-sdk-control-plane.js +0 -291
  761. package/src/workload-roles/boundary.d.ts +0 -34
  762. package/src/workload-roles/boundary.js +0 -137
  763. package/src/workload-roles/convergence.d.ts +0 -66
  764. package/src/workload-roles/convergence.js +0 -186
  765. package/src/workload-roles/handler.d.ts +0 -43
  766. package/src/workload-roles/handler.js +0 -158
  767. package/src/workload-roles/history.d.ts +0 -47
  768. package/src/workload-roles/history.js +0 -324
  769. package/src/workload-roles/injection.d.ts +0 -119
  770. package/src/workload-roles/injection.js +0 -495
  771. package/src/workload-roles/manifest.d.ts +0 -54
  772. package/src/workload-roles/manifest.js +0 -343
  773. package/src/workload-roles/provisioner.d.ts +0 -70
  774. package/src/workload-roles/provisioner.js +0 -239
  775. package/src/workload-roles/registration.d.ts +0 -102
  776. package/src/workload-roles/registration.js +0 -462
  777. package/src/workload-roles/stage-boundary.d.ts +0 -31
  778. package/src/workload-roles/stage-boundary.js +0 -208
  779. /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.d.ts +0 -0
  780. /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.js +0 -0
@@ -1,2520 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EBK_RECORD_MAIN_TOKEN_SECRET = exports.THIN_DEPLOY_WORKFLOW_PATH = void 0;
4
- exports.renderThinDeployVerifyCaller = renderThinDeployVerifyCaller;
5
- exports.protectedBrowserInstallScript = protectedBrowserInstallScript;
6
- exports.machineCredentialRequestScript = machineCredentialRequestScript;
7
- exports.exactStageDeployerGuardScript = exactStageDeployerGuardScript;
8
- exports.canonicalStageAuthorityDerivationScript = canonicalStageAuthorityDerivationScript;
9
- exports.exactStagingPromotionPullGuardScript = exactStagingPromotionPullGuardScript;
10
- exports.stagingPromotionReceiptValidationScript = stagingPromotionReceiptValidationScript;
11
- exports.restoredCandidateValidationScript = restoredCandidateValidationScript;
12
- exports.stagingPromotionSealScript = stagingPromotionSealScript;
13
- exports.postdeploySupplyChainBindingScript = postdeploySupplyChainBindingScript;
14
- exports.renderThinDeployWorkflowFilePlan = renderThinDeployWorkflowFilePlan;
15
- exports.THIN_DEPLOY_WORKFLOW_PATH = '.github/workflows/deploy.yml';
16
- /** The production environment secret that lets record-main fast-forward main. */
17
- exports.EBK_RECORD_MAIN_TOKEN_SECRET = 'EBK_RECORD_MAIN_TOKEN';
18
- const EXACT_SEMVER = /^\d+\.\d+\.\d+$/;
19
- const WORKSPACE_NAME = /^[a-z0-9][a-z0-9-]{0,62}$/;
20
- const ACTION_PIN = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@[a-f0-9]{40}(?: # [^\r\n]+)?$/;
21
- function assertOptions(options) {
22
- if (options.productionApprovalMode === 'trunk-promotion' &&
23
- (options.deploymentProfile === 'starter' ||
24
- options.deliveryLane === 'trunk')) {
25
- throw new Error('trunk-promotion requires an isolated deployment profile on the protected pair.');
26
- }
27
- if (!WORKSPACE_NAME.test(options.name)) {
28
- throw new Error('Workspace name must be a bounded lowercase slug.');
29
- }
30
- for (const [name, value] of Object.entries(options.actionPins)) {
31
- if (!ACTION_PIN.test(value)) {
32
- throw new Error(`${name} must be an exact 40-character action pin.`);
33
- }
34
- }
35
- for (const [name, value] of Object.entries(options.toolVersions)) {
36
- if (!EXACT_SEMVER.test(value)) {
37
- throw new Error(`${name} must be an exact semantic version.`);
38
- }
39
- }
40
- }
41
- function workflowCallTrigger(profile, deliveryLane = 'protected-pair') {
42
- return profile === 'starter' && deliveryLane !== 'trunk'
43
- ? ''
44
- : ` workflow_call:
45
- inputs:
46
- source_branch:
47
- required: true
48
- type: string
49
- source_commit:
50
- required: true
51
- type: string
52
- source_ref:
53
- required: true
54
- type: string
55
- verify_run_attempt:
56
- required: true
57
- type: string
58
- verify_run_id:
59
- required: true
60
- type: string
61
- `;
62
- }
63
- function renderThinDeployVerifyCaller(profile, deliveryLane = 'protected-pair', productionApprovalMode = 'promotion-pr') {
64
- const trunk = deliveryLane === 'trunk';
65
- if (profile === 'starter' && !trunk)
66
- return '';
67
- // GitHub validates every nested deploy.yml job against this caller's
68
- // permissions on every event, so the ceiling must admit the managed
69
- // rehearsal, which pushes its sealed receipt branch and opens the pull
70
- // request with the workflow token (isolated profiles only).
71
- const nestedWrite = profile !== 'starter';
72
- // Trunk lane: every merged main push is a production delivery.
73
- // Trunk promotion: production deploys from the develop run itself and
74
- // record-main fast-forwards main afterwards, so a main push only verifies.
75
- const protectedBranchCondition = trunk
76
- ? "github.ref == 'refs/heads/main'"
77
- : productionApprovalMode === 'trunk-promotion'
78
- ? "github.ref == 'refs/heads/develop'"
79
- : "(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main')";
80
- return `
81
-
82
- deploy:
83
- name: deploy exact verified source
84
- needs: [acceptance, release-candidate]
85
- if: >-
86
- always() &&
87
- github.event_name == 'push' &&
88
- ${protectedBranchCondition} &&
89
- needs.acceptance.result == 'success' &&
90
- needs.acceptance.outputs.history_only != 'true' &&
91
- (needs.release-candidate.result == 'success' ||
92
- (github.ref == 'refs/heads/main' && needs.release-candidate.result == 'skipped'))
93
- # Ceiling for the nested deploy.yml jobs; each nested job declares its
94
- # own least-privilege set. Isolated profiles admit the rehearse job's
95
- # receipt push and pull request (EBK-INT-2026-080).
96
- permissions:
97
- actions: read
98
- contents: ${nestedWrite ? 'write' : 'read'}
99
- id-token: write${nestedWrite ? '\n pull-requests: write' : ''}
100
- uses: ./.github/workflows/deploy.yml
101
- with:
102
- source_branch: \${{ github.ref_name }}
103
- source_commit: \${{ github.sha }}
104
- source_ref: \${{ github.ref }}
105
- verify_run_attempt: \${{ github.run_attempt }}
106
- verify_run_id: \${{ github.run_id }}
107
- # The reusable workflow reads the production environment secret
108
- # AWS_STAGING_PROMOTION_PULL_ROLE_ARN, which only reaches a called
109
- # workflow when the caller inherits secrets (EBK-INT-2026-075).
110
- secrets: inherit`;
111
- }
112
- function indentedScript(source, spaces) {
113
- const prefix = ' '.repeat(spaces);
114
- return source
115
- .trim()
116
- .split('\n')
117
- .map((line) => `${prefix}${line}`)
118
- .join('\n');
119
- }
120
- /** @internal Run exactly this generated script in the protected-runner fixture. */
121
- function protectedBrowserInstallScript() {
122
- return `set -euo pipefail
123
- if [ -z "$EBK_SLICE_PROJECTS" ]; then exit 0; fi
124
- case "$EBK_SLICE_PROJECTS" in ,*|*,|*,,*) echo 'Invalid smoke project inventory'; exit 1 ;; esac
125
- IFS=',' read -r -a projects <<< "$EBK_SLICE_PROJECTS"
126
- seen=,
127
- for project in "\${projects[@]}"; do
128
- case "$project" in ''|*[!A-Za-z0-9_-]*) echo 'Invalid smoke project'; exit 1 ;; esac
129
- case "$seen" in *,"$project",*) echo 'Duplicate smoke project'; exit 1 ;; esac
130
- seen="$seen$project,"
131
- done
132
- for project in "\${projects[@]}"; do
133
- pnpm --dir "packages/$project" exec playwright install --with-deps chromium
134
- done`;
135
- }
136
- /**
137
- * @internal Run exactly this generated script in the protected-runner fixture.
138
- *
139
- * Reads the deploying stage's GitHub environment variables through request
140
- * names and exports the canonical machine-credential variables only when they
141
- * are set. An unset GitHub variable expands to '', which the generated Slice
142
- * SST config would read as a generation rather than its blue-1 default, so the
143
- * canonical names never reach the lifecycle when the request is empty.
144
- */
145
- function machineCredentialRequestScript() {
146
- return `set -euo pipefail
147
- generation="$EBK_REQUESTED_MACHINE_CREDENTIAL_GENERATION"
148
- retire="$EBK_REQUESTED_MACHINE_RETIRE_PREVIOUS_GENERATION"
149
- generation_pattern='^(blue|green)-[1-9][0-9]{0,11}$'
150
- if [ -n "$generation" ] && ! [[ "$generation" =~ $generation_pattern ]]; then
151
- echo 'EBK_MACHINE_CREDENTIAL_GENERATION must be blue-N or green-N, where N is 1 to 12 digits without a leading zero, or unset'
152
- exit 1
153
- fi
154
- case "$retire" in
155
- ''|false|true) ;;
156
- *) echo 'EBK_MACHINE_RETIRE_PREVIOUS_GENERATION must be exactly true or false, or unset'; exit 1 ;;
157
- esac
158
- if [ "$retire" = true ]; then
159
- [ -n "$generation" ] || {
160
- echo 'Retiring the previous machine credential generation requires EBK_MACHINE_CREDENTIAL_GENERATION to name the current generation'
161
- exit 1
162
- }
163
- if [ "$EBK_ACTION" = deploy ] && [ "$EBK_LIFECYCLE_SCOPE" != full ]; then
164
- echo 'Retiring the previous machine credential generation requires a Deploy dispatch with lifecycle full; affected scope can skip the Slice'
165
- exit 1
166
- fi
167
- fi
168
- if [ -n "$generation" ]; then
169
- echo "EBK_MACHINE_CREDENTIAL_GENERATION=$generation" >> "$GITHUB_ENV"
170
- echo "Requested machine credential generation: $generation"
171
- fi
172
- if [ "$retire" = true ]; then
173
- echo 'EBK_MACHINE_RETIRE_PREVIOUS_GENERATION=true' >> "$GITHUB_ENV"
174
- echo 'Requested retirement of the previous machine credential generation'
175
- fi`;
176
- }
177
- function machineCredentialRequestStep() {
178
- return ` - name: Validate requested machine credential generation
179
- env:
180
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
181
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
182
- EBK_REQUESTED_MACHINE_CREDENTIAL_GENERATION: \${{ vars.EBK_MACHINE_CREDENTIAL_GENERATION }}
183
- EBK_REQUESTED_MACHINE_RETIRE_PREVIOUS_GENERATION: \${{ vars.EBK_MACHINE_RETIRE_PREVIOUS_GENERATION }}
184
- run: |
185
- ${indentedScript(machineCredentialRequestScript(), 10)}`;
186
- }
187
- /** @internal Exported for executable source-contract tests. */
188
- function exactStageDeployerGuardScript(operation, accountVariable) {
189
- return `read -r caller_account caller_arn <<< "$(aws sts get-caller-identity --query '[Account,Arn]' --output text)"
190
- [ "$caller_account" = "${accountVariable}" ] || {
191
- echo '${operation} caller account differs from committed policy'; exit 1;
192
- }
193
- caller_partition="\${caller_arn#arn:}"
194
- caller_partition="\${caller_partition%%:*}"
195
- [ "$caller_partition" = "$AWS_PARTITION" ] || {
196
- echo '${operation} caller partition differs from committed policy'; exit 1;
197
- }
198
- expected_role_arn="arn:$AWS_PARTITION:iam::${accountVariable}:role/ebk/$EBK_STAGE/deployment/ebk-$EBK_STAGE-deploy"
199
- [ "$AWS_DEPLOY_ROLE_ARN" = "$expected_role_arn" ] || {
200
- echo '${operation} configured role is not the canonical stage deployer'; exit 1;
201
- }
202
- expected_caller_prefix="arn:$AWS_PARTITION:sts::${accountVariable}:assumed-role/ebk-$EBK_STAGE-deploy/"
203
- case "$caller_arn" in
204
- "$expected_caller_prefix"?*) ;;
205
- *) echo '${operation} caller is not the exact stage deployer'; exit 1 ;;
206
- esac`;
207
- }
208
- /** @internal Shared verbatim by every generated protected workflow. */
209
- function canonicalStageAuthorityDerivationScript() {
210
- return `case "$EBK_STAGE" in
211
- development) account_id="$EBK_DEVELOPMENT_ACCOUNT" ;;
212
- staging) account_id="$EBK_STAGING_ACCOUNT" ;;
213
- production) account_id="$EBK_PRODUCTION_ACCOUNT" ;;
214
- *) exit 1 ;;
215
- esac
216
- case "$account_id" in *[!0-9]*|'') exit 1 ;; esac
217
- [ "\${#account_id}" -eq 12 ]
218
- case "$EBK_REGION" in
219
- cn-*) partition=aws-cn; audience=sts.amazonaws.com.cn ;;
220
- us-gov-*) partition=aws-us-gov; audience=sts.amazonaws.com ;;
221
- us-iso-*|us-isob-*|eu-isoe-*|us-isof-*)
222
- echo 'The committed Region belongs to an unsupported AWS partition.' >&2
223
- exit 1
224
- ;;
225
- *) partition=aws; audience=sts.amazonaws.com ;;
226
- esac
227
- role_arn="arn:$partition:iam::$account_id:role/ebk/$EBK_STAGE/deployment/ebk-$EBK_STAGE-deploy"
228
- echo "account_id=$account_id" >> "$GITHUB_OUTPUT"
229
- echo "audience=$audience" >> "$GITHUB_OUTPUT"
230
- echo "partition=$partition" >> "$GITHUB_OUTPUT"
231
- echo "role_arn=$role_arn" >> "$GITHUB_OUTPUT"`;
232
- }
233
- /** @internal Exported for executable source-contract tests. */
234
- function exactStagingPromotionPullGuardScript() {
235
- return `read -r caller_account caller_arn <<< "$(aws sts get-caller-identity --query '[Account,Arn]' --output text)"
236
- [ "$caller_account" = "$EBK_STAGING_ACCOUNT_ID" ] || {
237
- echo 'Staging registry caller account differs from committed policy'; exit 1;
238
- }
239
- caller_partition="\${caller_arn#arn:}"
240
- caller_partition="\${caller_partition%%:*}"
241
- [ "$caller_partition" = "$AWS_PARTITION" ] || {
242
- echo 'Staging registry caller partition differs from committed policy'; exit 1;
243
- }
244
- expected_role_arn="arn:$AWS_PARTITION:iam::$EBK_STAGING_ACCOUNT_ID:role/ebk/promotion/ebk-staging-promotion-pull"
245
- [ "$AWS_STAGING_PROMOTION_PULL_ROLE_ARN" = "$expected_role_arn" ] || {
246
- echo 'Staging registry configured role is not the canonical promotion pull role'; exit 1;
247
- }
248
- expected_caller_prefix="arn:$AWS_PARTITION:sts::$EBK_STAGING_ACCOUNT_ID:assumed-role/ebk-staging-promotion-pull/"
249
- case "$caller_arn" in
250
- "$expected_caller_prefix"?*) ;;
251
- *) echo 'Staging registry caller is not the exact promotion pull role'; exit 1 ;;
252
- esac`;
253
- }
254
- /** @internal Shared verbatim with the generated workflow and executable tests. */
255
- function stagingPromotionReceiptValidationScript() {
256
- return `import { createHash } from 'node:crypto';
257
- import { appendFileSync, readFileSync } from 'node:fs';
258
- import { join } from 'node:path';
259
-
260
- const commit = /^[a-f0-9]{40,64}$/;
261
- const integer = /^[1-9][0-9]*$/;
262
- const digest = /^sha256:[a-f0-9]{64}$/;
263
- const required = (name, pattern) => {
264
- const value = process.env[name]?.trim() ?? '';
265
- if (!pattern.test(value)) throw new Error(name + ' is absent or malformed.');
266
- return value;
267
- };
268
- const root = process.env.EBK_STAGING_RECEIPT_ROOT?.trim() ?? '';
269
- if (!root) throw new Error('Staging deployment receipt root is absent.');
270
- const expectedHasSlices = required('EBK_EXPECTED_HAS_SLICES', /^(?:true|false)$/) === 'true';
271
- const expectedHasContainers = required('EBK_EXPECTED_HAS_CONTAINERS', /^(?:true|false)$/) === 'true';
272
- if (expectedHasContainers && !expectedHasSlices) throw new Error('Container work requires a selected Slice.');
273
- const sourceCommit = required('EBK_STAGING_SOURCE_COMMIT', commit);
274
- const expectedAccount = required('EBK_EXPECTED_STAGING_ACCOUNT_ID', /^[0-9]{12}$/);
275
- const expectedProfile = required('EBK_EXPECTED_DEPLOYMENT_PROFILE', /^(?:production-isolated|fully-isolated)$/);
276
- const expectedRegion = required('EBK_EXPECTED_DEPLOYMENT_REGION', /^[a-z]{2}(?:-gov)?-[a-z]+(?:-[a-z]+)*-[0-9]$/);
277
- const deploymentRunId = required('EBK_STAGING_DEPLOYMENT_RUN_ID', integer);
278
- const deploymentRunAttempt = required('EBK_STAGING_DEPLOYMENT_RUN_ATTEMPT', integer);
279
- const receiptArtifactId = required('EBK_STAGING_RECEIPT_ARTIFACT_ID', integer);
280
- const receiptArtifactDigest = required('EBK_STAGING_RECEIPT_ARTIFACT_DIGEST', digest);
281
- const receiptBytes = readFileSync(join(root, 'latest.json'));
282
- const promotionBytes = readFileSync(join(root, 'promotion.json'));
283
- const receipt = JSON.parse(receiptBytes.toString('utf8'));
284
- const promotion = JSON.parse(promotionBytes.toString('utf8'));
285
- const receiptDigest = createHash('sha256').update(receiptBytes).digest('hex');
286
- if (
287
- receipt?.kind !== 'ebk-deployment-receipt' ||
288
- receipt.schemaVersion !== 1 ||
289
- receipt.outcome !== 'succeeded' ||
290
- receipt.authority !== 'github' ||
291
- receipt.stage !== 'staging' ||
292
- receipt.account !== expectedAccount ||
293
- receipt.profile !== expectedProfile ||
294
- receipt.region !== expectedRegion ||
295
- receipt.source?.clean !== true ||
296
- receipt.source?.commit !== sourceCommit ||
297
- promotion?.kind !== 'ebk-staging-deployment-promotion' ||
298
- promotion.schemaVersion !== 1 ||
299
- promotion.hasSlices !== expectedHasSlices ||
300
- typeof promotion.hasContainers !== 'boolean' ||
301
- (promotion.hasContainers && !promotion.hasSlices) ||
302
- (expectedHasContainers && !promotion.hasContainers) ||
303
- promotion.stage !== 'staging' ||
304
- promotion.account !== expectedAccount ||
305
- promotion.deploymentProfile !== expectedProfile ||
306
- promotion.region !== expectedRegion ||
307
- promotion.sourceCommit !== sourceCommit ||
308
- promotion.deployment?.runId !== deploymentRunId ||
309
- promotion.deployment?.runAttempt !== deploymentRunAttempt ||
310
- promotion.deployment?.receiptDigest !== receiptDigest ||
311
- (expectedHasSlices
312
- ? !integer.test(promotion.candidate?.artifactId ?? '') ||
313
- !digest.test(promotion.candidate?.artifactDigest ?? '') ||
314
- !integer.test(promotion.candidate?.producerRunId ?? '') ||
315
- !integer.test(promotion.candidate?.producerRunAttempt ?? '') ||
316
- promotion.candidate?.sourceCommit !== sourceCommit ||
317
- !/^[a-f0-9]{64}$/.test(promotion.candidate?.materialDigest ?? '')
318
- : promotion.candidate !== null) ||
319
- (promotion.hasContainers
320
- ? !integer.test(promotion.container?.artifactId ?? '') ||
321
- !digest.test(promotion.container?.artifactDigest ?? '')
322
- : promotion.container !== null)
323
- ) {
324
- throw new Error('Staging deployment receipt and candidate promotion binding disagree.');
325
- }
326
- const outputs = {
327
- deployment_run_attempt: deploymentRunAttempt,
328
- deployment_run_id: deploymentRunId,
329
- receipt_artifact_digest: receiptArtifactDigest,
330
- receipt_artifact_id: receiptArtifactId,
331
- source_commit: sourceCommit,
332
- };
333
- if (expectedHasSlices) Object.assign(outputs, {
334
- artifact_digest: promotion.candidate.artifactDigest,
335
- artifact_id: promotion.candidate.artifactId,
336
- candidate_material_digest: promotion.candidate.materialDigest,
337
- producer_run_attempt: promotion.candidate.producerRunAttempt,
338
- producer_run_id: promotion.candidate.producerRunId,
339
- });
340
- if (expectedHasContainers) Object.assign(outputs, {
341
- container_artifact_digest: promotion.container.artifactDigest,
342
- container_artifact_id: promotion.container.artifactId,
343
- });
344
- for (const [name, value] of Object.entries(outputs)) appendFileSync(process.env.GITHUB_OUTPUT, name + '=' + value + '\\n');`;
345
- }
346
- /** @internal Shared verbatim with the generated workflow and executable tests. */
347
- function restoredCandidateValidationScript() {
348
- return `import { createHash } from 'node:crypto';
349
- import { readFileSync, readdirSync } from 'node:fs';
350
- import { join } from 'node:path';
351
-
352
- const root = '.ebk/evidence/release-candidate/packages';
353
- const sourceCommit = process.env.EBK_RELEASE_SOURCE_COMMIT?.trim() ?? '';
354
- const producerRunId = process.env.EBK_CANDIDATE_PRODUCER_RUN_ID?.trim() ?? '';
355
- const producerRunAttempt = process.env.EBK_CANDIDATE_PRODUCER_RUN_ATTEMPT?.trim() ?? '';
356
- const expected = process.env.EBK_CANDIDATE_MATERIAL_DIGEST?.trim() ?? '';
357
- if (!/^[a-f0-9]{40,64}$/.test(sourceCommit) || !/^[1-9][0-9]*$/.test(producerRunId) || !/^[1-9][0-9]*$/.test(producerRunAttempt) || !/^[a-f0-9]{64}$/.test(expected)) {
358
- throw new Error('Restored candidate authority is absent or malformed.');
359
- }
360
- const projects = readdirSync(root, { withFileTypes: true })
361
- .filter((entry) => entry.isDirectory())
362
- .map((entry) => entry.name)
363
- .sort();
364
- if (projects.length === 0 || projects.some((project) => !/^[a-z0-9][a-z0-9-]{0,62}$/.test(project))) {
365
- throw new Error('Restored candidate project inventory is absent or malformed.');
366
- }
367
- const entries = projects.map((project) => {
368
- const bytes = readFileSync(join(root, project, 'candidate.json'));
369
- const value = JSON.parse(bytes.toString('utf8'));
370
- if (
371
- value?.kind !== 'ebk-release-candidate' ||
372
- value.schemaVersion !== 1 ||
373
- value.slice !== project ||
374
- value.sourceCommit !== sourceCommit ||
375
- value.provenance?.runId !== producerRunId ||
376
- value.provenance?.runAttempt !== producerRunAttempt
377
- ) throw new Error('Restored candidate provenance is stale or cross-paired.');
378
- return { manifestDigest: createHash('sha256').update(bytes).digest('hex'), project };
379
- });
380
- const observed = createHash('sha256').update(JSON.stringify(entries)).digest('hex');
381
- if (observed !== expected) throw new Error('Restored candidate material digest differs from staging.');`;
382
- }
383
- /** @internal Shared verbatim with the generated workflow and executable tests. */
384
- function stagingPromotionSealScript() {
385
- return `import { createHash } from 'node:crypto';
386
- import { mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
387
- import { join } from 'node:path';
388
-
389
- const required = (name, pattern) => {
390
- const value = process.env[name]?.trim() ?? '';
391
- if (!pattern.test(value)) throw new Error(name + ' is absent or malformed.');
392
- return value;
393
- };
394
- const sourceCommit = required('EBK_RELEASE_SOURCE_COMMIT', /^[a-f0-9]{40,64}$/);
395
- const hasSlices = required('EBK_HAS_SLICES', /^(?:true|false)$/) === 'true';
396
- const hasContainers = required('EBK_HAS_CONTAINERS', /^(?:true|false)$/) === 'true';
397
- if (hasContainers && !hasSlices) throw new Error('Container work requires a selected Slice.');
398
- const account = required('EBK_POLICY_ACCOUNT_ID', /^[0-9]{12}$/);
399
- const deploymentProfile = required('EBK_DEPLOYMENT_PROFILE', /^(?:production-isolated|fully-isolated)$/);
400
- const region = required('EBK_POLICY_REGION', /^[a-z]{2}(?:-gov)?-[a-z]+(?:-[a-z]+)*-[0-9]$/);
401
- const deploymentRunId = required('GITHUB_RUN_ID', /^[1-9][0-9]*$/);
402
- const deploymentRunAttempt = required('GITHUB_RUN_ATTEMPT', /^[1-9][0-9]*$/);
403
- const receiptPath = '.ebk/evidence/deployment/latest.json';
404
- const receiptBytes = readFileSync(receiptPath);
405
- const receipt = JSON.parse(receiptBytes.toString('utf8'));
406
- if (receipt?.kind !== 'ebk-deployment-receipt' || receipt.schemaVersion !== 1 || receipt.outcome !== 'succeeded' || receipt.authority !== 'github' || receipt.stage !== 'staging' || receipt.account !== account || receipt.profile !== deploymentProfile || receipt.region !== region || receipt.source?.clean !== true || receipt.source?.commit !== sourceCommit) {
407
- throw new Error('Successful staging deployment receipt is absent or stale.');
408
- }
409
- const candidateEnvironment = {
410
- artifactDigest: process.env.EBK_CANDIDATE_ARTIFACT_DIGEST?.trim() ?? '',
411
- artifactId: process.env.EBK_CANDIDATE_ARTIFACT_ID?.trim() ?? '',
412
- producerRunAttempt: process.env.EBK_CANDIDATE_PRODUCER_RUN_ATTEMPT?.trim() ?? '',
413
- producerRunId: process.env.EBK_CANDIDATE_PRODUCER_RUN_ID?.trim() ?? '',
414
- };
415
- const containerEnvironment = {
416
- artifactDigest: process.env.EBK_CONTAINER_ARTIFACT_DIGEST?.trim() ?? '',
417
- artifactId: process.env.EBK_CONTAINER_ARTIFACT_ID?.trim() ?? '',
418
- };
419
- let candidate = null;
420
- let container = null;
421
- if (hasSlices) {
422
- const producerRunId = required('EBK_CANDIDATE_PRODUCER_RUN_ID', /^[1-9][0-9]*$/);
423
- const producerRunAttempt = required('EBK_CANDIDATE_PRODUCER_RUN_ATTEMPT', /^[1-9][0-9]*$/);
424
- const artifactId = required('EBK_CANDIDATE_ARTIFACT_ID', /^[1-9][0-9]*$/);
425
- const artifactDigest = required('EBK_CANDIDATE_ARTIFACT_DIGEST', /^sha256:[a-f0-9]{64}$/);
426
- const root = '.ebk/evidence/release-candidate/packages';
427
- const projects = readdirSync(root, { withFileTypes: true })
428
- .filter((entry) => entry.isDirectory())
429
- .map((entry) => entry.name)
430
- .sort();
431
- if (projects.length === 0 || projects.some((project) => !/^[a-z0-9][a-z0-9-]{0,62}$/.test(project))) throw new Error('Staging candidate inventory is absent or malformed.');
432
- const entries = projects.map((project) => {
433
- const bytes = readFileSync(join(root, project, 'candidate.json'));
434
- const value = JSON.parse(bytes.toString('utf8'));
435
- if (value?.kind !== 'ebk-release-candidate' || value.schemaVersion !== 1 || value.slice !== project || value.sourceCommit !== sourceCommit || value.provenance?.runId !== producerRunId || value.provenance?.runAttempt !== producerRunAttempt) {
436
- throw new Error('Staging candidate provenance is stale or cross-paired.');
437
- }
438
- return { manifestDigest: createHash('sha256').update(bytes).digest('hex'), project };
439
- });
440
- candidate = { artifactDigest, artifactId, materialDigest: createHash('sha256').update(JSON.stringify(entries)).digest('hex'), producerRunAttempt, producerRunId, sourceCommit };
441
- } else if (Object.values(candidateEnvironment).some(Boolean)) {
442
- throw new Error('A staging promotion without Slices must not carry Slice release material.');
443
- }
444
- if (hasContainers) {
445
- const artifactId = required('EBK_CONTAINER_ARTIFACT_ID', /^[1-9][0-9]*$/);
446
- // The upload action returns bare hex; the artifacts API uses sha256:<hex>.
447
- const raw = containerEnvironment.artifactDigest;
448
- process.env.EBK_CONTAINER_ARTIFACT_DIGEST = /^[a-f0-9]{64}$/.test(raw) ? 'sha256:' + raw : raw;
449
- const artifactDigest = required('EBK_CONTAINER_ARTIFACT_DIGEST', /^sha256:[a-f0-9]{64}$/);
450
- container = { artifactDigest, artifactId };
451
- } else if (Object.values(containerEnvironment).some(Boolean)) {
452
- throw new Error('A staging promotion without OCI artifacts must not carry container material.');
453
- }
454
- const promotion = {
455
- account,
456
- candidate,
457
- container,
458
- deploymentProfile,
459
- deployment: { receiptDigest: createHash('sha256').update(receiptBytes).digest('hex'), runAttempt: deploymentRunAttempt, runId: deploymentRunId },
460
- hasSlices,
461
- hasContainers,
462
- kind: 'ebk-staging-deployment-promotion',
463
- region,
464
- schemaVersion: 1,
465
- sourceCommit,
466
- stage: 'staging',
467
- };
468
- mkdirSync('.ebk/evidence/deployment', { recursive: true });
469
- writeFileSync('.ebk/evidence/deployment/promotion.json', JSON.stringify(promotion, null, 2) + '\\n', { mode: 0o600 });`;
470
- }
471
- /** @internal Shared verbatim with the generated workflow and executable tests. */
472
- function postdeploySupplyChainBindingScript() {
473
- return `import { createHash } from 'node:crypto';
474
- import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
475
-
476
- const required = (name, pattern) => {
477
- const value = process.env[name]?.trim() ?? '';
478
- if (!pattern.test(value)) throw new Error(name + ' is absent or malformed.');
479
- return value;
480
- };
481
- const canonical = (value) => {
482
- if (value === null || typeof value !== 'object') return JSON.stringify(value);
483
- if (Array.isArray(value)) return '[' + value.map(canonical).join(',') + ']';
484
- return '{' + Object.entries(value)
485
- .sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0)
486
- .map(([key, child]) => JSON.stringify(key) + ':' + canonical(child))
487
- .join(',') + '}';
488
- };
489
- const accountId = required('EBK_POLICY_ACCOUNT_ID', /^[0-9]{12}$/);
490
- const deploymentCommit = required('EBK_SOURCE_COMMIT', /^[a-f0-9]{40,64}$/);
491
- const profile = required('EBK_DEPLOYMENT_PROFILE', /^(?:starter|production-isolated|fully-isolated)$/);
492
- const region = required('EBK_POLICY_REGION', /^[a-z]{2}(?:-gov)?-[a-z]+(?:-[a-z]+)*-[0-9]$/);
493
- const releaseCandidateArtifactDigest = required('EBK_CANDIDATE_ARTIFACT_DIGEST', /^sha256:[a-f0-9]{64}$/);
494
- const releaseCandidateArtifactId = required('EBK_CANDIDATE_ARTIFACT_ID', /^[1-9][0-9]*$/);
495
- const releaseCandidateProducerRunAttempt = required('EBK_CANDIDATE_PRODUCER_RUN_ATTEMPT', /^[1-9][0-9]*$/);
496
- const releaseCandidateProducerRunId = required('EBK_CANDIDATE_PRODUCER_RUN_ID', /^[1-9][0-9]*$/);
497
- const releaseSourceCommit = required('EBK_RELEASE_SOURCE_COMMIT', /^[a-f0-9]{40,64}$/);
498
- const runAttempt = required('GITHUB_RUN_ATTEMPT', /^[1-9][0-9]*$/);
499
- const runId = required('GITHUB_RUN_ID', /^[1-9][0-9]*$/);
500
- const stage = required('EBK_STAGE', /^(?:development|staging|production)$/);
501
- const receipt = JSON.parse(readFileSync('.ebk/evidence/deployment/latest.json', 'utf8'));
502
- if (
503
- receipt?.kind !== 'ebk-deployment-receipt' ||
504
- receipt.schemaVersion !== 1 ||
505
- receipt.outcome !== 'succeeded' ||
506
- receipt.authority !== 'github' ||
507
- receipt.account !== accountId ||
508
- receipt.profile !== profile ||
509
- receipt.region !== region ||
510
- receipt.stage !== stage ||
511
- receipt.source?.clean !== true ||
512
- receipt.source?.commit !== deploymentCommit
513
- ) throw new Error('Successful deployment receipt is absent or cross-paired.');
514
- const unsigned = {
515
- accountId,
516
- deploymentCommit,
517
- kind: 'ebk-postdeploy-supply-chain-binding',
518
- profile,
519
- region,
520
- releaseCandidateArtifactDigest,
521
- releaseCandidateArtifactId,
522
- releaseCandidateProducerRunAttempt,
523
- releaseCandidateProducerRunId,
524
- releaseSourceCommit,
525
- runAttempt,
526
- runId,
527
- schemaVersion: 1,
528
- stage,
529
- };
530
- const binding = {
531
- ...unsigned,
532
- materialDigest: createHash('sha256').update(canonical(unsigned)).digest('hex'),
533
- };
534
- mkdirSync('.ebk/evidence/deployment', { recursive: true, mode: 0o700 });
535
- writeFileSync(
536
- '.ebk/evidence/deployment/postdeploy-supply-chain.json',
537
- JSON.stringify(binding, null, 2) + '\\n',
538
- { flag: 'wx', mode: 0o600 },
539
- );`;
540
- }
541
- function renderThinDeployWorkflow(options) {
542
- const { actionPins, deploymentProfile, name, toolVersions } = options;
543
- const trunkPromotion = options.productionApprovalMode === 'trunk-promotion';
544
- // The starter protected pair deploys development from protected develop;
545
- // in the trunk lane develop is unprotected and owns no stage.
546
- const developmentFromProtectedDevelop = deploymentProfile === 'starter' && options.deliveryLane !== 'trunk';
547
- return `name: Deploy
548
- run-name: Deploy \${{ inputs.source_commit || github.sha }}
549
-
550
- on:
551
- ${workflowCallTrigger(deploymentProfile, options.deliveryLane)} workflow_dispatch:
552
- inputs:
553
- action:
554
- description: Native lifecycle action
555
- required: true
556
- default: deploy
557
- type: choice
558
- options: [deploy, refresh, unlock, remove${deploymentProfile === 'starter' ? '' : ', rehearse'}]
559
- project:
560
- description: Required registered project for unlock or remove recovery
561
- required: false
562
- type: string${deploymentProfile === 'starter'
563
- ? ''
564
- : `
565
- probe_url:
566
- description: rehearse only; exact HTTPS Router health URL in /<kebab-slice>/api/health form for the staging blocking rehearsal
567
- required: false
568
- type: string`}
569
- lifecycle:
570
- description: affected skips Slices unchanged since the newest successful deployment; full deploys everything
571
- required: false
572
- default: affected
573
- type: choice
574
- options: [affected, full]
575
-
576
- concurrency:
577
- group: protected-lifecycle-\${{ inputs.source_branch || github.ref_name }}
578
- cancel-in-progress: false
579
-
580
- permissions:
581
- contents: read
582
-
583
- env:
584
- EBK_DEPLOYMENT_SOURCE_BRANCH: \${{ inputs.source_branch || github.ref_name }}
585
- EBK_DEPLOYMENT_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
586
- EBK_DEPLOYMENT_SOURCE_REF: \${{ inputs.source_ref || github.ref }}
587
- EBK_EXPECTED_SST_VERSION: ${toolVersions.sst}
588
-
589
- jobs:
590
- prepare:
591
- name: route protected native lifecycle
592
- runs-on: ubuntu-latest
593
- outputs:
594
- action: \${{ steps.route.outputs.action }}
595
- probe_url: \${{ steps.route.outputs.probe_url }}
596
- account_id: \${{ steps.account.outputs.account_id }}
597
- has_slices: \${{ steps.policy.outputs.has_slices }}
598
- has_containers: \${{ steps.policy.outputs.has_containers }}
599
- container_projects: \${{ steps.policy.outputs.container_projects }}
600
- container_matrix: \${{ steps.policy.outputs.container_matrix }}
601
- ordered_projects: \${{ steps.policy.outputs.ordered_projects }}
602
- oidc_audience: \${{ steps.account.outputs.audience }}
603
- partition: \${{ steps.account.outputs.partition }}
604
- profile: \${{ steps.policy.outputs.deployment_profile }}
605
- project: \${{ steps.route.outputs.project }}
606
- region: \${{ steps.policy.outputs.deployment_region }}
607
- slice_projects: \${{ steps.policy.outputs.slice_projects }}
608
- slice_matrix: \${{ steps.policy.outputs.slice_matrix }}
609
- staging_account_id: \${{ steps.policy.outputs.staging_account_id }}
610
- stage: \${{ steps.route.outputs.stage }}
611
- stage_deploy_role_arn: \${{ steps.account.outputs.role_arn }}${trunkPromotion
612
- ? `
613
- production_account_id: \${{ steps.production-account.outputs.account_id }}
614
- production_deploy_role_arn: \${{ steps.production-account.outputs.role_arn }}`
615
- : ''}
616
- steps:
617
- - name: Verify exact protected branch tip before setup
618
- env:
619
- EBK_CONTEXT_REF: \${{ github.ref }}
620
- EBK_CONTEXT_REF_NAME: \${{ github.ref_name }}
621
- EBK_CONTEXT_RUN_ATTEMPT: \${{ github.run_attempt }}
622
- EBK_CONTEXT_RUN_ID: \${{ github.run_id }}
623
- EBK_CONTEXT_SHA: \${{ github.sha }}
624
- EBK_INPUT_RUN_ATTEMPT: \${{ inputs.verify_run_attempt || '' }}
625
- EBK_INPUT_RUN_ID: \${{ inputs.verify_run_id || '' }}
626
- EBK_INPUT_SOURCE_BRANCH: \${{ inputs.source_branch || '' }}
627
- EBK_INPUT_SOURCE_COMMIT: \${{ inputs.source_commit || '' }}
628
- EBK_INPUT_SOURCE_REF: \${{ inputs.source_ref || '' }}
629
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
630
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
631
- EBK_SOURCE_REF: \${{ env.EBK_DEPLOYMENT_SOURCE_REF }}
632
- EBK_TRIGGER: \${{ github.event_name }}
633
- GH_REPO: \${{ github.repository }}
634
- GH_TOKEN: \${{ github.token }}
635
- run: |
636
- set -euo pipefail
637
- case "$EBK_SOURCE_COMMIT" in ''|*[!0-9a-f]*) exit 1 ;; esac
638
- { [ "\${#EBK_SOURCE_COMMIT}" -eq 40 ] || [ "\${#EBK_SOURCE_COMMIT}" -eq 64 ]; } || exit 1
639
- case "$EBK_SOURCE_BRANCH:$EBK_SOURCE_REF" in
640
- develop:refs/heads/develop|main:refs/heads/main) ;;
641
- *) echo 'Protected lifecycle must bind one exact protected branch ref'; exit 1 ;;
642
- esac
643
- if [ -n "$EBK_INPUT_RUN_ID$EBK_INPUT_RUN_ATTEMPT$EBK_INPUT_SOURCE_BRANCH$EBK_INPUT_SOURCE_COMMIT$EBK_INPUT_SOURCE_REF" ]; then
644
- [ "$EBK_TRIGGER" = push ] || { echo 'Automatic deployment requires one protected push Verify caller'; exit 1; }
645
- [ -n "$EBK_INPUT_RUN_ID" ] && [ -n "$EBK_INPUT_RUN_ATTEMPT" ] &&
646
- [ -n "$EBK_INPUT_SOURCE_BRANCH" ] && [ -n "$EBK_INPUT_SOURCE_COMMIT" ] && [ -n "$EBK_INPUT_SOURCE_REF" ] ||
647
- { echo 'Automatic deployment caller binding is incomplete'; exit 1; }
648
- [ "$EBK_INPUT_RUN_ID" = "$EBK_CONTEXT_RUN_ID" ] &&
649
- [ "$EBK_INPUT_RUN_ATTEMPT" = "$EBK_CONTEXT_RUN_ATTEMPT" ] &&
650
- [ "$EBK_INPUT_SOURCE_COMMIT" = "$EBK_CONTEXT_SHA" ] &&
651
- [ "$EBK_INPUT_SOURCE_BRANCH" = "$EBK_CONTEXT_REF_NAME" ] &&
652
- [ "$EBK_INPUT_SOURCE_REF" = "$EBK_CONTEXT_REF" ] ||
653
- { echo 'Automatic deployment differs from its exact Verify caller'; exit 1; }
654
- else
655
- [ "$EBK_TRIGGER" = workflow_dispatch ] || { echo 'Manual deployment requires workflow dispatch'; exit 1; }
656
- fi
657
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
658
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
659
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
660
- }
661
- - name: Check out immutable source
662
- uses: ${actionPins.checkout}
663
- with:
664
- fetch-depth: 0
665
- persist-credentials: false
666
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
667
- - uses: ${actionPins.pnpmSetup}
668
- - uses: ${actionPins.setupNode}
669
- with:
670
- node-version: ${toolVersions.node}
671
- cache: pnpm
672
- - run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
673
- - id: route
674
- name: Resolve protected stage and action
675
- env:
676
- EBK_DISPATCH_ACTION: \${{ inputs.action || '' }}
677
- EBK_DISPATCH_PROBE_URL: \${{ inputs.probe_url || '' }}
678
- EBK_DISPATCH_PROJECT: \${{ inputs.project || '' }}
679
- EBK_PROFILE: ${deploymentProfile}
680
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
681
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
682
- EBK_TRIGGER: \${{ github.event_name }}
683
- run: |
684
- set -euo pipefail
685
- action=deploy
686
- project=
687
- if [ "$EBK_TRIGGER" = workflow_dispatch ]; then
688
- action="$EBK_DISPATCH_ACTION"
689
- project="$EBK_DISPATCH_PROJECT"
690
- fi
691
- case "$EBK_SOURCE_COMMIT" in ''|*[!0-9a-f]*) exit 1 ;; esac
692
- { [ "\${#EBK_SOURCE_COMMIT}" -eq 40 ] || [ "\${#EBK_SOURCE_COMMIT}" -eq 64 ]; } || exit 1
693
- case "$action" in deploy|refresh|unlock|remove|rehearse) ;; *) exit 1 ;; esac
694
- case "$project" in ''|*[!A-Za-z0-9_-]*) [ -z "$project" ] || exit 1 ;; esac
695
- case "$action" in
696
- unlock|remove) [ -n "$project" ] || { echo 'unlock and remove require an explicit project'; exit 1; } ;;
697
- deploy|refresh) [ -z "$project" ] || { echo 'deploy and refresh operate on the policy-derived project order'; exit 1; } ;;
698
- rehearse)
699
- [ -z "$project" ] || { echo 'rehearse targets the foundation Router WAF and takes no project'; exit 1; }
700
- [ "$EBK_PROFILE" != starter ] || { echo 'starter rehearses development locally; rehearse is for isolated staging'; exit 1; }
701
- [ "$EBK_SOURCE_BRANCH" = develop ] || { echo 'rehearse runs from develop against staging'; exit 1; }
702
- case "$EBK_DISPATCH_PROBE_URL" in
703
- https://*/*/api/health) ;;
704
- *) echo 'rehearse requires probe_url in https://<router>/<kebab-slice>/api/health form'; exit 1 ;;
705
- esac
706
- ;;
707
- esac
708
- # The committed deployment plan knows deploy, refresh, unlock, and
709
- # remove; a rehearsal derives the same project inventory as deploy.
710
- plan_action="$action"
711
- [ "$action" != rehearse ] || plan_action=deploy
712
- case "$EBK_SOURCE_BRANCH" in
713
- main) stage=production ;;${options.deliveryLane === 'trunk'
714
- ? `
715
- develop) echo 'Trunk lane protected lifecycle runs from main'; exit 1 ;;`
716
- : `
717
- develop)
718
- if [ "$EBK_PROFILE" = starter ]; then
719
- stage=development
720
- else
721
- stage=staging
722
- fi
723
- ;;`}
724
- *) echo 'Protected lifecycle must run from develop or main'; exit 1 ;;
725
- esac
726
- echo "action=$action" >> "$GITHUB_OUTPUT"
727
- echo "plan_action=$plan_action" >> "$GITHUB_OUTPUT"
728
- echo "probe_url=$EBK_DISPATCH_PROBE_URL" >> "$GITHUB_OUTPUT"
729
- echo "project=$project" >> "$GITHUB_OUTPUT"
730
- echo "stage=$stage" >> "$GITHUB_OUTPUT"
731
- - id: policy
732
- name: Derive ordered projects from committed policy
733
- env:
734
- EBK_ACTION: \${{ steps.route.outputs.plan_action }}
735
- EBK_PROJECT: \${{ steps.route.outputs.project }}
736
- EBK_STAGE: \${{ steps.route.outputs.stage }}
737
- run: |
738
- set -euo pipefail
739
- args=("--action=$EBK_ACTION" "--stage=$EBK_STAGE")
740
- if [ -n "$EBK_PROJECT" ]; then args+=("--project=$EBK_PROJECT"); fi
741
- pnpm nx run ${name}:deployment-plan -- "\${args[@]}"
742
- - name: Bind generated profile
743
- env:
744
- EBK_RENDERED_PROFILE: ${deploymentProfile}
745
- EBK_REPOSITORY_PROFILE: \${{ steps.policy.outputs.deployment_profile }}
746
- run: test "$EBK_RENDERED_PROFILE" = "$EBK_REPOSITORY_PROFILE"
747
- - id: account
748
- name: Derive canonical committed stage authority
749
- env:
750
- EBK_DEVELOPMENT_ACCOUNT: \${{ steps.policy.outputs.development_account_id }}
751
- EBK_PRODUCTION_ACCOUNT: \${{ steps.policy.outputs.production_account_id }}
752
- EBK_REGION: \${{ steps.policy.outputs.deployment_region }}
753
- EBK_STAGE: \${{ steps.route.outputs.stage }}
754
- EBK_STAGING_ACCOUNT: \${{ steps.policy.outputs.staging_account_id }}
755
- run: |
756
- ${indentedScript(`set -euo pipefail\n${canonicalStageAuthorityDerivationScript()}`, 10)}${trunkPromotion
757
- ? `
758
- # Trunk promotion deploys production from the develop run, so the
759
- # production authority is derived here beside the staging authority.
760
- - id: production-account
761
- name: Derive canonical committed production authority for trunk promotion
762
- if: >-
763
- steps.route.outputs.action == 'deploy' &&
764
- steps.route.outputs.stage == 'staging' &&
765
- steps.policy.outputs.deployment_profile != 'starter' &&
766
- steps.policy.outputs.has_slices == 'true'
767
- env:
768
- EBK_DEVELOPMENT_ACCOUNT: \${{ steps.policy.outputs.development_account_id }}
769
- EBK_PRODUCTION_ACCOUNT: \${{ steps.policy.outputs.production_account_id }}
770
- EBK_REGION: \${{ steps.policy.outputs.deployment_region }}
771
- EBK_STAGE: production
772
- EBK_STAGING_ACCOUNT: \${{ steps.policy.outputs.staging_account_id }}
773
- run: |
774
- ${indentedScript(`set -euo pipefail\n${canonicalStageAuthorityDerivationScript()}`, 10)}`
775
- : ''}
776
-
777
- immutable-artifacts:
778
- name: prepare exact immutable release artifacts
779
- needs: prepare
780
- if: >-
781
- needs.prepare.outputs.action == 'deploy' &&
782
- (
783
- needs.prepare.outputs.has_slices == 'true' ||
784
- (needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile != 'starter')
785
- )
786
- runs-on: ubuntu-latest
787
- permissions:
788
- actions: read
789
- contents: read
790
- outputs:
791
- artifact_digest: \${{ steps.current.outputs.artifact_digest || steps.staging.outputs.artifact_digest }}
792
- artifact_id: \${{ steps.current.outputs.artifact_id || steps.staging.outputs.artifact_id }}
793
- candidate_material_digest: \${{ steps.staging.outputs.candidate_material_digest }}
794
- container_artifact_digest: \${{ steps.staging.outputs.container_artifact_digest }}
795
- container_artifact_id: \${{ steps.staging.outputs.container_artifact_id }}
796
- staging_deployment_run_attempt: \${{ steps.staging.outputs.deployment_run_attempt }}
797
- staging_deployment_run_id: \${{ steps.staging.outputs.deployment_run_id }}
798
- baseline_artifact_digest: \${{ steps.baseline.outputs.artifact_digest }}
799
- baseline_artifact_id: \${{ steps.baseline.outputs.artifact_id }}
800
- baseline_commit: \${{ steps.baseline.outputs.commit }}
801
- baseline_found: \${{ steps.baseline.outputs.found }}
802
- baseline_run_id: \${{ steps.baseline.outputs.run_id }}
803
- producer_run_attempt: \${{ steps.current.outputs.producer_run_attempt || steps.staging.outputs.producer_run_attempt }}
804
- producer_run_id: \${{ steps.current.outputs.producer_run_id || steps.staging.outputs.producer_run_id }}
805
- source_commit: \${{ steps.current.outputs.source_commit || steps.staging.outputs.source_commit }}
806
- steps:
807
- - name: Check out immutable production ancestry
808
- if: needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile != 'starter'
809
- uses: ${actionPins.checkout}
810
- with:
811
- fetch-depth: 0
812
- persist-credentials: false
813
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
814
- - id: current
815
- name: Select exact successful current-source CI candidate
816
- if: >-
817
- needs.prepare.outputs.has_slices == 'true' &&
818
- (needs.prepare.outputs.stage != 'production' || needs.prepare.outputs.profile == 'starter')
819
- env:
820
- EBK_CALLER_RUN_ATTEMPT: \${{ inputs.verify_run_attempt || '' }}
821
- EBK_CALLER_RUN_ID: \${{ inputs.verify_run_id || '' }}
822
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
823
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
824
- GH_REPO: \${{ github.repository }}
825
- GH_TOKEN: \${{ github.token }}
826
- run: |
827
- set -euo pipefail
828
- if [ -n "$EBK_CALLER_RUN_ID" ]; then
829
- [ -n "$EBK_CALLER_RUN_ATTEMPT" ] || exit 1
830
- run_id="$EBK_CALLER_RUN_ID"
831
- run_attempt="$EBK_CALLER_RUN_ATTEMPT"
832
- else
833
- runs="$(gh api "/repos/$GH_REPO/actions/workflows/ci.yml/runs?event=push&branch=$EBK_SOURCE_BRANCH&head_sha=$EBK_SOURCE_COMMIT&status=success&per_page=100")"
834
- producer="$(printf '%s' "$runs" | jq -c --arg branch "$EBK_SOURCE_BRANCH" --arg source "$EBK_SOURCE_COMMIT" \
835
- '[.workflow_runs[] | select(.head_sha == $source and .head_branch == $branch and .event == "push" and .conclusion == "success" and .path == ".github/workflows/ci.yml")] | if length == 1 then .[0] else empty end')"
836
- [ -n "$producer" ] || { echo 'Exact successful CI candidate producer is absent or ambiguous'; exit 1; }
837
- run_id="$(printf '%s' "$producer" | jq -r '.id // empty')"
838
- run_attempt="$(printf '%s' "$producer" | jq -r '.run_attempt // empty')"
839
- fi
840
- artifacts="$(gh api "/repos/$GH_REPO/actions/runs/$run_id/artifacts?per_page=100")"
841
- artifact="$(printf '%s' "$artifacts" | jq -c --arg source "$EBK_SOURCE_COMMIT" \
842
- '[.artifacts[] | select(.name == "release-candidate-" + $source and .expired == false)] | if length == 1 then .[0] else empty end')"
843
- [ -n "$artifact" ] || { echo 'Exact release candidate artifact is absent or ambiguous'; exit 1; }
844
- artifact_id="$(printf '%s' "$artifact" | jq -r '.id // empty')"
845
- artifact_digest="$(printf '%s' "$artifact" | jq -r '.digest // empty')"
846
- case "$run_id:$run_attempt:$artifact_id" in *[!0-9:]*) exit 1 ;; esac
847
- case "$artifact_digest" in sha256:????????????????????????????????????????????????????????????????) ;; *) exit 1 ;; esac
848
- echo "artifact_digest=$artifact_digest" >> "$GITHUB_OUTPUT"
849
- echo "artifact_id=$artifact_id" >> "$GITHUB_OUTPUT"
850
- echo "producer_run_attempt=$run_attempt" >> "$GITHUB_OUTPUT"
851
- echo "producer_run_id=$run_id" >> "$GITHUB_OUTPUT"
852
- echo "source_commit=$EBK_SOURCE_COMMIT" >> "$GITHUB_OUTPUT"
853
- - id: baseline
854
- name: Select the newest successful deployment receipt on this branch
855
- if: >-
856
- needs.prepare.outputs.has_slices == 'true' &&
857
- (needs.prepare.outputs.stage != 'production' || needs.prepare.outputs.profile == 'starter')
858
- env:
859
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
860
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
861
- EBK_STAGE: \${{ needs.prepare.outputs.stage }}
862
- GH_REPO: \${{ github.repository }}
863
- GH_TOKEN: \${{ github.token }}
864
- run: |
865
- set -euo pipefail
866
- # A baseline lets unchanged OCI artifacts reuse their retained evidence.
867
- # Declining is always safe: without one, every artifact is rebuilt.
868
- echo "found=false" >> "$GITHUB_OUTPUT"
869
- runs="$(gh api "/repos/$GH_REPO/actions/workflows/ci.yml/runs?event=push&branch=$EBK_SOURCE_BRANCH&status=success&per_page=50")"
870
- for candidate in $(printf '%s' "$runs" | jq -r --arg branch "$EBK_SOURCE_BRANCH" \\
871
- '.workflow_runs | sort_by(.run_number) | reverse | .[] | select(.head_branch == $branch and .event == "push" and .conclusion == "success" and .path == ".github/workflows/ci.yml") | "\\(.id):\\(.run_attempt):\\(.head_sha)"'); do
872
- IFS=':' read -r run_id run_attempt head_sha <<< "$candidate"
873
- case "$run_id:$run_attempt" in *[!0-9:]*) continue ;; esac
874
- case "$head_sha" in ????????????????????????????????????????) ;; *) continue ;; esac
875
- [ "$head_sha" != "$EBK_SOURCE_COMMIT" ] || continue
876
- # This job has no checkout on the staging path, so ancestry comes
877
- # from the API rather than a local repository (EBK-INT-2026-083).
878
- ancestry="$(gh api "/repos/$GH_REPO/compare/$head_sha...$EBK_SOURCE_COMMIT" --jq '.status' 2>/dev/null || echo unknown)"
879
- [ "$ancestry" = ahead ] || continue
880
- artifacts="$(gh api "/repos/$GH_REPO/actions/runs/$run_id/artifacts?per_page=100")"
881
- receipt="$(printf '%s' "$artifacts" | jq -c --arg name "deployment-receipt-$EBK_STAGE-$run_id-$run_attempt" \\
882
- '[.artifacts[] | select(.name == $name and .expired == false)] | if length == 1 then .[0] else empty end')"
883
- [ -n "$receipt" ] || continue
884
- artifact_id="$(printf '%s' "$receipt" | jq -r '.id // empty')"
885
- artifact_digest="$(printf '%s' "$receipt" | jq -r '.digest // empty')"
886
- case "$artifact_id" in ''|*[!0-9]*) continue ;; esac
887
- case "$artifact_digest" in sha256:????????????????????????????????????????????????????????????????) ;; *) continue ;; esac
888
- echo "artifact_digest=$artifact_digest" >> "$GITHUB_OUTPUT"
889
- echo "artifact_id=$artifact_id" >> "$GITHUB_OUTPUT"
890
- echo "commit=$head_sha" >> "$GITHUB_OUTPUT"
891
- echo "found=true" >> "$GITHUB_OUTPUT"
892
- echo "run_id=$run_id" >> "$GITHUB_OUTPUT"
893
- echo "Baseline deployment receipt: run $run_id attempt $run_attempt at $head_sha"
894
- break
895
- done
896
- - id: staging-receipt
897
- name: Select exact successful staging deployment receipt
898
- if: needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile != 'starter'
899
- env:
900
- EBK_DEPLOYMENT_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
901
- GH_REPO: \${{ github.repository }}
902
- GH_TOKEN: \${{ github.token }}
903
- run: |
904
- set -euo pipefail
905
- parents="$(git rev-list --parents -n 1 "$EBK_DEPLOYMENT_SOURCE_COMMIT")"
906
- set -- $parents
907
- [ "$#" -eq 3 ] || { echo 'Isolated production requires one exact two-parent promotion merge'; exit 1; }
908
- [ "$1" = "$EBK_DEPLOYMENT_SOURCE_COMMIT" ] || exit 1
909
- staging_source="$3"
910
- git merge-base --is-ancestor "$staging_source" "$EBK_DEPLOYMENT_SOURCE_COMMIT" || {
911
- echo 'Staging promotion source is not an ancestor of production'; exit 1;
912
- }
913
- [ "$(git rev-parse "$EBK_DEPLOYMENT_SOURCE_COMMIT^{tree}")" = "$(git rev-parse "$staging_source^{tree}")" ] || {
914
- echo 'Production merge tree differs from the promoted staging source'; exit 1;
915
- }
916
- git show-ref --verify --quiet refs/remotes/origin/develop || {
917
- echo 'Protected develop lineage is absent from the immutable checkout'; exit 1;
918
- }
919
- git rev-list --first-parent refs/remotes/origin/develop > "$RUNNER_TEMP/develop-first-parent"
920
- grep -Fxq "$staging_source" "$RUNNER_TEMP/develop-first-parent" || {
921
- echo 'Staging promotion source is absent from protected develop first-parent history'; exit 1;
922
- }
923
- runs="$(gh api "/repos/$GH_REPO/actions/workflows/ci.yml/runs?event=push&branch=develop&head_sha=$staging_source&status=success&per_page=100")"
924
- producer="$(printf '%s' "$runs" | jq -c --arg source "$staging_source" \
925
- '[.workflow_runs[] | select(.head_sha == $source and .head_branch == "develop" and .event == "push" and .conclusion == "success" and .path == ".github/workflows/ci.yml")] | if length == 1 then .[0] else empty end')"
926
- [ -n "$producer" ] || { echo 'Exact successful staging Verify deployment is absent or ambiguous'; exit 1; }
927
- run_id="$(printf '%s' "$producer" | jq -r '.id // empty')"
928
- run_attempt="$(printf '%s' "$producer" | jq -r '.run_attempt // empty')"
929
- artifacts="$(gh api "/repos/$GH_REPO/actions/runs/$run_id/artifacts?per_page=100")"
930
- receipt_name="deployment-receipt-staging-$run_id-$run_attempt"
931
- receipt="$(printf '%s' "$artifacts" | jq -c --arg name "$receipt_name" \
932
- '[.artifacts[] | select(.name == $name and .expired == false)] | if length == 1 then .[0] else empty end')"
933
- [ -n "$receipt" ] || { echo 'Exact successful staging deployment receipt is absent or ambiguous'; exit 1; }
934
- artifact_id="$(printf '%s' "$receipt" | jq -r '.id // empty')"
935
- artifact_digest="$(printf '%s' "$receipt" | jq -r '.digest // empty')"
936
- case "$run_id:$run_attempt:$artifact_id" in *[!0-9:]*) exit 1 ;; esac
937
- case "$artifact_digest" in sha256:????????????????????????????????????????????????????????????????) ;; *) exit 1 ;; esac
938
- echo "artifact_digest=$artifact_digest" >> "$GITHUB_OUTPUT"
939
- echo "artifact_id=$artifact_id" >> "$GITHUB_OUTPUT"
940
- echo "run_attempt=$run_attempt" >> "$GITHUB_OUTPUT"
941
- echo "run_id=$run_id" >> "$GITHUB_OUTPUT"
942
- echo "source_commit=$staging_source" >> "$GITHUB_OUTPUT"
943
- - name: Restore exact staging deployment receipt
944
- if: needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile != 'starter'
945
- uses: ${actionPins.downloadArtifact}
946
- with:
947
- artifact-ids: \${{ steps.staging-receipt.outputs.artifact_id }}
948
- github-token: \${{ github.token }}
949
- path: \${{ runner.temp }}/staging-deployment-receipt
950
- run-id: \${{ steps.staging-receipt.outputs.run_id }}
951
- - id: staging
952
- name: Bind exact staging deployment and release evidence
953
- if: needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile != 'starter'
954
- env:
955
- EBK_STAGING_DEPLOYMENT_RUN_ATTEMPT: \${{ steps.staging-receipt.outputs.run_attempt }}
956
- EBK_STAGING_DEPLOYMENT_RUN_ID: \${{ steps.staging-receipt.outputs.run_id }}
957
- EBK_EXPECTED_HAS_SLICES: \${{ needs.prepare.outputs.has_slices }}
958
- EBK_EXPECTED_HAS_CONTAINERS: \${{ needs.prepare.outputs.has_containers }}
959
- EBK_EXPECTED_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
960
- EBK_EXPECTED_DEPLOYMENT_REGION: \${{ needs.prepare.outputs.region }}
961
- EBK_EXPECTED_STAGING_ACCOUNT_ID: \${{ needs.prepare.outputs.staging_account_id }}
962
- EBK_STAGING_RECEIPT_ARTIFACT_DIGEST: \${{ steps.staging-receipt.outputs.artifact_digest }}
963
- EBK_STAGING_RECEIPT_ARTIFACT_ID: \${{ steps.staging-receipt.outputs.artifact_id }}
964
- # The receipt artifact keeps .ebk/evidence as its root, so latest.json
965
- # and promotion.json live under deployment/ (EBK-INT-2026-074).
966
- EBK_STAGING_RECEIPT_ROOT: \${{ runner.temp }}/staging-deployment-receipt/deployment
967
- EBK_STAGING_SOURCE_COMMIT: \${{ steps.staging-receipt.outputs.source_commit }}
968
- GH_REPO: \${{ github.repository }}
969
- GH_TOKEN: \${{ github.token }}
970
- run: |
971
- node --input-type=module <<'NODE'
972
- ${indentedScript(stagingPromotionReceiptValidationScript(), 10)}
973
- NODE
974
- if [ "$EBK_EXPECTED_HAS_SLICES" = true ]; then
975
- promotion="$EBK_STAGING_RECEIPT_ROOT/promotion.json"
976
- candidate_run_id="$(jq -r '.candidate.producerRunId' "$promotion")"
977
- candidate_run_attempt="$(jq -r '.candidate.producerRunAttempt' "$promotion")"
978
- candidate_artifact_id="$(jq -r '.candidate.artifactId' "$promotion")"
979
- candidate_artifact_digest="$(jq -r '.candidate.artifactDigest' "$promotion")"
980
- candidate_run="$(gh api "/repos/$GH_REPO/actions/runs/$candidate_run_id")"
981
- printf '%s' "$candidate_run" | jq -e \
982
- --arg source "$EBK_STAGING_SOURCE_COMMIT" \
983
- --arg attempt "$candidate_run_attempt" \
984
- '.head_sha == $source and .head_branch == "develop" and .event == "push" and .path == ".github/workflows/ci.yml" and .conclusion == "success" and (.run_attempt | tostring) == $attempt' >/dev/null
985
- candidate_artifacts="$(gh api "/repos/$GH_REPO/actions/runs/$candidate_run_id/artifacts?per_page=100")"
986
- printf '%s' "$candidate_artifacts" | jq -e \
987
- --arg id "$candidate_artifact_id" \
988
- --arg digest "$candidate_artifact_digest" \
989
- --arg name "release-candidate-$EBK_STAGING_SOURCE_COMMIT" \
990
- '[.artifacts[] | select((.id | tostring) == $id and .name == $name and .digest == $digest and .expired == false)] | length == 1' >/dev/null
991
- fi
992
- if [ "$EBK_EXPECTED_HAS_CONTAINERS" = true ]; then
993
- container_artifact_id="$(jq -r '.container.artifactId' "$promotion")"
994
- container_artifact_digest="$(jq -r '.container.artifactDigest' "$promotion")"
995
- staging_artifacts="$(gh api "/repos/$GH_REPO/actions/runs/$EBK_STAGING_DEPLOYMENT_RUN_ID/artifacts?per_page=100")"
996
- printf '%s' "$staging_artifacts" | jq -e \
997
- --arg id "$container_artifact_id" \
998
- --arg digest "$container_artifact_digest" \
999
- --arg name "container-release-staging-$EBK_STAGING_DEPLOYMENT_RUN_ID-$EBK_STAGING_DEPLOYMENT_RUN_ATTEMPT" \
1000
- '[.artifacts[] | select((.id | tostring) == $id and .name == $name and .digest == $digest and .expired == false)] | length == 1' >/dev/null
1001
- fi
1002
-
1003
- container-platform:
1004
- name: native \${{ needs.prepare.outputs.stage }} OCI \${{ matrix.project.project }} \${{ matrix.platform }}
1005
- needs: [prepare, immutable-artifacts]
1006
- if: >-
1007
- always() &&
1008
- needs.prepare.result == 'success' &&
1009
- needs.immutable-artifacts.result == 'success' &&
1010
- needs.prepare.outputs.action == 'deploy' &&
1011
- needs.prepare.outputs.has_containers == 'true' &&
1012
- (
1013
- needs.prepare.outputs.stage == 'staging' ||
1014
- (needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile == 'starter')
1015
- )
1016
- strategy:
1017
- fail-fast: false
1018
- # One job per Slice and architecture: Slices build in parallel instead of
1019
- # looping on one runner per architecture.
1020
- matrix:
1021
- project: \${{ fromJson(needs.prepare.outputs.container_matrix) }}
1022
- # architecture is an original axis: include entries only decorate the
1023
- # matching combination. Include-only keys would be merged into every
1024
- # project and the later entry would overwrite the earlier one, so every
1025
- # Slice would build one architecture (EBK-INT-2026-081).
1026
- architecture: [amd64, arm64]
1027
- include:
1028
- - architecture: amd64
1029
- platform: linux/amd64
1030
- runner: ubuntu-latest
1031
- target: container-release-amd64
1032
- - architecture: arm64
1033
- platform: linux/arm64
1034
- runner: ubuntu-24.04-arm
1035
- target: container-release-arm64
1036
- runs-on: \${{ matrix.runner }}
1037
- environment: \${{ needs.prepare.outputs.stage }}
1038
- permissions:
1039
- actions: read
1040
- contents: read
1041
- id-token: write
1042
- env:
1043
- AWS_DEPLOY_ROLE_ARN: \${{ needs.prepare.outputs.stage_deploy_role_arn }}
1044
- AWS_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_EXPECTED_ACCOUNT_ID }}
1045
- AWS_PARTITION: \${{ needs.prepare.outputs.partition }}
1046
- AWS_REGION: \${{ vars.AWS_REGION }}
1047
- EBK_ACTION: deploy
1048
- EBK_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
1049
- EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.account_id }}
1050
- EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
1051
- EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit }}
1052
- EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
1053
- EBK_STAGE: \${{ needs.prepare.outputs.stage }}
1054
- EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.container_projects }}
1055
- EBK_SLICE_PROJECT: \${{ matrix.project.project }}
1056
- EBK_CONTAINER_PROJECTS: \${{ needs.prepare.outputs.container_projects }}
1057
- steps:
1058
- - name: Check out immutable container source
1059
- uses: ${actionPins.checkout}
1060
- env:
1061
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1062
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1063
- with:
1064
- fetch-depth: 0
1065
- persist-credentials: false
1066
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1067
- - uses: ${actionPins.pnpmSetup}
1068
- env:
1069
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1070
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1071
- - uses: ${actionPins.setupNode}
1072
- env:
1073
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1074
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1075
- with:
1076
- node-version: ${toolVersions.node}
1077
- cache: pnpm
1078
- - env:
1079
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1080
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1081
- run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
1082
- - name: Verify managed workspace integrity before container authority
1083
- env:
1084
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1085
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1086
- run: pnpm nx run ${name}:workspace-health
1087
- - name: Restore exact immutable release candidate for container build
1088
- uses: ${actionPins.downloadArtifact}
1089
- env:
1090
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1091
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1092
- with:
1093
- artifact-ids: \${{ needs.immutable-artifacts.outputs.artifact_id }}
1094
- github-token: \${{ github.token }}
1095
- path: .ebk/evidence/release-candidate
1096
- run-id: \${{ needs.immutable-artifacts.outputs.producer_run_id }}
1097
- - name: Restore the baseline deployment receipt for unchanged artifacts
1098
- if: needs.immutable-artifacts.outputs.baseline_found == 'true'
1099
- uses: ${actionPins.downloadArtifact}
1100
- env:
1101
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1102
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1103
- with:
1104
- artifact-ids: \${{ needs.immutable-artifacts.outputs.baseline_artifact_id }}
1105
- github-token: \${{ github.token }}
1106
- path: \${{ runner.temp }}/ebk-deployment-baseline
1107
- run-id: \${{ needs.immutable-artifacts.outputs.baseline_run_id }}
1108
- - name: Revalidate exact protected branch tip before OIDC
1109
- env:
1110
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1111
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1112
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
1113
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1114
- GH_REPO: \${{ github.repository }}
1115
- GH_TOKEN: \${{ github.token }}
1116
- run: |
1117
- set -euo pipefail
1118
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ] || {
1119
- echo 'Deployment checkout differs from the exact protected source'; exit 1;
1120
- }
1121
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
1122
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
1123
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
1124
- }
1125
- - name: Assume the current stage deployment role for container build
1126
- uses: ${actionPins.configureAwsCredentials}
1127
- with:
1128
- audience: \${{ needs.prepare.outputs.oidc_audience }}
1129
- aws-region: \${{ vars.AWS_REGION }}
1130
- role-session-name: ebk-container-\${{ matrix.architecture }}-\${{ github.run_id }}-\${{ github.run_attempt }}
1131
- role-to-assume: \${{ env.AWS_DEPLOY_ROLE_ARN }}
1132
- - name: Verify exact container build authority
1133
- run: |
1134
- set -euo pipefail
1135
- [ "$AWS_EXPECTED_ACCOUNT_ID" = "$EBK_POLICY_ACCOUNT_ID" ]
1136
- [ "$AWS_REGION" = "$EBK_POLICY_REGION" ]
1137
- [ "$(aws sts get-caller-identity --query Account --output text)" = "$EBK_POLICY_ACCOUNT_ID" ]
1138
- - name: Restore the container layer and release tool caches
1139
- uses: ${actionPins.cache}
1140
- env:
1141
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1142
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1143
- with:
1144
- path: |
1145
- \${{ runner.temp }}/ebk-buildx-cache
1146
- \${{ runner.temp }}/ebk-release-tools
1147
- key: ebk-container-\${{ needs.prepare.outputs.stage }}-\${{ matrix.project.project }}-\${{ matrix.architecture }}-\${{ hashFiles('pnpm-lock.yaml') }}-\${{ github.run_id }}
1148
- restore-keys: |
1149
- ebk-container-\${{ needs.prepare.outputs.stage }}-\${{ matrix.project.project }}-\${{ matrix.architecture }}-\${{ hashFiles('pnpm-lock.yaml') }}-
1150
- ebk-container-\${{ needs.prepare.outputs.stage }}-\${{ matrix.project.project }}-\${{ matrix.architecture }}-
1151
- - name: Build and run exact native OCI artifacts
1152
- env:
1153
- EBK_BUILDX_CACHE_DIR: \${{ runner.temp }}/ebk-buildx-cache
1154
- EBK_RELEASE_TOOL_CACHE_DIR: \${{ runner.temp }}/ebk-release-tools
1155
- EBK_CONTAINER_BASELINE_COMMIT: \${{ needs.immutable-artifacts.outputs.baseline_commit }}
1156
- EBK_CONTAINER_BASELINE_ROOT: \${{ needs.immutable-artifacts.outputs.baseline_found == 'true' && format('{0}/ebk-deployment-baseline', runner.temp) || '' }}
1157
- run: |
1158
- set -euo pipefail
1159
- ${indentedScript(exactStageDeployerGuardScript('Container build', '$EBK_POLICY_ACCOUNT_ID'), 10)}
1160
- case "$EBK_SLICE_PROJECT" in
1161
- ''|-*|*-|*[!a-z0-9-]*) echo 'Container build Slice project must be an exact normalized Slice name'; exit 1 ;;
1162
- esac
1163
- case ",$EBK_CONTAINER_PROJECTS," in
1164
- *",$EBK_SLICE_PROJECT,"*) ;;
1165
- *) echo 'Container build Slice project is not in the committed deployment plan'; exit 1 ;;
1166
- esac
1167
- pnpm nx run "$EBK_SLICE_PROJECT:\${{ matrix.target }}"
1168
- - name: Retain native platform evidence
1169
- uses: ${actionPins.uploadArtifact}
1170
- with:
1171
- name: container-platform-\${{ needs.prepare.outputs.stage }}-\${{ matrix.project.project }}-\${{ matrix.architecture }}-\${{ github.run_id }}-\${{ github.run_attempt }}
1172
- if-no-files-found: error
1173
- include-hidden-files: true
1174
- retention-days: 30
1175
- # The glob keeps partials/<stage> as the artifact root: the assemble
1176
- # job merges every platform artifact into that directory and the
1177
- # container release tool reads <project>/<architecture>/ beneath it.
1178
- # A literal <project>/<architecture> path would make the architecture
1179
- # directory the root and flatten the merged restore.
1180
- path: .ebk/evidence/container-release/partials/\${{ needs.prepare.outputs.stage }}/*/\${{ matrix.architecture }}
1181
-
1182
- container-assemble:
1183
- name: assemble \${{ needs.prepare.outputs.stage }} OCI indexes
1184
- needs: [prepare, immutable-artifacts, container-platform]
1185
- if: >-
1186
- always() &&
1187
- needs.prepare.result == 'success' &&
1188
- needs.immutable-artifacts.result == 'success' &&
1189
- needs.container-platform.result == 'success' &&
1190
- needs.prepare.outputs.action == 'deploy' &&
1191
- needs.prepare.outputs.has_containers == 'true'
1192
- runs-on: ubuntu-latest
1193
- environment: \${{ needs.prepare.outputs.stage }}
1194
- permissions:
1195
- actions: read
1196
- contents: read
1197
- id-token: write
1198
- outputs:
1199
- artifact_digest: \${{ steps.retain.outputs.artifact-digest }}
1200
- artifact_id: \${{ steps.retain.outputs.artifact-id }}
1201
- env:
1202
- AWS_DEPLOY_ROLE_ARN: \${{ needs.prepare.outputs.stage_deploy_role_arn }}
1203
- AWS_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_EXPECTED_ACCOUNT_ID }}
1204
- AWS_PARTITION: \${{ needs.prepare.outputs.partition }}
1205
- AWS_REGION: \${{ vars.AWS_REGION }}
1206
- EBK_ACTION: deploy
1207
- EBK_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
1208
- EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.account_id }}
1209
- EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
1210
- EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit }}
1211
- EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
1212
- EBK_STAGE: \${{ needs.prepare.outputs.stage }}
1213
- EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.container_projects }}
1214
- steps:
1215
- - name: Check out immutable container source
1216
- uses: ${actionPins.checkout}
1217
- env:
1218
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1219
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1220
- with:
1221
- fetch-depth: 0
1222
- persist-credentials: false
1223
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1224
- - uses: ${actionPins.pnpmSetup}
1225
- env:
1226
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1227
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1228
- - uses: ${actionPins.setupNode}
1229
- env:
1230
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1231
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1232
- with:
1233
- node-version: ${toolVersions.node}
1234
- cache: pnpm
1235
- - env:
1236
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1237
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1238
- run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
1239
- - name: Verify managed workspace integrity before container authority
1240
- env:
1241
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1242
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1243
- run: pnpm nx run ${name}:workspace-health
1244
- - name: Restore exact immutable release candidate for container assembly
1245
- uses: ${actionPins.downloadArtifact}
1246
- env:
1247
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1248
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1249
- with:
1250
- artifact-ids: \${{ needs.immutable-artifacts.outputs.artifact_id }}
1251
- github-token: \${{ github.token }}
1252
- path: .ebk/evidence/release-candidate
1253
- run-id: \${{ needs.immutable-artifacts.outputs.producer_run_id }}
1254
- - name: Restore both native platform records
1255
- uses: ${actionPins.downloadArtifact}
1256
- env:
1257
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1258
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1259
- with:
1260
- pattern: container-platform-\${{ needs.prepare.outputs.stage }}-*-\${{ github.run_id }}-\${{ github.run_attempt }}
1261
- merge-multiple: true
1262
- path: .ebk/evidence/container-release/partials/\${{ needs.prepare.outputs.stage }}
1263
- - name: Revalidate exact protected branch tip before OIDC
1264
- env:
1265
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1266
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1267
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
1268
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1269
- GH_REPO: \${{ github.repository }}
1270
- GH_TOKEN: \${{ github.token }}
1271
- run: |
1272
- set -euo pipefail
1273
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ] || {
1274
- echo 'Deployment checkout differs from the exact protected source'; exit 1;
1275
- }
1276
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
1277
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
1278
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
1279
- }
1280
- - name: Assume the current stage deployment role for container assembly
1281
- uses: ${actionPins.configureAwsCredentials}
1282
- with:
1283
- audience: \${{ needs.prepare.outputs.oidc_audience }}
1284
- aws-region: \${{ vars.AWS_REGION }}
1285
- role-session-name: ebk-container-assemble-\${{ github.run_id }}-\${{ github.run_attempt }}
1286
- role-to-assume: \${{ env.AWS_DEPLOY_ROLE_ARN }}
1287
- - name: Verify exact container assembly authority
1288
- run: |
1289
- set -euo pipefail
1290
- [ "$AWS_EXPECTED_ACCOUNT_ID" = "$EBK_POLICY_ACCOUNT_ID" ]
1291
- [ "$AWS_REGION" = "$EBK_POLICY_REGION" ]
1292
- [ "$(aws sts get-caller-identity --query Account --output text)" = "$EBK_POLICY_ACCOUNT_ID" ]
1293
- - name: Assemble exact dual-architecture indexes
1294
- run: |
1295
- set -euo pipefail
1296
- ${indentedScript(exactStageDeployerGuardScript('Container assembly', '$EBK_POLICY_ACCOUNT_ID'), 10)}
1297
- IFS=',' read -r -a projects <<< "$EBK_SLICE_PROJECTS"
1298
- for project in "\${projects[@]}"; do
1299
- test -n "$project" || continue
1300
- pnpm nx run "$project:container-release-assemble"
1301
- binding=".ebk/evidence/container-release/$EBK_STAGE/packages/$project/binding.json"
1302
- sidecar=".ebk/evidence/container-release/$EBK_STAGE/packages/$project/release-bound-binding.json"
1303
- test -f "$binding" && test ! -e "$sidecar"
1304
- cp "$binding" "$sidecar"
1305
- cmp "$binding" "$sidecar"
1306
- done
1307
- - id: retain
1308
- name: Retain exact predeploy container bundle
1309
- uses: ${actionPins.uploadArtifact}
1310
- with:
1311
- name: container-release-\${{ needs.prepare.outputs.stage }}-\${{ github.run_id }}-\${{ github.run_attempt }}
1312
- if-no-files-found: error
1313
- include-hidden-files: true
1314
- retention-days: 30
1315
- path: .ebk/evidence/container-release
1316
-
1317
- container-promote-production:
1318
- name: promote reviewed OCI indexes to production
1319
- needs: [prepare, immutable-artifacts]
1320
- if: >-
1321
- always() &&
1322
- needs.prepare.result == 'success' &&
1323
- needs.immutable-artifacts.result == 'success' &&
1324
- needs.prepare.outputs.action == 'deploy' &&
1325
- needs.prepare.outputs.stage == 'production' &&
1326
- needs.prepare.outputs.profile != 'starter' &&
1327
- needs.prepare.outputs.has_containers == 'true'
1328
- runs-on: ubuntu-latest
1329
- environment: production
1330
- permissions:
1331
- actions: read
1332
- contents: read
1333
- id-token: write
1334
- outputs:
1335
- artifact_digest: \${{ steps.retain.outputs.artifact-digest }}
1336
- artifact_id: \${{ steps.retain.outputs.artifact-id }}
1337
- env:
1338
- AWS_DEPLOY_ROLE_ARN: \${{ needs.prepare.outputs.stage_deploy_role_arn }}
1339
- AWS_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_EXPECTED_ACCOUNT_ID }}
1340
- AWS_PARTITION: \${{ needs.prepare.outputs.partition }}
1341
- AWS_REGION: \${{ vars.AWS_REGION }}
1342
- EBK_ACTION: deploy
1343
- EBK_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
1344
- EBK_POLICY_PRODUCTION_ACCOUNT_ID: \${{ needs.prepare.outputs.account_id }}
1345
- EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
1346
- EBK_POLICY_STAGING_ACCOUNT_ID: \${{ needs.prepare.outputs.staging_account_id }}
1347
- EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit }}
1348
- EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
1349
- EBK_STAGE: production
1350
- EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.container_projects }}
1351
- steps:
1352
- - name: Check out immutable production source
1353
- uses: ${actionPins.checkout}
1354
- env:
1355
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1356
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1357
- with:
1358
- fetch-depth: 0
1359
- persist-credentials: false
1360
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1361
- - uses: ${actionPins.pnpmSetup}
1362
- env:
1363
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1364
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1365
- - uses: ${actionPins.setupNode}
1366
- env:
1367
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1368
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1369
- with:
1370
- node-version: ${toolVersions.node}
1371
- cache: pnpm
1372
- - env:
1373
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1374
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1375
- run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
1376
- - name: Verify managed workspace integrity before container authority
1377
- env:
1378
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1379
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1380
- run: pnpm nx run ${name}:workspace-health
1381
- - name: Restore exact immutable release candidate for promotion
1382
- uses: ${actionPins.downloadArtifact}
1383
- env:
1384
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1385
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1386
- with:
1387
- artifact-ids: \${{ needs.immutable-artifacts.outputs.artifact_id }}
1388
- github-token: \${{ github.token }}
1389
- path: .ebk/evidence/release-candidate
1390
- run-id: \${{ needs.immutable-artifacts.outputs.producer_run_id }}
1391
- - name: Restore exact staging container bundle
1392
- uses: ${actionPins.downloadArtifact}
1393
- env:
1394
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1395
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1396
- with:
1397
- artifact-ids: \${{ needs.immutable-artifacts.outputs.container_artifact_id }}
1398
- github-token: \${{ github.token }}
1399
- path: .ebk/evidence/container-release
1400
- run-id: \${{ needs.immutable-artifacts.outputs.staging_deployment_run_id }}
1401
- - name: Revalidate exact protected branch tip before OIDC
1402
- env:
1403
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1404
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1405
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
1406
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1407
- GH_REPO: \${{ github.repository }}
1408
- GH_TOKEN: \${{ github.token }}
1409
- run: |
1410
- set -euo pipefail
1411
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ] || {
1412
- echo 'Deployment checkout differs from the exact protected source'; exit 1;
1413
- }
1414
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
1415
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
1416
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
1417
- }
1418
- - name: Assume exact staging registry pull role
1419
- uses: ${actionPins.configureAwsCredentials}
1420
- with:
1421
- audience: \${{ needs.prepare.outputs.oidc_audience }}
1422
- aws-region: \${{ vars.AWS_STAGING_PROMOTION_REGION }}
1423
- role-session-name: ebk-staging-container-pull-\${{ github.run_id }}-\${{ github.run_attempt }}
1424
- role-to-assume: \${{ secrets.AWS_STAGING_PROMOTION_PULL_ROLE_ARN }}
1425
- - name: Authenticate exact staging source registry
1426
- env:
1427
- AWS_STAGING_PROMOTION_PULL_ROLE_ARN: \${{ secrets.AWS_STAGING_PROMOTION_PULL_ROLE_ARN }}
1428
- EBK_STAGING_ACCOUNT_ID: \${{ vars.AWS_STAGING_PROMOTION_EXPECTED_ACCOUNT_ID }}
1429
- EBK_STAGING_REGION: \${{ vars.AWS_STAGING_PROMOTION_REGION }}
1430
- run: |
1431
- set -euo pipefail
1432
- [ "$EBK_STAGING_ACCOUNT_ID" = "$EBK_POLICY_STAGING_ACCOUNT_ID" ]
1433
- [ "$EBK_STAGING_REGION" = "$EBK_POLICY_REGION" ]
1434
- ${indentedScript(exactStagingPromotionPullGuardScript(), 10)}
1435
- [ "$EBK_STAGING_ACCOUNT_ID" != "$AWS_EXPECTED_ACCOUNT_ID" ]
1436
- registry_suffix=.com
1437
- case "$EBK_STAGING_REGION" in cn-*) registry_suffix=.com.cn ;; esac
1438
- aws ecr get-login-password --region "$EBK_STAGING_REGION" |
1439
- docker login --username AWS --password-stdin \
1440
- "$EBK_STAGING_ACCOUNT_ID.dkr.ecr.$EBK_STAGING_REGION.amazonaws$registry_suffix"
1441
- - name: Revalidate exact protected branch tip before OIDC
1442
- env:
1443
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1444
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1445
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
1446
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1447
- GH_REPO: \${{ github.repository }}
1448
- GH_TOKEN: \${{ github.token }}
1449
- run: |
1450
- set -euo pipefail
1451
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ] || {
1452
- echo 'Deployment checkout differs from the exact protected source'; exit 1;
1453
- }
1454
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
1455
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
1456
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
1457
- }
1458
- - name: Assume the production deployment role for container promotion
1459
- uses: ${actionPins.configureAwsCredentials}
1460
- with:
1461
- audience: \${{ needs.prepare.outputs.oidc_audience }}
1462
- aws-region: \${{ vars.AWS_REGION }}
1463
- role-session-name: ebk-production-container-push-\${{ github.run_id }}-\${{ github.run_attempt }}
1464
- role-to-assume: \${{ env.AWS_DEPLOY_ROLE_ARN }}
1465
- - name: Promote exact staging indexes without rebuilding
1466
- env:
1467
- EBK_STAGING_PROMOTION_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_STAGING_PROMOTION_EXPECTED_ACCOUNT_ID }}
1468
- EBK_STAGING_PROMOTION_REGION: \${{ vars.AWS_STAGING_PROMOTION_REGION }}
1469
- run: |
1470
- set -euo pipefail
1471
- [ "$AWS_EXPECTED_ACCOUNT_ID" = "$EBK_POLICY_PRODUCTION_ACCOUNT_ID" ]
1472
- [ "$AWS_REGION" = "$EBK_POLICY_REGION" ]
1473
- ${indentedScript(exactStageDeployerGuardScript('Container promotion', '$AWS_EXPECTED_ACCOUNT_ID'), 10)}
1474
- IFS=',' read -r -a projects <<< "$EBK_SLICE_PROJECTS"
1475
- for project in "\${projects[@]}"; do
1476
- test -n "$project" || continue
1477
- # The container release tool resolves these against the repository
1478
- # root, so they stay repository-relative (EBK-INT-2026-077).
1479
- export EBK_CONTAINER_PROMOTION_SOURCE_BINDING_PATH=".ebk/evidence/container-release/staging/packages/$project/binding.json"
1480
- export EBK_CONTAINER_PROMOTION_SOURCE_SIDECAR_PATH=".ebk/evidence/container-release/staging/packages/$project/release-bound-binding.json"
1481
- pnpm nx run "$project:container-release-promote"
1482
- done
1483
- - id: retain
1484
- name: Retain production target container binding
1485
- uses: ${actionPins.uploadArtifact}
1486
- with:
1487
- name: container-release-production-\${{ github.run_id }}-\${{ github.run_attempt }}
1488
- if-no-files-found: error
1489
- include-hidden-files: true
1490
- retention-days: 90
1491
- path: .ebk/evidence/container-release
1492
-
1493
- execute:
1494
- name: native \${{ needs.prepare.outputs.action }} \${{ needs.prepare.outputs.stage }}
1495
- needs: [prepare, immutable-artifacts, container-assemble, container-promote-production]
1496
- if: >-
1497
- always() &&
1498
- needs.prepare.result == 'success' &&
1499
- needs.prepare.outputs.action != 'rehearse' &&
1500
- (
1501
- needs.prepare.outputs.action != 'deploy' ||
1502
- (
1503
- needs.prepare.outputs.has_slices != 'true' &&
1504
- (needs.prepare.outputs.stage != 'production' || needs.prepare.outputs.profile == 'starter')
1505
- ) || (
1506
- needs.immutable-artifacts.result == 'success' &&
1507
- (
1508
- needs.prepare.outputs.has_containers != 'true' ||
1509
- needs.prepare.outputs.stage == 'development' ||
1510
- (
1511
- (
1512
- needs.prepare.outputs.stage == 'staging' ||
1513
- (needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile == 'starter')
1514
- ) &&
1515
- needs.container-assemble.result == 'success'
1516
- ) ||
1517
- (
1518
- needs.prepare.outputs.stage == 'production' &&
1519
- needs.prepare.outputs.profile != 'starter' &&
1520
- needs.container-promote-production.result == 'success'
1521
- )
1522
- )
1523
- )
1524
- )
1525
- runs-on: ubuntu-latest
1526
- environment: \${{ needs.prepare.outputs.stage }}
1527
- permissions:
1528
- actions: read
1529
- contents: read
1530
- id-token: write
1531
- env:
1532
- AWS_DEPLOY_ROLE_ARN: \${{ needs.prepare.outputs.stage_deploy_role_arn }}
1533
- AWS_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_EXPECTED_ACCOUNT_ID }}
1534
- AWS_PARTITION: \${{ needs.prepare.outputs.partition }}
1535
- AWS_REGION: \${{ vars.AWS_REGION }}
1536
- EBK_ACTION: \${{ needs.prepare.outputs.action }}
1537
- EBK_ALLOW_PRODUCTION_REMOVE: \${{ vars.EBK_ALLOW_PRODUCTION_REMOVE }}
1538
- EBK_CANDIDATE_ARTIFACT_DIGEST: \${{ needs.immutable-artifacts.outputs.artifact_digest }}
1539
- EBK_CANDIDATE_ARTIFACT_ID: \${{ needs.immutable-artifacts.outputs.artifact_id }}
1540
- EBK_CANDIDATE_MATERIAL_DIGEST: \${{ needs.immutable-artifacts.outputs.candidate_material_digest }}
1541
- EBK_CANDIDATE_PRODUCER_RUN_ATTEMPT: \${{ needs.immutable-artifacts.outputs.producer_run_attempt }}
1542
- EBK_CANDIDATE_PRODUCER_RUN_ID: \${{ needs.immutable-artifacts.outputs.producer_run_id }}
1543
- EBK_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
1544
- EBK_ORDERED_PROJECTS: \${{ needs.prepare.outputs.ordered_projects }}
1545
- EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.account_id }}
1546
- EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
1547
- EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit || inputs.source_commit || github.sha }}
1548
- EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.slice_projects }}
1549
- EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
1550
- EBK_STAGE: \${{ needs.prepare.outputs.stage }}
1551
- EBK_LIFECYCLE_SCOPE: \${{ inputs.lifecycle || 'affected' }}
1552
- EBK_BASELINE_FOUND: \${{ needs.immutable-artifacts.outputs.baseline_found }}
1553
- EBK_BASELINE_RUN_ID: \${{ needs.immutable-artifacts.outputs.baseline_run_id }}
1554
- steps:
1555
- - name: Check out immutable deployment source
1556
- uses: ${actionPins.checkout}
1557
- env:
1558
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1559
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1560
- with:
1561
- fetch-depth: 0
1562
- persist-credentials: false
1563
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1564
- - uses: ${actionPins.pnpmSetup}
1565
- env:
1566
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1567
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1568
- - uses: ${actionPins.setupNode}
1569
- env:
1570
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1571
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1572
- with:
1573
- node-version: ${toolVersions.node}
1574
- cache: pnpm
1575
- - env:
1576
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1577
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1578
- run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
1579
- - name: Verify managed workspace integrity before AWS authority
1580
- env:
1581
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1582
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1583
- run: pnpm nx run ${name}:workspace-health
1584
- - name: Restore exact immutable release candidate
1585
- if: needs.prepare.outputs.action == 'deploy' && needs.prepare.outputs.has_slices == 'true'
1586
- uses: ${actionPins.downloadArtifact}
1587
- env:
1588
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1589
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1590
- with:
1591
- artifact-ids: \${{ needs.immutable-artifacts.outputs.artifact_id }}
1592
- github-token: \${{ github.token }}
1593
- path: .ebk/evidence/release-candidate
1594
- run-id: \${{ needs.immutable-artifacts.outputs.producer_run_id }}
1595
- - name: Restore the baseline deployment receipt for unchanged Slices
1596
- if: needs.prepare.outputs.action == 'deploy' && needs.immutable-artifacts.outputs.baseline_found == 'true'
1597
- uses: ${actionPins.downloadArtifact}
1598
- env:
1599
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1600
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1601
- with:
1602
- artifact-ids: \${{ needs.immutable-artifacts.outputs.baseline_artifact_id }}
1603
- github-token: \${{ github.token }}
1604
- path: \${{ runner.temp }}/ebk-deployment-baseline
1605
- run-id: \${{ needs.immutable-artifacts.outputs.baseline_run_id }}
1606
- - name: Restore exact current-stage container binding
1607
- if: >-
1608
- needs.prepare.outputs.action == 'deploy' &&
1609
- needs.prepare.outputs.has_containers == 'true' &&
1610
- (
1611
- needs.prepare.outputs.stage == 'staging' ||
1612
- (needs.prepare.outputs.stage == 'production' && needs.prepare.outputs.profile == 'starter')
1613
- )
1614
- uses: ${actionPins.downloadArtifact}
1615
- env:
1616
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1617
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1618
- with:
1619
- name: container-release-\${{ needs.prepare.outputs.stage }}-\${{ github.run_id }}-\${{ github.run_attempt }}
1620
- path: .ebk/evidence/container-release
1621
- - name: Restore exact promoted production container binding
1622
- if: >-
1623
- needs.prepare.outputs.action == 'deploy' &&
1624
- needs.prepare.outputs.has_containers == 'true' &&
1625
- needs.prepare.outputs.stage == 'production' &&
1626
- needs.prepare.outputs.profile != 'starter'
1627
- uses: ${actionPins.downloadArtifact}
1628
- env:
1629
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1630
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1631
- with:
1632
- name: container-release-production-\${{ github.run_id }}-\${{ github.run_attempt }}
1633
- path: .ebk/evidence/container-release
1634
- - name: Verify exact predeploy container binding inventory
1635
- if: >-
1636
- needs.prepare.outputs.action == 'deploy' &&
1637
- needs.prepare.outputs.has_containers == 'true' &&
1638
- needs.prepare.outputs.stage != 'development'
1639
- env:
1640
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1641
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1642
- EBK_CONTAINER_PROJECTS: \${{ needs.prepare.outputs.container_projects }}
1643
- run: |
1644
- set -euo pipefail
1645
- IFS=',' read -r -a projects <<< "$EBK_CONTAINER_PROJECTS"
1646
- for project in "\${projects[@]}"; do
1647
- test -n "$project" || continue
1648
- test -f ".ebk/evidence/container-release/$EBK_STAGE/packages/$project/binding.json" || {
1649
- echo "Exact predeploy container binding is absent for $project"
1650
- exit 1
1651
- }
1652
- done
1653
- - name: Verify exact restored staging-tested release candidate
1654
- if: env.EBK_ACTION == 'deploy' && env.EBK_STAGE == 'production' && needs.prepare.outputs.profile != 'starter' && needs.prepare.outputs.has_slices == 'true'
1655
- env:
1656
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1657
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1658
- run: |
1659
- node --input-type=module <<'NODE'
1660
- ${indentedScript(restoredCandidateValidationScript(), 10)}
1661
- NODE
1662
- - name: Authorize deployed Blueprint trust before protected mutation
1663
- if: env.EBK_ACTION == 'deploy'
1664
- env:
1665
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1666
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1667
- EBK_PROTECTED_BLUEPRINT_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1668
- run: |
1669
- set -euo pipefail
1670
- case "$EBK_PROTECTED_BLUEPRINT_COMMIT" in
1671
- ''|*[!0-9a-f]*) echo 'Protected Blueprint authority must be one full lowercase Git object ID'; exit 1 ;;
1672
- esac
1673
- test "\${#EBK_PROTECTED_BLUEPRINT_COMMIT}" -eq 40 ||
1674
- test "\${#EBK_PROTECTED_BLUEPRINT_COMMIT}" -eq 64 ||
1675
- { echo 'Protected Blueprint authority must be one full Git object ID'; exit 1; }
1676
- test "$(git rev-parse HEAD)" = "$EBK_PROTECTED_BLUEPRINT_COMMIT" ||
1677
- { echo 'Protected Blueprint authority differs from the exact workflow checkout'; exit 1; }
1678
- case "$EBK_STAGE" in${developmentFromProtectedDevelop
1679
- ? `
1680
- development) protected_branch=develop ;;`
1681
- : ''}
1682
- staging) protected_branch=develop ;;
1683
- production) protected_branch=main ;;
1684
- *) exit 1 ;;
1685
- esac
1686
- node tools/blueprint-trust-check.mjs \
1687
- --operation=deploy \
1688
- --protected-branch="$protected_branch" \
1689
- --protected-ref="$EBK_PROTECTED_BLUEPRINT_COMMIT" \
1690
- --output=.ebk/evidence/supply-chain/blueprint-trust.json
1691
- - name: Produce subject-bound protected scanner evidence
1692
- if: env.EBK_ACTION == 'deploy'
1693
- env:
1694
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1695
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1696
- run: pnpm nx run ${name}:supply-chain-scan
1697
- - name: Enforce protected supply-chain policy before mutation
1698
- if: env.EBK_ACTION == 'deploy'
1699
- env:
1700
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1701
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1702
- run: pnpm nx run ${name}:supply-chain-check-protected
1703
- - name: Install pinned Playwright Chromium for deployed smoke proofs
1704
- if: env.EBK_ACTION == 'deploy' && needs.prepare.outputs.has_slices == 'true'
1705
- env:
1706
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1707
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1708
- run: |
1709
- ${indentedScript(protectedBrowserInstallScript(), 10)}
1710
- ${machineCredentialRequestStep()}
1711
- - name: Revalidate exact protected branch tip before OIDC
1712
- env:
1713
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1714
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1715
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
1716
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1717
- GH_REPO: \${{ github.repository }}
1718
- GH_TOKEN: \${{ github.token }}
1719
- run: |
1720
- set -euo pipefail
1721
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ] || {
1722
- echo 'Deployment checkout differs from the exact protected source'; exit 1;
1723
- }
1724
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
1725
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
1726
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
1727
- }
1728
- - name: Assume the one stage deployment role
1729
- uses: ${actionPins.configureAwsCredentials}
1730
- with:
1731
- audience: \${{ needs.prepare.outputs.oidc_audience }}
1732
- aws-region: \${{ vars.AWS_REGION }}
1733
- role-session-name: ebk-native-\${{ github.run_id }}-\${{ github.run_attempt }}
1734
- role-to-assume: \${{ env.AWS_DEPLOY_ROLE_ARN }}
1735
- - name: Verify exact stage authority
1736
- run: |
1737
- set -euo pipefail
1738
- [ "$AWS_EXPECTED_ACCOUNT_ID" = "$EBK_POLICY_ACCOUNT_ID" ]
1739
- [ "$AWS_REGION" = "$EBK_POLICY_REGION" ]
1740
- ${indentedScript(exactStageDeployerGuardScript('Native lifecycle', '$EBK_POLICY_ACCOUNT_ID'), 10)}
1741
- - name: Run ordered native lifecycle targets
1742
- id: native-lifecycle
1743
- env:
1744
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1745
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1746
- EBK_GITHUB_JOB_WORKFLOW_REF: \${{ job.workflow_ref }}
1747
- GITHUB_TOKEN: \${{ github.token }}
1748
- run: |
1749
- set -euo pipefail
1750
- test -n "$AWS_DEPLOY_ROLE_ARN" || { echo 'Stage deployment role is absent'; exit 1; }
1751
- if [ "$EBK_ACTION" = deploy ]; then
1752
- case "$EBK_LIFECYCLE_SCOPE" in affected|full) ;; *) echo 'Lifecycle scope must be affected or full'; exit 1 ;; esac
1753
- baseline_arguments=()
1754
- if [ "$EBK_LIFECYCLE_SCOPE" = affected ] && [ "$EBK_BASELINE_FOUND" = true ]; then
1755
- case "$EBK_BASELINE_RUN_ID" in ''|*[!0-9]*) echo 'Baseline run id is malformed'; exit 1 ;; esac
1756
- baseline_arguments=(
1757
- --baselineReceipt="$RUNNER_TEMP/ebk-deployment-baseline/deployment/latest.json"
1758
- --baselineRunId="$EBK_BASELINE_RUN_ID"
1759
- --baselineRunAttempt=1
1760
- )
1761
- fi
1762
- pnpm nx run ${name}:deploy-local -- \
1763
- --stage="$EBK_STAGE" \
1764
- --expectedRoleArn="$AWS_DEPLOY_ROLE_ARN" \
1765
- --lifecycleScope="$EBK_LIFECYCLE_SCOPE" \
1766
- "\${baseline_arguments[@]}"
1767
- else
1768
- [ -n "$EBK_ORDERED_PROJECTS" ] || { echo 'Committed deployment order is empty'; exit 1; }
1769
- IFS=',' read -r -a projects <<< "$EBK_ORDERED_PROJECTS"
1770
- seen=,
1771
- for project in "\${projects[@]}"; do
1772
- case "$project" in ''|*[!A-Za-z0-9_-]*) exit 1 ;; esac
1773
- case "$seen" in *,"$project",*) echo "Duplicate lifecycle project: $project"; exit 1 ;; esac
1774
- seen="$seen$project,"
1775
- pnpm nx run "$project:$EBK_ACTION" -- --stage="$EBK_STAGE" --region="$AWS_REGION" --expectedRoleArn="$AWS_DEPLOY_ROLE_ARN"
1776
- done
1777
- fi
1778
- - name: Prove temporary smoke admission removed
1779
- if: always() && env.EBK_ACTION == 'deploy' && steps.native-lifecycle.outcome != 'skipped'
1780
- env:
1781
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1782
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1783
- EBK_GITHUB_JOB_WORKFLOW_REF: \${{ job.workflow_ref }}
1784
- GITHUB_TOKEN: \${{ github.token }}
1785
- run: |
1786
- set -euo pipefail
1787
- ${indentedScript(exactStageDeployerGuardScript('Smoke access cleanup', '$EBK_POLICY_ACCOUNT_ID'), 10)}
1788
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ]
1789
- git diff --quiet HEAD
1790
- node --input-type=module <<'NODE'
1791
- import { cleanupGithubPrivateSmoke } from '@empire-builder-kit/nx/foundation';
1792
- await cleanupGithubPrivateSmoke({
1793
- account: process.env.EBK_POLICY_ACCOUNT_ID,
1794
- deploymentProfile: process.env.EBK_DEPLOYMENT_PROFILE,
1795
- root: process.cwd(),
1796
- source: process.env.EBK_SOURCE_COMMIT,
1797
- stage: process.env.EBK_STAGE,
1798
- workspace: '${name}',
1799
- });
1800
- NODE
1801
- - name: Seal exact staging promotion receipt
1802
- if: env.EBK_ACTION == 'deploy' && env.EBK_STAGE == 'staging' && needs.prepare.outputs.profile != 'starter'
1803
- env:
1804
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1805
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1806
- EBK_CONTAINER_ARTIFACT_DIGEST: \${{ needs.container-assemble.outputs.artifact_digest }}
1807
- EBK_CONTAINER_ARTIFACT_ID: \${{ needs.container-assemble.outputs.artifact_id }}
1808
- EBK_HAS_SLICES: \${{ needs.prepare.outputs.has_slices }}
1809
- EBK_HAS_CONTAINERS: \${{ needs.prepare.outputs.has_containers }}
1810
- run: |
1811
- node --input-type=module <<'NODE'
1812
- ${indentedScript(stagingPromotionSealScript(), 10)}
1813
- NODE
1814
- - name: Seal exact postdeploy supply-chain binding
1815
- if: env.EBK_ACTION == 'deploy' && env.EBK_STAGE != 'development' && needs.prepare.outputs.has_slices == 'true'
1816
- env:
1817
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1818
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1819
- run: |
1820
- node --input-type=module <<'NODE'
1821
- ${indentedScript(postdeploySupplyChainBindingScript(), 10)}
1822
- NODE
1823
- - name: Retain bounded deployment receipt
1824
- if: always() && needs.prepare.outputs.action == 'deploy'
1825
- uses: ${actionPins.uploadArtifact}
1826
- with:
1827
- if-no-files-found: warn
1828
- name: deployment-receipt-\${{ needs.prepare.outputs.stage }}-\${{ github.run_id }}-\${{ github.run_attempt }}
1829
- path: |
1830
- .ebk/evidence/deployment/latest.json
1831
- .ebk/evidence/deployment/postdeploy-supply-chain.json
1832
- .ebk/evidence/deployment/promotion.json
1833
- .ebk/evidence/container-release/**
1834
- retention-days: 30
1835
- ${deploymentProfile === 'starter' ? '' : renderRehearseJob(options)}${trunkPromotion ? renderTrunkPromotionJobs(options) : ''}`;
1836
- }
1837
- /**
1838
- * Managed Router WAF blocking rehearsal (EBK-INT-2026-079). The protected
1839
- * dispatch runs the foundation rehearsal target under the staging deployment
1840
- * role with seedProbes, so the runner performs the operator probes itself
1841
- * inside the private-smoke allowlist admission, proves the admission removed,
1842
- * and opens the pull request that carries the sealed evidence and receipt
1843
- * back to develop through the ordinary review path.
1844
- */
1845
- function renderRehearseJob(options) {
1846
- const { actionPins, name, toolVersions } = options;
1847
- return `
1848
- rehearse:
1849
- name: rehearse staging Router WAF blocking
1850
- needs: prepare
1851
- if: >-
1852
- needs.prepare.result == 'success' &&
1853
- needs.prepare.outputs.action == 'rehearse' &&
1854
- needs.prepare.outputs.stage == 'staging' &&
1855
- needs.prepare.outputs.profile != 'starter'
1856
- runs-on: ubuntu-latest
1857
- environment: \${{ needs.prepare.outputs.stage }}
1858
- permissions:
1859
- actions: read
1860
- contents: write
1861
- id-token: write
1862
- pull-requests: write
1863
- env:
1864
- AWS_DEPLOY_ROLE_ARN: \${{ needs.prepare.outputs.stage_deploy_role_arn }}
1865
- AWS_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_EXPECTED_ACCOUNT_ID }}
1866
- AWS_PARTITION: \${{ needs.prepare.outputs.partition }}
1867
- AWS_REGION: \${{ vars.AWS_REGION }}
1868
- EBK_ACTION: rehearse
1869
- EBK_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
1870
- EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.account_id }}
1871
- EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
1872
- EBK_PROBE_URL: \${{ needs.prepare.outputs.probe_url }}
1873
- EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
1874
- EBK_STAGE: \${{ needs.prepare.outputs.stage }}
1875
- steps:
1876
- - name: Check out immutable deployment source
1877
- uses: ${actionPins.checkout}
1878
- env:
1879
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1880
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1881
- with:
1882
- fetch-depth: 0
1883
- persist-credentials: false
1884
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1885
- - uses: ${actionPins.pnpmSetup}
1886
- env:
1887
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1888
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1889
- - uses: ${actionPins.setupNode}
1890
- env:
1891
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1892
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1893
- with:
1894
- node-version: ${toolVersions.node}
1895
- cache: pnpm
1896
- - env:
1897
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1898
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1899
- run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
1900
- - name: Verify managed workspace integrity before AWS authority
1901
- env:
1902
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1903
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1904
- run: pnpm nx run ${name}:workspace-health
1905
- - name: Require the exact pending rehearsal seeds
1906
- env:
1907
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1908
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1909
- run: |
1910
- set -euo pipefail
1911
- for seed in router-waf-live-evidence router-waf-blocking-rehearsal; do
1912
- [ "$(jq -r '.status // empty' "packages/foundation/security/$seed.json")" = pending ] || {
1913
- echo "packages/foundation/security/$seed.json must be reset to its pending seed before another rehearsal"; exit 1;
1914
- }
1915
- done
1916
- - name: Revalidate exact protected branch tip before OIDC
1917
- env:
1918
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1919
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1920
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
1921
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
1922
- GH_REPO: \${{ github.repository }}
1923
- GH_TOKEN: \${{ github.token }}
1924
- run: |
1925
- set -euo pipefail
1926
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ] || {
1927
- echo 'Deployment checkout differs from the exact protected source'; exit 1;
1928
- }
1929
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
1930
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
1931
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
1932
- }
1933
- - name: Assume the one stage deployment role
1934
- uses: ${actionPins.configureAwsCredentials}
1935
- with:
1936
- audience: \${{ needs.prepare.outputs.oidc_audience }}
1937
- aws-region: \${{ vars.AWS_REGION }}
1938
- role-session-name: ebk-rehearse-\${{ github.run_id }}-\${{ github.run_attempt }}
1939
- role-to-assume: \${{ env.AWS_DEPLOY_ROLE_ARN }}
1940
- - name: Verify exact stage authority
1941
- run: |
1942
- set -euo pipefail
1943
- [ "$AWS_EXPECTED_ACCOUNT_ID" = "$EBK_POLICY_ACCOUNT_ID" ]
1944
- [ "$AWS_REGION" = "$EBK_POLICY_REGION" ]
1945
- ${indentedScript(exactStageDeployerGuardScript('Router WAF rehearsal', '$EBK_POLICY_ACCOUNT_ID'), 10)}
1946
- - name: Rehearse Router WAF blocking with runner-seeded probes
1947
- id: rehearsal
1948
- env:
1949
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1950
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1951
- EBK_GITHUB_JOB_WORKFLOW_REF: \${{ job.workflow_ref }}
1952
- GITHUB_TOKEN: \${{ github.token }}
1953
- run: |
1954
- set -euo pipefail
1955
- test -n "$AWS_DEPLOY_ROLE_ARN" || { echo 'Stage deployment role is absent'; exit 1; }
1956
- pnpm nx run foundation:router-waf-rehearsal -- \\
1957
- --probeUrl="$EBK_PROBE_URL" \\
1958
- --seedProbes=true
1959
- - name: Prove temporary smoke admission removed
1960
- if: always() && steps.rehearsal.outcome != 'skipped'
1961
- env:
1962
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1963
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1964
- EBK_GITHUB_JOB_WORKFLOW_REF: \${{ job.workflow_ref }}
1965
- GITHUB_TOKEN: \${{ github.token }}
1966
- run: |
1967
- set -euo pipefail
1968
- ${indentedScript(exactStageDeployerGuardScript('Smoke access cleanup', '$EBK_POLICY_ACCOUNT_ID'), 10)}
1969
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ]
1970
- node --input-type=module <<'NODE'
1971
- import { cleanupGithubPrivateSmoke } from '@empire-builder-kit/nx/foundation';
1972
- await cleanupGithubPrivateSmoke({
1973
- account: process.env.EBK_POLICY_ACCOUNT_ID,
1974
- deploymentProfile: process.env.EBK_DEPLOYMENT_PROFILE,
1975
- root: process.cwd(),
1976
- source: process.env.EBK_SOURCE_COMMIT,
1977
- stage: process.env.EBK_STAGE,
1978
- workspace: '${name}',
1979
- });
1980
- NODE
1981
- - name: Retain the sealed rehearsal evidence
1982
- uses: ${actionPins.uploadArtifact}
1983
- with:
1984
- if-no-files-found: error
1985
- name: router-waf-rehearsal-\${{ github.run_id }}-\${{ github.run_attempt }}
1986
- path: |
1987
- packages/foundation/security/router-waf-live-evidence.json
1988
- packages/foundation/security/router-waf-blocking-rehearsal.json
1989
- retention-days: 90
1990
- - name: Open the rehearsal receipt pull request
1991
- env:
1992
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
1993
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
1994
- EBK_RUN_ATTEMPT: \${{ github.run_attempt }}
1995
- EBK_RUN_ID: \${{ github.run_id }}
1996
- GH_REPO: \${{ github.repository }}
1997
- GH_TOKEN: \${{ github.token }}
1998
- run: |
1999
- set -euo pipefail
2000
- case "$EBK_RUN_ID:$EBK_RUN_ATTEMPT" in *[!0-9:]*|:*|*:) exit 1 ;; esac
2001
- branch="ebk/router-waf-rehearsal-$EBK_RUN_ID-$EBK_RUN_ATTEMPT"
2002
- git diff --quiet -- packages/foundation/security && { echo 'The rehearsal sealed nothing new'; exit 1; }
2003
- git config user.name 'ebk-router-waf-rehearsal[bot]'
2004
- git config user.email 'ebk-router-waf-rehearsal[bot]@users.noreply.github.com'
2005
- git checkout -q -b "$branch"
2006
- git add packages/foundation/security/router-waf-live-evidence.json packages/foundation/security/router-waf-blocking-rehearsal.json
2007
- git commit -q -m "chore(security): seal the staging Router WAF blocking rehearsal (run $EBK_RUN_ID)"
2008
- # git over HTTPS authenticates with basic x-access-token, the same
2009
- # header actions/checkout persists; a bearer header makes git fall
2010
- # back to a username prompt (EBK-INT-2026-085).
2011
- authorization="$(printf 'x-access-token:%s' "$GH_TOKEN" | base64 | tr -d '\\n')"
2012
- git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic $authorization" push -q origin "HEAD:refs/heads/$branch"
2013
- gh pr create \\
2014
- --head "$branch" \\
2015
- --base develop \\
2016
- --title 'chore(security): seal the staging Router WAF blocking rehearsal' \\
2017
- --body "Managed rehearsal run $EBK_RUN_ID attempt $EBK_RUN_ATTEMPT sealed the staging Router WAF blocking rehearsal for the committed policy digest. Merge to unblock the production Router WAF gate; the receipt binds the exact account, Region, and policy digest."
2018
- `;
2019
- }
2020
- /**
2021
- * Trunk promotion: after a successful staging lifecycle on develop, the same
2022
- * run binds its own staging receipt, promotes the reviewed OCI indexes into
2023
- * production, deploys production, and fast-forwards main to the deployed
2024
- * commit. Every job carries the production environment so environment
2025
- * reviewers can still gate it, and every step reuses the promotion-pr scripts.
2026
- */
2027
- function renderTrunkPromotionJobs(options) {
2028
- const { actionPins, name, toolVersions } = options;
2029
- const checkoutAndInstall = (integrityStep) => ` - name: Check out immutable deployment source
2030
- uses: ${actionPins.checkout}
2031
- env:
2032
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2033
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2034
- with:
2035
- fetch-depth: 0
2036
- persist-credentials: false
2037
- ref: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
2038
- - uses: ${actionPins.pnpmSetup}
2039
- env:
2040
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2041
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2042
- - uses: ${actionPins.setupNode}
2043
- env:
2044
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2045
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2046
- with:
2047
- node-version: ${toolVersions.node}
2048
- cache: pnpm
2049
- - env:
2050
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2051
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2052
- run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
2053
- - name: ${integrityStep}
2054
- env:
2055
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2056
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2057
- run: pnpm nx run ${name}:workspace-health`;
2058
- const revalidateTip = ` - name: Revalidate exact protected branch tip before OIDC
2059
- env:
2060
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2061
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2062
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
2063
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
2064
- GH_REPO: \${{ github.repository }}
2065
- GH_TOKEN: \${{ github.token }}
2066
- run: |
2067
- set -euo pipefail
2068
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ] || {
2069
- echo 'Deployment checkout differs from the exact protected source'; exit 1;
2070
- }
2071
- branch_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/$EBK_SOURCE_BRANCH" --jq '.object.sha')"
2072
- [ "$branch_tip" = "$EBK_SOURCE_COMMIT" ] || {
2073
- echo 'Deployment source is no longer the exact protected branch tip'; exit 1;
2074
- }`;
2075
- const trunkPromotionGate = ` needs.prepare.outputs.action == 'deploy' &&
2076
- needs.prepare.outputs.stage == 'staging' &&
2077
- needs.prepare.outputs.profile != 'starter' &&
2078
- needs.prepare.outputs.has_slices == 'true'`;
2079
- return `
2080
- promote-production:
2081
- name: promote the staging-tested candidate to production
2082
- needs: [prepare, immutable-artifacts, container-assemble, execute]
2083
- if: >-
2084
- always() &&
2085
- needs.prepare.result == 'success' &&
2086
- needs.immutable-artifacts.result == 'success' &&
2087
- (needs.prepare.outputs.has_containers != 'true' || needs.container-assemble.result == 'success') &&
2088
- needs.execute.result == 'success' &&
2089
- ${trunkPromotionGate}
2090
- runs-on: ubuntu-latest
2091
- environment: production
2092
- permissions:
2093
- actions: read
2094
- contents: read
2095
- id-token: write
2096
- outputs:
2097
- artifact_digest: \${{ steps.retain.outputs.artifact-digest }}
2098
- artifact_id: \${{ steps.retain.outputs.artifact-id }}
2099
- candidate_artifact_digest: \${{ steps.staging.outputs.artifact_digest }}
2100
- candidate_artifact_id: \${{ steps.staging.outputs.artifact_id }}
2101
- candidate_material_digest: \${{ steps.staging.outputs.candidate_material_digest }}
2102
- candidate_producer_run_attempt: \${{ steps.staging.outputs.producer_run_attempt }}
2103
- candidate_producer_run_id: \${{ steps.staging.outputs.producer_run_id }}
2104
- env:
2105
- AWS_DEPLOY_ROLE_ARN: \${{ needs.prepare.outputs.production_deploy_role_arn }}
2106
- AWS_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_EXPECTED_ACCOUNT_ID }}
2107
- AWS_PARTITION: \${{ needs.prepare.outputs.partition }}
2108
- AWS_REGION: \${{ vars.AWS_REGION }}
2109
- EBK_ACTION: deploy
2110
- EBK_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
2111
- EBK_POLICY_PRODUCTION_ACCOUNT_ID: \${{ needs.prepare.outputs.production_account_id }}
2112
- EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
2113
- EBK_POLICY_STAGING_ACCOUNT_ID: \${{ needs.prepare.outputs.staging_account_id }}
2114
- EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit }}
2115
- EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
2116
- EBK_STAGE: production
2117
- EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.slice_projects }}
2118
- EBK_CONTAINER_PROJECTS: \${{ needs.prepare.outputs.container_projects }}
2119
- steps:
2120
- ${checkoutAndInstall('Verify managed workspace integrity before container authority')}
2121
- - id: staging-receipt
2122
- name: Select this run's staging deployment receipt
2123
- env:
2124
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2125
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2126
- EBK_DEPLOYMENT_RUN_ATTEMPT: \${{ github.run_attempt }}
2127
- EBK_DEPLOYMENT_RUN_ID: \${{ github.run_id }}
2128
- GH_REPO: \${{ github.repository }}
2129
- GH_TOKEN: \${{ github.token }}
2130
- run: |
2131
- set -euo pipefail
2132
- case "$EBK_DEPLOYMENT_RUN_ID:$EBK_DEPLOYMENT_RUN_ATTEMPT" in *[!0-9:]*|:*|*:) exit 1 ;; esac
2133
- artifacts="$(gh api "/repos/$GH_REPO/actions/runs/$EBK_DEPLOYMENT_RUN_ID/artifacts?per_page=100")"
2134
- receipt_name="deployment-receipt-staging-$EBK_DEPLOYMENT_RUN_ID-$EBK_DEPLOYMENT_RUN_ATTEMPT"
2135
- receipt="$(printf '%s' "$artifacts" | jq -c --arg name "$receipt_name" \\
2136
- '[.artifacts[] | select(.name == $name and .expired == false)] | if length == 1 then .[0] else empty end')"
2137
- [ -n "$receipt" ] || { echo 'This run retained no exact staging deployment receipt'; exit 1; }
2138
- artifact_id="$(printf '%s' "$receipt" | jq -r '.id // empty')"
2139
- artifact_digest="$(printf '%s' "$receipt" | jq -r '.digest // empty')"
2140
- case "$artifact_id" in ''|*[!0-9]*) exit 1 ;; esac
2141
- case "$artifact_digest" in sha256:????????????????????????????????????????????????????????????????) ;; *) exit 1 ;; esac
2142
- echo "artifact_digest=$artifact_digest" >> "$GITHUB_OUTPUT"
2143
- echo "artifact_id=$artifact_id" >> "$GITHUB_OUTPUT"
2144
- - name: Restore this run's staging deployment receipt
2145
- uses: ${actionPins.downloadArtifact}
2146
- env:
2147
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2148
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2149
- with:
2150
- artifact-ids: \${{ steps.staging-receipt.outputs.artifact_id }}
2151
- github-token: \${{ github.token }}
2152
- path: \${{ runner.temp }}/staging-deployment-receipt
2153
- - id: staging
2154
- name: Bind exact staging deployment and release evidence
2155
- env:
2156
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2157
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2158
- EBK_STAGING_DEPLOYMENT_RUN_ATTEMPT: \${{ github.run_attempt }}
2159
- EBK_STAGING_DEPLOYMENT_RUN_ID: \${{ github.run_id }}
2160
- EBK_EXPECTED_HAS_SLICES: \${{ needs.prepare.outputs.has_slices }}
2161
- EBK_EXPECTED_HAS_CONTAINERS: \${{ needs.prepare.outputs.has_containers }}
2162
- EBK_EXPECTED_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
2163
- EBK_EXPECTED_DEPLOYMENT_REGION: \${{ needs.prepare.outputs.region }}
2164
- EBK_EXPECTED_STAGING_ACCOUNT_ID: \${{ needs.prepare.outputs.staging_account_id }}
2165
- EBK_STAGING_RECEIPT_ARTIFACT_DIGEST: \${{ steps.staging-receipt.outputs.artifact_digest }}
2166
- EBK_STAGING_RECEIPT_ARTIFACT_ID: \${{ steps.staging-receipt.outputs.artifact_id }}
2167
- # The receipt artifact keeps .ebk/evidence as its root (EBK-INT-2026-074).
2168
- EBK_STAGING_RECEIPT_ROOT: \${{ runner.temp }}/staging-deployment-receipt/deployment
2169
- EBK_STAGING_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
2170
- GH_REPO: \${{ github.repository }}
2171
- GH_TOKEN: \${{ github.token }}
2172
- run: |
2173
- node --input-type=module <<'NODE'
2174
- ${indentedScript(stagingPromotionReceiptValidationScript(), 10)}
2175
- NODE
2176
- promotion="$EBK_STAGING_RECEIPT_ROOT/promotion.json"
2177
- candidate_run_id="$(jq -r '.candidate.producerRunId' "$promotion")"
2178
- candidate_run_attempt="$(jq -r '.candidate.producerRunAttempt' "$promotion")"
2179
- candidate_artifact_id="$(jq -r '.candidate.artifactId' "$promotion")"
2180
- candidate_artifact_digest="$(jq -r '.candidate.artifactDigest' "$promotion")"
2181
- candidate_run="$(gh api "/repos/$GH_REPO/actions/runs/$candidate_run_id")"
2182
- printf '%s' "$candidate_run" | jq -e \\
2183
- --arg source "$EBK_STAGING_SOURCE_COMMIT" \\
2184
- --arg attempt "$candidate_run_attempt" \\
2185
- '.head_sha == $source and .head_branch == "develop" and .event == "push" and .path == ".github/workflows/ci.yml" and .conclusion == "success" and (.run_attempt | tostring) == $attempt' >/dev/null
2186
- candidate_artifacts="$(gh api "/repos/$GH_REPO/actions/runs/$candidate_run_id/artifacts?per_page=100")"
2187
- printf '%s' "$candidate_artifacts" | jq -e \\
2188
- --arg id "$candidate_artifact_id" \\
2189
- --arg digest "$candidate_artifact_digest" \\
2190
- --arg name "release-candidate-$EBK_STAGING_SOURCE_COMMIT" \\
2191
- '[.artifacts[] | select((.id | tostring) == $id and .name == $name and .digest == $digest and .expired == false)] | length == 1' >/dev/null
2192
- - name: Restore exact immutable release candidate for promotion
2193
- uses: ${actionPins.downloadArtifact}
2194
- env:
2195
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2196
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2197
- with:
2198
- artifact-ids: \${{ steps.staging.outputs.artifact_id }}
2199
- github-token: \${{ github.token }}
2200
- path: .ebk/evidence/release-candidate
2201
- run-id: \${{ steps.staging.outputs.producer_run_id }}
2202
- - name: Restore this run's staging container bundle
2203
- if: needs.prepare.outputs.has_containers == 'true'
2204
- uses: ${actionPins.downloadArtifact}
2205
- env:
2206
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2207
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2208
- with:
2209
- artifact-ids: \${{ steps.staging.outputs.container_artifact_id }}
2210
- github-token: \${{ github.token }}
2211
- path: .ebk/evidence/container-release
2212
- ${revalidateTip}
2213
- - name: Assume exact staging registry pull role
2214
- if: needs.prepare.outputs.has_containers == 'true'
2215
- uses: ${actionPins.configureAwsCredentials}
2216
- with:
2217
- audience: \${{ needs.prepare.outputs.oidc_audience }}
2218
- aws-region: \${{ vars.AWS_STAGING_PROMOTION_REGION }}
2219
- role-session-name: ebk-staging-container-pull-\${{ github.run_id }}-\${{ github.run_attempt }}
2220
- role-to-assume: \${{ secrets.AWS_STAGING_PROMOTION_PULL_ROLE_ARN }}
2221
- - name: Authenticate exact staging source registry
2222
- if: needs.prepare.outputs.has_containers == 'true'
2223
- env:
2224
- AWS_STAGING_PROMOTION_PULL_ROLE_ARN: \${{ secrets.AWS_STAGING_PROMOTION_PULL_ROLE_ARN }}
2225
- EBK_STAGING_ACCOUNT_ID: \${{ vars.AWS_STAGING_PROMOTION_EXPECTED_ACCOUNT_ID }}
2226
- EBK_STAGING_REGION: \${{ vars.AWS_STAGING_PROMOTION_REGION }}
2227
- run: |
2228
- set -euo pipefail
2229
- [ "$EBK_STAGING_ACCOUNT_ID" = "$EBK_POLICY_STAGING_ACCOUNT_ID" ]
2230
- [ "$EBK_STAGING_REGION" = "$EBK_POLICY_REGION" ]
2231
- ${indentedScript(exactStagingPromotionPullGuardScript(), 10)}
2232
- [ "$EBK_STAGING_ACCOUNT_ID" != "$AWS_EXPECTED_ACCOUNT_ID" ]
2233
- registry_suffix=.com
2234
- case "$EBK_STAGING_REGION" in cn-*) registry_suffix=.com.cn ;; esac
2235
- aws ecr get-login-password --region "$EBK_STAGING_REGION" |
2236
- docker login --username AWS --password-stdin \\
2237
- "$EBK_STAGING_ACCOUNT_ID.dkr.ecr.$EBK_STAGING_REGION.amazonaws$registry_suffix"
2238
- ${revalidateTip}
2239
- - name: Assume the production deployment role for container promotion
2240
- if: needs.prepare.outputs.has_containers == 'true'
2241
- uses: ${actionPins.configureAwsCredentials}
2242
- with:
2243
- audience: \${{ needs.prepare.outputs.oidc_audience }}
2244
- aws-region: \${{ vars.AWS_REGION }}
2245
- role-session-name: ebk-production-container-push-\${{ github.run_id }}-\${{ github.run_attempt }}
2246
- role-to-assume: \${{ env.AWS_DEPLOY_ROLE_ARN }}
2247
- - name: Promote exact staging indexes without rebuilding
2248
- if: needs.prepare.outputs.has_containers == 'true'
2249
- env:
2250
- EBK_STAGING_PROMOTION_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_STAGING_PROMOTION_EXPECTED_ACCOUNT_ID }}
2251
- EBK_STAGING_PROMOTION_REGION: \${{ vars.AWS_STAGING_PROMOTION_REGION }}
2252
- run: |
2253
- set -euo pipefail
2254
- [ "$AWS_EXPECTED_ACCOUNT_ID" = "$EBK_POLICY_PRODUCTION_ACCOUNT_ID" ]
2255
- [ "$AWS_REGION" = "$EBK_POLICY_REGION" ]
2256
- ${indentedScript(exactStageDeployerGuardScript('Container promotion', '$AWS_EXPECTED_ACCOUNT_ID'), 10)}
2257
- IFS=',' read -r -a projects <<< "$EBK_CONTAINER_PROJECTS"
2258
- for project in "\${projects[@]}"; do
2259
- test -n "$project" || continue
2260
- # Repository-relative for the container release tool (EBK-INT-2026-077).
2261
- export EBK_CONTAINER_PROMOTION_SOURCE_BINDING_PATH=".ebk/evidence/container-release/staging/packages/$project/binding.json"
2262
- export EBK_CONTAINER_PROMOTION_SOURCE_SIDECAR_PATH=".ebk/evidence/container-release/staging/packages/$project/release-bound-binding.json"
2263
- pnpm nx run "$project:container-release-promote"
2264
- done
2265
- - id: retain
2266
- name: Retain production target container binding
2267
- if: needs.prepare.outputs.has_containers == 'true'
2268
- uses: ${actionPins.uploadArtifact}
2269
- with:
2270
- name: container-release-production-\${{ github.run_id }}-\${{ github.run_attempt }}
2271
- if-no-files-found: error
2272
- include-hidden-files: true
2273
- retention-days: 90
2274
- path: .ebk/evidence/container-release
2275
-
2276
- execute-production:
2277
- name: native deploy production
2278
- needs: [prepare, immutable-artifacts, promote-production]
2279
- if: >-
2280
- always() &&
2281
- needs.prepare.result == 'success' &&
2282
- needs.immutable-artifacts.result == 'success' &&
2283
- needs.promote-production.result == 'success' &&
2284
- ${trunkPromotionGate}
2285
- runs-on: ubuntu-latest
2286
- environment: production
2287
- permissions:
2288
- actions: read
2289
- contents: read
2290
- id-token: write
2291
- env:
2292
- AWS_DEPLOY_ROLE_ARN: \${{ needs.prepare.outputs.production_deploy_role_arn }}
2293
- AWS_EXPECTED_ACCOUNT_ID: \${{ vars.AWS_EXPECTED_ACCOUNT_ID }}
2294
- AWS_PARTITION: \${{ needs.prepare.outputs.partition }}
2295
- AWS_REGION: \${{ vars.AWS_REGION }}
2296
- EBK_ACTION: deploy
2297
- EBK_ALLOW_PRODUCTION_REMOVE: \${{ vars.EBK_ALLOW_PRODUCTION_REMOVE }}
2298
- EBK_CANDIDATE_ARTIFACT_DIGEST: \${{ needs.promote-production.outputs.candidate_artifact_digest }}
2299
- EBK_CANDIDATE_ARTIFACT_ID: \${{ needs.promote-production.outputs.candidate_artifact_id }}
2300
- EBK_CANDIDATE_MATERIAL_DIGEST: \${{ needs.promote-production.outputs.candidate_material_digest }}
2301
- EBK_CANDIDATE_PRODUCER_RUN_ATTEMPT: \${{ needs.promote-production.outputs.candidate_producer_run_attempt }}
2302
- EBK_CANDIDATE_PRODUCER_RUN_ID: \${{ needs.promote-production.outputs.candidate_producer_run_id }}
2303
- EBK_DEPLOYMENT_PROFILE: \${{ needs.prepare.outputs.profile }}
2304
- EBK_ORDERED_PROJECTS: \${{ needs.prepare.outputs.ordered_projects }}
2305
- EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.production_account_id }}
2306
- EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
2307
- EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit || inputs.source_commit || github.sha }}
2308
- EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.slice_projects }}
2309
- EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
2310
- EBK_STAGE: production
2311
- # Production has no same-branch baseline receipt in this run; the
2312
- # full lifecycle keeps its evidence complete.
2313
- EBK_LIFECYCLE_SCOPE: full
2314
- EBK_BASELINE_FOUND: 'false'
2315
- EBK_BASELINE_RUN_ID: ''
2316
- steps:
2317
- ${checkoutAndInstall('Verify managed workspace integrity before AWS authority')}
2318
- - name: Restore exact immutable release candidate
2319
- uses: ${actionPins.downloadArtifact}
2320
- env:
2321
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2322
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2323
- with:
2324
- artifact-ids: \${{ needs.promote-production.outputs.candidate_artifact_id }}
2325
- github-token: \${{ github.token }}
2326
- path: .ebk/evidence/release-candidate
2327
- run-id: \${{ needs.promote-production.outputs.candidate_producer_run_id }}
2328
- - name: Restore exact promoted production container binding
2329
- if: needs.prepare.outputs.has_containers == 'true'
2330
- uses: ${actionPins.downloadArtifact}
2331
- env:
2332
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2333
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2334
- with:
2335
- name: container-release-production-\${{ github.run_id }}-\${{ github.run_attempt }}
2336
- path: .ebk/evidence/container-release
2337
- - name: Verify exact predeploy container binding inventory
2338
- if: needs.prepare.outputs.has_containers == 'true'
2339
- env:
2340
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2341
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2342
- EBK_CONTAINER_PROJECTS: \${{ needs.prepare.outputs.container_projects }}
2343
- run: |
2344
- set -euo pipefail
2345
- IFS=',' read -r -a projects <<< "$EBK_CONTAINER_PROJECTS"
2346
- for project in "\${projects[@]}"; do
2347
- test -n "$project" || continue
2348
- test -f ".ebk/evidence/container-release/$EBK_STAGE/packages/$project/binding.json" || {
2349
- echo "Exact predeploy container binding is absent for $project"
2350
- exit 1
2351
- }
2352
- done
2353
- - name: Verify exact restored staging-tested release candidate
2354
- env:
2355
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2356
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2357
- run: |
2358
- node --input-type=module <<'NODE'
2359
- ${indentedScript(restoredCandidateValidationScript(), 10)}
2360
- NODE
2361
- - name: Authorize deployed Blueprint trust before protected mutation
2362
- env:
2363
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2364
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2365
- EBK_PROTECTED_BLUEPRINT_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
2366
- run: |
2367
- set -euo pipefail
2368
- case "$EBK_PROTECTED_BLUEPRINT_COMMIT" in
2369
- ''|*[!0-9a-f]*) echo 'Protected Blueprint authority must be one full lowercase Git object ID'; exit 1 ;;
2370
- esac
2371
- test "\${#EBK_PROTECTED_BLUEPRINT_COMMIT}" -eq 40 ||
2372
- test "\${#EBK_PROTECTED_BLUEPRINT_COMMIT}" -eq 64 ||
2373
- { echo 'Protected Blueprint authority must be one full Git object ID'; exit 1; }
2374
- test "$(git rev-parse HEAD)" = "$EBK_PROTECTED_BLUEPRINT_COMMIT" ||
2375
- { echo 'Protected Blueprint authority differs from the exact workflow checkout'; exit 1; }
2376
- node tools/blueprint-trust-check.mjs \\
2377
- --operation=deploy \\
2378
- --protected-branch=main \\
2379
- --protected-ref="$EBK_PROTECTED_BLUEPRINT_COMMIT" \\
2380
- --output=.ebk/evidence/supply-chain/blueprint-trust.json
2381
- - name: Produce subject-bound protected scanner evidence
2382
- env:
2383
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2384
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2385
- run: pnpm nx run ${name}:supply-chain-scan
2386
- - name: Enforce protected supply-chain policy before mutation
2387
- env:
2388
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2389
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2390
- run: pnpm nx run ${name}:supply-chain-check-protected
2391
- - name: Install pinned Playwright Chromium for deployed smoke proofs
2392
- env:
2393
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2394
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2395
- run: |
2396
- ${indentedScript(protectedBrowserInstallScript(), 10)}
2397
- ${machineCredentialRequestStep()}
2398
- ${revalidateTip}
2399
- - name: Assume the one stage deployment role
2400
- uses: ${actionPins.configureAwsCredentials}
2401
- with:
2402
- audience: \${{ needs.prepare.outputs.oidc_audience }}
2403
- aws-region: \${{ vars.AWS_REGION }}
2404
- role-session-name: ebk-native-\${{ github.run_id }}-\${{ github.run_attempt }}
2405
- role-to-assume: \${{ env.AWS_DEPLOY_ROLE_ARN }}
2406
- - name: Verify exact stage authority
2407
- run: |
2408
- set -euo pipefail
2409
- [ "$AWS_EXPECTED_ACCOUNT_ID" = "$EBK_POLICY_ACCOUNT_ID" ]
2410
- [ "$AWS_REGION" = "$EBK_POLICY_REGION" ]
2411
- ${indentedScript(exactStageDeployerGuardScript('Native lifecycle', '$EBK_POLICY_ACCOUNT_ID'), 10)}
2412
- - name: Run ordered native lifecycle targets
2413
- id: native-lifecycle
2414
- env:
2415
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2416
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2417
- EBK_GITHUB_JOB_WORKFLOW_REF: \${{ job.workflow_ref }}
2418
- GITHUB_TOKEN: \${{ github.token }}
2419
- run: |
2420
- set -euo pipefail
2421
- test -n "$AWS_DEPLOY_ROLE_ARN" || { echo 'Stage deployment role is absent'; exit 1; }
2422
- pnpm nx run ${name}:deploy-local -- \\
2423
- --stage="$EBK_STAGE" \\
2424
- --expectedRoleArn="$AWS_DEPLOY_ROLE_ARN" \\
2425
- --lifecycleScope="$EBK_LIFECYCLE_SCOPE"
2426
- - name: Prove temporary smoke admission removed
2427
- if: always() && steps.native-lifecycle.outcome != 'skipped'
2428
- env:
2429
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2430
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2431
- EBK_GITHUB_JOB_WORKFLOW_REF: \${{ job.workflow_ref }}
2432
- GITHUB_TOKEN: \${{ github.token }}
2433
- run: |
2434
- set -euo pipefail
2435
- ${indentedScript(exactStageDeployerGuardScript('Smoke access cleanup', '$EBK_POLICY_ACCOUNT_ID'), 10)}
2436
- [ "$(git rev-parse HEAD)" = "$EBK_SOURCE_COMMIT" ]
2437
- git diff --quiet HEAD
2438
- node --input-type=module <<'NODE'
2439
- import { cleanupGithubPrivateSmoke } from '@empire-builder-kit/nx/foundation';
2440
- await cleanupGithubPrivateSmoke({
2441
- account: process.env.EBK_POLICY_ACCOUNT_ID,
2442
- deploymentProfile: process.env.EBK_DEPLOYMENT_PROFILE,
2443
- root: process.cwd(),
2444
- source: process.env.EBK_SOURCE_COMMIT,
2445
- stage: process.env.EBK_STAGE,
2446
- workspace: '${name}',
2447
- });
2448
- NODE
2449
- - name: Seal exact postdeploy supply-chain binding
2450
- env:
2451
- ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
2452
- ACTIONS_ID_TOKEN_REQUEST_URL: ''
2453
- run: |
2454
- node --input-type=module <<'NODE'
2455
- ${indentedScript(postdeploySupplyChainBindingScript(), 10)}
2456
- NODE
2457
- - name: Retain bounded deployment receipt
2458
- if: always()
2459
- uses: ${actionPins.uploadArtifact}
2460
- with:
2461
- if-no-files-found: warn
2462
- name: deployment-receipt-production-\${{ github.run_id }}-\${{ github.run_attempt }}
2463
- path: |
2464
- .ebk/evidence/deployment/latest.json
2465
- .ebk/evidence/deployment/postdeploy-supply-chain.json
2466
- .ebk/evidence/deployment/promotion.json
2467
- .ebk/evidence/container-release/**
2468
- retention-days: 30
2469
-
2470
- record-main:
2471
- name: record the deployed commit on main
2472
- needs: [prepare, execute-production]
2473
- if: >-
2474
- always() &&
2475
- needs.prepare.result == 'success' &&
2476
- needs.execute-production.result == 'success' &&
2477
- ${trunkPromotionGate}
2478
- runs-on: ubuntu-latest
2479
- environment: production
2480
- # The fast-forward uses the scoped environment token, not the workflow token.
2481
- permissions:
2482
- contents: read
2483
- steps:
2484
- - name: Fast-forward protected main to the deployed commit
2485
- env:
2486
- EBK_RECORD_MAIN_TOKEN: \${{ secrets.${exports.EBK_RECORD_MAIN_TOKEN_SECRET} }}
2487
- EBK_SOURCE_BRANCH: \${{ env.EBK_DEPLOYMENT_SOURCE_BRANCH }}
2488
- EBK_SOURCE_COMMIT: \${{ env.EBK_DEPLOYMENT_SOURCE_COMMIT }}
2489
- GH_REPO: \${{ github.repository }}
2490
- run: |
2491
- set -euo pipefail
2492
- test -n "$EBK_RECORD_MAIN_TOKEN" || { echo '${exports.EBK_RECORD_MAIN_TOKEN_SECRET} is absent from the production environment'; exit 1; }
2493
- [ "$EBK_SOURCE_BRANCH" = develop ] || { echo 'Trunk promotion records main only from develop'; exit 1; }
2494
- case "$EBK_SOURCE_COMMIT" in ''|*[!0-9a-f]*) exit 1 ;; esac
2495
- export GH_TOKEN="$EBK_RECORD_MAIN_TOKEN"
2496
- develop_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/develop" --jq '.object.sha')"
2497
- [ "$develop_tip" = "$EBK_SOURCE_COMMIT" ] || { echo 'Deployed commit is no longer the develop tip; leaving main unchanged'; exit 1; }
2498
- main_tip="$(gh api "/repos/$GH_REPO/git/ref/heads/main" --jq '.object.sha')"
2499
- if [ "$main_tip" = "$EBK_SOURCE_COMMIT" ]; then
2500
- echo 'main already records the deployed commit'
2501
- exit 0
2502
- fi
2503
- # GitHub refuses a non-fast-forward reference update unless force is
2504
- # requested; it is never requested here.
2505
- gh api -X PATCH "/repos/$GH_REPO/git/refs/heads/main" -f sha="$EBK_SOURCE_COMMIT" -F force=false >/dev/null
2506
- recorded="$(gh api "/repos/$GH_REPO/git/ref/heads/main" --jq '.object.sha')"
2507
- [ "$recorded" = "$EBK_SOURCE_COMMIT" ] || { echo 'main did not record the deployed commit'; exit 1; }
2508
- echo "main now records $EBK_SOURCE_COMMIT (previously $main_tip)"
2509
- `;
2510
- }
2511
- function renderThinDeployWorkflowFilePlan(options) {
2512
- assertOptions(options);
2513
- return {
2514
- files: {
2515
- [exports.THIN_DEPLOY_WORKFLOW_PATH]: renderThinDeployWorkflow(options),
2516
- },
2517
- managedPaths: [exports.THIN_DEPLOY_WORKFLOW_PATH],
2518
- };
2519
- }
2520
- //# sourceMappingURL=workspace-files-thin-deploy.js.map