@empire-builder-kit/nx 1.0.0-rc.47 → 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 (764) hide show
  1. package/README.md +14 -169
  2. package/executors.json +24 -79
  3. package/generators.json +8 -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 -272
  29. package/src/aws-authority/stage-authority.js +109 -3609
  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 +3 -68
  42. package/src/executors/dev-doctor/dev-doctor.js +2 -2
  43. package/src/executors/local-deploy/deployed-smoke.d.ts +12 -0
  44. package/src/executors/local-deploy/deployed-smoke.js +115 -0
  45. package/src/executors/local-deploy/deployment-authority.d.ts +24 -0
  46. package/src/executors/local-deploy/deployment-authority.js +81 -0
  47. package/src/executors/local-deploy/deployment-child.d.ts +18 -0
  48. package/src/executors/local-deploy/deployment-child.js +77 -0
  49. package/src/executors/local-deploy/deployment-contracts.d.ts +96 -0
  50. package/src/executors/local-deploy/deployment-contracts.js +3 -0
  51. package/src/executors/local-deploy/deployment-projects.d.ts +4 -0
  52. package/src/executors/local-deploy/deployment-projects.js +16 -0
  53. package/src/executors/local-deploy/deployment-receipt.d.ts +4 -0
  54. package/src/executors/local-deploy/deployment-receipt.js +55 -0
  55. package/src/executors/local-deploy/deployment-scope.d.ts +17 -0
  56. package/src/executors/local-deploy/deployment-scope.js +239 -0
  57. package/src/executors/local-deploy/deployment-source.d.ts +13 -0
  58. package/src/executors/local-deploy/deployment-source.js +86 -0
  59. package/src/executors/local-deploy/local-deploy.d.ts +5 -121
  60. package/src/executors/local-deploy/local-deploy.js +55 -936
  61. package/src/executors/sst-lifecycle/governed-child-process.d.ts +27 -0
  62. package/src/executors/sst-lifecycle/governed-child-process.js +277 -0
  63. package/src/executors/sst-lifecycle/governed-native-operation.js +4 -10
  64. package/src/executors/sst-lifecycle/run-sst-command.d.ts +4 -85
  65. package/src/executors/sst-lifecycle/run-sst-command.js +28 -834
  66. package/src/executors/sst-lifecycle/sst-contracts.d.ts +44 -0
  67. package/src/executors/sst-lifecycle/sst-contracts.js +3 -0
  68. package/src/executors/sst-lifecycle/sst-invocation.d.ts +17 -0
  69. package/src/executors/sst-lifecycle/sst-invocation.js +502 -0
  70. package/src/executors/sst-lifecycle/task-unlock.js +3 -3
  71. package/src/foundation/discovery.d.ts +1 -5
  72. package/src/foundation/discovery.js +0 -2
  73. package/src/foundation/index.d.ts +0 -2
  74. package/src/foundation/index.js +0 -9
  75. package/src/foundation/local-private-smoke-access.d.ts +6 -15
  76. package/src/foundation/local-private-smoke-access.js +8 -192
  77. package/src/foundation/observability.d.ts +16 -26
  78. package/src/foundation/observability.js +34 -135
  79. package/src/foundation/preflight.js +0 -14
  80. package/src/foundation/private-smoke-access.d.ts +7 -14
  81. package/src/foundation/private-smoke-access.js +4 -126
  82. package/src/foundation/root-site-workspace.d.ts +35 -0
  83. package/src/foundation/root-site-workspace.js +80 -0
  84. package/src/foundation/root-site.d.ts +8 -7
  85. package/src/foundation/root-site.js +17 -9
  86. package/src/generators/formatting.js +5 -4
  87. package/src/generators/function/function.d.ts +9 -5
  88. package/src/generators/function/function.js +106 -136
  89. package/src/generators/function/schema.json +2 -2
  90. package/src/generators/function-access/function-access.d.ts +0 -6
  91. package/src/generators/function-access/function-access.js +41 -109
  92. package/src/generators/observability-policy.js +1 -2
  93. package/src/{supply-chain → generators}/pnpm-toolchain-authority.d.ts +3 -3
  94. package/src/{supply-chain → generators}/pnpm-toolchain-authority.js +12 -12
  95. package/src/generators/post-generation-install.d.ts +1 -8
  96. package/src/generators/post-generation-install.js +11 -139
  97. package/src/generators/preset/dependency-overrides.d.ts +13 -19
  98. package/src/generators/preset/dependency-overrides.js +12 -56
  99. package/src/generators/preset/generator.js +0 -3
  100. package/src/generators/preset/workspace-files-foundation-infra.d.ts +6 -0
  101. package/src/generators/preset/workspace-files-foundation-infra.js +586 -0
  102. package/src/generators/preset/workspace-files-foundation-readme.d.ts +5 -0
  103. package/src/generators/preset/workspace-files-foundation-readme.js +90 -0
  104. package/src/generators/preset/workspace-files-foundation.d.ts +3 -0
  105. package/src/generators/preset/workspace-files-foundation.js +170 -0
  106. package/src/generators/preset/workspace-files-ownership.d.ts +9 -0
  107. package/src/generators/preset/workspace-files-ownership.js +124 -0
  108. package/src/generators/preset/workspace-files-root-config.d.ts +32 -0
  109. package/src/generators/preset/workspace-files-root-config.js +356 -0
  110. package/src/generators/preset/workspace-files-root-docs.d.ts +5 -0
  111. package/src/generators/preset/workspace-files-root-docs.js +109 -0
  112. package/src/generators/preset/workspace-files-shared.d.ts +18 -0
  113. package/src/generators/preset/workspace-files-shared.js +7 -0
  114. package/src/generators/preset/workspace-files-workflows.d.ts +39 -0
  115. package/src/generators/preset/workspace-files-workflows.js +306 -0
  116. package/src/generators/preset/workspace-files-workspace-health.d.ts +6 -0
  117. package/src/generators/preset/workspace-files-workspace-health.js +148 -0
  118. package/src/generators/preset/workspace-files.d.ts +10 -24
  119. package/src/generators/preset/workspace-files.js +48 -10705
  120. package/src/generators/site/built-in-site-documentation-files.d.ts +2 -1
  121. package/src/generators/site/built-in-site-documentation-files.js +15 -56
  122. package/src/generators/site/built-in-site-files.d.ts +4 -1
  123. package/src/generators/site/built-in-site-files.js +12 -11
  124. package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -1
  125. package/src/generators/site/built-in-site-infrastructure-files.js +46 -206
  126. package/src/generators/site/built-in-site-plan.d.ts +5 -1
  127. package/src/generators/site/built-in-site-plan.js +7 -5
  128. package/src/generators/site/built-in-site-project-files.d.ts +10 -2
  129. package/src/generators/site/built-in-site-project-files.js +131 -177
  130. package/src/generators/site/built-in-site-script-files.d.ts +2 -0
  131. package/src/generators/site/built-in-site-script-files.js +76 -280
  132. package/src/generators/site/built-in-site-shared.d.ts +64 -4
  133. package/src/generators/site/built-in-site-shared.js +307 -14
  134. package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -1
  135. package/src/generators/site/built-in-site-sst-config-files.js +90 -22
  136. package/src/generators/site/built-in-site-web-files.d.ts +2 -1
  137. package/src/generators/site/built-in-site-web-files.js +19 -225
  138. package/src/generators/site/schema.d.ts +5 -0
  139. package/src/generators/site/schema.json +6 -0
  140. package/src/generators/site/site.d.ts +0 -8
  141. package/src/generators/site/site.js +17 -85
  142. package/src/generators/slice/built-in-plan-api-files.d.ts +1 -2
  143. package/src/generators/slice/built-in-plan-api-files.js +30 -890
  144. package/src/generators/slice/built-in-plan-database-lifecycle-files.js +57 -1851
  145. package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +5 -2
  146. package/src/generators/slice/built-in-plan-infrastructure-files.js +80 -3272
  147. package/src/generators/slice/built-in-plan-key-value-files.d.ts +3 -2
  148. package/src/generators/slice/built-in-plan-key-value-files.js +3 -21
  149. package/src/generators/slice/built-in-plan-project-files.d.ts +5 -3
  150. package/src/generators/slice/built-in-plan-project-files.js +79 -897
  151. package/src/generators/slice/built-in-plan-shared.d.ts +3 -18
  152. package/src/generators/slice/built-in-plan-shared.js +4 -57
  153. package/src/generators/slice/built-in-plan-web-files.d.ts +1 -1
  154. package/src/generators/slice/built-in-plan-web-files.js +14 -540
  155. package/src/generators/slice/built-in-plan.d.ts +2 -3
  156. package/src/generators/slice/built-in-plan.js +79 -277
  157. package/src/{developer-agent/preview-changes.d.ts → generators/slice/generation-tree.d.ts} +1 -5
  158. package/src/generators/slice/generation-tree.js +161 -0
  159. package/src/generators/slice/schema.json +12 -4
  160. package/src/generators/slice/slice-config.d.ts +7 -0
  161. package/src/generators/slice/slice-config.js +125 -0
  162. package/src/generators/slice/slice.js +29 -261
  163. package/src/generators/slice/sql-bootstrap.d.ts +1 -0
  164. package/src/generators/slice/sql-bootstrap.js +505 -0
  165. package/src/generators/slice/sql-client.d.ts +1 -0
  166. package/src/generators/slice/sql-client.js +107 -0
  167. package/src/generators/slice/sql-infrastructure.d.ts +1 -0
  168. package/src/generators/slice/sql-infrastructure.js +225 -0
  169. package/src/generators/slice/sql-logging.d.ts +1 -0
  170. package/src/generators/slice/sql-logging.js +266 -0
  171. package/src/generators/slice/sql-migration.d.ts +2 -0
  172. package/src/generators/slice/sql-migration.js +202 -0
  173. package/src/generators/slice/standard-slice-contract.d.ts +25 -0
  174. package/src/generators/slice/standard-slice-contract.js +64 -0
  175. package/src/generators/sql/schema.json +1 -1
  176. package/src/generators/sql/sql.d.ts +1 -1
  177. package/src/generators/sql/sql.js +13 -7
  178. package/src/generators/upgrade/framework-package-upgrade.d.ts +4 -27
  179. package/src/generators/upgrade/framework-package-upgrade.js +16 -39
  180. package/src/generators/upgrade/framework-packages.d.ts +25 -0
  181. package/src/generators/upgrade/framework-packages.js +138 -0
  182. package/src/generators/upgrade/function-authentication-notice.d.ts +10 -18
  183. package/src/generators/upgrade/function-authentication-notice.js +24 -44
  184. package/src/generators/upgrade/schema.d.ts +0 -3
  185. package/src/generators/upgrade/schema.json +6 -16
  186. package/src/generators/upgrade/slice-compositions.d.ts +20 -0
  187. package/src/generators/upgrade/slice-compositions.js +100 -0
  188. package/src/generators/upgrade/slice-upgrade-guidance.d.ts +19 -0
  189. package/src/generators/upgrade/slice-upgrade-guidance.js +50 -0
  190. package/src/generators/upgrade/slice-upgrade.d.ts +4 -0
  191. package/src/generators/upgrade/slice-upgrade.js +231 -0
  192. package/src/generators/upgrade/upgrade-plan.d.ts +10 -13
  193. package/src/generators/upgrade/upgrade-plan.js +33 -197
  194. package/src/generators/upgrade/upgrade-preflight.d.ts +20 -0
  195. package/src/generators/upgrade/upgrade-preflight.js +64 -0
  196. package/src/generators/upgrade/upgrade.d.ts +8 -53
  197. package/src/generators/upgrade/upgrade.js +23 -1571
  198. package/src/generators/workload/schema.json +2 -2
  199. package/src/generators/workload/workload.d.ts +11 -11
  200. package/src/generators/workload/workload.js +166 -1255
  201. package/src/index.d.ts +0 -5
  202. package/src/index.js +0 -5
  203. package/src/local-dev/browser-verification.d.ts +0 -7
  204. package/src/local-dev/browser-verification.js +0 -136
  205. package/src/local-dev/contracts.d.ts +6 -0
  206. package/src/local-dev/contracts.js +17 -9
  207. package/src/local-dev/environment-checks.d.ts +126 -0
  208. package/src/local-dev/environment-checks.js +81 -0
  209. package/src/local-dev/environment-inspector.d.ts +3 -124
  210. package/src/local-dev/environment-inspector.js +9 -148
  211. package/src/local-dev/private-state.d.ts +1 -0
  212. package/src/local-dev/private-state.js +19 -23
  213. package/src/local-dev/process-identity.js +4 -2
  214. package/src/local-dev/slice-runner-child.d.ts +37 -0
  215. package/src/local-dev/slice-runner-child.js +127 -0
  216. package/src/local-dev/slice-runner-recovery.d.ts +32 -0
  217. package/src/local-dev/slice-runner-recovery.js +216 -0
  218. package/src/local-dev/slice-runner-state.d.ts +82 -0
  219. package/src/local-dev/slice-runner-state.js +265 -0
  220. package/src/local-dev/slice-runner.d.ts +4 -117
  221. package/src/local-dev/slice-runner.js +59 -594
  222. package/src/local-dev/tls.js +8 -97
  223. package/src/ownership/index.d.ts +1 -0
  224. package/src/ownership/index.js +6 -0
  225. package/src/ownership/pnpm-workspace.d.ts +77 -0
  226. package/src/ownership/pnpm-workspace.js +225 -0
  227. package/src/ownership/site-record.d.ts +8 -0
  228. package/src/ownership/site-record.js +17 -2
  229. package/src/repository-policy/capacity-migration.d.ts +1 -1
  230. package/src/repository-policy/capacity-migration.js +1 -1
  231. package/src/repository-policy/foundation-router.d.ts +17 -0
  232. package/src/repository-policy/foundation-router.js +44 -0
  233. package/src/repository-policy/index.d.ts +2 -0
  234. package/src/repository-policy/index.js +2 -0
  235. package/src/repository-policy/policy-accounts.d.ts +22 -0
  236. package/src/repository-policy/policy-accounts.js +134 -0
  237. package/src/repository-policy/policy-files.d.ts +8 -0
  238. package/src/repository-policy/policy-files.js +201 -0
  239. package/src/repository-policy/policy-internal.d.ts +2 -0
  240. package/src/repository-policy/policy-internal.js +11 -0
  241. package/src/repository-policy/policy-model.d.ts +95 -0
  242. package/src/repository-policy/policy-model.js +42 -0
  243. package/src/repository-policy/policy-validation.d.ts +4 -0
  244. package/src/repository-policy/policy-validation.js +308 -0
  245. package/src/repository-policy/policy.d.ts +5 -120
  246. package/src/repository-policy/policy.js +34 -662
  247. package/src/repository-policy/public-dns.d.ts +4 -0
  248. package/src/repository-policy/public-dns.js +102 -5
  249. package/src/{generators/repository-policy → repository-policy}/tree-policy.d.ts +1 -1
  250. package/src/{generators/repository-policy → repository-policy}/tree-policy.js +5 -5
  251. package/src/schemas/repository-policy-v1.json +40 -3
  252. package/src/secrets/index.d.ts +0 -5
  253. package/src/secrets/index.js +0 -5
  254. package/src/slice-infra/index.d.ts +57 -0
  255. package/src/slice-infra/index.js +117 -0
  256. package/src/slice-scripts/build.d.ts +27 -0
  257. package/src/slice-scripts/build.js +120 -0
  258. package/src/slice-scripts/database.d.ts +87 -0
  259. package/src/slice-scripts/database.js +328 -0
  260. package/src/slice-scripts/index.d.ts +11 -0
  261. package/src/slice-scripts/index.js +23 -0
  262. package/src/slice-scripts/root-site-routes.d.ts +11 -0
  263. package/src/slice-scripts/root-site-routes.js +83 -0
  264. package/src/slice-scripts/sql-migration-engine.mjs +180 -0
  265. package/src/workload-roles/effective-policy.d.ts +0 -37
  266. package/src/workload-roles/effective-policy.js +1 -174
  267. package/src/workload-roles/standard-slice.d.ts +2 -19
  268. package/src/workload-roles/standard-slice.js +3 -129
  269. package/src/api-contract/baseline-update.d.ts +0 -82
  270. package/src/api-contract/baseline-update.js +0 -225
  271. package/src/api-contract/compatibility.d.ts +0 -30
  272. package/src/api-contract/compatibility.js +0 -643
  273. package/src/api-contract/contract-graph.d.ts +0 -35
  274. package/src/api-contract/contract-graph.js +0 -141
  275. package/src/api-contract/evidence.d.ts +0 -23
  276. package/src/api-contract/evidence.js +0 -87
  277. package/src/api-contract/index.d.ts +0 -6
  278. package/src/api-contract/index.js +0 -10
  279. package/src/api-contract/model.d.ts +0 -144
  280. package/src/api-contract/model.js +0 -993
  281. package/src/api-contract/rollout.d.ts +0 -32
  282. package/src/api-contract/rollout.js +0 -88
  283. package/src/authorization/compatibility.d.ts +0 -62
  284. package/src/authorization/compatibility.js +0 -175
  285. package/src/authorization/index.d.ts +0 -1
  286. package/src/authorization/index.js +0 -5
  287. package/src/blueprints/execution.d.ts +0 -55
  288. package/src/blueprints/execution.js +0 -329
  289. package/src/blueprints/external-sandbox.d.ts +0 -53
  290. package/src/blueprints/external-sandbox.js +0 -1194
  291. package/src/blueprints/index.d.ts +0 -5
  292. package/src/blueprints/index.js +0 -9
  293. package/src/blueprints/inputs.d.ts +0 -43
  294. package/src/blueprints/inputs.js +0 -103
  295. package/src/blueprints/manifest.d.ts +0 -281
  296. package/src/blueprints/manifest.js +0 -424
  297. package/src/blueprints/resolver.d.ts +0 -37
  298. package/src/blueprints/resolver.js +0 -387
  299. package/src/blueprints/transitions.d.ts +0 -20
  300. package/src/blueprints/transitions.js +0 -61
  301. package/src/cli/agent-command.d.ts +0 -30
  302. package/src/cli/agent-command.js +0 -204
  303. package/src/cli/agent-runtime.d.ts +0 -25
  304. package/src/cli/agent-runtime.js +0 -498
  305. package/src/cli/blueprint-authority.d.ts +0 -9
  306. package/src/cli/blueprint-authority.js +0 -43
  307. package/src/cli/blueprint-command.d.ts +0 -24
  308. package/src/cli/blueprint-command.js +0 -63
  309. package/src/data-lifecycle/index.d.ts +0 -3
  310. package/src/data-lifecycle/index.js +0 -7
  311. package/src/data-lifecycle/model.d.ts +0 -172
  312. package/src/data-lifecycle/model.js +0 -95
  313. package/src/data-lifecycle/sensitive-artifacts.d.ts +0 -28
  314. package/src/data-lifecycle/sensitive-artifacts.js +0 -146
  315. package/src/data-lifecycle/validation.d.ts +0 -32
  316. package/src/data-lifecycle/validation.js +0 -837
  317. package/src/database-retirement/contract.d.ts +0 -68
  318. package/src/database-retirement/contract.js +0 -166
  319. package/src/database-retirement/index.d.ts +0 -1
  320. package/src/database-retirement/index.js +0 -5
  321. package/src/developer-agent/context.d.ts +0 -57
  322. package/src/developer-agent/context.js +0 -662
  323. package/src/developer-agent/generator-planning.d.ts +0 -34
  324. package/src/developer-agent/generator-planning.js +0 -759
  325. package/src/developer-agent/generator-preview.d.ts +0 -8
  326. package/src/developer-agent/generator-preview.js +0 -650
  327. package/src/developer-agent/git-inspection.d.ts +0 -112
  328. package/src/developer-agent/git-inspection.js +0 -887
  329. package/src/developer-agent/handoff.d.ts +0 -43
  330. package/src/developer-agent/handoff.js +0 -713
  331. package/src/developer-agent/index.d.ts +0 -10
  332. package/src/developer-agent/index.js +0 -14
  333. package/src/developer-agent/model.d.ts +0 -497
  334. package/src/developer-agent/model.js +0 -144
  335. package/src/developer-agent/operation-registry.d.ts +0 -61
  336. package/src/developer-agent/operation-registry.js +0 -1591
  337. package/src/developer-agent/ordering.d.ts +0 -9
  338. package/src/developer-agent/ordering.js +0 -15
  339. package/src/developer-agent/planning.d.ts +0 -25
  340. package/src/developer-agent/planning.js +0 -481
  341. package/src/developer-agent/preview-changes.js +0 -225
  342. package/src/developer-agent/preview-source.d.ts +0 -2
  343. package/src/developer-agent/preview-source.js +0 -19
  344. package/src/developer-agent/validation.d.ts +0 -30
  345. package/src/developer-agent/validation.js +0 -2729
  346. package/src/developer-agent/workspace-inspection.d.ts +0 -20
  347. package/src/developer-agent/workspace-inspection.js +0 -1236
  348. package/src/developer-agent/workspace-path.d.ts +0 -6
  349. package/src/developer-agent/workspace-path.js +0 -22
  350. package/src/executors/blueprint-trust/blueprint-trust.d.ts +0 -29
  351. package/src/executors/blueprint-trust/blueprint-trust.js +0 -121
  352. package/src/executors/blueprint-trust/schema.json +0 -27
  353. package/src/executors/blueprint-verification/blueprint-verification.d.ts +0 -13
  354. package/src/executors/blueprint-verification/blueprint-verification.js +0 -110
  355. package/src/executors/blueprint-verification/schema.json +0 -44
  356. package/src/executors/developer-context/developer-context.d.ts +0 -38
  357. package/src/executors/developer-context/developer-context.js +0 -78
  358. package/src/executors/developer-context/schema.json +0 -87
  359. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +0 -19
  360. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +0 -105
  361. package/src/executors/foundation-profile-preflight/schema.json +0 -32
  362. package/src/executors/github-bootstrap/github-bootstrap.d.ts +0 -13
  363. package/src/executors/github-bootstrap/github-bootstrap.js +0 -62
  364. package/src/executors/github-bootstrap/schema.json +0 -50
  365. package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +0 -37
  366. package/src/executors/infrastructure-plan/infrastructure-plan.js +0 -275
  367. package/src/executors/infrastructure-plan/schema.json +0 -38
  368. package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +0 -42
  369. package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +0 -1229
  370. package/src/executors/router-waf-rehearsal/schema.json +0 -29
  371. package/src/executors/secret-guardrails/schema.json +0 -6
  372. package/src/executors/secret-guardrails/secret-guardrails.d.ts +0 -3
  373. package/src/executors/secret-guardrails/secret-guardrails.js +0 -44
  374. package/src/executors/secret-initialize/schema.json +0 -42
  375. package/src/executors/secret-initialize/secret-initialize.d.ts +0 -34
  376. package/src/executors/secret-initialize/secret-initialize.js +0 -297
  377. package/src/executors/secret-metadata/schema.json +0 -36
  378. package/src/executors/secret-metadata/secret-metadata.d.ts +0 -46
  379. package/src/executors/secret-metadata/secret-metadata.js +0 -230
  380. package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +0 -53
  381. package/src/executors/sst-lifecycle/generated-secret-retirement.js +0 -192
  382. package/src/executors/sst-lifecycle/logging-preflight.d.ts +0 -22
  383. package/src/executors/sst-lifecycle/logging-preflight.js +0 -217
  384. package/src/executors/sst-lifecycle/secret-preflight.d.ts +0 -27
  385. package/src/executors/sst-lifecycle/secret-preflight.js +0 -125
  386. package/src/executors/work-markers/schema.json +0 -14
  387. package/src/executors/work-markers/work-markers.d.ts +0 -6
  388. package/src/executors/work-markers/work-markers.js +0 -20
  389. package/src/foundation/cost-estimate.d.ts +0 -175
  390. package/src/foundation/cost-estimate.js +0 -706
  391. package/src/foundation/private-smoke-admission.d.ts +0 -45
  392. package/src/foundation/private-smoke-admission.js +0 -180
  393. package/src/foundation/private-smoke-control-plane.d.ts +0 -18
  394. package/src/foundation/private-smoke-control-plane.js +0 -184
  395. package/src/foundation/root-site-readiness.d.ts +0 -27
  396. package/src/foundation/root-site-readiness.js +0 -78
  397. package/src/foundation/router-waf-rate-rehearsal.d.ts +0 -97
  398. package/src/foundation/router-waf-rate-rehearsal.js +0 -210
  399. package/src/foundation/router-waf.d.ts +0 -149
  400. package/src/foundation/router-waf.js +0 -809
  401. package/src/frontend-security/index.d.ts +0 -1
  402. package/src/frontend-security/index.js +0 -5
  403. package/src/frontend-security/security-headers.d.ts +0 -50
  404. package/src/frontend-security/security-headers.js +0 -418
  405. package/src/generators/blueprint/blueprint.d.ts +0 -5
  406. package/src/generators/blueprint/blueprint.js +0 -102
  407. package/src/generators/blueprint/files.d.ts +0 -6
  408. package/src/generators/blueprint/files.js +0 -217
  409. package/src/generators/blueprint/schema.d.ts +0 -4
  410. package/src/generators/blueprint/schema.json +0 -18
  411. package/src/generators/feature-registry.d.ts +0 -13
  412. package/src/generators/feature-registry.js +0 -73
  413. package/src/generators/function/function-registration.d.ts +0 -24
  414. package/src/generators/function/function-registration.js +0 -66
  415. package/src/generators/observability-infrastructure.d.ts +0 -2
  416. package/src/generators/observability-infrastructure.js +0 -31
  417. package/src/generators/preset/workspace-files-adopter-skills.d.ts +0 -7
  418. package/src/generators/preset/workspace-files-adopter-skills.js +0 -359
  419. package/src/generators/preset/workspace-files-agent-development.d.ts +0 -9
  420. package/src/generators/preset/workspace-files-agent-development.js +0 -42
  421. package/src/generators/preset/workspace-files-ci-acceptance.d.ts +0 -1
  422. package/src/generators/preset/workspace-files-ci-acceptance.js +0 -791
  423. package/src/generators/preset/workspace-files-ci-install.d.ts +0 -2
  424. package/src/generators/preset/workspace-files-ci-install.js +0 -196
  425. package/src/generators/preset/workspace-files-developer-agent.d.ts +0 -16
  426. package/src/generators/preset/workspace-files-developer-agent.js +0 -644
  427. package/src/generators/preset/workspace-files-ecr-inspector.d.ts +0 -18
  428. package/src/generators/preset/workspace-files-ecr-inspector.js +0 -298
  429. package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +0 -6
  430. package/src/generators/preset/workspace-files-foundation-workload-roles.js +0 -409
  431. package/src/generators/preset/workspace-files-performance-cost.d.ts +0 -66
  432. package/src/generators/preset/workspace-files-performance-cost.js +0 -866
  433. package/src/generators/preset/workspace-files-performance-load.d.ts +0 -73
  434. package/src/generators/preset/workspace-files-performance-load.js +0 -815
  435. package/src/generators/preset/workspace-files-shared-operation-claims.d.ts +0 -10
  436. package/src/generators/preset/workspace-files-shared-operation-claims.js +0 -59
  437. package/src/generators/preset/workspace-files-stage-authority.d.ts +0 -6
  438. package/src/generators/preset/workspace-files-stage-authority.js +0 -586
  439. package/src/generators/preset/workspace-files-thin-deploy.d.ts +0 -76
  440. package/src/generators/preset/workspace-files-thin-deploy.js +0 -2563
  441. package/src/generators/preset/workspace-files-thin-docs.d.ts +0 -7
  442. package/src/generators/preset/workspace-files-thin-docs.js +0 -386
  443. package/src/generators/preset/workspace-files-thin-release.d.ts +0 -14
  444. package/src/generators/preset/workspace-files-thin-release.js +0 -26
  445. package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +0 -9
  446. package/src/generators/preset/workspace-files-workload-role-baseline.js +0 -1314
  447. package/src/generators/repository-policy/repository-policy.d.ts +0 -4
  448. package/src/generators/repository-policy/repository-policy.js +0 -294
  449. package/src/generators/repository-policy/schema.d.ts +0 -30
  450. package/src/generators/repository-policy/schema.json +0 -127
  451. package/src/generators/site/built-in-site-smoke-files.d.ts +0 -2
  452. package/src/generators/site/built-in-site-smoke-files.js +0 -37
  453. package/src/generators/slice/built-in-plan-alarm-identity.d.ts +0 -182
  454. package/src/generators/slice/built-in-plan-alarm-identity.js +0 -209
  455. package/src/generators/slice/built-in-plan-api-contract-files.d.ts +0 -2
  456. package/src/generators/slice/built-in-plan-api-contract-files.js +0 -2848
  457. package/src/generators/slice/built-in-plan-async-work-files.d.ts +0 -2
  458. package/src/generators/slice/built-in-plan-async-work-files.js +0 -6118
  459. package/src/generators/slice/built-in-plan-authorization-files.d.ts +0 -2
  460. package/src/generators/slice/built-in-plan-authorization-files.js +0 -2082
  461. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +0 -2
  462. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +0 -1301
  463. package/src/generators/slice/built-in-plan-authorization-storage.d.ts +0 -3
  464. package/src/generators/slice/built-in-plan-authorization-storage.js +0 -119
  465. package/src/generators/slice/built-in-plan-background-work-files.d.ts +0 -2
  466. package/src/generators/slice/built-in-plan-background-work-files.js +0 -99
  467. package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +0 -2
  468. package/src/generators/slice/built-in-plan-data-deletion-files.js +0 -273
  469. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +0 -2
  470. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +0 -223
  471. package/src/generators/slice/built-in-plan-data-files.d.ts +0 -2
  472. package/src/generators/slice/built-in-plan-data-files.js +0 -618
  473. package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +0 -2
  474. package/src/generators/slice/built-in-plan-data-lifecycle-files.js +0 -775
  475. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +0 -2
  476. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +0 -863
  477. package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +0 -2
  478. package/src/generators/slice/built-in-plan-data-retention-job-files.js +0 -169
  479. package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +0 -2
  480. package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +0 -186
  481. package/src/generators/slice/built-in-plan-data-rights-files.d.ts +0 -2
  482. package/src/generators/slice/built-in-plan-data-rights-files.js +0 -152
  483. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +0 -2
  484. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +0 -508
  485. package/src/generators/slice/built-in-plan-event-contract-literal.d.ts +0 -6
  486. package/src/generators/slice/built-in-plan-event-contract-literal.js +0 -52
  487. package/src/generators/slice/built-in-plan-foundation-files.d.ts +0 -15
  488. package/src/generators/slice/built-in-plan-foundation-files.js +0 -314
  489. package/src/generators/slice/built-in-plan-frontend-files.d.ts +0 -2
  490. package/src/generators/slice/built-in-plan-frontend-files.js +0 -1975
  491. package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +0 -6
  492. package/src/generators/slice/built-in-plan-frontend-header-proof.js +0 -282
  493. package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +0 -2
  494. package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +0 -373
  495. package/src/generators/slice/built-in-plan-key-value-cleanup.d.ts +0 -4
  496. package/src/generators/slice/built-in-plan-key-value-cleanup.js +0 -101
  497. package/src/generators/slice/built-in-plan-key-value-consumer.d.ts +0 -4
  498. package/src/generators/slice/built-in-plan-key-value-consumer.js +0 -151
  499. package/src/generators/slice/built-in-plan-key-value-deletion.d.ts +0 -2
  500. package/src/generators/slice/built-in-plan-key-value-deletion.js +0 -377
  501. package/src/generators/slice/built-in-plan-key-value-delivery.d.ts +0 -2
  502. package/src/generators/slice/built-in-plan-key-value-delivery.js +0 -137
  503. package/src/generators/slice/built-in-plan-key-value-export.d.ts +0 -2
  504. package/src/generators/slice/built-in-plan-key-value-export.js +0 -595
  505. package/src/generators/slice/built-in-plan-key-value-holds.d.ts +0 -2
  506. package/src/generators/slice/built-in-plan-key-value-holds.js +0 -189
  507. package/src/generators/slice/built-in-plan-key-value-infrastructure.d.ts +0 -2
  508. package/src/generators/slice/built-in-plan-key-value-infrastructure.js +0 -102
  509. package/src/generators/slice/built-in-plan-key-value-performance.d.ts +0 -5
  510. package/src/generators/slice/built-in-plan-key-value-performance.js +0 -530
  511. package/src/generators/slice/built-in-plan-key-value-provider.d.ts +0 -4
  512. package/src/generators/slice/built-in-plan-key-value-provider.js +0 -366
  513. package/src/generators/slice/built-in-plan-key-value-records.d.ts +0 -3
  514. package/src/generators/slice/built-in-plan-key-value-records.js +0 -232
  515. package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.d.ts +0 -2
  516. package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.js +0 -103
  517. package/src/generators/slice/built-in-plan-key-value-retention-job-files.d.ts +0 -2
  518. package/src/generators/slice/built-in-plan-key-value-retention-job-files.js +0 -160
  519. package/src/generators/slice/built-in-plan-key-value-retention-maintenance.d.ts +0 -2
  520. package/src/generators/slice/built-in-plan-key-value-retention-maintenance.js +0 -329
  521. package/src/generators/slice/built-in-plan-key-value-retention-worker.d.ts +0 -2
  522. package/src/generators/slice/built-in-plan-key-value-retention-worker.js +0 -477
  523. package/src/generators/slice/built-in-plan-key-value-retention.d.ts +0 -2
  524. package/src/generators/slice/built-in-plan-key-value-retention.js +0 -184
  525. package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +0 -29
  526. package/src/generators/slice/built-in-plan-log-group-helpers.js +0 -130
  527. package/src/generators/slice/built-in-plan-metadata-files.d.ts +0 -3
  528. package/src/generators/slice/built-in-plan-metadata-files.js +0 -401
  529. package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +0 -2
  530. package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +0 -324
  531. package/src/generators/slice/built-in-plan-next-build-authority.d.ts +0 -5
  532. package/src/generators/slice/built-in-plan-next-build-authority.js +0 -124
  533. package/src/generators/slice/built-in-plan-operations-files.d.ts +0 -8
  534. package/src/generators/slice/built-in-plan-operations-files.js +0 -1106
  535. package/src/generators/slice/built-in-plan-performance-files.d.ts +0 -4
  536. package/src/generators/slice/built-in-plan-performance-files.js +0 -2444
  537. package/src/generators/slice/built-in-plan-release-files.d.ts +0 -2
  538. package/src/generators/slice/built-in-plan-release-files.js +0 -6585
  539. package/src/generators/slice/built-in-plan-reliability-files.d.ts +0 -2
  540. package/src/generators/slice/built-in-plan-reliability-files.js +0 -4728
  541. package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +0 -2
  542. package/src/generators/slice/built-in-plan-secret-runtime-files.js +0 -1015
  543. package/src/generators/slice/built-in-plan-sql-events.d.ts +0 -2
  544. package/src/generators/slice/built-in-plan-sql-events.js +0 -276
  545. package/src/generators/slice/built-in-plan-testing-files.d.ts +0 -2
  546. package/src/generators/slice/built-in-plan-testing-files.js +0 -2618
  547. package/src/generators/slice/built-in-plan-testing-persistence-event-files.d.ts +0 -7
  548. package/src/generators/slice/built-in-plan-testing-persistence-event-files.js +0 -487
  549. package/src/generators/slice/built-in-plan-testing-persistence-files.d.ts +0 -2
  550. package/src/generators/slice/built-in-plan-testing-persistence-files.js +0 -180
  551. package/src/generators/slice/built-in-plan-thin-release-files.d.ts +0 -11
  552. package/src/generators/slice/built-in-plan-thin-release-files.js +0 -162
  553. package/src/generators/slice/built-in-plan-verification-files.d.ts +0 -2
  554. package/src/generators/slice/built-in-plan-verification-files.js +0 -442
  555. package/src/generators/slice/built-in-plan-workload-role-files.d.ts +0 -2
  556. package/src/generators/slice/built-in-plan-workload-role-files.js +0 -2220
  557. package/src/generators/slice/data-policy-review-seed.d.ts +0 -2
  558. package/src/generators/slice/data-policy-review-seed.js +0 -22
  559. package/src/generators/slice/deployed-smoke-diagnostics.d.ts +0 -35
  560. package/src/generators/slice/deployed-smoke-diagnostics.js +0 -189
  561. package/src/generators/slice/deployed-smoke-readiness.d.ts +0 -9
  562. package/src/generators/slice/deployed-smoke-readiness.js +0 -309
  563. package/src/generators/slice/local-source-identity.d.ts +0 -2
  564. package/src/generators/slice/local-source-identity.js +0 -31
  565. package/src/generators/slice/pnpm-launch-script.d.ts +0 -13
  566. package/src/generators/slice/pnpm-launch-script.js +0 -28
  567. package/src/generators/upgrade/custom-domain-notice.d.ts +0 -19
  568. package/src/generators/upgrade/custom-domain-notice.js +0 -38
  569. package/src/generators/upgrade/external-blueprint-compositions.d.ts +0 -84
  570. package/src/generators/upgrade/external-blueprint-compositions.js +0 -478
  571. package/src/generators/upgrade/sql-seeded-reconciliation.d.ts +0 -2
  572. package/src/generators/upgrade/sql-seeded-reconciliation.js +0 -170
  573. package/src/generators/workload/performance-registration.d.ts +0 -33
  574. package/src/generators/workload/performance-registration.js +0 -224
  575. package/src/generators/workload/reliability-registration.d.ts +0 -16
  576. package/src/generators/workload/reliability-registration.js +0 -150
  577. package/src/generators/workload/service-performance-files.d.ts +0 -5
  578. package/src/generators/workload/service-performance-files.js +0 -1883
  579. package/src/git-policy/action-pins.d.ts +0 -43
  580. package/src/git-policy/action-pins.js +0 -50
  581. package/src/git-policy/github-bootstrap.d.ts +0 -95
  582. package/src/git-policy/github-bootstrap.js +0 -1250
  583. package/src/git-policy/index.d.ts +0 -3
  584. package/src/git-policy/index.js +0 -7
  585. package/src/git-policy/routing.d.ts +0 -21
  586. package/src/git-policy/routing.js +0 -138
  587. package/src/infrastructure-change/convergence.d.ts +0 -13
  588. package/src/infrastructure-change/convergence.js +0 -85
  589. package/src/infrastructure-change/drift.d.ts +0 -13
  590. package/src/infrastructure-change/drift.js +0 -112
  591. package/src/infrastructure-change/index.d.ts +0 -7
  592. package/src/infrastructure-change/index.js +0 -11
  593. package/src/infrastructure-change/local-capability.d.ts +0 -73
  594. package/src/infrastructure-change/local-capability.js +0 -114
  595. package/src/infrastructure-change/model.d.ts +0 -274
  596. package/src/infrastructure-change/model.js +0 -29
  597. package/src/infrastructure-change/normalize.d.ts +0 -16
  598. package/src/infrastructure-change/normalize.js +0 -285
  599. package/src/infrastructure-change/plan.d.ts +0 -67
  600. package/src/infrastructure-change/plan.js +0 -671
  601. package/src/infrastructure-change/risk.d.ts +0 -9
  602. package/src/infrastructure-change/risk.js +0 -349
  603. package/src/infrastructure-change/summary.d.ts +0 -20
  604. package/src/infrastructure-change/summary.js +0 -130
  605. package/src/performance/cost-collection.d.ts +0 -225
  606. package/src/performance/cost-collection.js +0 -827
  607. package/src/performance/cost-controls.d.ts +0 -135
  608. package/src/performance/cost-controls.js +0 -347
  609. package/src/performance/evidence.d.ts +0 -140
  610. package/src/performance/evidence.js +0 -601
  611. package/src/performance/index.d.ts +0 -10
  612. package/src/performance/index.js +0 -14
  613. package/src/performance/load-safety.d.ts +0 -84
  614. package/src/performance/load-safety.js +0 -348
  615. package/src/performance/model.d.ts +0 -129
  616. package/src/performance/model.js +0 -451
  617. package/src/performance/pr-artifact-budget.d.ts +0 -42
  618. package/src/performance/pr-artifact-budget.js +0 -151
  619. package/src/performance/runner.d.ts +0 -75
  620. package/src/performance/runner.js +0 -227
  621. package/src/performance/scenario-endpoint.d.ts +0 -1
  622. package/src/performance/scenario-endpoint.js +0 -5
  623. package/src/performance/scenario.d.ts +0 -215
  624. package/src/performance/scenario.js +0 -744
  625. package/src/performance/unit-cost.d.ts +0 -105
  626. package/src/performance/unit-cost.js +0 -364
  627. package/src/release/index.d.ts +0 -2
  628. package/src/release/index.js +0 -6
  629. package/src/release/lifecycle.d.ts +0 -132
  630. package/src/release/lifecycle.js +0 -411
  631. package/src/release/manifest.d.ts +0 -148
  632. package/src/release/manifest.js +0 -503
  633. package/src/release/rollout.d.ts +0 -170
  634. package/src/release/rollout.js +0 -578
  635. package/src/release/source-authority.d.ts +0 -19
  636. package/src/release/source-authority.js +0 -212
  637. package/src/schemas/aggregate-count-evidence-v1.json +0 -135
  638. package/src/schemas/api-contract-baseline-v1.json +0 -674
  639. package/src/schemas/api-contract-compatibility-report-v1.json +0 -126
  640. package/src/schemas/aws-billing-actual-evidence-v1.json +0 -407
  641. package/src/schemas/blueprint-input-schema-v1.json +0 -23
  642. package/src/schemas/blueprint-v1.json +0 -188
  643. package/src/schemas/data-lifecycle-policy-v1.json +0 -517
  644. package/src/schemas/performance-policy-v1.json +0 -335
  645. package/src/schemas/testing-evidence-quarantine-v1.json +0 -168
  646. package/src/schemas/testing-evidence-result-v1.json +0 -319
  647. package/src/secrets/aws-control-plane.d.ts +0 -29
  648. package/src/secrets/aws-control-plane.js +0 -322
  649. package/src/secrets/generated-aws-control-plane.d.ts +0 -33
  650. package/src/secrets/generated-aws-control-plane.js +0 -322
  651. package/src/secrets/guardrails.d.ts +0 -26
  652. package/src/secrets/guardrails.js +0 -328
  653. package/src/secrets/metadata.d.ts +0 -48
  654. package/src/secrets/metadata.js +0 -199
  655. package/src/secrets/operator.d.ts +0 -190
  656. package/src/secrets/operator.js +0 -701
  657. package/src/secrets/verification.d.ts +0 -18
  658. package/src/secrets/verification.js +0 -152
  659. package/src/supply-chain/action-pins.d.ts +0 -26
  660. package/src/supply-chain/action-pins.js +0 -262
  661. package/src/supply-chain/blueprint-trust-git.d.ts +0 -130
  662. package/src/supply-chain/blueprint-trust-git.js +0 -1666
  663. package/src/supply-chain/blueprint-trust-process.d.ts +0 -4
  664. package/src/supply-chain/blueprint-trust-process.js +0 -88
  665. package/src/supply-chain/blueprint-trust.d.ts +0 -354
  666. package/src/supply-chain/blueprint-trust.js +0 -1558
  667. package/src/supply-chain/blueprint-verification-authority.d.ts +0 -62
  668. package/src/supply-chain/blueprint-verification-authority.js +0 -679
  669. package/src/supply-chain/blueprint-verification-execution.d.ts +0 -68
  670. package/src/supply-chain/blueprint-verification-execution.js +0 -639
  671. package/src/supply-chain/build-output-bounds.d.ts +0 -2
  672. package/src/supply-chain/build-output-bounds.js +0 -12
  673. package/src/supply-chain/build-output.d.ts +0 -41
  674. package/src/supply-chain/build-output.js +0 -551
  675. package/src/supply-chain/common.d.ts +0 -21
  676. package/src/supply-chain/common.js +0 -107
  677. package/src/supply-chain/container-artifact-contract.d.ts +0 -23
  678. package/src/supply-chain/container-artifact-contract.js +0 -208
  679. package/src/supply-chain/container-release.d.ts +0 -119
  680. package/src/supply-chain/container-release.js +0 -496
  681. package/src/supply-chain/ecr-applicability.d.ts +0 -19
  682. package/src/supply-chain/ecr-applicability.js +0 -103
  683. package/src/supply-chain/ecr-scanning.d.ts +0 -85
  684. package/src/supply-chain/ecr-scanning.js +0 -325
  685. package/src/supply-chain/ecs-deployed-image.d.ts +0 -87
  686. package/src/supply-chain/ecs-deployed-image.js +0 -302
  687. package/src/supply-chain/errors.d.ts +0 -6
  688. package/src/supply-chain/errors.js +0 -15
  689. package/src/supply-chain/generated-blueprint-trust-command.d.ts +0 -4
  690. package/src/supply-chain/generated-blueprint-trust-command.js +0 -1394
  691. package/src/supply-chain/generated-command.d.ts +0 -1
  692. package/src/supply-chain/generated-command.js +0 -775
  693. package/src/supply-chain/generated-container-release-command.d.ts +0 -16
  694. package/src/supply-chain/generated-container-release-command.js +0 -3248
  695. package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -20
  696. package/src/supply-chain/generated-ecr-collector-command.js +0 -1445
  697. package/src/supply-chain/generated-files.d.ts +0 -13
  698. package/src/supply-chain/generated-files.js +0 -421
  699. package/src/supply-chain/generated-scanner-command.d.ts +0 -1
  700. package/src/supply-chain/generated-scanner-command.js +0 -778
  701. package/src/supply-chain/index.d.ts +0 -28
  702. package/src/supply-chain/index.js +0 -36
  703. package/src/supply-chain/inventory.d.ts +0 -96
  704. package/src/supply-chain/inventory.js +0 -828
  705. package/src/supply-chain/license-expression.d.ts +0 -7
  706. package/src/supply-chain/license-expression.js +0 -128
  707. package/src/supply-chain/policy.d.ts +0 -105
  708. package/src/supply-chain/policy.js +0 -304
  709. package/src/supply-chain/publication.d.ts +0 -48
  710. package/src/supply-chain/publication.js +0 -85
  711. package/src/supply-chain/sbom.d.ts +0 -228
  712. package/src/supply-chain/sbom.js +0 -913
  713. package/src/supply-chain/scanner.d.ts +0 -77
  714. package/src/supply-chain/scanner.js +0 -514
  715. package/src/supply-chain/vendored-source.d.ts +0 -95
  716. package/src/supply-chain/vendored-source.js +0 -315
  717. package/src/testing-evidence/fixture-scope.d.ts +0 -53
  718. package/src/testing-evidence/fixture-scope.js +0 -142
  719. package/src/testing-evidence/index.d.ts +0 -5
  720. package/src/testing-evidence/index.js +0 -9
  721. package/src/testing-evidence/quarantine.d.ts +0 -48
  722. package/src/testing-evidence/quarantine.js +0 -253
  723. package/src/testing-evidence/result.d.ts +0 -109
  724. package/src/testing-evidence/result.js +0 -585
  725. package/src/testing-evidence/runner-adapter.d.ts +0 -51
  726. package/src/testing-evidence/runner-adapter.js +0 -288
  727. package/src/testing-evidence/sensitive-artifacts.d.ts +0 -13
  728. package/src/testing-evidence/sensitive-artifacts.js +0 -93
  729. package/src/work-markers/index.d.ts +0 -1
  730. package/src/work-markers/index.js +0 -5
  731. package/src/work-markers/work-markers.d.ts +0 -39
  732. package/src/work-markers/work-markers.js +0 -363
  733. package/src/workload-roles/account-baseline.d.ts +0 -143
  734. package/src/workload-roles/account-baseline.js +0 -980
  735. package/src/workload-roles/authority.d.ts +0 -40
  736. package/src/workload-roles/authority.js +0 -202
  737. package/src/workload-roles/aws-adapter.d.ts +0 -99
  738. package/src/workload-roles/aws-adapter.js +0 -416
  739. package/src/workload-roles/aws-internal-handler.d.ts +0 -27
  740. package/src/workload-roles/aws-internal-handler.js +0 -58
  741. package/src/workload-roles/aws-s3-state.d.ts +0 -52
  742. package/src/workload-roles/aws-s3-state.js +0 -191
  743. package/src/workload-roles/aws-sdk-control-plane.d.ts +0 -12
  744. package/src/workload-roles/aws-sdk-control-plane.js +0 -291
  745. package/src/workload-roles/boundary.d.ts +0 -34
  746. package/src/workload-roles/boundary.js +0 -137
  747. package/src/workload-roles/convergence.d.ts +0 -66
  748. package/src/workload-roles/convergence.js +0 -186
  749. package/src/workload-roles/handler.d.ts +0 -43
  750. package/src/workload-roles/handler.js +0 -158
  751. package/src/workload-roles/history.d.ts +0 -47
  752. package/src/workload-roles/history.js +0 -324
  753. package/src/workload-roles/injection.d.ts +0 -119
  754. package/src/workload-roles/injection.js +0 -495
  755. package/src/workload-roles/manifest.d.ts +0 -54
  756. package/src/workload-roles/manifest.js +0 -343
  757. package/src/workload-roles/provisioner.d.ts +0 -70
  758. package/src/workload-roles/provisioner.js +0 -239
  759. package/src/workload-roles/registration.d.ts +0 -102
  760. package/src/workload-roles/registration.js +0 -462
  761. package/src/workload-roles/stage-boundary.d.ts +0 -31
  762. package/src/workload-roles/stage-boundary.js +0 -208
  763. /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.d.ts +0 -0
  764. /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.js +0 -0
@@ -1,1975 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderProductFrontendFiles = renderProductFrontendFiles;
4
- const built_in_plan_frontend_header_proof_js_1 = require("./built-in-plan-frontend-header-proof.js");
5
- const built_in_plan_shared_js_1 = require("./built-in-plan-shared.js");
6
- const index_js_1 = require("../../frontend-security/index.js");
7
- /** @internal */
8
- function renderProductFrontendFiles(name, pascalName) {
9
- const states = [
10
- 'loading',
11
- 'empty',
12
- 'success',
13
- 'validation',
14
- 'partial',
15
- 'forbidden',
16
- 'not-found',
17
- 'failure',
18
- 'stale',
19
- 'offline',
20
- ];
21
- return {
22
- 'frontend/contract.json': (0, built_in_plan_shared_js_1.json)({
23
- accessibility: {
24
- automatedScan: 'axe-rendered-state',
25
- conformanceTarget: 'WCAG-2.2-AA',
26
- manualEvidence: [
27
- 'keyboard',
28
- 'focus',
29
- 'announcements',
30
- 'zoom-and-reflow',
31
- 'reduced-motion',
32
- 'assistive-technology',
33
- ],
34
- nativeBeforeAria: true,
35
- zeroViolationsIsConformanceClaim: false,
36
- },
37
- browserSecurity: {
38
- browserStorage: 'no-sensitive-data',
39
- clientGraphResolution: 'typescript-tsconfig-local-module-closure',
40
- clientPublicConfiguration: ['NEXT_PUBLIC_API_URL'],
41
- effectiveResponseValidation: true,
42
- foundationBaselineMayNotBeWeakened: true,
43
- headerApplicationPoint: 'next-proxy-request-nonce',
44
- headerProfiles: ['local-development', 'deployed-https'],
45
- productionInlineAuthority: 'per-request-cryptographic-nonce',
46
- sliceHeaderAuthority: 'frontend/security-headers.json#csp-only',
47
- serverOnlyMarker: 'server-only',
48
- },
49
- deploymentProof: {
50
- generatedStandardProfile: 'server-rendered-opennext',
51
- privateStaticFirstProfile: 'reference-static-site',
52
- staticExportSliceGeneration: 'post-1.0',
53
- },
54
- evidence: {
55
- baselineProfile: 'browser-and-operating-system',
56
- screenshotsContainOnlyNeutralSyntheticContent: true,
57
- visualBaseline: 'frontend/visual-baselines.json',
58
- visualObservations: '.ebk/evidence/frontend/frontend-visual-observations.json',
59
- },
60
- ownership: {
61
- adopterOwned: ['brand', 'content', 'product-interaction', 'theme'],
62
- managed: [
63
- 'validators',
64
- 'neutral-proof-fixture',
65
- 'default-test-targets',
66
- ],
67
- seeded: [
68
- 'frontend-contract',
69
- 'route-state-inventory',
70
- 'security-header-policy',
71
- 'support-policy',
72
- 'visual-baseline',
73
- 'accessibility-runbook',
74
- ],
75
- },
76
- postV1Exclusions: [
77
- 'organization-design-system-generation',
78
- 'non-slice-recipe-distribution',
79
- 'static-export-slice-generation',
80
- 'operations-console-ui',
81
- 'hosted-component-marketplace',
82
- ],
83
- publicConfiguration: {
84
- allowlist: ['NEXT_PUBLIC_API_URL'],
85
- dynamicEnvironmentLookup: 'forbidden-in-client-graph',
86
- },
87
- schemaVersion: 1,
88
- semanticQueries: ['role', 'name', 'description', 'state'],
89
- slice: name,
90
- stateFixture: `/${name}/_ebk/frontend-states`,
91
- states,
92
- }),
93
- 'frontend/support-policy.json': (0, built_in_plan_shared_js_1.json)({
94
- assistiveTechnology: [
95
- {
96
- browser: 'adopter-selected',
97
- screenReader: 'adopter-selected',
98
- status: 'manual-proof-required',
99
- },
100
- ],
101
- browserFamilies: [
102
- {
103
- family: 'chromium',
104
- policy: 'current-stable',
105
- status: 'framework-default-executed',
106
- },
107
- {
108
- family: 'firefox',
109
- policy: 'current-stable',
110
- status: 'unevaluated-adopter-owned',
111
- },
112
- {
113
- family: 'webkit',
114
- policy: 'current-stable',
115
- status: 'unevaluated-adopter-owned',
116
- },
117
- ],
118
- inputModalities: ['keyboard', 'pointer', 'touch'],
119
- languageDirections: ['ltr', 'rtl-review-when-applicable'],
120
- note: 'The framework default executes Chromium only. Firefox, WebKit, and assistive-technology status remain unevaluated until adopter-owned evidence exists; upgrades do not silently change this seeded policy.',
121
- schemaVersion: 1,
122
- slice: name,
123
- viewportClasses: ['narrow', 'medium', 'wide'],
124
- }),
125
- 'frontend/routes.json': (0, built_in_plan_shared_js_1.json)({
126
- routes: [
127
- {
128
- actor: 'public',
129
- feature: 'product-entry',
130
- path: `/${name}`,
131
- readAuthorization: 'public-content-only',
132
- states: ['success', 'failure'],
133
- },
134
- {
135
- actor: 'unauthenticated-user',
136
- feature: 'sign-in',
137
- mutationAuthorization: 'server-authentication-and-session-cookie-plan',
138
- path: `/${name}/sign-in`,
139
- states: [
140
- 'initial',
141
- 'loading',
142
- 'validation',
143
- 'success',
144
- 'failure',
145
- 'offline',
146
- ],
147
- },
148
- {
149
- actor: 'unauthenticated-user',
150
- feature: 'password-reset',
151
- mutationAuthorization: 'server-normalized-non-enumerating-reset-request',
152
- path: `/${name}/password-reset`,
153
- states: [
154
- 'initial',
155
- 'loading',
156
- 'validation',
157
- 'success',
158
- 'failure',
159
- 'offline',
160
- ],
161
- },
162
- {
163
- actor: 'synthetic-proof-only',
164
- feature: 'neutral-frontend-states',
165
- path: `/${name}/_ebk/frontend-states`,
166
- readAuthorization: 'public-neutral-content-only',
167
- states,
168
- },
169
- ],
170
- schemaVersion: 1,
171
- slice: name,
172
- }),
173
- 'frontend/security-headers.json': (0, built_in_plan_shared_js_1.json)((0, index_js_1.sliceFrontendSecurityHeaderPolicy)(name)),
174
- 'frontend/visual-baselines.json': (0, built_in_plan_shared_js_1.json)({
175
- records: [],
176
- schemaVersion: 1,
177
- slice: name,
178
- }),
179
- 'docs/frontend-accessibility.md': `# ${pascalName} frontend and accessibility
180
-
181
- The Standard Slice uses a server-first Next.js App Router boundary. Routes and
182
- layouts own URL structure, metadata, composition, and coarse loading or error
183
- states. Server Components may resolve identity, authorization, configuration,
184
- secrets, and protected data. Client Components are the smallest possible
185
- interaction boundary and may receive only intentional serializable view models.
186
- Application policy, validation, and mutations remain server-authoritative.
187
-
188
- The generated Standard profile proves server-rendered OpenNext behavior. The
189
- required static-first proof belongs to the private \`reference-static-site\`
190
- application. Static-export Slice generation and an organization design-system
191
- generator are post-1.0 work; do not imitate either contract inside this Slice.
192
-
193
- ## Ownership
194
-
195
- \`web/src/app/globals.css\`, product content, page composition, brand, and theme
196
- remain seeded Slice-owned material. Framework regeneration must preserve them.
197
- The \`/_ebk/frontend-states\` route is a managed neutral proof fixture, not a
198
- product component catalog and not an import surface for product code.
199
-
200
- The seeded files in \`frontend/\` declare this Slice's route/state, support, and
201
- visual-evidence decisions. Review them when browser support or a journey
202
- changes; framework upgrades must not silently rewrite adopter commitments.
203
-
204
- ## Server and client boundaries
205
-
206
- - Mark every secret or protected-data module with \`import 'server-only'\`.
207
- - Client code may read only the literal public keys in
208
- \`frontend/contract.json\`. A \`NEXT_PUBLIC_\` prefix means public, not safe.
209
- - Never pass ORM records, credentials, authorization policy, or protected
210
- identifiers into a Client Component.
211
- - Do not put protected values in URLs, browser storage, analytics, screenshots,
212
- logs, or error copy.
213
- - Raw HTML, dynamic environment access, and a client-to-server-only import fail
214
- \`frontend-boundaries\`.
215
-
216
- ## Response-header ownership
217
-
218
- The Foundation owns HTTPS, deployed HSTS, and the minimum Permissions-Policy,
219
- Referrer-Policy, and X-Content-Type-Options values in
220
- \`packages/foundation/contracts/frontend-security-headers.json\`. This Slice
221
- owns only its enforced CSP template in \`frontend/security-headers.json\`. The
222
- generated Next 16 \`proxy.ts\` creates a cryptographically random nonce for
223
- each deployed request, composes those disjoint sources, places the materialized
224
- CSP on the request so Next can nonce its framework output, and applies the same
225
- headers to the response. Do not add the same headers to Next configuration,
226
- route handlers, OpenNext, or the Foundation Router. Case-insensitive duplicates
227
- and cross-owner declarations fail before the response is rendered.
228
-
229
- The deployed profile intentionally forces dynamic rendering: static generation,
230
- ISR, PPR, and shared CDN caching cannot safely reuse a request nonce. The
231
- standard SST/OpenNext server keeps Proxy inside the server runtime. A future
232
- external Proxy placement must preserve the request-header handoff and the exact
233
- response policy before it can replace this authority.
234
-
235
- The managed \`/_ebk/frontend-csp\` response is the one reviewed raw-HTML proof
236
- adapter. It contains neutral synthetic parser-inserted script and style pairs so
237
- the deployed browser check can prove that matching nonces execute and missing
238
- nonces are refused. Product routes must not import or imitate that adapter.
239
-
240
- The local-development profile omits HSTS over loopback HTTP and permits only the
241
- development connections needed by Next. Staging and production are locked to
242
- the deployed-https profile. Local packed proof can exercise the deployed
243
- response composition over loopback, but only a deployed HTTPS observation is
244
- hosted transport evidence. Header observation aborts after ten seconds;
245
- \`EBK_FRONTEND_HEADER_FETCH_TIMEOUT_MS\` may lower that bound for a constrained
246
- runner but cannot increase it.
247
-
248
- ## Route and state review
249
-
250
- For every product route, record the actor, read authorization, mutation
251
- authorization, view model, freshness, applicable states, and recovery behavior.
252
- The neutral fixture demonstrates loading, empty, success, validation, partial,
253
- forbidden, not-found, failure, stale, and offline states. Product fixtures
254
- should reproduce equivalent states with synthetic inputs rather than production
255
- data.
256
-
257
- Every mutation authenticates, authorizes, validates, normalizes, and applies
258
- idempotency or concurrency behavior on the server. A hidden or disabled control
259
- is never authorization. Validation errors remain associated with their fields
260
- and are summarized or announced when useful.
261
-
262
- ## Required checks
263
-
264
- Run the Slice targets for:
265
-
266
- - static accessibility lint and client/server boundary validation;
267
- - rendered-state accessibility scans;
268
- - keyboard, focus restoration, and announcement behavior;
269
- - narrow viewport reflow and reduced motion;
270
- - effective local and deployed response headers; and
271
- - stable neutral screenshots and the visual report.
272
-
273
- Automated scans identify only a subset of accessibility barriers and are not a
274
- WCAG conformance claim. Critical journeys additionally require a documented
275
- keyboard, zoom/reflow, and assistive-technology pass. Record the browser,
276
- assistive technology, versions, journey, findings, repairs, and reviewer
277
- without copying user content.
278
-
279
- An accessibility quarantine uses the shared \`testing/quarantine.json\` record
280
- and adds an \`accessibility\` object containing the affected WCAG criteria,
281
- journey, and an approver distinct from the owner. The exception must remain
282
- bounded, supplemental, and linked to remediation. It cannot waive a security
283
- header failure, leaked server module, unresolved \`EBK-SECURITY\` or
284
- \`EBK-BLOCKER\` marker, or the only proof of a protected journey.
285
-
286
- ## Visual reports
287
-
288
- Browser proof writes synthetic screenshots and observations under
289
- \`.ebk/evidence/frontend/\`. The committed
290
- \`frontend/visual-baselines.json\` contains digests and no image data. Updating
291
- it is an intentional local development action with a work reference; CI and
292
- protected stages refuse updates. Baselines are browser-and-operating-system
293
- specific so one reviewed profile cannot silently replace another. Review the
294
- retained screenshots, semantic tests, accessibility results, browser console,
295
- and network results together.
296
-
297
- ## Larger design systems and external starters
298
-
299
- V1 manages validators, test adapters, and this neutral proof fixture. It does
300
- not publish product-facing components from the framework. Product components
301
- remain Slice-owned; future reusable wrappers belong to an organization-owned
302
- design-system project only after that separate post-1.0 generator contract is
303
- implemented. Until then, keep brand and theme decisions in the Slice and do not
304
- create a second framework token authority.
305
-
306
- An external non-Slice starter needs an accepted recipe, ownership, upgrade, and
307
- verification contract. The v1 Slice Blueprint must not be stretched to
308
- distribute one implicitly. This boundary is deliberate even when an example
309
- looks reusable.
310
-
311
- ## Manual review
312
-
313
- An agent driving a real browser may perform and record the keyboard, focus,
314
- zoom/reflow, reduced-motion, and announcement checks below and attach them to
315
- the visual report. A human using actual assistive technology (screen reader,
316
- switch access, or magnifier) completes the assistive-technology pass and is
317
- recorded as the reviewer for that pass; the quarantine approver must still be
318
- distinct from the owner.
319
-
320
- Confirm, at minimum:
321
-
322
- 1. landmark and heading order, names, roles, descriptions, and state;
323
- 2. complete keyboard operation, visible focus, logical order, dialog
324
- containment, and focus restoration;
325
- 3. validation, status, loading, and recovery announcements without excessive
326
- live-region noise;
327
- 4. text and non-text contrast, non-color cues, target size, narrow reflow, 200%
328
- text sizing, browser zoom, and long-content expansion;
329
- 5. reduced-motion behavior and absence of dangerous flashing;
330
- 6. useful behavior when images, fonts, analytics, or optional enhancement fail;
331
- 7. effective HTTPS headers and enforced CSP rather than report-only alone; and
332
- 8. no credentials, personal data, protected identifiers, or raw form values in
333
- retained evidence.
334
- `,
335
- 'web/src/lib/public-configuration.ts': `export const PUBLIC_WEB_CONFIGURATION_KEYS = [
336
- 'NEXT_PUBLIC_API_URL',
337
- ] as const;
338
-
339
- export interface PublicWebConfiguration {
340
- apiUrl?: string;
341
- }
342
-
343
- function publicUrl(value: string | undefined): string | undefined {
344
- const trimmed = value?.trim();
345
- if (!trimmed) return undefined;
346
- const parsed = new URL(trimmed);
347
- const local =
348
- parsed.hostname === '127.0.0.1' ||
349
- parsed.hostname === 'localhost' ||
350
- parsed.hostname === '::1';
351
- if (
352
- (parsed.protocol !== 'https:' && !(local && parsed.protocol === 'http:')) ||
353
- parsed.username ||
354
- parsed.password ||
355
- parsed.search ||
356
- parsed.hash
357
- ) {
358
- throw new Error('NEXT_PUBLIC_API_URL must be an HTTPS URL without credentials, query, or fragment.');
359
- }
360
- return parsed.href.replace(/\\/$/, '');
361
- }
362
-
363
- export function readPublicWebConfiguration(
364
- environment: Readonly<{ NEXT_PUBLIC_API_URL?: string }> = {
365
- NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
366
- },
367
- ): PublicWebConfiguration {
368
- const apiUrl = publicUrl(environment.NEXT_PUBLIC_API_URL);
369
- return apiUrl ? { apiUrl } : {};
370
- }
371
- `,
372
- 'web/src/lib/server-configuration.ts': `import 'server-only';
373
-
374
- export type ServerWebConfigurationKey =
375
- | 'AUTH_CLIENT_ID'
376
- | 'EBK_SOURCE_COMMIT'
377
- | 'EBK_STAGE';
378
-
379
- export function requireServerWebConfiguration(
380
- key: ServerWebConfigurationKey,
381
- environment: Readonly<Record<string, string | undefined>> = process.env,
382
- ): string {
383
- const value = environment[key]?.trim();
384
- if (!value) {
385
- throw new Error(key + ' is required by the ${name} server runtime.');
386
- }
387
- return value;
388
- }
389
- `,
390
- 'web/src/app/%5Febk/frontend-states/fixture.module.css': `.fixture {
391
- background: #ffffff;
392
- color: #172033;
393
- font: 1rem/1.5 system-ui, sans-serif;
394
- margin: 0 auto;
395
- max-width: 72rem;
396
- overflow-wrap: anywhere;
397
- padding: 1.5rem;
398
- }
399
-
400
- .fixturePage {
401
- overflow-wrap: anywhere;
402
- }
403
-
404
- .fixture a {
405
- color: #0645ad;
406
- text-decoration-thickness: .12em;
407
- text-underline-offset: .16em;
408
- }
409
-
410
- .fixture :where(a, button, input):focus-visible {
411
- outline: .2rem solid #b94a00;
412
- outline-offset: .2rem;
413
- }
414
-
415
- .fixture :where(button, input) {
416
- font: inherit;
417
- min-height: 2.75rem;
418
- }
419
-
420
- .fixture button {
421
- background: #153f78;
422
- border: .125rem solid #153f78;
423
- border-radius: .25rem;
424
- color: #ffffff;
425
- cursor: pointer;
426
- padding: .55rem 1rem;
427
- }
428
-
429
- .fixture button:hover {
430
- background: #0b2d5b;
431
- }
432
-
433
- .fixture nav ul,
434
- .stateNavigation ul,
435
- .pagination {
436
- display: flex;
437
- flex-wrap: wrap;
438
- gap: .75rem;
439
- list-style: none;
440
- padding: 0;
441
- }
442
-
443
- .stateNavigation a {
444
- align-items: center;
445
- display: inline-flex;
446
- min-height: 2.75rem;
447
- padding-inline: .5rem;
448
- }
449
-
450
- .panel {
451
- border: .125rem solid #52657d;
452
- border-radius: .5rem;
453
- margin-block: 1rem;
454
- padding: 1rem;
455
- }
456
-
457
- .error {
458
- border-color: #8b1d2c;
459
- }
460
-
461
- .field {
462
- display: grid;
463
- gap: .35rem;
464
- margin-block: 1rem;
465
- max-width: 32rem;
466
- }
467
-
468
- .field input {
469
- border: .125rem solid #52657d;
470
- border-radius: .25rem;
471
- padding: .5rem;
472
- }
473
-
474
- .field input[aria-invalid='true'] {
475
- border-color: #8b1d2c;
476
- }
477
-
478
- .tableWrapper {
479
- max-width: 100%;
480
- overflow-x: auto;
481
- }
482
-
483
- .table {
484
- border-collapse: collapse;
485
- inline-size: 100%;
486
- }
487
-
488
- .table :where(th, td) {
489
- border: .0625rem solid #52657d;
490
- padding: .5rem;
491
- text-align: start;
492
- }
493
-
494
- .dialog {
495
- background: #ffffff;
496
- border: .125rem solid #172033;
497
- border-radius: .5rem;
498
- color: #172033;
499
- max-inline-size: min(32rem, calc(100% - 2rem));
500
- padding: 1.25rem;
501
- }
502
-
503
- .dialog::backdrop {
504
- background: rgb(12 20 34 / 70%);
505
- }
506
-
507
- .motionSample {
508
- transition: transform 180ms ease;
509
- }
510
-
511
- .motionSample:hover {
512
- transform: translateY(-.125rem);
513
- }
514
-
515
- @media (prefers-reduced-motion: reduce) {
516
- .fixture *,
517
- .fixture *::before,
518
- .fixture *::after {
519
- animation-duration: .01ms !important;
520
- animation-iteration-count: 1 !important;
521
- scroll-behavior: auto !important;
522
- transition-duration: .01ms !important;
523
- }
524
- }
525
-
526
- @media (max-width: 30rem) {
527
- .fixture {
528
- padding: .75rem;
529
- }
530
- }
531
- `,
532
- 'web/src/app/%5Febk/frontend-states/states.ts': `export const FRONTEND_FIXTURE_STATES = ${JSON.stringify(states)} as const;
533
- export type FrontendFixtureState = (typeof FRONTEND_FIXTURE_STATES)[number];
534
- `,
535
- 'web/src/app/%5Febk/frontend-states/fixture.tsx': `'use client';
536
-
537
- import { useRef, useState } from 'react';
538
- import styles from './fixture.module.css';
539
- import type { FrontendFixtureState } from './states';
540
-
541
- function StatePanel({ state }: Readonly<{ state: FrontendFixtureState }>) {
542
- if (state === 'loading') {
543
- return <section aria-labelledby="state-heading" className={styles.panel}>
544
- <h2 id="state-heading">Loading records</h2>
545
- <p aria-live="polite" role="status">Loading the current records.</p>
546
- </section>;
547
- }
548
- if (state === 'empty') {
549
- return <section aria-labelledby="state-heading" className={styles.panel}>
550
- <h2 id="state-heading">No records yet</h2>
551
- <p>Create the first record when the required details are available.</p>
552
- <button type="button">Create a record</button>
553
- </section>;
554
- }
555
- if (state === 'validation') {
556
- return <section aria-labelledby="state-heading" className={styles.panel}>
557
- <h2 id="state-heading">Review the form</h2>
558
- <div className={styles.error} role="alert">
559
- <p>There is one problem. Correct it and submit again.</p>
560
- <a href="#fixture-name">Enter a record name</a>
561
- </div>
562
- <div className={styles.field}>
563
- <label htmlFor="fixture-name">Record name</label>
564
- <input
565
- aria-describedby="fixture-name-error"
566
- aria-invalid="true"
567
- id="fixture-name"
568
- name="name"
569
- required
570
- />
571
- <p id="fixture-name-error">Enter a record name.</p>
572
- </div>
573
- <button type="button">Save record</button>
574
- </section>;
575
- }
576
- if (state === 'partial') {
577
- return <section aria-labelledby="state-heading" className={styles.panel}>
578
- <h2 id="state-heading">Records partially available</h2>
579
- <p role="status">Recent records are available. Archived records could not be loaded.</p>
580
- <button type="button">Retry archived records</button>
581
- </section>;
582
- }
583
- if (state === 'forbidden') {
584
- return <section aria-labelledby="state-heading" className={styles.panel}>
585
- <h2 id="state-heading">Access not permitted</h2>
586
- <p>Your signed-in account cannot view these records.</p>
587
- <a href="/${name}">Return to ${pascalName}</a>
588
- </section>;
589
- }
590
- if (state === 'not-found') {
591
- return <section aria-labelledby="state-heading" className={styles.panel}>
592
- <h2 id="state-heading">Record not found</h2>
593
- <p>It may have been removed or the link may be incorrect.</p>
594
- <a href="/${name}">Return to ${pascalName}</a>
595
- </section>;
596
- }
597
- if (state === 'failure') {
598
- return <section aria-labelledby="state-heading" className={styles.panel}>
599
- <h2 id="state-heading">Records unavailable</h2>
600
- <p role="alert">The request failed. Support reference: ui-safe-0001.</p>
601
- <button type="button">Try again</button>
602
- </section>;
603
- }
604
- if (state === 'stale') {
605
- return <section aria-labelledby="state-heading" className={styles.panel}>
606
- <h2 id="state-heading">Newer changes are available</h2>
607
- <p role="status">This view is out of date. Review changes before saving.</p>
608
- <button type="button">Review newer changes</button>
609
- </section>;
610
- }
611
- if (state === 'offline') {
612
- return <section aria-labelledby="state-heading" className={styles.panel}>
613
- <h2 id="state-heading">Connection interrupted</h2>
614
- <p role="status">Your change was not sent. Reconnect and try again.</p>
615
- <button type="button">Retry connection</button>
616
- </section>;
617
- }
618
- return <section aria-labelledby="state-heading" className={styles.panel}>
619
- <h2 id="state-heading">Record saved</h2>
620
- <p role="status">The synthetic record was saved.</p>
621
- </section>;
622
- }
623
-
624
- export function NeutralFrontendStateFixture({
625
- state,
626
- }: Readonly<{ state: FrontendFixtureState }>) {
627
- const dialog = useRef<HTMLDialogElement>(null);
628
- const dialogClose = useRef<HTMLButtonElement>(null);
629
- const dialogTrigger = useRef<HTMLButtonElement>(null);
630
- const [dialogOpen, setDialogOpen] = useState(false);
631
-
632
- function openDialog() {
633
- setDialogOpen(true);
634
- dialog.current?.showModal();
635
- queueMicrotask(() => dialogClose.current?.focus());
636
- }
637
-
638
- function restoreDialogFocus() {
639
- setDialogOpen(false);
640
- dialogTrigger.current?.focus();
641
- }
642
-
643
- return <div className={styles.fixture}>
644
- <StatePanel state={state} />
645
-
646
- <section aria-labelledby="actions-heading" className={styles.panel}>
647
- <h2 id="actions-heading">Semantic actions</h2>
648
- <p>Use a link to navigate and a button to change the current interface.</p>
649
- <a href="/${name}">Return to ${pascalName}</a>
650
- {' '}
651
- <button
652
- aria-expanded={dialogOpen}
653
- aria-haspopup="dialog"
654
- className={styles.motionSample}
655
- onClick={openDialog}
656
- ref={dialogTrigger}
657
- type="button"
658
- >
659
- Open details dialog
660
- </button>
661
- </section>
662
-
663
- <section aria-labelledby="table-heading" className={styles.panel}>
664
- <h2 id="table-heading">Synthetic records</h2>
665
- <div className={styles.tableWrapper}>
666
- <table className={styles.table}>
667
- <caption>Neutral fixture record status</caption>
668
- <thead><tr><th scope="col">Record</th><th scope="col">Status</th></tr></thead>
669
- <tbody><tr><th scope="row">Example A</th><td>Ready</td></tr></tbody>
670
- </table>
671
- </div>
672
- <nav aria-label="Record pages">
673
- <ul className={styles.pagination}>
674
- <li><a aria-current="page" href="?state=success">Page 1</a></li>
675
- <li><a href="?state=empty">Page 2</a></li>
676
- </ul>
677
- </nav>
678
- </section>
679
-
680
- <dialog
681
- aria-labelledby="details-dialog-title"
682
- className={styles.dialog}
683
- onCancel={restoreDialogFocus}
684
- onClose={restoreDialogFocus}
685
- ref={dialog}
686
- >
687
- <h2 id="details-dialog-title">Synthetic record details</h2>
688
- <p>This dialog contains neutral proof content only.</p>
689
- <button onClick={() => dialog.current?.close()} ref={dialogClose} type="button">
690
- Close details
691
- </button>
692
- </dialog>
693
- </div>;
694
- }
695
- `,
696
- 'web/src/app/%5Febk/frontend-states/page.tsx': `import type { Metadata } from 'next';
697
- import { NeutralFrontendStateFixture } from './fixture';
698
- import styles from './fixture.module.css';
699
- import {
700
- FRONTEND_FIXTURE_STATES,
701
- type FrontendFixtureState,
702
- } from './states';
703
-
704
- export const metadata: Metadata = {
705
- robots: { follow: false, index: false },
706
- title: '${pascalName} neutral frontend states',
707
- };
708
-
709
- function fixtureState(value: string | undefined): FrontendFixtureState {
710
- return FRONTEND_FIXTURE_STATES.find((state) => state === value) ?? 'success';
711
- }
712
-
713
- export default async function FrontendStates({
714
- searchParams,
715
- }: Readonly<{ searchParams: Promise<{ state?: string }> }>) {
716
- const state = fixtureState((await searchParams).state);
717
- return <main className={styles.fixturePage}>
718
- <h1>${pascalName} neutral frontend states</h1>
719
- <p>
720
- This managed route contains synthetic accessibility evidence, not product
721
- content or a shared design system.
722
- </p>
723
- <nav aria-label="Frontend fixture states" className={styles.stateNavigation}>
724
- <ul>
725
- {FRONTEND_FIXTURE_STATES.map((candidate) => <li key={candidate}>
726
- <a
727
- aria-current={candidate === state ? 'page' : undefined}
728
- href={'/${name}/_ebk/frontend-states?state=' + candidate}
729
- >
730
- {candidate}
731
- </a>
732
- </li>)}
733
- </ul>
734
- </nav>
735
- <NeutralFrontendStateFixture state={state} />
736
- </main>;
737
- }
738
- `,
739
- 'web/src/app/%5Febk/frontend-states/page.spec.tsx': `import { renderToStaticMarkup } from 'react-dom/server';
740
- import { describe, expect, it } from 'vitest';
741
- import { NeutralFrontendStateFixture } from './fixture';
742
- import { FRONTEND_FIXTURE_STATES } from './states';
743
-
744
- describe('neutral frontend state fixture', () => {
745
- it.each(FRONTEND_FIXTURE_STATES)('renders the %s state with one named region', (state) => {
746
- const html = renderToStaticMarkup(<NeutralFrontendStateFixture state={state} />);
747
- expect(html).toContain('id="state-heading"');
748
- expect(html).not.toContain('dangerouslySetInnerHTML');
749
- expect(html).not.toContain('placeholder');
750
- });
751
-
752
- it('keeps the dialog, table, pagination, field, and status semantics inspectable', () => {
753
- const html = renderToStaticMarkup(<NeutralFrontendStateFixture state="validation" />);
754
- expect(html).toContain('<dialog');
755
- expect(html).toContain('aria-labelledby="details-dialog-title"');
756
- expect(html).toContain('<caption>');
757
- expect(html).toContain('aria-label="Record pages"');
758
- expect(html).toContain('aria-invalid="true"');
759
- expect(html).toContain('role="alert"');
760
- });
761
- });
762
- `,
763
- 'web/src/app/%5Febk/frontend-csp/route.ts': `import 'server-only';
764
- import { headers } from 'next/headers';
765
-
766
- const noncePattern = /^[A-Za-z0-9+/_-]{16,128}={0,2}$/;
767
-
768
- export async function GET(): Promise<Response> {
769
- const nonce = (await headers()).get('x-nonce') ?? '';
770
- if (!noncePattern.test(nonce)) {
771
- return new Response('Strict CSP proof requires the request nonce.', {
772
- status: 500,
773
- });
774
- }
775
- return new Response(
776
- '<!doctype html><html><head>' +
777
- '<style nonce="' + nonce + '">#approved-style{color:rgb(1,2,3)}</style>' +
778
- '<style>#unapproved-style{color:rgb(4,5,6)}</style>' +
779
- '</head><body>' +
780
- '<h1>${pascalName} strict CSP proof</h1>' +
781
- '<p id="approved-style">Approved style</p>' +
782
- '<p id="unapproved-style">Unapproved style</p>' +
783
- '<script nonce="' + nonce + '">' +
784
- "document.documentElement.dataset.ebkApprovedInline='executed'" +
785
- '</script>' +
786
- '<script>' +
787
- "document.documentElement.dataset.ebkUnapprovedInline='executed'" +
788
- '</script>' +
789
- '</body></html>',
790
- { headers: { 'Content-Type': 'text/html; charset=utf-8' } },
791
- );
792
- }
793
- `,
794
- 'scripts/frontend-boundaries.mjs': `import {
795
- lstatSync,
796
- mkdirSync,
797
- opendirSync,
798
- readFileSync,
799
- writeFileSync,
800
- } from 'node:fs';
801
- import { dirname, extname, join, relative, resolve, sep } from 'node:path';
802
- import { fileURLToPath } from 'node:url';
803
- import ts from 'typescript';
804
-
805
- const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
806
- const sourceRoot = join(projectRoot, 'web', 'src');
807
- const contractPath = join(projectRoot, 'frontend', 'contract.json');
808
- const tsconfigPath = join(projectRoot, 'web', 'tsconfig.json');
809
- const SOURCE_EXTENSIONS = new Set(['.cjs', '.js', '.jsx', '.mjs', '.ts', '.tsx']);
810
- const CLIENT_ASSET_EXTENSIONS = new Set(['.css']);
811
- const MAX_SOURCE_DIRECTORIES = 512;
812
- const MAX_SOURCE_FILES = 1_024;
813
- const MAX_SOURCE_FILE_BYTES = 1024 * 1024;
814
- const MAX_SOURCE_BYTES = 16 * 1024 * 1024;
815
- const MAX_TRAVERSAL_ENTRIES = 20_000;
816
-
817
- function portable(path) {
818
- return relative(projectRoot, path).split(sep).join('/');
819
- }
820
-
821
- function lineOf(sourceFile, node) {
822
- return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;
823
- }
824
-
825
- function sourcePaths(root) {
826
- const paths = [];
827
- const findings = [];
828
- const pending = [root];
829
- let directories = 0;
830
- let entries = 0;
831
- let totalBytes = 0;
832
- let traversalAborted = false;
833
- while (pending.length > 0 && !traversalAborted) {
834
- const directory = pending.pop();
835
- directories += 1;
836
- if (directories > MAX_SOURCE_DIRECTORIES) {
837
- findings.push({
838
- classification: 'source-directory-limit-exceeded',
839
- limit: MAX_SOURCE_DIRECTORIES,
840
- path: portable(directory),
841
- });
842
- traversalAborted = true;
843
- break;
844
- }
845
- const handle = opendirSync(directory);
846
- try {
847
- let entry;
848
- while ((entry = handle.readSync()) !== null) {
849
- entries += 1;
850
- if (entries > MAX_TRAVERSAL_ENTRIES) {
851
- findings.push({
852
- classification: 'source-entry-limit-exceeded',
853
- limit: MAX_TRAVERSAL_ENTRIES,
854
- path: portable(directory),
855
- });
856
- traversalAborted = true;
857
- break;
858
- }
859
- const path = join(directory, entry.name);
860
- if (entry.isSymbolicLink()) {
861
- findings.push({
862
- classification: 'source-symlink-forbidden',
863
- path: portable(path),
864
- });
865
- } else if (entry.isDirectory()) {
866
- pending.push(path);
867
- } else if (entry.isFile() && SOURCE_EXTENSIONS.has(extname(entry.name))) {
868
- const size = lstatSync(path).size;
869
- if (size > MAX_SOURCE_FILE_BYTES) {
870
- findings.push({
871
- bytes: size,
872
- classification: 'source-file-byte-limit-exceeded',
873
- limit: MAX_SOURCE_FILE_BYTES,
874
- path: portable(path),
875
- });
876
- continue;
877
- }
878
- if (paths.length >= MAX_SOURCE_FILES) {
879
- findings.push({
880
- classification: 'source-file-limit-exceeded',
881
- limit: MAX_SOURCE_FILES,
882
- path: portable(path),
883
- });
884
- traversalAborted = true;
885
- break;
886
- }
887
- if (totalBytes + size > MAX_SOURCE_BYTES) {
888
- findings.push({
889
- classification: 'source-total-byte-limit-exceeded',
890
- limit: MAX_SOURCE_BYTES,
891
- path: portable(path),
892
- });
893
- traversalAborted = true;
894
- break;
895
- }
896
- totalBytes += size;
897
- paths.push(path);
898
- } else if (
899
- !entry.isFile() &&
900
- !entry.isDirectory() &&
901
- !entry.isSymbolicLink()
902
- ) {
903
- findings.push({
904
- classification: 'source-special-file-forbidden',
905
- path: portable(path),
906
- });
907
- }
908
- }
909
- } finally {
910
- handle.closeSync();
911
- }
912
- }
913
- return {
914
- findings,
915
- paths: traversalAborted ? [] : paths,
916
- };
917
- }
918
-
919
- function outsideSourceRoot(target) {
920
- const fromSourceRoot = relative(sourceRoot, target);
921
- return (
922
- fromSourceRoot === '..' ||
923
- fromSourceRoot.startsWith('..' + sep) ||
924
- resolve(sourceRoot, fromSourceRoot) !== target
925
- );
926
- }
927
-
928
- function relativeImport(importer, specifier, existing, compilerOptions) {
929
- const requestedTarget = resolve(dirname(importer), specifier);
930
- if (outsideSourceRoot(requestedTarget)) {
931
- return {
932
- failure: 'outside-source-root',
933
- kind: 'relative',
934
- specifier,
935
- target: requestedTarget,
936
- };
937
- }
938
- const resolvedModule = ts.resolveModuleName(
939
- specifier,
940
- importer,
941
- compilerOptions,
942
- ts.sys,
943
- ).resolvedModule;
944
- if (!resolvedModule) {
945
- if (
946
- ts.sys.fileExists(requestedTarget) &&
947
- CLIENT_ASSET_EXTENSIONS.has(extname(requestedTarget))
948
- ) {
949
- return { kind: 'asset', specifier, target: requestedTarget };
950
- }
951
- return {
952
- failure: ts.sys.fileExists(requestedTarget)
953
- ? 'unsupported-target'
954
- : 'unresolved',
955
- kind: 'relative',
956
- specifier,
957
- target: ts.sys.fileExists(requestedTarget) ? requestedTarget : undefined,
958
- };
959
- }
960
- const target = resolve(resolvedModule.resolvedFileName);
961
- if (outsideSourceRoot(target)) {
962
- return {
963
- failure: 'outside-source-root',
964
- kind: 'relative',
965
- specifier,
966
- target,
967
- };
968
- }
969
- if (!existing.has(target)) {
970
- if (CLIENT_ASSET_EXTENSIONS.has(extname(target))) {
971
- return { kind: 'asset', specifier, target };
972
- }
973
- return {
974
- failure: 'unsupported-target',
975
- kind: 'relative',
976
- specifier,
977
- target,
978
- };
979
- }
980
- return { kind: 'relative', specifier, target };
981
- }
982
-
983
- function compilerConfiguration() {
984
- const loaded = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
985
- if (loaded.error) {
986
- throw new Error(
987
- 'web/tsconfig.json is invalid: ' +
988
- ts.flattenDiagnosticMessageText(loaded.error.messageText, ' '),
989
- );
990
- }
991
- const parsed = ts.parseJsonConfigFileContent(
992
- loaded.config,
993
- ts.sys,
994
- dirname(tsconfigPath),
995
- undefined,
996
- tsconfigPath,
997
- );
998
- if (parsed.errors.length > 0) {
999
- throw new Error(
1000
- 'web/tsconfig.json is invalid: ' +
1001
- parsed.errors
1002
- .map((diagnostic) =>
1003
- ts.flattenDiagnosticMessageText(diagnostic.messageText, ' '),
1004
- )
1005
- .join(' '),
1006
- );
1007
- }
1008
- return {
1009
- aliasPatterns: Object.keys(parsed.options.paths ?? {}).sort(),
1010
- options: parsed.options,
1011
- };
1012
- }
1013
-
1014
- function aliasMatches(pattern, specifier) {
1015
- const wildcard = pattern.indexOf('*');
1016
- if (wildcard === -1) return pattern === specifier;
1017
- if (pattern.indexOf('*', wildcard + 1) !== -1) return false;
1018
- const prefix = pattern.slice(0, wildcard);
1019
- const suffix = pattern.slice(wildcard + 1);
1020
- return (
1021
- specifier.length >= prefix.length + suffix.length &&
1022
- specifier.startsWith(prefix) &&
1023
- specifier.endsWith(suffix)
1024
- );
1025
- }
1026
-
1027
- function moduleImport(
1028
- importer,
1029
- specifier,
1030
- existing,
1031
- compilerOptions,
1032
- aliasPatterns,
1033
- ) {
1034
- if (specifier.startsWith('.')) {
1035
- return relativeImport(importer, specifier, existing, compilerOptions);
1036
- }
1037
- const alias = aliasPatterns.find((pattern) =>
1038
- aliasMatches(pattern, specifier),
1039
- );
1040
- const resolvedModule = ts.resolveModuleName(
1041
- specifier,
1042
- importer,
1043
- compilerOptions,
1044
- ts.sys,
1045
- ).resolvedModule;
1046
- if (!resolvedModule) {
1047
- return alias
1048
- ? { alias, failure: 'unresolved', kind: 'alias', specifier }
1049
- : undefined;
1050
- }
1051
- if (!alias && resolvedModule.isExternalLibraryImport) return undefined;
1052
- const kind = alias ? 'alias' : 'base-url';
1053
- const target = resolve(resolvedModule.resolvedFileName);
1054
- if (outsideSourceRoot(target)) {
1055
- return {
1056
- alias,
1057
- failure: 'outside-source-root',
1058
- kind,
1059
- specifier,
1060
- target,
1061
- };
1062
- }
1063
- if (!existing.has(target)) {
1064
- return {
1065
- alias,
1066
- failure: 'unsupported-target',
1067
- kind,
1068
- specifier,
1069
- target,
1070
- };
1071
- }
1072
- return { alias, kind, specifier, target };
1073
- }
1074
-
1075
- function scriptKind(path) {
1076
- switch (extname(path)) {
1077
- case '.js':
1078
- case '.mjs':
1079
- case '.cjs':
1080
- return ts.ScriptKind.JS;
1081
- case '.jsx':
1082
- return ts.ScriptKind.JSX;
1083
- case '.tsx':
1084
- return ts.ScriptKind.TSX;
1085
- default:
1086
- return ts.ScriptKind.TS;
1087
- }
1088
- }
1089
-
1090
- function calledModule(node) {
1091
- if (
1092
- ts.isImportDeclaration(node) ||
1093
- ts.isExportDeclaration(node)
1094
- ) {
1095
- return node.moduleSpecifier && ts.isStringLiteralLike(node.moduleSpecifier)
1096
- ? { kind: 'static', specifier: node.moduleSpecifier.text }
1097
- : undefined;
1098
- }
1099
- if (!ts.isCallExpression(node)) return undefined;
1100
- const kind =
1101
- node.expression.kind === ts.SyntaxKind.ImportKeyword
1102
- ? 'dynamic-import'
1103
- : ts.isIdentifier(node.expression) && node.expression.text === 'require'
1104
- ? 'require'
1105
- : undefined;
1106
- if (!kind) return undefined;
1107
- const argument = node.arguments[0];
1108
- return node.arguments.length === 1 && argument && ts.isStringLiteralLike(argument)
1109
- ? { kind, specifier: argument.text }
1110
- : { kind, specifier: null };
1111
- }
1112
-
1113
- function environmentRead(node) {
1114
- if (
1115
- ts.isPropertyAccessExpression(node) &&
1116
- isProcessEnvironmentObject(node.expression)
1117
- ) {
1118
- return node.name.text;
1119
- }
1120
- if (
1121
- ts.isElementAccessExpression(node) &&
1122
- isProcessEnvironmentObject(node.expression)
1123
- ) {
1124
- return ts.isStringLiteralLike(node.argumentExpression)
1125
- ? node.argumentExpression.text
1126
- : null;
1127
- }
1128
- return undefined;
1129
- }
1130
-
1131
- function isProcessEnvironmentObject(node) {
1132
- return (
1133
- (ts.isPropertyAccessExpression(node) &&
1134
- ts.isIdentifier(node.expression) &&
1135
- node.expression.text === 'process' &&
1136
- node.name.text === 'env') ||
1137
- (ts.isElementAccessExpression(node) &&
1138
- ts.isIdentifier(node.expression) &&
1139
- node.expression.text === 'process' &&
1140
- ts.isStringLiteralLike(node.argumentExpression) &&
1141
- node.argumentExpression.text === 'env')
1142
- );
1143
- }
1144
-
1145
- function serverPackage(specifier) {
1146
- return (
1147
- specifier === 'next/headers' ||
1148
- specifier === 'next/server' ||
1149
- specifier === 'server-only' ||
1150
- specifier.startsWith('@aws-sdk/') ||
1151
- specifier === '@empire-builder-kit/runtime/auth-backend' ||
1152
- specifier === '@empire-builder-kit/runtime/database' ||
1153
- specifier === '@empire-builder-kit/runtime/secrets'
1154
- );
1155
- }
1156
-
1157
- export function inspectFrontendBoundaries() {
1158
- const contract = JSON.parse(readFileSync(contractPath, 'utf8'));
1159
- if (
1160
- contract?.schemaVersion !== 1 ||
1161
- contract?.slice !== '${name}' ||
1162
- !Array.isArray(contract?.publicConfiguration?.allowlist)
1163
- ) {
1164
- throw new Error('frontend/contract.json is missing the managed public configuration contract.');
1165
- }
1166
- const allowedPublic = new Set(contract.publicConfiguration.allowlist);
1167
- const discovered = sourcePaths(sourceRoot);
1168
- const findings = [...discovered.findings];
1169
- const paths = discovered.paths;
1170
- const existing = new Set(paths);
1171
- const modules = new Map();
1172
- const { aliasPatterns, options: compilerOptions } = compilerConfiguration();
1173
-
1174
- for (const path of paths) {
1175
- const source = readFileSync(path, 'utf8');
1176
- const sourceFile = ts.createSourceFile(
1177
- path,
1178
- source,
1179
- ts.ScriptTarget.Latest,
1180
- true,
1181
- scriptKind(path),
1182
- );
1183
- const imports = [];
1184
- const dynamicModuleSpecifiers = [];
1185
- const serverPackages = [];
1186
- let serverOnly = false;
1187
- const inspectModules = (node) => {
1188
- const called = calledModule(node);
1189
- if (called) {
1190
- const moduleSpecifier = called.specifier;
1191
- if (moduleSpecifier === null) {
1192
- dynamicModuleSpecifiers.push({
1193
- kind: called.kind,
1194
- line: lineOf(sourceFile, node),
1195
- });
1196
- } else {
1197
- if (moduleSpecifier === 'server-only') serverOnly = true;
1198
- if (serverPackage(moduleSpecifier)) serverPackages.push(moduleSpecifier);
1199
- const target = moduleImport(
1200
- path,
1201
- moduleSpecifier,
1202
- existing,
1203
- compilerOptions,
1204
- aliasPatterns,
1205
- );
1206
- if (target) imports.push(target);
1207
- }
1208
- }
1209
- ts.forEachChild(node, inspectModules);
1210
- };
1211
- inspectModules(sourceFile);
1212
- let client = false;
1213
- for (const statement of sourceFile.statements) {
1214
- if (
1215
- !ts.isExpressionStatement(statement) ||
1216
- !ts.isStringLiteral(statement.expression)
1217
- ) {
1218
- break;
1219
- }
1220
- if (statement.expression.text === 'use client') client = true;
1221
- }
1222
- modules.set(path, {
1223
- client,
1224
- dynamicModuleSpecifiers,
1225
- imports: imports.filter(
1226
- (candidate, index) =>
1227
- imports.findIndex(
1228
- (entry) => JSON.stringify(entry) === JSON.stringify(candidate),
1229
- ) === index,
1230
- ),
1231
- serverOnly,
1232
- serverPackages: [...new Set(serverPackages)],
1233
- sourceFile,
1234
- });
1235
- }
1236
-
1237
- const clientReachable = new Map();
1238
- for (const [path, module] of modules) {
1239
- if (!module.client) continue;
1240
- const pending = [
1241
- {
1242
- ancestry: [],
1243
- edgeKinds: [],
1244
- path,
1245
- root: path,
1246
- },
1247
- ];
1248
- const visited = new Set();
1249
- while (pending.length > 0) {
1250
- const current = pending.pop();
1251
- if (!current) continue;
1252
- if (current.ancestry.includes(current.path)) {
1253
- const cycleStart = current.ancestry.indexOf(current.path);
1254
- const cycleEdgeKinds = [
1255
- ...new Set(current.edgeKinds.slice(cycleStart)),
1256
- ].sort();
1257
- const cyclePaths = current.ancestry
1258
- .slice(cycleStart)
1259
- .map((cyclePath) => portable(cyclePath))
1260
- .sort();
1261
- const reachedThroughAlias = cycleEdgeKinds.includes('alias');
1262
- const reachedThroughBaseUrl = cycleEdgeKinds.includes('base-url');
1263
- if (
1264
- cycleEdgeKinds.length > 1 &&
1265
- (reachedThroughAlias || reachedThroughBaseUrl)
1266
- ) {
1267
- findings.push({
1268
- classification: 'client-mixed-local-module-cycle',
1269
- client: portable(current.root),
1270
- cycleEdgeKinds,
1271
- path: cyclePaths[0],
1272
- });
1273
- } else if (reachedThroughBaseUrl) {
1274
- findings.push({
1275
- classification: 'client-base-url-cycle',
1276
- client: portable(current.root),
1277
- cycleEdgeKinds,
1278
- path: cyclePaths[0],
1279
- });
1280
- } else if (reachedThroughAlias) {
1281
- findings.push({
1282
- classification: 'client-path-alias-cycle',
1283
- client: portable(current.root),
1284
- cycleEdgeKinds,
1285
- path: cyclePaths[0],
1286
- });
1287
- }
1288
- continue;
1289
- }
1290
- if (visited.has(current.path)) continue;
1291
- visited.add(current.path);
1292
- const currentModule = modules.get(current.path);
1293
- if (!currentModule) continue;
1294
- if (!clientReachable.has(current.path)) {
1295
- clientReachable.set(current.path, new Set());
1296
- }
1297
- clientReachable.get(current.path).add(current.root);
1298
- if (currentModule.serverOnly) {
1299
- findings.push({
1300
- classification: 'client-imports-server-only',
1301
- client: portable(current.root),
1302
- path: portable(current.path),
1303
- });
1304
- }
1305
- for (const dynamic of currentModule.dynamicModuleSpecifiers) {
1306
- findings.push({
1307
- classification: 'client-dynamic-module-specifier',
1308
- client: portable(current.root),
1309
- kind: dynamic.kind,
1310
- line: dynamic.line,
1311
- path: portable(current.path),
1312
- });
1313
- }
1314
- for (const packageName of currentModule.serverPackages) {
1315
- findings.push({
1316
- classification: 'client-imports-server-package',
1317
- client: portable(current.root),
1318
- package: packageName,
1319
- path: portable(current.path),
1320
- });
1321
- }
1322
- const orderedImports = [...currentModule.imports].sort((left, right) =>
1323
- JSON.stringify(right) < JSON.stringify(left)
1324
- ? -1
1325
- : JSON.stringify(right) > JSON.stringify(left)
1326
- ? 1
1327
- : 0,
1328
- );
1329
- for (const imported of orderedImports) {
1330
- if (imported.failure) {
1331
- const importKind =
1332
- imported.kind === 'relative'
1333
- ? 'relative-import'
1334
- : imported.kind === 'alias'
1335
- ? 'path-alias'
1336
- : 'base-url';
1337
- findings.push({
1338
- alias: imported.alias,
1339
- classification:
1340
- imported.failure === 'outside-source-root'
1341
- ? 'client-' + importKind + '-outside-source-root'
1342
- : imported.failure === 'unsupported-target'
1343
- ? 'client-' + importKind + '-target-unsupported'
1344
- : 'client-' + importKind + '-unresolved',
1345
- client: portable(current.root),
1346
- path: portable(current.path),
1347
- specifier: imported.specifier,
1348
- target: imported.target ? portable(imported.target) : undefined,
1349
- });
1350
- continue;
1351
- }
1352
- pending.push({
1353
- ancestry: [...current.ancestry, current.path],
1354
- edgeKinds: [...current.edgeKinds, imported.kind],
1355
- path: imported.target,
1356
- root: current.root,
1357
- });
1358
- }
1359
- }
1360
- }
1361
-
1362
- for (const [path, module] of modules) {
1363
- const inClientGraph = clientReachable.has(path);
1364
- const visit = (node) => {
1365
- const key = environmentRead(node);
1366
- const parent = node.parent;
1367
- const parentConsumesEnvironment =
1368
- (parent &&
1369
- ts.isPropertyAccessExpression(parent) &&
1370
- parent.expression === node) ||
1371
- (parent &&
1372
- ts.isElementAccessExpression(parent) &&
1373
- parent.expression === node);
1374
- if (inClientGraph && key === null) {
1375
- findings.push({
1376
- classification: 'client-dynamic-environment-access',
1377
- line: lineOf(module.sourceFile, node),
1378
- path: portable(path),
1379
- });
1380
- } else if (
1381
- inClientGraph &&
1382
- isProcessEnvironmentObject(node) &&
1383
- !parentConsumesEnvironment
1384
- ) {
1385
- findings.push({
1386
- classification: 'client-dynamic-environment-access',
1387
- line: lineOf(module.sourceFile, node),
1388
- path: portable(path),
1389
- });
1390
- } else if (inClientGraph && typeof key === 'string') {
1391
- findings.push({
1392
- classification:
1393
- key.startsWith('NEXT_PUBLIC_') && allowedPublic.has(key)
1394
- ? undefined
1395
- : key.startsWith('NEXT_PUBLIC_')
1396
- ? 'undeclared-public-configuration'
1397
- : 'client-reads-server-environment',
1398
- key:
1399
- key.startsWith('NEXT_PUBLIC_') && !allowedPublic.has(key)
1400
- ? key
1401
- : undefined,
1402
- line: lineOf(module.sourceFile, node),
1403
- path: portable(path),
1404
- });
1405
- }
1406
- if (
1407
- (ts.isIdentifier(node) && node.text === 'dangerouslySetInnerHTML') ||
1408
- (ts.isPropertyAccessExpression(node) && node.name.text === 'innerHTML')
1409
- ) {
1410
- findings.push({
1411
- classification: 'raw-html-sink-requires-reviewed-adapter',
1412
- line: lineOf(module.sourceFile, node),
1413
- path: portable(path),
1414
- });
1415
- }
1416
- ts.forEachChild(node, visit);
1417
- };
1418
- visit(module.sourceFile);
1419
- }
1420
-
1421
- const normalized = findings
1422
- .filter((finding) => finding.classification)
1423
- .map((finding) =>
1424
- Object.fromEntries(
1425
- Object.entries(finding).filter(([, value]) => value !== undefined),
1426
- ),
1427
- )
1428
- .sort((left, right) =>
1429
- JSON.stringify(left) < JSON.stringify(right)
1430
- ? -1
1431
- : JSON.stringify(left) > JSON.stringify(right)
1432
- ? 1
1433
- : 0,
1434
- );
1435
- return {
1436
- counts: { checked: modules.size, findings: normalized.length },
1437
- findings: normalized,
1438
- kind: 'ebk-frontend-boundary-result',
1439
- outcome: normalized.length === 0 ? 'passed' : 'failed',
1440
- schemaVersion: 1,
1441
- slice: '${name}',
1442
- };
1443
- }
1444
-
1445
- function main() {
1446
- const result = inspectFrontendBoundaries();
1447
- const outputArgument = process.argv.find((value) => value.startsWith('--output='));
1448
- if (outputArgument) {
1449
- const output = resolve(projectRoot, outputArgument.slice('--output='.length));
1450
- if (
1451
- relative(projectRoot, output).startsWith('..' + sep) ||
1452
- relative(projectRoot, output) === '..'
1453
- ) {
1454
- throw new Error('Frontend boundary evidence must remain inside the Product Slice.');
1455
- }
1456
- mkdirSync(dirname(output), { recursive: true, mode: 0o700 });
1457
- writeFileSync(output, JSON.stringify(result, null, 2) + '\\n', { mode: 0o600 });
1458
- }
1459
- process.stdout.write(JSON.stringify(result) + '\\n');
1460
- if (result.outcome !== 'passed') process.exitCode = 1;
1461
- }
1462
-
1463
- main();
1464
- `,
1465
- 'scripts/frontend-security-headers.mjs': (0, built_in_plan_frontend_header_proof_js_1.renderFrontendSecurityHeaderProof)(name, 'Product Slice'),
1466
- 'scripts/frontend-visual-report.mjs': `import { createHash } from 'node:crypto';
1467
- import {
1468
- lstatSync,
1469
- mkdirSync,
1470
- readFileSync,
1471
- realpathSync,
1472
- writeFileSync,
1473
- } from 'node:fs';
1474
- import { dirname, join, relative, resolve, sep } from 'node:path';
1475
- import { fileURLToPath } from 'node:url';
1476
-
1477
- const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
1478
- const baselinePath = join(projectRoot, 'frontend', 'visual-baselines.json');
1479
- const observationPath = join(
1480
- projectRoot,
1481
- '.ebk',
1482
- 'evidence',
1483
- 'frontend',
1484
- 'frontend-visual-observations.json',
1485
- );
1486
- const resultPath = join(
1487
- projectRoot,
1488
- '.ebk',
1489
- 'evidence',
1490
- 'frontend',
1491
- 'frontend-visual-report.json',
1492
- );
1493
- const digestPattern = /^sha256:[a-f0-9]{64}$/;
1494
- const tokenPattern = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;
1495
-
1496
- function regularProjectFile(path, label) {
1497
- const relativePath = relative(projectRoot, path);
1498
- if (
1499
- !relativePath ||
1500
- relativePath === '..' ||
1501
- relativePath.startsWith('..' + sep) ||
1502
- resolve(projectRoot, relativePath) !== path
1503
- ) {
1504
- throw new Error(label + ' must remain inside the Product Slice.');
1505
- }
1506
- const stat = lstatSync(path);
1507
- if (!stat.isFile() || stat.isSymbolicLink()) {
1508
- throw new Error(label + ' must be a regular non-symlink file.');
1509
- }
1510
- const real = realpathSync(path);
1511
- const realRelative = relative(realpathSync(projectRoot), real);
1512
- if (realRelative === '..' || realRelative.startsWith('..' + sep)) {
1513
- throw new Error(label + ' resolves outside the Product Slice.');
1514
- }
1515
- }
1516
-
1517
- function readJson(path, label) {
1518
- regularProjectFile(path, label);
1519
- return JSON.parse(readFileSync(path, 'utf8'));
1520
- }
1521
-
1522
- function exactKeys(value, allowed) {
1523
- return (
1524
- value &&
1525
- typeof value === 'object' &&
1526
- Object.keys(value).every((key) => allowed.includes(key))
1527
- );
1528
- }
1529
-
1530
- function records(value, label, { observations = false } = {}) {
1531
- if (
1532
- !exactKeys(
1533
- value,
1534
- observations
1535
- ? ['records', 'schemaVersion', 'slice']
1536
- : ['records', 'reviewedAt', 'schemaVersion', 'slice', 'workItem'],
1537
- ) ||
1538
- value?.schemaVersion !== 1 ||
1539
- value?.slice !== '${name}' ||
1540
- !Array.isArray(value?.records)
1541
- ) {
1542
- throw new Error(label + ' is not a ${name} frontend visual record.');
1543
- }
1544
- if (
1545
- !observations &&
1546
- ((value.reviewedAt === undefined) !== (value.workItem === undefined) ||
1547
- (value.records.length > 0 &&
1548
- (value.reviewedAt === undefined || value.workItem === undefined)) ||
1549
- (value.reviewedAt !== undefined &&
1550
- (typeof value.reviewedAt !== 'string' ||
1551
- !Number.isFinite(Date.parse(value.reviewedAt)) ||
1552
- new Date(value.reviewedAt).toISOString() !== value.reviewedAt ||
1553
- !/^(?:GH:[1-9][0-9]*|PLAN:[A-Za-z0-9._/-]+)$/.test(
1554
- value.workItem ?? '',
1555
- ))))
1556
- ) {
1557
- throw new Error(label + ' has invalid review attribution.');
1558
- }
1559
- const ids = new Set();
1560
- return value.records.map((record, index) => {
1561
- if (
1562
- !exactKeys(record, ['artifact', 'digest', 'id', 'profile', 'viewport']) ||
1563
- !record ||
1564
- typeof record !== 'object' ||
1565
- !tokenPattern.test(record.id ?? '') ||
1566
- !tokenPattern.test(record.profile ?? '') ||
1567
- !tokenPattern.test(record.viewport ?? '') ||
1568
- !digestPattern.test(record.digest ?? '') ||
1569
- typeof record.artifact !== 'string' ||
1570
- !record.artifact.startsWith('.ebk/evidence/frontend/visuals/') ||
1571
- record.artifact.includes('..')
1572
- ) {
1573
- throw new Error(label + ' record ' + index + ' is malformed.');
1574
- }
1575
- if (observations) {
1576
- const artifactPath = resolve(projectRoot, record.artifact);
1577
- regularProjectFile(artifactPath, label + ' artifact ' + index);
1578
- const actualDigest =
1579
- 'sha256:' +
1580
- createHash('sha256').update(readFileSync(artifactPath)).digest('hex');
1581
- if (actualDigest !== record.digest) {
1582
- throw new Error(label + ' artifact ' + index + ' does not match its digest.');
1583
- }
1584
- }
1585
- const key = record.id + '@' + record.viewport + '@' + record.profile;
1586
- if (ids.has(key)) throw new Error(label + ' contains duplicate record ' + key + '.');
1587
- ids.add(key);
1588
- return {
1589
- artifact: record.artifact,
1590
- digest: record.digest,
1591
- id: record.id,
1592
- profile: record.profile,
1593
- viewport: record.viewport,
1594
- };
1595
- }).sort((left, right) =>
1596
- left.id + '@' + left.viewport + '@' + left.profile <
1597
- right.id + '@' + right.viewport + '@' + right.profile
1598
- ? -1
1599
- : left.id + '@' + left.viewport + '@' + left.profile >
1600
- right.id + '@' + right.viewport + '@' + right.profile
1601
- ? 1
1602
- : 0,
1603
- );
1604
- }
1605
-
1606
- function compare(baseline, observed) {
1607
- const expected = new Map(
1608
- baseline.map((record) => [
1609
- record.id + '@' + record.viewport + '@' + record.profile,
1610
- record,
1611
- ]),
1612
- );
1613
- const actual = new Map(
1614
- observed.map((record) => [
1615
- record.id + '@' + record.viewport + '@' + record.profile,
1616
- record,
1617
- ]),
1618
- );
1619
- const findings = [];
1620
- for (const [key, record] of expected) {
1621
- const observation = actual.get(key);
1622
- if (!observation) findings.push({ classification: 'observation-missing', id: key });
1623
- else if (observation.digest !== record.digest) {
1624
- findings.push({ classification: 'visual-change-unreviewed', id: key });
1625
- }
1626
- }
1627
- for (const key of actual.keys()) {
1628
- if (!expected.has(key)) findings.push({ classification: 'baseline-missing', id: key });
1629
- }
1630
- return findings.sort((left, right) =>
1631
- left.id < right.id ? -1 : left.id > right.id ? 1 : 0,
1632
- );
1633
- }
1634
-
1635
- export function verifyFrontendVisualReport() {
1636
- const baseline = records(
1637
- readJson(baselinePath, 'Visual baseline'),
1638
- 'Visual baseline',
1639
- );
1640
- const observed = records(
1641
- readJson(observationPath, 'Visual observation'),
1642
- 'Visual observation',
1643
- { observations: true },
1644
- );
1645
- const observedProfiles = new Set(observed.map(({ profile }) => profile));
1646
- const applicableBaseline = baseline.filter(({ profile }) =>
1647
- observedProfiles.has(profile),
1648
- );
1649
- const findings =
1650
- applicableBaseline.length === 0
1651
- ? [{ classification: 'baseline-empty', id: '${name}' }]
1652
- : compare(applicableBaseline, observed);
1653
- return {
1654
- counts: {
1655
- applicableBaseline: applicableBaseline.length,
1656
- baseline: baseline.length,
1657
- observed: observed.length,
1658
- },
1659
- findings,
1660
- kind: 'ebk-frontend-visual-result',
1661
- outcome: findings.length === 0 ? 'passed' : 'failed',
1662
- schemaVersion: 1,
1663
- slice: '${name}',
1664
- };
1665
- }
1666
-
1667
- function updateBaseline(workItem) {
1668
- if (
1669
- process.env.CI === 'true' ||
1670
- process.env.GITHUB_ACTIONS === 'true' ||
1671
- !['', 'development'].includes(process.env.EBK_STAGE ?? '')
1672
- ) {
1673
- throw new Error('Frontend visual baselines may be updated only in local development.');
1674
- }
1675
- if (!/^(?:GH:[1-9][0-9]*|PLAN:[A-Za-z0-9._/-]+)$/.test(workItem ?? '')) {
1676
- throw new Error('Visual baseline update requires --work-item=GH:<number> or PLAN:<reference>.');
1677
- }
1678
- const observed = records(
1679
- readJson(observationPath, 'Visual observation'),
1680
- 'Visual observation',
1681
- { observations: true },
1682
- );
1683
- if (observed.length === 0) throw new Error('Visual baseline update requires observations.');
1684
- const previous = records(
1685
- readJson(baselinePath, 'Visual baseline'),
1686
- 'Visual baseline',
1687
- );
1688
- const updatedProfiles = new Set(observed.map(({ profile }) => profile));
1689
- const nextRecords = [
1690
- ...previous.filter(({ profile }) => !updatedProfiles.has(profile)),
1691
- ...observed,
1692
- ].sort((left, right) =>
1693
- left.id + '@' + left.viewport + '@' + left.profile <
1694
- right.id + '@' + right.viewport + '@' + right.profile
1695
- ? -1
1696
- : left.id + '@' + left.viewport + '@' + left.profile >
1697
- right.id + '@' + right.viewport + '@' + right.profile
1698
- ? 1
1699
- : 0,
1700
- );
1701
- writeFileSync(
1702
- baselinePath,
1703
- JSON.stringify(
1704
- {
1705
- records: nextRecords,
1706
- reviewedAt: new Date().toISOString(),
1707
- schemaVersion: 1,
1708
- slice: '${name}',
1709
- workItem,
1710
- },
1711
- null,
1712
- 2,
1713
- ) + '\\n',
1714
- );
1715
- }
1716
-
1717
- function writeResult(result) {
1718
- mkdirSync(dirname(resultPath), { recursive: true, mode: 0o700 });
1719
- writeFileSync(resultPath, JSON.stringify(result, null, 2) + '\\n', { mode: 0o600 });
1720
- process.stdout.write(JSON.stringify(result) + '\\n');
1721
- }
1722
-
1723
- function main() {
1724
- const command = process.argv[2];
1725
- if (command === 'update') {
1726
- const workItem = process.argv.find((value) => value.startsWith('--work-item='));
1727
- updateBaseline(workItem?.slice('--work-item='.length));
1728
- } else if (command !== 'verify') {
1729
- throw new Error('Usage: frontend-visual-report.mjs <verify|update> [--work-item=GH:123]');
1730
- }
1731
- const result = verifyFrontendVisualReport();
1732
- writeResult(result);
1733
- if (result.outcome !== 'passed') process.exitCode = 1;
1734
- }
1735
-
1736
- main();
1737
- `,
1738
- 'e2e/frontend-accessibility.spec.ts': `import { createHash } from 'node:crypto';
1739
- import { mkdirSync, writeFileSync } from 'node:fs';
1740
- import { join } from 'node:path';
1741
- import AxeBuilder from '@axe-core/playwright';
1742
- import { expect, test, type Page } from '@playwright/test';
1743
-
1744
- const states = ${JSON.stringify(states)} as const;
1745
-
1746
- function requiredEnvironment(name: string): string {
1747
- const value = process.env[name]?.trim();
1748
- if (!value) throw new Error(name + ' is required for frontend browser proof.');
1749
- return value;
1750
- }
1751
-
1752
- function fixtureUrl(state: (typeof states)[number]): string {
1753
- const product = new URL(requiredEnvironment('EBK_SMOKE_URL'));
1754
- product.pathname =
1755
- product.pathname.replace(/\\/$/, '') + '/_ebk/frontend-states';
1756
- product.searchParams.set('state', state);
1757
- return product.href;
1758
- }
1759
-
1760
- function cspProofUrl(): string {
1761
- const product = new URL(requiredEnvironment('EBK_SMOKE_URL'));
1762
- product.pathname = product.pathname.replace(/\\/$/, '') + '/_ebk/frontend-csp';
1763
- return product.href;
1764
- }
1765
-
1766
- function observeBrowserFailures(page: Page): string[] {
1767
- const failures: string[] = [];
1768
- page.on('console', (message) => {
1769
- if (message.type() === 'error') {
1770
- failures.push(
1771
- 'console-error:' +
1772
- message.text().replace(/\\s+/g, ' ').slice(0, 300),
1773
- );
1774
- }
1775
- });
1776
- page.on('pageerror', (error) =>
1777
- failures.push(
1778
- 'uncaught-page-error:' +
1779
- error.message.replace(/\\s+/g, ' ').slice(0, 300),
1780
- ),
1781
- );
1782
- page.on('requestfailed', (request) =>
1783
- failures.push(
1784
- 'request-failed:' +
1785
- new URL(request.url()).pathname.slice(0, 200),
1786
- ),
1787
- );
1788
- return failures;
1789
- }
1790
-
1791
- async function installSecurityPolicyViolationObserver(page: Page): Promise<void> {
1792
- await page.addInitScript(() => {
1793
- const observedWindow = window as Window & {
1794
- __ebkSecurityPolicyViolations?: string[];
1795
- };
1796
- const violations: string[] = [];
1797
- Object.defineProperty(observedWindow, '__ebkSecurityPolicyViolations', {
1798
- configurable: false,
1799
- enumerable: false,
1800
- value: violations,
1801
- writable: false,
1802
- });
1803
- document.addEventListener('securitypolicyviolation', (event) => {
1804
- if (violations.length < 20) {
1805
- violations.push(
1806
- 'csp-violation:' + event.effectiveDirective + ':' + event.disposition,
1807
- );
1808
- }
1809
- });
1810
- });
1811
- }
1812
-
1813
- async function securityPolicyViolations(page: Page): Promise<string[]> {
1814
- return page.evaluate(() => {
1815
- const observedWindow = window as Window & {
1816
- __ebkSecurityPolicyViolations?: string[];
1817
- };
1818
- return [...(observedWindow.__ebkSecurityPolicyViolations ?? [])];
1819
- });
1820
- }
1821
-
1822
- test.describe('generated frontend accessibility', () => {
1823
- test('scans every deterministic rendered state', async ({ page }) => {
1824
- const browserFailures = observeBrowserFailures(page);
1825
- for (const state of states) {
1826
- await page.goto(fixtureUrl(state));
1827
- await expect(
1828
- page.getByRole('heading', { level: 1, name: '${pascalName} neutral frontend states' }),
1829
- ).toBeVisible();
1830
- const result = await new AxeBuilder({ page })
1831
- .withTags(['wcag2a', 'wcag2aa', 'wcag21aa', 'wcag22aa'])
1832
- .analyze();
1833
- expect(result.violations, state).toEqual([]);
1834
- }
1835
- expect([...new Set(browserFailures)].sort()).toEqual([]);
1836
- });
1837
-
1838
- test('operates the dialog by keyboard and restores focus', async ({ page }) => {
1839
- const frameworkResponse = await page.goto(fixtureUrl('success'));
1840
- expect(frameworkResponse).not.toBeNull();
1841
- const trigger = page.getByRole('button', { name: 'Open details dialog' });
1842
- await trigger.focus();
1843
- await page.keyboard.press('Enter');
1844
- const dialog = page.getByRole('dialog', { name: 'Synthetic record details' });
1845
- await expect(dialog).toBeVisible();
1846
- await expect(page.getByRole('button', { name: 'Close details' })).toBeFocused();
1847
- await page.keyboard.press('Escape');
1848
- await expect(dialog).toBeHidden();
1849
- await expect(trigger).toBeFocused();
1850
- });
1851
-
1852
- test('preserves announcements, narrow reflow, and reduced motion', async ({ page }) => {
1853
- await page.setViewportSize({ height: 640, width: 320 });
1854
- await page.emulateMedia({ reducedMotion: 'reduce' });
1855
- await page.goto(fixtureUrl('validation'));
1856
- await expect(
1857
- page.getByRole('alert').filter({ hasText: 'one problem' }),
1858
- ).toContainText('one problem');
1859
- expect(
1860
- await page.evaluate(
1861
- () => document.documentElement.scrollWidth <= document.documentElement.clientWidth,
1862
- ),
1863
- ).toBe(true);
1864
- const duration = await page
1865
- .getByRole('button', { name: 'Open details dialog' })
1866
- .evaluate((element) => getComputedStyle(element).transitionDuration);
1867
- expect(duration.endsWith('s')).toBe(true);
1868
- expect(Number.parseFloat(duration)).toBeLessThanOrEqual(.001);
1869
- });
1870
-
1871
- test('hydrates framework UI and executes only nonce-authorized production inline script and style', async ({ page }) => {
1872
- test.skip(
1873
- process.env.EBK_FRONTEND_SECURITY_PROFILE !== 'deployed-https',
1874
- 'Strict nonce refusal is a deployed-profile proof.',
1875
- );
1876
- const browserFailures = observeBrowserFailures(page);
1877
- await installSecurityPolicyViolationObserver(page);
1878
- const frameworkResponse = await page.goto(fixtureUrl('success'));
1879
- expect(frameworkResponse).not.toBeNull();
1880
- await expect(
1881
- page.getByRole('heading', { level: 1, name: '${pascalName} neutral frontend states' }),
1882
- ).toBeVisible();
1883
- const trigger = page.getByRole('button', { name: 'Open details dialog' });
1884
- await trigger.click();
1885
- const dialog = page.getByRole('dialog', { name: 'Synthetic record details' });
1886
- await expect(dialog).toBeVisible();
1887
- await page.getByRole('button', { name: 'Close details' }).click();
1888
- await expect(dialog).toBeHidden();
1889
- await expect(trigger).toBeFocused();
1890
- expect([...new Set(browserFailures)].sort()).toEqual([]);
1891
- expect(await securityPolicyViolations(page)).toEqual([]);
1892
-
1893
- // The dedicated route below deliberately violates CSP. Keep its expected
1894
- // refusal signals separate from the clean framework-hydration observation.
1895
- const response = await page.goto(cspProofUrl());
1896
- expect(response).not.toBeNull();
1897
- const csp = response?.headers()['content-security-policy'] ?? '';
1898
- expect(csp).not.toContain("'unsafe-inline'");
1899
- const nonces = [...csp.matchAll(/'nonce-([A-Za-z0-9+/_-]{16,128}={0,2})'/g)].map(
1900
- (match) => match[1],
1901
- );
1902
- expect(new Set(nonces).size).toBe(1);
1903
- expect(nonces).toHaveLength(2);
1904
- const frameworkCsp =
1905
- frameworkResponse?.headers()['content-security-policy'] ?? '';
1906
- expect(frameworkCsp).not.toContain("'nonce-" + nonces[0] + "'");
1907
- const proof = await page.evaluate(() => {
1908
- const approvedStyle = document.querySelector('#approved-style');
1909
- const unapprovedStyle = document.querySelector('#unapproved-style');
1910
- if (!approvedStyle || !unapprovedStyle) {
1911
- throw new Error('The strict CSP proof fixture is incomplete.');
1912
- }
1913
- return {
1914
- approvedScript:
1915
- document.documentElement.dataset.ebkApprovedInline === 'executed',
1916
- approvedStyle: getComputedStyle(approvedStyle).color,
1917
- refusedScript:
1918
- document.documentElement.dataset.ebkUnapprovedInline === 'executed',
1919
- refusedStyle: getComputedStyle(unapprovedStyle).color,
1920
- };
1921
- });
1922
-
1923
- expect(proof).toMatchObject({
1924
- approvedScript: true,
1925
- approvedStyle: 'rgb(1, 2, 3)',
1926
- refusedScript: false,
1927
- });
1928
- expect(proof.refusedStyle).not.toBe('rgb(4, 5, 6)');
1929
- });
1930
-
1931
- test('captures stable neutral visual observations', async ({ browserName, page }) => {
1932
- const evidenceRoot = join(
1933
- process.cwd(),
1934
- '.ebk',
1935
- 'evidence',
1936
- 'frontend',
1937
- );
1938
- const visualRoot = join(evidenceRoot, 'visuals');
1939
- mkdirSync(visualRoot, { recursive: true, mode: 0o700 });
1940
- const records = [];
1941
- const profile = browserName + '-' + process.platform;
1942
- await page.setViewportSize({ height: 720, width: 1024 });
1943
- for (const state of ['empty', 'success', 'validation'] as const) {
1944
- await page.goto(fixtureUrl(state));
1945
- const artifact =
1946
- '.ebk/evidence/frontend/visuals/' +
1947
- state +
1948
- '-medium-' +
1949
- profile +
1950
- '.png';
1951
- const bytes = await page.screenshot({
1952
- animations: 'disabled',
1953
- caret: 'hide',
1954
- fullPage: true,
1955
- path: join(process.cwd(), artifact),
1956
- });
1957
- records.push({
1958
- artifact,
1959
- digest: 'sha256:' + createHash('sha256').update(bytes).digest('hex'),
1960
- id: state,
1961
- profile,
1962
- viewport: 'medium',
1963
- });
1964
- }
1965
- writeFileSync(
1966
- join(evidenceRoot, 'frontend-visual-observations.json'),
1967
- JSON.stringify({ records, schemaVersion: 1, slice: '${name}' }, null, 2) + '\\n',
1968
- { mode: 0o600 },
1969
- );
1970
- });
1971
- });
1972
- `,
1973
- };
1974
- }
1975
- //# sourceMappingURL=built-in-plan-frontend-files.js.map